From aaebee43905e1f9951321954231ac78f4bd22c06 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 4 Feb 2018 12:11:48 -0500 Subject: Add palette sampling to gfxx --- bin/gfxx.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin') diff --git a/bin/gfxx.c b/bin/gfxx.c index b72af163..31f97ea1 100644 --- a/bin/gfxx.c +++ b/bin/gfxx.c @@ -264,6 +264,13 @@ extern void draw(uint32_t *buf, size_t xres, size_t yres) { } } +static void samplePalette(void) { + size_t temp = scale; + scale = 1; + draw(palette, 256, 1); + scale = temp; +} + extern void input(char in) { size_t pixel = (bits + 7) / 8; size_t row = width * bits / 8; @@ -271,6 +278,7 @@ extern void input(char in) { case 'q': printOpts(); exit(EX_OK); break; case '[': if (!space--) space = COLOR__MAX - 1; break; case ']': if (++space == COLOR__MAX) space = 0; + break; case 'p': samplePalette(); break; case '{': if (bits > 16) bits -= 8; else bits = (bits + 1) / 2; break; case '}': if (bits < 16) bits *= 2; else if (bits < 32) bits += 8; break; case 'e': endian ^= true; -- cgit 1.4.1 follow=1'>log tree commit diff
path: root/home/.mkshrc (unfollow)
Commit message (Collapse)Author
2020-04-04Set publish date in feed from .DdJune McEnroe
2020-04-01Update cgit setup post with git-http-backendJune McEnroe-pink/commit/cgit.c?h=1.3.0&id=441e748564aff49932d02987cd2bdcfbb623c295&follow=1'>cgit.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