summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-07-25 01:32:26 +0200
committerkdx <kikoodx@paranoici.org>2023-07-25 01:32:26 +0200
commita853d39c8e12674d60bafd7225d55eccd444e2b9 (patch)
tree5540814d541197c9789dbfb635421eda3c18cb6c
parent1984f60480a050e16f671dbbb18922a90d7a9b1a (diff)
downloadcatgy-a853d39c8e12674d60bafd7225d55eccd444e2b9.tar.gz
improve blurge accuracyHEADmain
-rw-r--r--catgy.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/catgy.c b/catgy.c
index b917005..3722abc 100644
--- a/catgy.c
+++ b/catgy.c
@@ -74,10 +74,16 @@ average(uint8_t dest[3], uint8_t src[9])
static void
blurge(struct image *img)
{
+ struct image copy;
+ if (duplicate(&copy, 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]);
+ &copy.data[x * 3 - 3 + y * img->w * 3]);
+
+ free(copy.data);
}
static int