FastLED 3.9.15
Loading...
Searching...
No Matches
lzw.h
Go to the documentation of this file.
1/*
2 * This file is part of NetSurf's LibNSGIF, http://www.netsurf-browser.org/
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 *
6 * Copyright 2017 Michael Drake <michael.drake@codethink.co.uk>
7 * Copyright 2021 Michael Drake <tlsa@netsurf-browser.org>
8 */
9
10#ifndef LZW_H_
11#define LZW_H_
12
13#include "fl/stl/int.h"
14#include "fl/stl/noexcept.h"
15
16namespace fl {
17namespace third_party {
18
25
27#define LZW_CODE_MAX 12
28
29/* Declare lzw internal context structure */
30struct lzw_ctx;
31
44
53 struct lzw_ctx **ctx) FL_NOEXCEPT;
54
61 struct lzw_ctx *ctx) FL_NOEXCEPT;
62
75 struct lzw_ctx *ctx,
76 fl::u8 minimum_code_size,
77 const fl::u8 *input_data,
78 fl::size input_length,
79 fl::size input_pos) FL_NOEXCEPT;
80
92lzw_result lzw_decode(struct lzw_ctx *ctx,
93 const fl::u8 **const output_data,
94 fl::u32 *output_written) FL_NOEXCEPT;
95
114 struct lzw_ctx *ctx,
115 fl::u8 minimum_code_size,
116 fl::u32 transparency_idx,
117 const fl::u32 *colour_table,
118 const fl::u8 *input_data,
119 fl::size input_length,
120 fl::size input_pos) FL_NOEXCEPT;
121
138lzw_result lzw_decode_map(struct lzw_ctx *ctx,
139 fl::u32 *output_data,
140 fl::u32 output_length,
141 fl::u32 *output_written) FL_NOEXCEPT;
142
143} // namespace third_party
144} // namespace fl
145
146#endif
unsigned char u8
Definition s16x16x4.h:132
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_context_create(struct lzw_ctx **ctx) FL_NOEXCEPT
Create an LZW decompression context.
Definition lzw.cpp.hpp:104
void lzw_context_destroy(struct lzw_ctx *ctx) FL_NOEXCEPT
Destroy an LZW decompression context.
Definition lzw.cpp.hpp:116
lzw_result
LZW decoding response codes.
Definition lzw.h:33
@ LZW_NO_DATA
Error: Out of data.
Definition lzw.h:37
@ LZW_EOI_CODE
Error: End of Information code.
Definition lzw.h:38
@ LZW_OK
Success.
Definition lzw.h:34
@ LZW_NO_COLOUR
Error: No colour map provided.
Definition lzw.h:39
@ LZW_BAD_CODE
Error: Bad LZW code.
Definition lzw.h:42
@ LZW_NO_MEM
Error: Out of memory.
Definition lzw.h:36
@ LZW_BAD_PARAM
Error: Bad function parameter.
Definition lzw.h:41
@ LZW_OK_EOD
Success; reached zero-length sub-block.
Definition lzw.h:35
@ LZW_BAD_ICODE
Error: Bad initial LZW code.
Definition lzw.h:40
lzw_result 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) FL_NOEXCEPT
Initialise an LZW decompression context for decoding to colour map values.
Definition lzw.cpp.hpp:323
lzw_result lzw_decode(struct lzw_ctx *ctx, const fl::u8 **const output_data, fl::u32 *output_written) FL_NOEXCEPT
Read input codes until end of LZW context owned output buffer.
Definition lzw.cpp.hpp:500
lzw_result lzw_decode_map(struct lzw_ctx *ctx, fl::u32 *output_data, fl::u32 output_length, fl::u32 *output_written) FL_NOEXCEPT
Read LZW codes into client buffer, mapping output to colours.
Definition lzw.cpp.hpp:591
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT