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

◆ nsgif__colour_table_extract()

static nsgif_error fl::third_party::nsgif__colour_table_extract ( fl::u32 colour_table[NSGIF_MAX_COLOURS],
const struct nsgif_colour_layout * layout,
fl::size colour_table_entries,
const fl::u8 * data,
fl::size data_len,
fl::size * used,
bool decode )
inlinestatic

Extract a GIF colour table into a LibNSGIF colour table buffer.

Parameters
[in]colour_tableThe colour table to populate.
[in]layoutThe target pixel format to decode to.
[in]colour_table_entriesThe number of colour table entries.
[in]dataCurrent position in data.
[in]data_lenThe available length of data.
[out]usedNumber of colour table bytes read.
[in]decodeWhether to decode the colour table.
Returns
NSGIF_OK on success, appropriate error otherwise.

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

1123{
1124 if (data_len < colour_table_entries * 3) {
1125 return NSGIF_ERR_END_OF_DATA;
1126 }
1127
1128 if (decode) {
1129 nsgif__colour_table_decode(colour_table, layout,
1130 colour_table_entries, data);
1131 }
1132
1133 *used = colour_table_entries * 3;
1134 return NSGIF_OK;
1135}
@ NSGIF_ERR_END_OF_DATA
Unexpected end of GIF source data.
Definition nsgif.hpp:87
@ NSGIF_OK
Success.
Definition nsgif.hpp:62
static void nsgif__colour_table_decode(fl::u32 colour_table[NSGIF_MAX_COLOURS], const struct nsgif_colour_layout *layout, fl::size colour_table_entries, const fl::u8 *data) FL_NOEXCEPT
Extract a GIF colour table into a LibNSGIF colour table buffer.
Definition gif.cpp.hpp:1079

References FL_NOEXCEPT, nsgif__colour_table_decode(), NSGIF_ERR_END_OF_DATA, NSGIF_MAX_COLOURS, and NSGIF_OK.

Referenced by nsgif__parse_colour_table(), and nsgif_data_scan().

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