소스 검색

* 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);


불러오는 중...
취소
저장