From fd54698d12d468420d344f0ff4d5e502e04d64d4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 2 Mar 2025 22:18:45 +0100 Subject: Add some functions needed fore encoding LSS16 files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- lss16toppm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lss16toppm.c') 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; } } } -- cgit v1.2.3-70-g09d2