16 *error_message =
"Failed to allocate GIF decoder";
35 *error_message =
"Empty GIF data";
41 if (data.size() < 13) {
43 *error_message =
"GIF data too small";
49 if (data[0] !=
'G' || data[1] !=
'I' || data[2] !=
'F') {
51 *error_message =
"Invalid GIF signature";
57 if (!((data[3] ==
'8' && data[4] ==
'7' && data[5] ==
'a') ||
58 (data[3] ==
'8' && data[4] ==
'9' && data[5] ==
'a'))) {
60 *error_message =
"Unsupported GIF version";
68 fl::u16
width = data[6] | (data[7] << 8);
69 fl::u16
height = data[8] | (data[9] << 8);
73 *error_message =
"Invalid GIF dimensions";
84 if (decoder->begin(stream)) {
86 info.
width = decoder->getWidth();
87 info.
height = decoder->getHeight();
static GifInfo parseGifInfo(fl::span< const fl::u8 > data, fl::string *error_message=nullptr) FL_NO_EXCEPT
static IDecoderPtr createDecoder(const GifConfig &config, fl::string *error_message=nullptr) FL_NO_EXCEPT
static bool isSupported() FL_NO_EXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Base definition for an LED controller.