tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
Loading...
Searching...
No Matches
TinyLzwReader Struct Reference

A code stream being read, in either bit order and framing. More...

#include <lzw.h>

Public Attributes

const uint8_t * data
size_t size
size_t pos
uint32_t accumulator
uint32_t count
uint32_t remaining
uint8_t chained
uint8_t msb
int done

Detailed Description

A code stream being read, in either bit order and framing.

The two formats differ in three ways and all three are fields here rather than a second implementation: GIF packs codes least significant bit first and TIFF most significant, GIF frames its data in length prefixed sub-blocks and TIFF does not, and TIFF widens its codes one code earlier than GIF, which is a documented quirk of that format rather than a mistake in either.

Member Data Documentation

◆ accumulator

uint32_t TinyLzwReader::accumulator

Bits pulled but not yet consumed, an implementation detail.

◆ chained

uint8_t TinyLzwReader::chained

Non-zero when the data is framed in length prefixed sub-blocks.

◆ count

uint32_t TinyLzwReader::count

How many bits the accumulator holds, an implementation detail.

◆ data

const uint8_t* TinyLzwReader::data

The bytes being read.

◆ done

int TinyLzwReader::done

Set once the stream has run out, whether by marker or by end of buffer.

◆ msb

uint8_t TinyLzwReader::msb

Non-zero to read codes most significant bit first.

◆ pos

size_t TinyLzwReader::pos

Next byte to pull into the accumulator.

◆ remaining

uint32_t TinyLzwReader::remaining

Bytes left in the sub-block being read, when framing applies.

◆ size

size_t TinyLzwReader::size

How many bytes there are.


The documentation for this struct was generated from the following file: