FastLED 3.9.15
Loading...
Searching...
No Matches

◆ nsgif__decode()

static nsgif_error fl::third_party::nsgif__decode ( struct nsgif * gif,
struct nsgif_frame * frame,
const fl::u8 * data,
fl::u32 * frame_data )
inlinestatic

Definition at line 605 of file gif.cpp.hpp.

610{
611 nsgif_error ret;
612 fl::u32 width = frame->info.rect.x1 - frame->info.rect.x0;
613 fl::u32 height = frame->info.rect.y1 - frame->info.rect.y0;
614 fl::u32 offset_x = frame->info.rect.x0;
615 fl::u32 offset_y = frame->info.rect.y0;
616 fl::u32 transparency_index = frame->transparency_index;
617 fl::u32 * colour_table = gif->colour_table;
618
619 if (frame->info.interlaced == false && offset_x == 0 &&
620 width == gif->info.width &&
621 width == gif->rowspan) {
622 ret = nsgif__decode_simple(gif, height, offset_y,
623 data, transparency_index,
624 frame_data, colour_table);
625 } else {
627 offset_x, offset_y, frame->info.interlaced,
628 data, transparency_index,
629 frame_data, colour_table);
630 }
631
632 if (gif->data_complete && ret == NSGIF_ERR_END_OF_DATA) {
633 /* This is all the data there is, so make do. */
634 ret = NSGIF_OK;
635 }
636
637 return ret;
638}
static nsgif_error nsgif__decode_simple(struct nsgif *gif, fl::u32 height, fl::u32 offset_y, const fl::u8 *data, fl::u32 transparency_index, fl::u32 *frame_data, fl::u32 *colour_table) FL_NOEXCEPT
Definition gif.cpp.hpp:546
nsgif_error
LibNSGIF return codes.
Definition nsgif.hpp:58
@ NSGIF_ERR_END_OF_DATA
Unexpected end of GIF source data.
Definition nsgif.hpp:87
@ NSGIF_OK
Success.
Definition nsgif.hpp:62
static nsgif_error nsgif__decode_complex(struct nsgif *gif, fl::u32 width, fl::u32 height, fl::u32 offset_x, fl::u32 offset_y, fl::u32 interlace, const fl::u8 *data, fl::u32 transparency_index, fl::u32 *frame_data, fl::u32 *colour_table) FL_NOEXCEPT
Definition gif.cpp.hpp:446
nsgif_rect_t rect
Frame's redraw rectangle.
Definition nsgif.hpp:437
fl::u32 rowspan
Row span of frame_image in pixels.
Definition gif.cpp.hpp:88
fl::u32 * colour_table
current colour table
Definition gif.cpp.hpp:125
fl::u32 y0
y co-ordinate of redraw rectangle, top
Definition nsgif.hpp:48
fl::u32 width
width of GIF (may increase during decoding)
Definition nsgif.hpp:384
bool interlaced
whether the frame is interlaced
Definition nsgif.hpp:430
fl::u32 transparency_index
the index designating a transparent pixel
Definition gif.cpp.hpp:53
fl::u32 x1
x co-ordinate of redraw rectangle, right
Definition nsgif.hpp:50
struct nsgif_info info
Definition gif.cpp.hpp:72
fl::u32 y1
y co-ordinate of redraw rectangle, bottom
Definition nsgif.hpp:52
fl::u32 x0
x co-ordinate of redraw rectangle, left
Definition nsgif.hpp:46
struct nsgif_frame_info info
Definition gif.cpp.hpp:38
bool data_complete
Whether all the GIF data has been supplied, or if there may be more to come.
Definition gif.cpp.hpp:106
u8 u8 height
Definition blur.h:186
u8 width
Definition blur.h:186

References FL_NOEXCEPT, fl::height, nsgif__decode_complex(), nsgif__decode_simple(), NSGIF_ERR_END_OF_DATA, NSGIF_OK, and fl::width.

Referenced by nsgif__update_bitmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: