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

◆ nsgif__next_displayable_frame()

static nsgif_error fl::third_party::nsgif__next_displayable_frame ( const nsgif_t * gif,
fl::u32 * frame,
fl::u32 * delay )
static

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

1840{
1841 fl::u32 next = *frame;
1842
1843 do {
1844 next = nsgif__frame_next(gif, false, next);
1845 if (next <= *frame && *frame != NSGIF_FRAME_INVALID &&
1846 gif->data_complete == false) {
1847 return NSGIF_ERR_END_OF_DATA;
1848
1849 } else if (next == *frame || next == NSGIF_FRAME_INVALID) {
1851 }
1852
1853 if (delay != nullptr) {
1854 *delay += gif->frames[next].info.delay;
1855 }
1856
1857 } while (gif->frames[next].info.display == false);
1858
1859 *frame = next;
1860 return NSGIF_OK;
1861}
@ NSGIF_ERR_END_OF_DATA
Unexpected end of GIF source data.
Definition nsgif.hpp:87
@ NSGIF_ERR_FRAME_DISPLAY
The current frame cannot be displayed.
Definition nsgif.hpp:97
@ NSGIF_OK
Success.
Definition nsgif.hpp:62
static fl::u32 nsgif__frame_next(const nsgif_t *gif, bool partial, fl::u32 frame) FL_NOEXCEPT
Definition gif.cpp.hpp:1819
nsgif_frame * frames
decoded frames
Definition gif.cpp.hpp:79
bool display
whether the frame should be displayed/animated
Definition nsgif.hpp:424
fl::u32 delay
delay (in cs) before animating the frame
Definition nsgif.hpp:434
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
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98
#define NSGIF_FRAME_INVALID
Internal flag that a frame is invalid/unprocessed.
Definition gif.cpp.hpp:162

References fl::delay(), FL_NOEXCEPT, nsgif__frame_next(), NSGIF_ERR_END_OF_DATA, NSGIF_ERR_FRAME_DISPLAY, NSGIF_FRAME_INVALID, and NSGIF_OK.

Referenced by nsgif_frame_prepare().

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