From 7f73ae089e76411d728e8da8630f6a8404fc8f7d Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Wed, 5 Sep 2018 01:45:07 -0400 Subject: Zero after mirror --- bin/glitch.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'bin/glitch.c') diff --git a/bin/glitch.c b/bin/glitch.c index fdd1716f..57e67059 100644 --- a/bin/glitch.c +++ b/bin/glitch.c @@ -278,10 +278,10 @@ static struct { uint8_t applyFilter; enum Filter declareFilters[255]; enum Filter applyFilters[255]; - bool zeroX; - bool zeroY; bool invert; bool mirror; + bool zeroX; + bool zeroY; } options; struct Bytes { @@ -402,17 +402,6 @@ static void filterData(void) { } } -static void zeroX(void) { - size_t pixelSize = lineSize() / header.width; - for (uint32_t y = 0; y < header.height; ++y) { - memset(lines[y]->data, 0, pixelSize); - } -} - -static void zeroY(void) { - memset(lines[0]->data, 0, lineSize()); -} - static void invert(void) { for (uint32_t y = 0; y < header.height; ++y) { for (size_t i = 0; i < lineSize(); ++i) { @@ -431,6 +420,17 @@ static void mirror(void) { } } +static void zeroX(void) { + size_t pixelSize = lineSize() / header.width; + for (uint32_t y = 0; y < header.height; ++y) { + memset(lines[y]->data, 0, pixelSize); + } +} + +static void zeroY(void) { + memset(lines[0]->data, 0, lineSize()); +} + static void glitch(const char *inPath, const char *outPath) { if (inPath) { path = inPath; @@ -450,10 +450,10 @@ static void glitch(const char *inPath, const char *outPath) { scanlines(); reconData(); filterData(); - if (options.zeroX) zeroX(); - if (options.zeroY) zeroY(); if (options.invert) invert(); if (options.mirror) mirror(); + if (options.zeroX) zeroX(); + if (options.zeroY) zeroY(); free(lines); if (outPath) { -- cgit 1.4.1