Canvas5Structure::LWZDecoder Struct Reference

a basic LWZ decoder More...

Classes

struct  LWZEntry

Public Member Functions

 LWZDecoder (unsigned char const *data, unsigned long len)
 constructor
bool decode (std::vector< unsigned char > &output)

Static Public Attributes

static int const e_firstCode =(1<<8)
static int const e_maxCodeLen =12
static int const e_maxCode =(1<<e_maxCodeLen)

Protected Member Functions

void initDictionary ()
unsigned getBit () const
unsigned getCodeWord (unsigned codeLen) const
unsigned char decodeRec (unsigned int code, std::vector< unsigned char > &output)
 LWZDecoder (LWZDecoder const &)=delete
LWZDecoderoperator= (LWZDecoder const &)=delete

Protected Attributes

unsigned char const * m_data
unsigned long m_len
unsigned long m_pos
unsigned long m_bit
std::vector< LWZEntrym_dictionary

Detailed Description

a basic LWZ decoder

Note
this code is freely inspired from https://github.com/MichaelDipperstein/lzw GLP 3

Constructor & Destructor Documentation

◆ LWZDecoder() [1/2]

Canvas5Structure::LWZDecoder::LWZDecoder ( unsigned char const * data,
unsigned long len )
inline

constructor

Referenced by LWZDecoder(), and operator=().

◆ LWZDecoder() [2/2]

Canvas5Structure::LWZDecoder::LWZDecoder ( LWZDecoder const & )
protecteddelete

Member Function Documentation

◆ decode()

bool Canvas5Structure::LWZDecoder::decode ( std::vector< unsigned char > & output)

◆ decodeRec()

unsigned char Canvas5Structure::LWZDecoder::decodeRec ( unsigned int code,
std::vector< unsigned char > & output )
inlineprotected

Referenced by decode(), and decodeRec().

◆ getBit()

unsigned Canvas5Structure::LWZDecoder::getBit ( ) const
inlineprotected

Referenced by getCodeWord().

◆ getCodeWord()

unsigned Canvas5Structure::LWZDecoder::getCodeWord ( unsigned codeLen) const
inlineprotected

Referenced by decode().

◆ initDictionary()

void Canvas5Structure::LWZDecoder::initDictionary ( )
inlineprotected

Referenced by decode(), and LWZDecoder().

◆ operator=()

LWZDecoder & Canvas5Structure::LWZDecoder::operator= ( LWZDecoder const & )
protecteddelete

Member Data Documentation

◆ e_firstCode

int const Canvas5Structure::LWZDecoder::e_firstCode =(1<<8)
static

Referenced by decode(), decodeRec(), and initDictionary().

◆ e_maxCode

int const Canvas5Structure::LWZDecoder::e_maxCode =(1<<e_maxCodeLen)
static

Referenced by decode(), and initDictionary().

◆ e_maxCodeLen

int const Canvas5Structure::LWZDecoder::e_maxCodeLen =12
static

◆ m_bit

unsigned long Canvas5Structure::LWZDecoder::m_bit
protected

Referenced by getBit(), getCodeWord(), and LWZDecoder().

◆ m_data

unsigned char const* Canvas5Structure::LWZDecoder::m_data
protected

Referenced by getBit(), getCodeWord(), and LWZDecoder().

◆ m_dictionary

std::vector<LWZEntry> Canvas5Structure::LWZDecoder::m_dictionary
protected

◆ m_len

unsigned long Canvas5Structure::LWZDecoder::m_len
protected

Referenced by getBit(), getCodeWord(), and LWZDecoder().

◆ m_pos

unsigned long Canvas5Structure::LWZDecoder::m_pos
mutableprotected

Referenced by getBit(), getCodeWord(), and LWZDecoder().


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

Generated on Sun Jun 29 2025 04:36:30 for libmwaw by doxygen 1.14.0