Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Burger::GIFDecoder Class Reference

GIF style LZW decompresser. More...

Collaboration diagram for Burger::GIFDecoder:
Collaboration graph
[legend]

Public Member Functions

 GIFDecoder ()
 Initialize a GIFDecoder.
 
const char * Unpack (uint8_t *pOutput, uintptr_t uOutputLength, InputMemoryStream *pInput)
 Decompress the image.
 

Static Public Member Functions

static GIFDecoderNew (void)
 Allocate and initialize a GIFDecoder.
 

Private Member Functions

void Init (void)
 Init the LZW permanent tokens.
 
void Reset (void)
 Reset the LZW token tree.
 
uint_t GetCode (uint_t uBitsRequested)
 Get an LZW code token.
 

Private Attributes

InputMemoryStreamm_pInput
 Pointer to packed data.
 
uint_t m_uBitBucket
 Current bit bucket.
 
uint_t m_uBitCount
 Current valid bit count in bucket.
 
uint_t m_uChunkCount
 Number of bytes in stream.
 
uint_t m_uLZWCodeSize
 Starting data size.
 
const uint8_t * m_LZWTable [4096]
 Dictionary pointers.
 
uint8_t m_LZWArray [256]
 0-255 for default data
 
uint_t m_LZWSize [4096]
 Size of each entry.
 

Detailed Description

GIF style LZW decompresser.


This class will decompress LZW data in the GIF format

See also
FileGIF or GIFEncoder

Constructor & Destructor Documentation

◆ GIFDecoder()

Burger::GIFDecoder::GIFDecoder ( )

Initialize a GIFDecoder.


Member Function Documentation

◆ GetCode()

uint_t Burger::GIFDecoder::GetCode ( uint_t uBitsRequested)
private

Get an LZW code token.


Parameters
uBitsRequestedNumber of bits to pull from the byte stream
Returns
Value pulled from the bit stream (Zero if data is depleted)

◆ Init()

void Burger::GIFDecoder::Init ( void )
private

Init the LZW permanent tokens.


◆ New()

Burger::GIFDecoder *BURGER_API Burger::GIFDecoder::New ( void )
static

Allocate and initialize a GIFDecoder.


Returns
A pointer to a default GIFDecoder class or NULL if out of memory
See also
Delete(const T *)

◆ Reset()

void Burger::GIFDecoder::Reset ( void )
private

Reset the LZW token tree.


◆ Unpack()

const char * Burger::GIFDecoder::Unpack ( uint8_t * pOutput,
uintptr_t uOutputLength,
InputMemoryStream * pInput )

Decompress the image.


Decompress the LZW compressed image data into a linear buffer

Parameters
pOutputBuffer to accept the decompressed data
uOutputLengthLength of the buffer for decompressed data
pInputData stream to read compressed data from
Returns
NULL if success or a pointer to a string describing the error

Member Data Documentation

◆ m_LZWArray

uint8_t Burger::GIFDecoder::m_LZWArray[256]
private

0-255 for default data

◆ m_LZWSize

uint_t Burger::GIFDecoder::m_LZWSize[4096]
private

Size of each entry.

◆ m_LZWTable

const uint8_t* Burger::GIFDecoder::m_LZWTable[4096]
private

Dictionary pointers.

◆ m_pInput

InputMemoryStream* Burger::GIFDecoder::m_pInput
private

Pointer to packed data.

◆ m_uBitBucket

uint_t Burger::GIFDecoder::m_uBitBucket
private

Current bit bucket.

◆ m_uBitCount

uint_t Burger::GIFDecoder::m_uBitCount
private

Current valid bit count in bucket.

◆ m_uChunkCount

uint_t Burger::GIFDecoder::m_uChunkCount
private

Number of bytes in stream.

◆ m_uLZWCodeSize

uint_t Burger::GIFDecoder::m_uLZWCodeSize
private

Starting data size.