Browse Source

* also blur borders in filter_blur().

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@452 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 20 years ago
parent
commit
5e74d66c21
1 changed files with 21 additions and 1 deletions
  1. +21
    -1
      src/filter.c

+ 21
- 1
src/filter.c View File

@@ -291,7 +291,10 @@ void filter_smooth(struct image *img)

for(y = 0; y < img->height; y++)
for(x = 0; x < img->width; x++)
setpixel(dst, x, y, 255, 255, 255);
{
getpixel(img, x, y, &r, &g, &b);
setpixel(dst, x, y, r, g, b);
}

for(y = SSIZE/2; y < img->height - SSIZE/2; y++)
for(x = SSIZE/2; x < img->width - SSIZE/2; x++)
@@ -308,6 +311,23 @@ void filter_smooth(struct image *img)
setpixel(dst, x, y, i, i, i);
}

/* Remove border */
for(y = 0; y < dst->height; y++)
{
getpixel(dst, 1, y, &r, &g, &b);
setpixel(dst, 0, y, r, g, b);
getpixel(dst, dst->width - 2, y, &r, &g, &b);
setpixel(dst, dst->width - 1, y, r, g, b);
}

for(x = 0; x < dst->width; x++)
{
getpixel(dst, x, 1, &r, &g, &b);
setpixel(dst, x, 0, r, g, b);
getpixel(dst, x, dst->height - 2, &r, &g, &b);
setpixel(dst, x, dst->height - 1, r, g, b);
}

image_swap(img, dst);
image_free(dst);
}


Loading…
Cancel
Save