diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/glitch.c | 30 |
1 files changed, 15 insertions, 15 deletions
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) { |