1 // Copyright 2015 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
7 #ifndef CORE_SRC_FXCODEC_JBIG2_JBIG2_TRDPROC_H_
8 #define CORE_SRC_FXCODEC_JBIG2_JBIG2_TRDPROC_H_
10 #include "../../../include/fxcrt/fx_system.h"
12 #include "JBig2_Image.h"
14 class CJBig2_ArithDecoder;
15 class CJBig2_ArithIaidDecoder;
16 class CJBig2_ArithIntDecoder;
17 class CJBig2_BitStream;
18 class CJBig2_HuffmanTable;
20 struct JBig2HuffmanCode;
22 struct JBig2IntDecoderState {
23 CJBig2_ArithIntDecoder* IADT;
24 CJBig2_ArithIntDecoder* IAFS;
25 CJBig2_ArithIntDecoder* IADS;
26 CJBig2_ArithIntDecoder* IAIT;
27 CJBig2_ArithIntDecoder* IARI;
28 CJBig2_ArithIntDecoder* IARDW;
29 CJBig2_ArithIntDecoder* IARDH;
30 CJBig2_ArithIntDecoder* IARDX;
31 CJBig2_ArithIntDecoder* IARDY;
32 CJBig2_ArithIaidDecoder* IAID;
36 JBIG2_CORNER_BOTTOMLEFT = 0,
37 JBIG2_CORNER_TOPLEFT = 1,
38 JBIG2_CORNER_BOTTOMRIGHT = 2,
39 JBIG2_CORNER_TOPRIGHT = 3
42 class CJBig2_TRDProc {
44 CJBig2_Image* decode_Huffman(CJBig2_BitStream* pStream,
45 JBig2ArithCtx* grContext);
47 CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
48 JBig2ArithCtx* grContext,
49 JBig2IntDecoderState* pIDS = NULL);
56 FX_DWORD SBNUMINSTANCES;
60 JBig2HuffmanCode* SBSYMCODES;
63 CJBig2_Image** SBSYMS;
66 JBig2ComposeOp SBCOMBOP;
69 JBig2Corner REFCORNER;
71 CJBig2_HuffmanTable* SBHUFFFS;
72 CJBig2_HuffmanTable* SBHUFFDS;
73 CJBig2_HuffmanTable* SBHUFFDT;
74 CJBig2_HuffmanTable* SBHUFFRDW;
75 CJBig2_HuffmanTable* SBHUFFRDH;
76 CJBig2_HuffmanTable* SBHUFFRDX;
77 CJBig2_HuffmanTable* SBHUFFRDY;
78 CJBig2_HuffmanTable* SBHUFFRSIZE;
83 #endif // CORE_SRC_FXCODEC_JBIG2_JBIG2_TRDPROC_H_