Handle clear code.
- Parameters
-
| [in] | ctx | LZW reading context, updated. |
| [out] | code_out | Returns next code after a clear code. |
- Returns
- LZW_OK or error code.
Definition at line 233 of file lzw.cpp.hpp.
236{
237 fl::u16 code = 0;
238
239
243
244
245 do {
249 return res;
250 }
252
253
256 }
257
258 *code_out = code;
260}
static lzw_result lzw__read_code(struct lzw_read_ctx *ctx, fl::u16 code_size, fl::u16 *code_out) FL_NOEXCEPT
Get the next LZW code of given size from the raw input data.
lzw_result
LZW decoding response codes.
@ LZW_BAD_ICODE
Error: Bad initial LZW code.
fl::u16 table_size
Next position in table to fill.
fl::u16 clear_code
Special Clear code value.
fl::u16 eoi_code
Special End of Information code value.
fl::u8 initial_code_size
Starting LZW code size.
fl::u8 code_size
Current LZW code size.
struct lzw_read_ctx input
Input reading context.
fl::u16 code_max
Max code value for current code size.
References FL_NOEXCEPT, lzw__read_code(), LZW_BAD_ICODE, and LZW_OK.
Referenced by lzw__decode(), and lzw_decode_init().