ScummVM API documentation
Sci::Decompressor Class Reference

#include <decompressor.h>

Inheritance diagram for Sci::Decompressor:
Sci::DecompressorDCL Sci::DecompressorHuffman Sci::DecompressorLZW

Public Member Functions

virtual int unpack (Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
 

Protected Member Functions

virtual void init (Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
 
uint32 getBitsMSB (int n)
 
uint32 getBitsLSB (int n)
 
byte getByteMSB ()
 
byte getByteLSB ()
 
void fetchBitsMSB ()
 
void fetchBitsLSB ()
 
virtual void putByte (byte b)
 
bool isFinished ()
 

Protected Attributes

uint32 _dwBits
 bits buffer
 
byte _nBits
 number of unread bits in _dwBits
 
uint32 _szPacked
 size of the compressed data
 
uint32 _szUnpacked
 size of the decompressed data
 
uint32 _dwRead
 number of bytes read from _src
 
uint32 _dwWrote
 number of bytes written to _dest
 
Common::ReadStream_src
 
byte * _dest
 

Detailed Description

Base class for decompressors. Simply copies nPacked bytes from src to dest.

Member Function Documentation

◆ init()

virtual void Sci::Decompressor::init ( Common::ReadStream src,
byte *  dest,
uint32  nPacked,
uint32  nUnpacked 
)
protectedvirtual

Initialize decompressor.

Parameters
srcsource stream to read from
destdestination stream to write to
nPackedsize of packed data
nUnpacketsize of unpacked data
Returns
0 on success, non-zero on error

Reimplemented in Sci::DecompressorLZW.

◆ getBitsMSB()

uint32 Sci::Decompressor::getBitsMSB ( int  n)
protected

Get a number of bits from _src stream, starting with the most significant unread bit of the current four byte block.

Parameters
nnumber of bits to get
Returns
n-bits number

◆ getBitsLSB()

uint32 Sci::Decompressor::getBitsLSB ( int  n)
protected

Get a number of bits from _src stream, starting with the least significant unread bit of the current four byte block.

Parameters
nnumber of bits to get
Returns
n-bits number

◆ getByteMSB()

byte Sci::Decompressor::getByteMSB ( )
protected

Get one byte from _src stream.

Returns
byte

◆ putByte()

virtual void Sci::Decompressor::putByte ( byte  b)
protectedvirtual

Write one byte into _dest stream

Parameters
bbyte to put

◆ isFinished()

bool Sci::Decompressor::isFinished ( )
inlineprotected

Returns true if all expected data has been unpacked to _dest and there is no more data in _src.


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