瀏覽代碼

* median.c: oops, fix argument types in the qsort call.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2808 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 年之前
父節點
當前提交
37ed52dc95
共有 1 個檔案被更改,包括 5 行新增5 行删除
  1. +5
    -5
      pipi/filter/median.c

+ 5
- 5
pipi/filter/median.c 查看文件

@@ -29,7 +29,7 @@

static int cmpint(void const *i1, void const *i2)
{
return *(int const *)i1 > *(int const *)i2;
return *(double const *)i1 < *(double const *)i2;
}

pipi_image_t *pipi_median(pipi_image_t *src, int radius)
@@ -104,12 +104,12 @@ pipi_image_t *pipi_median_ext(pipi_image_t *src, int rx, int ry)
}

/* Sort the list */
qsort(list, size, sizeof(int), cmpint);
qsort(list, size, sizeof(double), cmpint);
if(!gray)
{
qsort(list + size, size, sizeof(int), cmpint);
qsort(list + 2 * size, size, sizeof(int), cmpint);
qsort(list + 3 * size, size, sizeof(int), cmpint);
qsort(list + size, size, sizeof(double), cmpint);
qsort(list + 2 * size, size, sizeof(double), cmpint);
qsort(list + 3 * size, size, sizeof(double), cmpint);
}

/* Store the median value */


Loading…
取消
儲存