From 2df6ea4b7a4e689e73b3cd1c68efe4e5031430ed Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 12 May 2018 21:50:27 +1000 Subject: [PATCH] Add a gif.decoder buffer for uncompressed data --- gen/c/std/gif.c | 2 ++ gen/h/std/gif.h | 2 ++ std/gif/decode_gif.wuffs | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/gen/c/std/gif.c b/gen/c/std/gif.c index 406e7235..6e23b228 100644 --- a/gen/c/std/gif.c +++ b/gen/c/std/gif.c @@ -1148,6 +1148,8 @@ typedef struct { uint32_t f_frame_left; uint32_t f_frame_width; uint32_t f_frame_height; + uint32_t f_uncompressed_index; + uint8_t f_uncompressed[4096]; uint8_t f_gct[768]; uint8_t f_lct[768]; wuffs_gif__lzw_decoder f_lzw; diff --git a/gen/h/std/gif.h b/gen/h/std/gif.h index 2ec1f2a4..e35225d8 100644 --- a/gen/h/std/gif.h +++ b/gen/h/std/gif.h @@ -1148,6 +1148,8 @@ typedef struct { uint32_t f_frame_left; uint32_t f_frame_width; uint32_t f_frame_height; + uint32_t f_uncompressed_index; + uint8_t f_uncompressed[4096]; uint8_t f_gct[768]; uint8_t f_lct[768]; wuffs_gif__lzw_decoder f_lzw; diff --git a/std/gif/decode_gif.wuffs b/std/gif/decode_gif.wuffs index 0eaa22e3..7bc5022f 100644 --- a/std/gif/decode_gif.wuffs +++ b/std/gif/decode_gif.wuffs @@ -50,6 +50,10 @@ pub struct decoder?( frame_width base.u32[..65535], frame_height base.u32[..65535], + // TODO: use these fields. + uncompressed_index base.u32[..4096], + uncompressed array[4096] base.u8, + // gct and lct are the Global / Local Color Tables: 256 (R, G, B) entries. // // TODO: 4 byte per pixel RGBA or BGRA instead of 3 bpp RGB?