Parse the image data for a gif frame.
Sets up gif->colour_table for the frame.
1205{
1207 fl::size len = gif->
buf + gif->
buf_len - data;
1208 fl::u32 frame_idx = frame - gif->
frames;
1209 fl::u8 minimum_code_size;
1211
1212 FL_ASSERT(gif !=
nullptr,
"GIF object required");
1213 FL_ASSERT(frame !=
nullptr,
"Frame object required");
1214
1215 if (!decode) {
1217 }
1218
1219
1220
1221
1222 switch (len) {
1224 break;
1226
1228
1230 }
1231
1232 minimum_code_size = data[0];
1235 }
1236
1237 if (decode) {
1239 } else {
1240 fl::u32 block_size = 0;
1241
1242
1243 data++;
1244 len--;
1245
1246 while (block_size != 1) {
1247 if (len < 1) {
1249 }
1250 block_size = data[0] + 1;
1251
1252 if (block_size > len) {
1255 }
1256
1257 len -= block_size;
1258 data += block_size;
1260 }
1261
1263
1266
1268 }
1269
1270 return ret;
1271}
#define FL_ASSERT(x, MSG)
#define LZW_CODE_MAX
Maximum LZW code size in bits.
nsgif_error
LibNSGIF return codes.
@ NSGIF_ERR_END_OF_DATA
Unexpected end of GIF source data.
@ NSGIF_ERR_DATA_FRAME
GIF source data contained an error in a frame.
static nsgif_error nsgif__update_bitmap(struct nsgif *gif, struct nsgif_frame *frame, const fl::u8 *data, fl::u32 frame_idx) FL_NOEXCEPT
nsgif_frame * frames
decoded frames
bool display
whether the frame should be displayed/animated
fl::u32 frame_count
number of frames decoded
fl::size buf_len
total number of bytes of GIF data available
fl::u32 lzw_data_length
Amount of LZW data found in scan.
fl::u32 frame_count_partial
number of frames partially decoded
struct nsgif_frame_info info
const fl::u8 * buf
pointer to GIF data