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

◆ nsgif_create()

nsgif_error fl::third_party::nsgif_create ( const nsgif_bitmap_cb_vt * bitmap_vt,
nsgif_bitmap_fmt_t bitmap_fmt,
nsgif_t ** gif_out )

Create the NSGIF object.

Parameters
[in]bitmap_vtBitmap operation functions v-table.
[in]bitmap_fmtBitmap pixel format specification.
[out]gif_outReturn nsgif_t object on success.
Returns
NSGIF_OK on success, or appropriate error otherwise.

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

1497{
1498 nsgif_t *gif;
1499
1500 gif = static_cast<nsgif_t*>(fl::Malloc(sizeof(*gif)));
1501 if (gif) {
1502 fl::memset(gif, 0, sizeof(*gif));
1503 }
1504 if (gif == nullptr) {
1505 return NSGIF_ERR_OOM;
1506 }
1507
1508 gif->bitmap = *bitmap_vt;
1511
1514
1516
1517 *gif_out = gif;
1518 return NSGIF_OK;
1519}
@ NSGIF_ERR_OOM
Out of memory error.
Definition nsgif.hpp:67
@ NSGIF_OK
Success.
Definition nsgif.hpp:62
static struct nsgif_colour_layout nsgif__bitmap_fmt_to_colour_layout(nsgif_bitmap_fmt_t bitmap_fmt) FL_NOEXCEPT
Definition gif.cpp.hpp:1434
struct nsgif nsgif_t
Opaque type used by LibNSGIF to represent a GIF object in memory.
Definition nsgif.hpp:34
fl::u32 prev_index
previous frame index
Definition gif.cpp.hpp:136
fl::u16 delay_min
Minimum allowable frame delay.
Definition gif.cpp.hpp:91
fl::u32 decoded_frame
current frame decoded to bitmap
Definition gif.cpp.hpp:83
nsgif_bitmap_cb_vt bitmap
callbacks for bitmap functions
Definition gif.cpp.hpp:77
struct nsgif_colour_layout colour_layout
Client's colour component order.
Definition gif.cpp.hpp:127
fl::u16 delay_default
Frame delay to apply when delay is less than delay_min.
Definition gif.cpp.hpp:94
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
void * Malloc(fl::size size)
#define NSGIF_FRAME_DELAY_MIN
Default minimum allowable frame delay in cs.
Definition gif.cpp.hpp:27
#define NSGIF_FRAME_DELAY_DEFAULT
Default frame delay to apply.
Definition gif.cpp.hpp:34
#define NSGIF_FRAME_INVALID
Internal flag that a frame is invalid/unprocessed.
Definition gif.cpp.hpp:162

References fl::third_party::nsgif::bitmap, fl::third_party::nsgif::colour_layout, fl::third_party::nsgif::decoded_frame, fl::third_party::nsgif::delay_default, fl::third_party::nsgif::delay_min, FL_NOEXCEPT, fl::Malloc(), fl::memset(), nsgif__bitmap_fmt_to_colour_layout(), NSGIF_ERR_OOM, NSGIF_FRAME_DELAY_DEFAULT, NSGIF_FRAME_DELAY_MIN, NSGIF_FRAME_INVALID, NSGIF_OK, and fl::third_party::nsgif::prev_index.

Referenced by fl::third_party::SoftwareGifDecoder::initializeDecoder().

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