22 #ifndef SCI_RESOURCE_DECOMPRESSOR_H 23 #define SCI_RESOURCE_DECOMPRESSOR_H 25 #include "common/scummsys.h" 33 enum ResourceCompression {
67 virtual int unpack(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
78 virtual void init(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
86 uint32 getBitsMSB(
int n);
94 uint32 getBitsLSB(
int n);
111 virtual void putByte(byte b);
118 return (_dwWrote == _szUnpacked) && (_dwRead >= _szPacked);
136 int unpack(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
override;
150 DecompressorLZW(
int nCompression) : _numbits(0), _curtoken(0), _endtoken(0) {
151 _compression = nCompression;
153 void init(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
override;
154 int unpack(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
override;
158 PIC_OPX_EMBEDDED_VIEW = 1,
159 PIC_OPX_SET_PALETTE = 2,
164 int unpackLZW1(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
168 void reorderPic(byte *src, byte *dest,
int dsize);
169 void reorderView(byte *src, byte *dest);
170 void decodeRLE(byte **rledata, byte **pixeldata, byte *outbuffer,
int size);
171 int getRLEsize(byte *rledata,
int dsize);
172 void buildCelHeaders(byte **seeker, byte **writer,
int celindex,
int *cc_lengths,
int max);
180 uint16 _curtoken, _endtoken;
189 int unpack(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
override;
198 int unpack(
Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked)
override;
202 void copyComp(
int offs, uint32 clen);
208 #endif // SCI_RESOURCE_DECOMPRESSOR_H uint32 _dwRead
number of bytes read from _src
Definition: decompressor.h:125
byte _nBits
number of unread bits in _dwBits
Definition: decompressor.h:122
uint32 _dwBits
bits buffer
Definition: decompressor.h:121
Definition: decompressor.h:175
uint32 _dwWrote
number of bytes written to _dest
Definition: decompressor.h:126
Definition: decompressor.h:148
Definition: algorithm.h:29
bool isFinished()
Definition: decompressor.h:117
Definition: decompressor.h:51
uint32 _szPacked
size of the compressed data
Definition: decompressor.h:123
uint32 _szUnpacked
size of the decompressed data
Definition: decompressor.h:124
Definition: decompressor.h:187
Definition: decompressor.h:134