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

◆ nsgif__colour_table_decode()

static void fl::third_party::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 )
static

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

Parameters
[in]colour_tableThe colour table to populate.
[in]layoutla.
[in]colour_table_entriesThe number of colour table entries.
[in]dataRaw colour table data.

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

1084{
1085 fl::u8 *entry = (fl::u8 *)colour_table;
1086
1087 while (colour_table_entries--) {
1088 /* Gif colour map contents are r,g,b.
1089 *
1090 * We want to pack them bytewise into the colour table,
1091 * according to the client colour layout.
1092 */
1093
1094 entry[layout->r] = *data++;
1095 entry[layout->g] = *data++;
1096 entry[layout->b] = *data++;
1097 entry[layout->a] = 0xff;
1098
1099 entry += sizeof(fl::u32);
1100 }
1101}
unsigned char u8
Definition coder.h:132
fl::u8 b
Byte offset within pixel to blue component.
Definition gif.cpp.hpp:66
fl::u8 g
Byte offset within pixel to green component.
Definition gif.cpp.hpp:65
fl::u8 r
Byte offset within pixel to red component.
Definition gif.cpp.hpp:64
fl::u8 a
Byte offset within pixel to alpha component.
Definition gif.cpp.hpp:67

References FL_NOEXCEPT, and NSGIF_MAX_COLOURS.

Referenced by nsgif__colour_table_extract(), and nsgif_local_palette().

+ Here is the caller graph for this function: