#include <LSILzwDictionary.h>
List of all members.
Detailed Description
Class CLzwDictionary
Description: A dictionary of codes + characters for use with LZW compression and decompression.
Member Typedef Documentation
Decompression uses a smaller dictionary.
Member Function Documentation
LSVOID LSE_CALL lsi::CLzwDictionary::AddCode |
( |
LSI_LZW_CODE |
_lcCode, |
|
|
LSUINT8 |
_ui8Char |
|
) |
| |
Add a code during decompression.
- Parameters:
-
_lcCode | The code to be added. |
_ui8Char | The character associated with this code. |
LSBOOL LSE_CALL lsi::CLzwDictionary::Alloc |
( |
LSUINT32 |
_ui32Total | ) |
[protected] |
Allocate the given amount of entries.
- Parameters:
-
_ui32Total | Total number of entries to allocate. |
- Returns:
- Returns true if there is enough RAM to complete the operation.
LSUINT32 LSE_CALL lsi::CLzwDictionary::DeriveBitsNeeded |
( |
| ) |
const [protected] |
Derive the total number of bits needed to read any code in the dictionary.
- Returns:
- Returns the number of bits needed to read any code in the dictionary.
static LSUINT32 LSE_CALL lsi::CLzwDictionary::GetBits |
( |
const LSUINT8 * |
_pui8Stream, |
|
|
LSUINT64 & |
_ui64BitIndex, |
|
|
LSUINT32 |
_ui32Total |
|
) |
| [static] |
Get bits from a stream. _ui64BitIndex is increased by _ui32Total upon return.
- Parameters:
-
_pui8Stream | Stream of data from which to read the bits. |
_ui64BitIndex | Bit index from which to start reading. |
_ui32Total | Number of bits to get. |
- Returns:
- Returns the read bits as an unsigned 32-bit integer.
LSE_INLINE LSUINT32 LSE_CALL lsi::CLzwDictionary::GetBitsNeeded |
( |
| ) |
const |
Get the number of bits needed to access any code.
- Returns:
- Returns the minimum number of bits needed to access any code in the dictionary.
LSUINT32 LSE_CALL lsi::CLzwDictionary::GetEntryIndex |
( |
LSI_LZW_CODE |
_lcCode | ) |
const |
Get an entry index by its code only. Used when decompressing.
- Parameters:
-
_lcCode | The code whose index is to be obtained. |
- Returns:
- Returns the index of the code, which is always the code itself.
LSUINT32 LSE_CALL lsi::CLzwDictionary::GetString |
( |
LSI_LZW_CODE |
_lcCode, |
|
|
LSUINT8 * |
_pui8String |
|
) |
| 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.
- Parameters:
-
_lcCode | Code for which to get the string. |
_pui8String | Holds the returned string in reverse order. |
- Returns:
- Returns the number of characters in the returned string.
LSUINT32 LSE_CALL lsi::CLzwDictionary::GetTotal |
( |
| ) |
const |
Get the size of the dictionary.
- Returns:
- Returns the number of codes in the dictionary.
LSBOOL LSE_CALL lsi::CLzwDictionary::InitializeDictionary |
( |
LSUINT32 |
_ui32Len, |
|
|
LSUINT32 |
_ui32MaxBits |
|
) |
| |
Set the initial dictionary where each entry is a root.
- Parameters:
-
_ui32Len | Number of codes in the base dictionary. No more than 256. |
_ui32MaxBits | Maximum number of bits for any code. since this class only performs decompression, this must always be true. |
- Returns:
- Returns true if there are no memory failures.
LSBOOL LSE_CALL lsi::CLzwDictionary::IsClearCode |
( |
LSI_LZW_CODE |
_lcCode | ) |
const |
Is the given code the clear code?
- Parameters:
-
_lcCode | The code to be tested against the clear code. |
- Returns:
- Returns true if the code is the clear code.
LSBOOL LSE_CALL lsi::CLzwDictionary::IsEndOfInputCode |
( |
LSI_LZW_CODE |
_lcCode | ) |
const |
Is the given code the end-of-input code?
- Parameters:
-
_lcCode | The code to be tested against the end-of-input code. |
- Returns:
- Returns true if the code is the end-of-input code.
LSVOID LSE_CALL lsi::CLzwDictionary::Reset |
( |
| ) |
[protected] |
LSVOID LSE_CALL lsi::CLzwDictionary::SetAllocator |
( |
CAllocator * |
_paAllocator | ) |
|
Set the allocator FIRST.
- Parameters:
-
_paAllocator | The allocator to be used by this object. Must be set before any action on this object takes place. |
Member Data Documentation
The number of bits required to read any code in the list.
The documentation for this class was generated from the following file: