ScummVM API documentation
lzw.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Based on the Reverse Engineering work of Christophe Fontanel,
24  * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
25  */
26 
27 #ifndef DM_LZW_H
28 #define DM_LZW_H
29 
30 #include "common/file.h"
31 
32 #include "dm/dm.h"
33 
34 namespace Common {
35  class MemoryReadStream;
36 }
37 
38 namespace DM {
40  bool _repetitionEnabled;
41  int16 _codeBitCount;
42  int16 _currentMaximumCode;
43  int16 _absoluteMaximumCode;
44  byte _inputBuffer[12];
45  int16 _dictNextAvailableCode;
46  bool _dictFlushed;
47 
48  byte _leastSignificantBitmasks[9];
49  int16 _inputBufferBitIndex;
50  int16 _inputBufferBitCount;
51  int16 _charToRepeat;
52 
53  byte *_tempBuffer;
54  int16 *_prefixCode;
55  byte *_appendCharacter;
56 
57  int16 getNextInputCode(Common::MemoryReadStream &stream, int32 *inputByteCount);
58  void outputCharacter(byte character, byte **out);
59  void operator=(const LZWdecompressor&); // deleted
60 public:
62  ~LZWdecompressor();
63  int32 decompress(Common::MemoryReadStream &inputStream, int32 inputByteCount, byte *out);
64 };
65 
66 }
67 
68 #endif
Definition: lzw.h:39
Definition: algorithm.h:29
Definition: champion.h:35
Definition: memstream.h:43