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

◆ nsgif__initialise_sprite()

static nsgif_error fl::third_party::nsgif__initialise_sprite ( struct nsgif * gif,
fl::u32 width,
fl::u32 height )
static

Updates the sprite memory size.

Parameters
gifThe animation context
widthThe width of the sprite
heightThe height of the sprite
Returns
NSGIF_ERR_OOM for a memory error NSGIF_OK for success

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

212{
213 /* Already allocated? */
214 if (gif->frame_image) {
215 return NSGIF_OK;
216 }
217
218 FL_ASSERT(gif->bitmap.create, "GIF bitmap create function required");
219 gif->frame_image = gif->bitmap.create(width, height);
220 if (gif->frame_image == nullptr) {
221 return NSGIF_ERR_OOM;
222 }
223
224 return NSGIF_OK;
225}
#define FL_ASSERT(x, MSG)
Definition assert.h:6
@ NSGIF_ERR_OOM
Out of memory error.
Definition nsgif.hpp:67
@ NSGIF_OK
Success.
Definition nsgif.hpp:62
nsgif_bitmap_t * frame_image
currently decoded image; stored as bitmap from bitmap_create callback
Definition gif.cpp.hpp:86
nsgif_bitmap_cb_vt bitmap
callbacks for bitmap functions
Definition gif.cpp.hpp:77
nsgif_bitmap_t *(* create)(int width, int height)
Callback to create a bitmap with the given dimensions.
Definition nsgif.hpp:186
u8 u8 height
Definition blur.h:186
u8 width
Definition blur.h:186

References FL_ASSERT, FL_NOEXCEPT, fl::height, NSGIF_ERR_OOM, NSGIF_OK, and fl::width.

Referenced by nsgif__bitmap_get().

+ Here is the caller graph for this function: