doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
idCompressor_LZW Class Reference
Inheritance diagram for idCompressor_LZW:
idCompressor_BitStream idCompressor_None idCompressor idFile

Public Member Functions

 idCompressor_LZW (void)
 
void Init (idFile *f, bool compress, int wordLength)
 
void FinishCompress (void)
 
int Write (const void *inData, int inLength)
 
int Read (void *outData, int outLength)
 
- Public Member Functions inherited from idCompressor_BitStream
 idCompressor_BitStream (void)
 
float GetCompressionRatio (void) const
 
- Public Member Functions inherited from idCompressor_None
 idCompressor_None (void)
 
const char * GetName (void)
 
const char * GetFullPath (void)
 
int Length (void)
 
ID_TIME_T Timestamp (void)
 
int Tell (void)
 
void ForceFlush (void)
 
void Flush (void)
 
int Seek (long offset, fsOrigin_t origin)
 
- Public Member Functions inherited from idFile
virtual ~idFile (void)
 
virtual void Rewind (void)
 
virtual int Printf (const char *fmt,...) id_attribute((format(printf
 
virtual int virtual int VPrintf (const char *fmt, va_list arg)
 
virtual int WriteFloatString (const char *fmt,...) id_attribute((format(printf
 
virtual int virtual int ReadInt (int &value)
 
virtual int ReadUnsignedInt (unsigned int &value)
 
virtual int ReadShort (short &value)
 
virtual int ReadUnsignedShort (unsigned short &value)
 
virtual int ReadChar (char &value)
 
virtual int ReadUnsignedChar (unsigned char &value)
 
virtual int ReadFloat (float &value)
 
virtual int ReadBool (bool &value)
 
virtual int ReadString (idStr &string)
 
virtual int ReadVec2 (idVec2 &vec)
 
virtual int ReadVec3 (idVec3 &vec)
 
virtual int ReadVec4 (idVec4 &vec)
 
virtual int ReadVec6 (idVec6 &vec)
 
virtual int ReadMat3 (idMat3 &mat)
 
virtual int WriteInt (const int value)
 
virtual int WriteUnsignedInt (const unsigned int value)
 
virtual int WriteShort (const short value)
 
virtual int WriteUnsignedShort (unsigned short value)
 
virtual int WriteChar (const char value)
 
virtual int WriteUnsignedChar (const unsigned char value)
 
virtual int WriteFloat (const float value)
 
virtual int WriteBool (const bool value)
 
virtual int WriteString (const char *string)
 
virtual int WriteVec2 (const idVec2 &vec)
 
virtual int WriteVec3 (const idVec3 &vec)
 
virtual int WriteVec4 (const idVec4 &vec)
 
virtual int WriteVec6 (const idVec6 &vec)
 
virtual int WriteMat3 (const idMat3 &mat)
 

Protected Member Functions

int AddToDict (int w, int k)
 
int Lookup (int w, int k)
 
bool BumpBits ()
 
int WriteChain (int code)
 
void DecompressBlock ()
 
- Protected Member Functions inherited from idCompressor_BitStream
void InitCompress (const void *inData, const int inLength)
 
void InitDecompress (void *outData, int outLength)
 
void WriteBits (int value, int numBits)
 
int ReadBits (int numBits)
 
void UnreadBits (int numBits)
 
int Compare (const byte *src1, int bitPtr1, const byte *src2, int bitPtr2, int maxBits) const
 

Protected Attributes

struct {
   int   k
 
   int   w
 
dictionary [LZW_DICT_SIZE]
 
idHashIndex index
 
int nextCode
 
int codeBits
 
byte block [LZW_BLOCK_SIZE]
 
int blockSize
 
int blockIndex
 
int oldCode
 
- Protected Attributes inherited from idCompressor_BitStream
byte buffer [65536]
 
int wordLength
 
int readTotalBytes
 
int readLength
 
int readByte
 
int readBit
 
const bytereadData
 
int writeTotalBytes
 
int writeLength
 
int writeByte
 
int writeBit
 
bytewriteData
 
- Protected Attributes inherited from idCompressor_None
idFilefile
 
bool compress
 

Static Protected Attributes

static const int LZW_BLOCK_SIZE = 32767
 
static const int LZW_START_BITS = 9
 
static const int LZW_FIRST_CODE = (1 << (LZW_START_BITS-1))
 
static const int LZW_DICT_BITS = 12
 
static const int LZW_DICT_SIZE = 1 << LZW_DICT_BITS
 

Additional Inherited Members

- Static Public Member Functions inherited from idCompressor
static idCompressorAllocNoCompression (void)
 
static idCompressorAllocBitStream (void)
 
static idCompressorAllocRunLength (void)
 
static idCompressorAllocRunLength_ZeroBased (void)
 
static idCompressorAllocHuffman (void)
 
static idCompressorAllocArithmetic (void)
 
static idCompressorAllocLZSS (void)
 
static idCompressorAllocLZSS_WordAligned (void)
 
static idCompressorAllocLZW (void)
 

Detailed Description

Definition at line 2224 of file Compressor.cpp.

Constructor & Destructor Documentation

idCompressor_LZW::idCompressor_LZW ( void  )
inline

Definition at line 2226 of file Compressor.cpp.

Member Function Documentation

int idCompressor_LZW::AddToDict ( int  w,
int  k 
)
protected

Definition at line 2356 of file Compressor.cpp.

bool idCompressor_LZW::BumpBits ( )
protected

Definition at line 2371 of file Compressor.cpp.

void idCompressor_LZW::DecompressBlock ( void  )
protected

Definition at line 2450 of file Compressor.cpp.

void idCompressor_LZW::FinishCompress ( void  )
virtual

Reimplemented from idCompressor_BitStream.

Definition at line 2389 of file Compressor.cpp.

void idCompressor_LZW::Init ( idFile f,
bool  compress,
int  wordLength 
)
virtual

Reimplemented from idCompressor_BitStream.

Definition at line 2276 of file Compressor.cpp.

int idCompressor_LZW::Lookup ( int  w,
int  k 
)
protected

Definition at line 2335 of file Compressor.cpp.

int idCompressor_LZW::Read ( void outData,
int  outLength 
)
virtual

Reimplemented from idCompressor_BitStream.

Definition at line 2300 of file Compressor.cpp.

int idCompressor_LZW::Write ( const void inData,
int  inLength 
)
virtual

Reimplemented from idCompressor_BitStream.

Definition at line 2399 of file Compressor.cpp.

int idCompressor_LZW::WriteChain ( int  code)
protected

Definition at line 2429 of file Compressor.cpp.

Member Data Documentation

byte idCompressor_LZW::block[LZW_BLOCK_SIZE]
protected

Definition at line 2260 of file Compressor.cpp.

int idCompressor_LZW::blockIndex
protected

Definition at line 2262 of file Compressor.cpp.

int idCompressor_LZW::blockSize
protected

Definition at line 2261 of file Compressor.cpp.

int idCompressor_LZW::codeBits
protected

Definition at line 2257 of file Compressor.cpp.

struct { ... } idCompressor_LZW::dictionary[LZW_DICT_SIZE]
idHashIndex idCompressor_LZW::index
protected

Definition at line 2254 of file Compressor.cpp.

int idCompressor_LZW::k

Definition at line 2251 of file Compressor.cpp.

const int idCompressor_LZW::LZW_BLOCK_SIZE = 32767
staticprotected

Definition at line 2243 of file Compressor.cpp.

const int idCompressor_LZW::LZW_DICT_BITS = 12
staticprotected

Definition at line 2246 of file Compressor.cpp.

const int idCompressor_LZW::LZW_DICT_SIZE = 1 << LZW_DICT_BITS
staticprotected

Definition at line 2247 of file Compressor.cpp.

const int idCompressor_LZW::LZW_FIRST_CODE = (1 << (LZW_START_BITS-1))
staticprotected

Definition at line 2245 of file Compressor.cpp.

const int idCompressor_LZW::LZW_START_BITS = 9
staticprotected

Definition at line 2244 of file Compressor.cpp.

int idCompressor_LZW::nextCode
protected

Definition at line 2256 of file Compressor.cpp.

int idCompressor_LZW::oldCode
protected

Definition at line 2268 of file Compressor.cpp.

int idCompressor_LZW::w

Definition at line 2252 of file Compressor.cpp.


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