"L. Spiro Engine"
|
A dictionary for decoding an LZW bytestream. More...
#include <LSCLzwDecodingDict.h>
Classes | |
struct | LSN_LZW_DICT_ENTRY |
Public Types | |
typedef LSUINT32 | LSN_LZW_CODE |
typedef struct lsc::CLzwDecodingDict::LSN_LZW_DICT_ENTRY * | LPLSN_LZW_DICT_ENTRY |
typedef struct lsc::CLzwDecodingDict::LSN_LZW_DICT_ENTRY | LPCLSN_LZW_DICT_ENTRY |
Public Member Functions | |
LSVOID LSE_CALL | Reset () |
LSVOID LSE_CALL | SetAllocator (CStdAllocator *_psaAllocator) |
LSVOID LSE_CALL | InitializeDictionary (LSUINT32 _ui32Len, LSUINT32 _ui32MaxBits) |
LSBOOL LSE_CALL | IsClearCode (LSN_LZW_CODE _lcCode) const |
LSBOOL LSE_CALL | IsEndOfInputCode (LSN_LZW_CODE _lcCode) const |
LSUINT32 LSE_CALL | GetTotal () const |
LSBOOL LSE_CALL | AddCode (LSN_LZW_CODE _lcCode, LSUINT8 _ui8Char) |
LSBOOL LSE_CALL | GetString (LSN_LZW_CODE _lcCode, CString &_sString) const |
LSE_INLINE LSUINT32 LSE_CALL | GetBitsNeeded () const |
Protected Member Functions | |
LSBOOL LSE_CALL | Alloc () |
LSUINT32 LSE_CALL | DeriveBitsNeeded () const |
Protected Attributes | |
CAllocator | m_aAllocator |
LPLSN_LZW_DICT_ENTRY | m_lpldeDictionary |
LSUINT32 | m_ui32Total |
LSUINT32 | m_ui32Alloc |
LSUINT32 | m_ui32RootLen |
LSUINT32 | m_ui32MaxSize |
LSUINT32 | m_ui32MaxBits |
LSUINT32 | m_ui32BitsNeeded |
A dictionary for decoding an LZW bytestream.
Class CLzwDecodingDict Description: When decoding, the dictionary format for dictionary entries in the LZW compression scheme are different from when encoding. The codes are referenced only by code during decompression, allowing us to store the entries linearly during decompression. Our loop-up and usage functiosn for the codes are different from the ones used during encryption.
typedef struct lsc::CLzwDecodingDict::LSN_LZW_DICT_ENTRY * lsc::CLzwDecodingDict::LPLSN_LZW_DICT_ENTRY |
A dictionary entry. The code of the item is its index in the array.
typedef LSUINT32 lsc::CLzwDecodingDict::LSN_LZW_CODE |
A code.
LSBOOL LSE_CALL lsc::CLzwDecodingDict::AddCode | ( | LSN_LZW_CODE | _lcCode, |
LSUINT8 | _ui8Char | ||
) |
Add a code to the dictionary. Fails if the dictionary is full.
_lcCode | The code to be added. |
_ui8Char | The character associated with this code. |
LSBOOL LSE_CALL lsc::CLzwDecodingDict::Alloc | ( | ) | [protected] |
Allocate the full set of codes and initialize the roots.
LSUINT32 LSE_CALL lsc::CLzwDecodingDict::DeriveBitsNeeded | ( | ) | const [protected] |
Derive the total number of bits needed to read any code in the dictionary.
LSE_INLINE LSUINT32 LSE_CALL lsc::CLzwDecodingDict::GetBitsNeeded | ( | ) | const |
Get the number of bits needed to access any code.
LSBOOL LSE_CALL lsc::CLzwDecodingDict::GetString | ( | LSN_LZW_CODE | _lcCode, |
CString & | _sString | ||
) | const |
Get a string from the dictionary. Translates all codes to characters and returns the length of the string. The string is returned in reverse order.
_lcCode | The code to translate into a byte string. |
_sString | Upone return, this string contains the returned bytes. |
LSUINT32 LSE_CALL lsc::CLzwDecodingDict::GetTotal | ( | ) | const |
Get the size of the dictionary.
LSVOID LSE_CALL lsc::CLzwDecodingDict::InitializeDictionary | ( | LSUINT32 | _ui32Len, |
LSUINT32 | _ui32MaxBits | ||
) |
Set the initial dictionary where each entry is a root.
_ui32Len | Number of root entries in the dictionary. |
_ui32MaxBits | Maximum number of bits in any entry in the dictionary. |
LSBOOL LSE_CALL lsc::CLzwDecodingDict::IsClearCode | ( | LSN_LZW_CODE | _lcCode | ) | const |
Is the given code the clear code?
_lcCode | The code to be tested against the clear code. |
LSBOOL LSE_CALL lsc::CLzwDecodingDict::IsEndOfInputCode | ( | LSN_LZW_CODE | _lcCode | ) | const |
Is the given code the end-of-input code?
_lcCode | The code to be tested against the end-of-input code. |
LSVOID LSE_CALL lsc::CLzwDecodingDict::Reset | ( | ) |
Reset everything. Deallocates all resources.
LSVOID LSE_CALL lsc::CLzwDecodingDict::SetAllocator | ( | CStdAllocator * | _psaAllocator | ) |
Set the allocator. If different from the current allocator, the dictionary is reset.
_psaAllocator | The allocator to use by this class. |
CAllocator lsc::CLzwDecodingDict::m_aAllocator [protected] |
Our allocator.
The dictionary.
LSUINT32 lsc::CLzwDecodingDict::m_ui32BitsNeeded [protected] |
The bits needed for the current code.
LSUINT32 lsc::CLzwDecodingDict::m_ui32MaxBits [protected] |
Maximum number of bits in an entry.
LSUINT32 lsc::CLzwDecodingDict::m_ui32MaxSize [protected] |
Maximum size.
LSUINT32 lsc::CLzwDecodingDict::m_ui32RootLen [protected] |
Size of the root.
LSUINT32 lsc::CLzwDecodingDict::m_ui32Total [protected] |
The size of the dictionary.