diff options
-rw-r--r-- | catgy.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -74,10 +74,16 @@ average(uint8_t dest[3], uint8_t src[9]) static void blurge(struct image *img) { + struct image copy; + if (duplicate(©, img)) + return; + for (int y = 0; y < img->h; y++) for (int x = 1; x < img->w - 1; x++) average(&img->data[x * 3 + y * img->w * 3], - &img->data[x * 3 - 3 + y * img->w * 3]); + ©.data[x * 3 - 3 + y * img->w * 3]); + + free(copy.data); } static int |