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

◆ nsgif_data_complete()

void fl::third_party::nsgif_data_complete ( nsgif_t * gif)

Tell libnsgif that all the gif data has been provided.

Call this after calling nsgif_data_scan with the the entire GIF source data. You can call nsgif_data_scan multiple times up until this is called, and after this is called, nsgif_data_scan will return an error.

You can decode a GIF before this is called, however, it will fail to decode any truncated final frame data and will not perform loops when driven via nsgif_frame_prepare (because it doesn't know if there will be more frames supplied in future data).

Parameters
[in]gifThe nsgif_t object.

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

1774{
1775 if (gif->data_complete == false) {
1776 fl::u32 start = gif->info.frame_count;
1777 fl::u32 end = gif->frame_count_partial;
1778
1779 for (fl::u32 f = start; f < end; f++) {
1780 nsgif_frame *frame = &gif->frames[f];
1781
1782 if (frame->lzw_data_length > 0) {
1783 frame->info.display = true;
1784 gif->info.frame_count = f + 1;
1785
1786 if (f == 0) {
1787 frame->info.transparency = true;
1788 }
1789 break;
1790 }
1791 }
1792 }
1793
1794 gif->data_complete = true;
1795}
bool transparency
whether the frame may have transparency
Definition nsgif.hpp:426
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 frame_count
number of frames decoded
Definition nsgif.hpp:388
fl::u32 lzw_data_length
Amount of LZW data found in scan.
Definition gif.cpp.hpp:50
struct nsgif_info info
Definition gif.cpp.hpp:72
fl::u32 frame_count_partial
number of frames partially decoded
Definition gif.cpp.hpp:100
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
constexpr T * end(T(&array)[N]) FL_NOEXCEPT

References fl::third_party::nsgif_frame_info::display, fl::end(), FL_NOEXCEPT, fl::third_party::nsgif_frame::info, fl::third_party::nsgif_frame::lzw_data_length, and fl::third_party::nsgif_frame_info::transparency.

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

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