Переглянути джерело

* do equalizing on grayscale image.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@417 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 21 роки тому
джерело
коміт
87a7c38bde
1 змінених файлів з 3 додано та 1 видалено
  1. +3
    -1
      src/filters.c

+ 3
- 1
src/filters.c Переглянути файл

@@ -216,11 +216,13 @@ struct image *filter_equalize(struct image *img, int threshold)
threshold = -threshold;
}

threshold *= 3;

for(y = 0; y < img->height; y++)
for(x = 0; x < img->width; x++)
{
getpixel(img, x, y, &r, &g, &b);
if(r < threshold)
if(r + g + b < threshold)
setpixel(dst, x, y, min, min, min);
else
setpixel(dst, x, y, max, max, max);


Завантаження…
Відмінити
Зберегти