457{
462 const fl::u8 *uncompressed;
465 fl::u32 skip = 0;
467
471 }
472
475
478 }
479
480
483 data + 1 - gif->
buf);
486 }
487
488 do {
490 fl::u32 *frame_scanline;
491
492 frame_scanline = frame_data + offset_x +
494
497 unsigned row_available;
500
504 } else {
506 }
507 return ret;
508 }
511
514 }
516 }
517
521 if (transparency_index > 0xFF) {
522 while (row_available-- > 0) {
523 *frame_scanline++ =
524 colour_table[*uncompressed++];
525 }
526 } else {
527 while (row_available-- > 0) {
528 fl::u32 colour;
529 colour = *uncompressed++;
530 if (colour != transparency_index) {
531 *frame_scanline =
532 colour_table[colour];
533 }
534 frame_scanline++;
535 }
536 }
537 }
538
539 skip = clip_x;
542
543 return ret;
544}
lzw_result lzw_decode_init(struct lzw_ctx *ctx, fl::u8 minimum_code_size, const fl::u8 *input_data, fl::size input_length, fl::size input_pos) FL_NOEXCEPT
Initialise an LZW decompression context for decoding.
nsgif_error
LibNSGIF return codes.
static fl::u32 gif__clip(fl::u32 frame_off, fl::u32 frame_dim, fl::u32 image_ext) FL_NOEXCEPT
Get any frame clip adjustment for the image extent.
lzw_result
LZW decoding response codes.
@ LZW_EOI_CODE
Error: End of Information code.
@ LZW_OK_EOD
Success; reached zero-length sub-block.
static nsgif_error nsgif__error_from_lzw(lzw_result l_res) FL_NOEXCEPT
Convert an LZW result code to equivalent GIF result code.
static bool nsgif__next_row(fl::u32 interlace, fl::u32 height, fl::u32 *y, fl::u8 *step) FL_NOEXCEPT
Get the next line for GIF decode.
lzw_result lzw_decode(struct lzw_ctx *ctx, const fl::u8 **const output_data, fl::u32 *output_written) FL_NOEXCEPT
Read input codes until end of LZW context owned output buffer.
static void gif__jump_data(fl::u32 *skip, fl::u32 *available, const fl::u8 **pos) FL_NOEXCEPT
Perform any jump over decoded data, to accommodate clipped portion of frame.
fl::u32 rowspan
Row span of frame_image in pixels.
fl::u32 width
width of GIF (may increase during decoding)
fl::u32 height
height of GIF (may increase during decoding)
fl::size buf_len
total number of bytes of GIF data available
void * lzw_ctx
LZW decode context.
const fl::u8 * buf
pointer to GIF data
LZW decompression context.
constexpr enable_if< is_fixed_point< T >::value, T >::type step(T edge, T x) FL_NOEXCEPT