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

◆ nsgif_set_frame_delay_behaviour()

void fl::third_party::nsgif_set_frame_delay_behaviour ( nsgif_t * gif,
fl::u16 delay_min,
fl::u16 delay_default )

Configure handling of small frame delays.

Historically people created GIFs with a tiny frame delay, however the slow hardware of the time meant they actually played much slower. As computers sped up, to prevent animations playing faster than intended, decoders came to ignore overly small frame delays.

By default a nsgif_frame_prepare() managed animation will override frame delays of less than 2 centiseconds with a default frame delay of 10 centiseconds. This matches the behaviour of web browsers and other renderers.

Both the minimum and the default values can be overridden for a given GIF by the client. To get frame delays exactly as specified by the GIF file, set delay_min to zero.

Note that this does not affect the frame delay in the frame info (nsgif_frame_info_t) structure, which will always contain values specified by the GIF.

Parameters
[in]gifThe nsgif_t object to configure.
[in]delay_minThe minimum frame delay in centiseconds.
[in]delay_defaultThe delay to use if a frame delay is less than delay_min.

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

1526{
1527 gif->delay_min = delay_min;
1528 gif->delay_default = delay_default;
1529}
fl::u16 delay_min
Minimum allowable frame delay.
Definition gif.cpp.hpp:91
fl::u16 delay_default
Frame delay to apply when delay is less than delay_min.
Definition gif.cpp.hpp:94

References FL_NOEXCEPT.