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(-) 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 ut type='hidden' name='id' value='3d8a6507ca542881a5e8b30ad6b7068a9c4fdeea'/>
path: root/ui-ssdiff.c (unfollow)
Commit message (Expand)Author
2014-01-12ui-snapshot: set unused cgit_filter fields to zeroJohn Keeping
2014-01-12html: remove redundant htmlfd variableJohn Keeping
2014-01-12tests: add Valgrind supportJohn Keeping
2014-01-12cache: don't leave cache_slot fields uninitializedJohn Keeping
2014-01-10filter: split filter functions into their own fileJason A. Donenfeld
2014-01-10filter: make exit status localJason A. Donenfeld
2014-01-10parsing: fix header typoJason A. Donenfeld
2014-01-10cgit.c: Fix comment on bit mask hackLukas Fleischer
2014-01-10cgit.c: Use "else" for mutually exclusive branchesLukas Fleischer
2014-01-10ui-snapshot.c: Do not reinvent suffixcmp()Lukas Fleischer
2014-01-10Refactor cgit_parse_snapshots_mask()Lukas Fleischer
2014-01-10Disallow use of undocumented snapshot delimitersLukas Fleischer
2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer
2014-01-09README: Fix dependenciesLukas Fleischer
2014-01-08README: Spelling and formatting fixesLukas Fleischer
2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch
2014-01-08Add a suggestion to the manpagePřemysl Janouch
2014-01-08Fix the example configurationPřemysl Janouch
2014-01-08Fix about-formatting.shPřemysl Janouch
2014-01-08Fix some spelling errorsPřemysl Janouch
2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts