diff options
| author | Mattias Andrée <m@maandree.se> | 2025-03-02 22:18:45 +0100 | 
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2025-03-02 22:18:45 +0100 | 
| commit | fd54698d12d468420d344f0ff4d5e502e04d64d4 (patch) | |
| tree | 62fbc4488e3374b27dddffe00de665894e7eec41 /lss16toppm.c | |
| parent | First commit (diff) | |
| download | liblss16-fd54698d12d468420d344f0ff4d5e502e04d64d4.tar.gz liblss16-fd54698d12d468420d344f0ff4d5e502e04d64d4.tar.bz2 liblss16-fd54698d12d468420d344f0ff4d5e502e04d64d4.tar.xz | |
Add some functions needed fore encoding LSS16 files
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'lss16toppm.c')
| -rw-r--r-- | lss16toppm.c | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/lss16toppm.c b/lss16toppm.c index db4d448..6dcff62 100644 --- a/lss16toppm.c +++ b/lss16toppm.c @@ -92,14 +92,14 @@ main(int argc, char *argv[])  			if (!head_printed) {  				head_printed = 1; -				len = sprintf(wbuf, "P6\n%u %u\n255\n", decoder.width, decoder.height); +				len = sprintf(wbuf, "P6\n%u %u\n255\n", decoder.image.width, decoder.image.height);  				if (len < 0 || (size_t)len >= sizeof(wbuf))  					abort();  				pending = (size_t)len;  				if (print_colour_map) { -					for (i = 0; i < sizeof(decoder.colour_map) / sizeof(*decoder.colour_map); i++) { -						fprintf(stderr, "#%02x%02x%02x=%zu\n", decoder.colour_map[i].r, -						        decoder.colour_map[i].g, decoder.colour_map[i].b, i); +					for (i = 0; i < sizeof(decoder.image.colour_map) / sizeof(*decoder.image.colour_map); i++) { +						fprintf(stderr, "#%02x%02x%02x=%zu\n", decoder.image.colour_map[i].r, +						        decoder.image.colour_map[i].g, decoder.image.colour_map[i].b, i);  					}  				}  			} @@ -108,9 +108,9 @@ main(int argc, char *argv[])  					writeall(wbuf, pending);  					pending = 0;  				} -				wbuf[pending++] = (char)decoder.colour_map[pixels[i]].r; -				wbuf[pending++] = (char)decoder.colour_map[pixels[i]].g; -				wbuf[pending++] = (char)decoder.colour_map[pixels[i]].b; +				wbuf[pending++] = (char)decoder.image.colour_map[pixels[i]].r; +				wbuf[pending++] = (char)decoder.image.colour_map[pixels[i]].g; +				wbuf[pending++] = (char)decoder.image.colour_map[pixels[i]].b;  			}  		}  	} | 
