xref: /AOO41X/main/svtools/source/filter/igif/decode.hxx (revision 01aa44aa134af97080e2cf8e8bf3a0a4cd1cffe0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _DECODE_HXX
25 #define _DECODE_HXX
26 
27 #ifndef _BMPACC_HXX
28 #include <vcl/bmpacc.hxx>
29 #endif
30 
31 struct GIFLZWTableEntry;
32 
33 class GIFLZWDecompressor
34 {
35     GIFLZWTableEntry*   pTable;
36     HPBYTE              pOutBuf;
37     HPBYTE              pOutBufData;
38     HPBYTE              pBlockBuf;
39     sal_uLong               nInputBitsBuf;
40     sal_uInt16              nTableSize;
41     sal_uInt16              nClearCode;
42     sal_uInt16              nEOICode;
43     sal_uInt16              nCodeSize;
44     sal_uInt16              nOldCode;
45     sal_uInt16              nOutBufDataLen;
46     sal_uInt16              nInputBitsBufSize;
47     sal_Bool                bEOIFound;
48     sal_uInt8               nDataSize;
49     sal_uInt8               nBlockBufSize;
50     sal_uInt8               nBlockBufPos;
51 
52     void                AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData);
53     sal_Bool                ProcessOneCode();
54 
55 
56 public:
57 
58                         GIFLZWDecompressor( sal_uInt8 cDataSize );
59                         ~GIFLZWDecompressor();
60 
61     HPBYTE              DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize, sal_uLong& rCount, sal_Bool& rEOI );
62 };
63 
64 #endif
65