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

◆ lzw_decode_init_map()

lzw_result fl::third_party::lzw_decode_init_map ( struct lzw_ctx * ctx,
fl::u8 minimum_code_size,
fl::u32 transparency_idx,
const fl::u32 * colour_table,
const fl::u8 * input_data,
fl::size input_length,
fl::size input_pos )

Initialise an LZW decompression context for decoding to colour map values.

For transparency to work correctly, the given client buffer must have the values from the previous frame. The transparency_idx should be a value of 256 or above, if the frame does not have transparency.

Parameters
[in]ctxThe LZW decompression context to initialise.
[in]minimum_code_sizeThe LZW Minimum Code Size.
[in]transparency_idxIndex representing transparency.
[in]colour_tableIndex to pixel colour mapping.
[in]input_dataThe compressed data.
[in]input_lengthByte length of compressed data.
[in]input_posStart position in data. Must be position of a size byte at sub-block start.
Returns
LZW_OK on success, or appropriate error code otherwise.

Definition at line 323 of file lzw.cpp.hpp.

331{
332 lzw_result res;
333
334 if (colour_table == nullptr) {
335 return LZW_BAD_PARAM;
336 }
337
338 res = lzw_decode_init(ctx, minimum_code_size,
339 input_data, input_length, input_pos);
340 if (res != LZW_OK) {
341 return res;
342 }
343
344 ctx->has_transparency = (transparency_idx <= 0xFF);
345 ctx->transparency_idx = transparency_idx;
346 ctx->colour_map = colour_table;
347
348 return LZW_OK;
349}
lzw_result lzw_decode_init(struct lzw_ctx *ctx, fl::u8 minimum_code_size, const fl::u8 *input_data, fl::size input_length, fl::size input_pos) FL_NOEXCEPT
Initialise an LZW decompression context for decoding.
Definition lzw.cpp.hpp:263
lzw_result
LZW decoding response codes.
Definition lzw.h:33
@ LZW_OK
Success.
Definition lzw.h:34
@ LZW_BAD_PARAM
Error: Bad function parameter.
Definition lzw.h:41
bool has_transparency
Whether the image is opaque.
Definition lzw.cpp.hpp:92
const fl::u32 * colour_map
Index to colour mapping.
Definition lzw.cpp.hpp:94
fl::u8 transparency_idx
Index representing transparency.
Definition lzw.cpp.hpp:93

References FL_NOEXCEPT, LZW_BAD_PARAM, lzw_decode_init(), and LZW_OK.

Referenced by nsgif__decode_simple().

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