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

◆ nsgif__bitmap_get()

static fl::u32 * fl::third_party::nsgif__bitmap_get ( struct nsgif * gif)
inlinestatic

Helper to get the rendering bitmap for a gif.

Parameters
[in]gifThe gif object we're decoding.
Returns
Client pixel buffer for rendering into.

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

235{
236 nsgif_error ret;
237
238 /* Make sure we have a buffer to decode to. */
239 ret = nsgif__initialise_sprite(gif, gif->info.width, gif->info.height);
240 if (ret != NSGIF_OK) {
241 return nullptr;
242 }
243
244 gif->rowspan = gif->info.width;
245 if (gif->bitmap.get_rowspan) {
246 gif->rowspan = gif->bitmap.get_rowspan(gif->frame_image);
247 }
248
249 /* Get the frame data */
250 FL_ASSERT(gif->bitmap.get_buffer, "GIF bitmap get_buffer function required");
251 return reinterpret_cast<fl::u32*>(gif->bitmap.get_buffer(gif->frame_image));
252}
#define FL_ASSERT(x, MSG)
Definition assert.h:6
static nsgif_error nsgif__initialise_sprite(struct nsgif *gif, fl::u32 width, fl::u32 height) FL_NOEXCEPT
Updates the sprite memory size.
Definition gif.cpp.hpp:208
nsgif_error
LibNSGIF return codes.
Definition nsgif.hpp:58
@ NSGIF_OK
Success.
Definition nsgif.hpp:62
fl::u32(* get_rowspan)(nsgif_bitmap_t *bitmap)
Get row span in pixels.
Definition nsgif.hpp:241
nsgif_bitmap_t * frame_image
currently decoded image; stored as bitmap from bitmap_create callback
Definition gif.cpp.hpp:86
fl::u32 rowspan
Row span of frame_image in pixels.
Definition gif.cpp.hpp:88
nsgif_bitmap_cb_vt bitmap
callbacks for bitmap functions
Definition gif.cpp.hpp:77
fl::u32 width
width of GIF (may increase during decoding)
Definition nsgif.hpp:384
fl::u32 height
height of GIF (may increase during decoding)
Definition nsgif.hpp:386
fl::u8 *(* get_buffer)(nsgif_bitmap_t *bitmap)
Get pointer to pixel buffer in a bitmap.
Definition nsgif.hpp:205
struct nsgif_info info
Definition gif.cpp.hpp:72

References FL_ASSERT, FL_NOEXCEPT, nsgif__initialise_sprite(), and NSGIF_OK.

Referenced by nsgif__record_frame(), and nsgif__update_bitmap().

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