25class JBIG2ArithmeticDecoder;
26class JBIG2ArithmeticDecoderStats;
27class JBIG2HuffmanDecoder;
28struct JBIG2HuffmanTable;
33class JBIG2Stream:
public FilterStream {
36 JBIG2Stream(Stream *strA, Object *globalsStream);
37 virtual ~JBIG2Stream();
38 virtual StreamKind getKind() {
return strJBIG2; }
40 virtual int getChar();
41 virtual int lookChar();
42 virtual GString *getPSFilter(
const char *indent);
43 virtual GBool isBinary(GBool last = gTrue);
48 void readSymbolDictSeg(Guint segNum, Guint length,
49 Guint *refSegs, Guint nRefSegs);
50 void readTextRegionSeg(Guint segNum, GBool imm,
51 GBool lossless, Guint length,
52 Guint *refSegs, Guint nRefSegs);
53 JBIG2Bitmap *readTextRegion(GBool huff, GBool refine,
58 JBIG2HuffmanTable *symCodeTab,
61 Guint defPixel, Guint combOp,
62 Guint transposed, Guint refCorner,
64 JBIG2HuffmanTable *huffFSTable,
65 JBIG2HuffmanTable *huffDSTable,
66 JBIG2HuffmanTable *huffDTTable,
67 JBIG2HuffmanTable *huffRDWTable,
68 JBIG2HuffmanTable *huffRDHTable,
69 JBIG2HuffmanTable *huffRDXTable,
70 JBIG2HuffmanTable *huffRDYTable,
71 JBIG2HuffmanTable *huffRSizeTable,
74 void readPatternDictSeg(Guint segNum, Guint length);
75 void readHalftoneRegionSeg(Guint segNum, GBool imm,
76 GBool lossless, Guint length,
77 Guint *refSegs, Guint nRefSegs);
78 void readGenericRegionSeg(Guint segNum, GBool imm,
79 GBool lossless, Guint length);
80 JBIG2Bitmap *readGenericBitmap(GBool mmr,
int w,
int h,
81 int templ, GBool tpgdOn,
82 GBool useSkip, JBIG2Bitmap *skip,
85 void readGenericRefinementRegionSeg(Guint segNum, GBool imm,
86 GBool lossless, Guint length,
89 JBIG2Bitmap *readGenericRefinementRegion(
int w,
int h,
90 int templ, GBool tpgrOn,
91 JBIG2Bitmap *refBitmap,
94 void readPageInfoSeg(Guint length);
95 void readEndOfStripeSeg(Guint length);
96 void readProfilesSeg(Guint length);
97 void readCodeTableSeg(Guint segNum, Guint length);
98 void readExtensionSeg(Guint length);
99 JBIG2Segment *findSegment(Guint segNum);
100 void discardSegment(Guint segNum);
101 void resetGenericStats(Guint templ,
102 JBIG2ArithmeticDecoderStats *prevStats);
103 void resetRefinementStats(Guint templ,
104 JBIG2ArithmeticDecoderStats *prevStats);
105 void resetIntStats(
int symCodeLen);
106 GBool readUByte(Guint *x);
107 GBool readByte(
int *x);
108 GBool readUWord(Guint *x);
109 GBool readULong(Guint *x);
110 GBool readLong(
int *x);
112 Guint pageW, pageH, curPageH;
114 JBIG2Bitmap *pageBitmap;
117 GList *globalSegments;
122 JBIG2ArithmeticDecoder *arithDecoder;
123 JBIG2ArithmeticDecoderStats *genericRegionStats;
124 JBIG2ArithmeticDecoderStats *refinementRegionStats;
125 JBIG2ArithmeticDecoderStats *iadhStats;
126 JBIG2ArithmeticDecoderStats *iadwStats;
127 JBIG2ArithmeticDecoderStats *iaexStats;
128 JBIG2ArithmeticDecoderStats *iaaiStats;
129 JBIG2ArithmeticDecoderStats *iadtStats;
130 JBIG2ArithmeticDecoderStats *iaitStats;
131 JBIG2ArithmeticDecoderStats *iafsStats;
132 JBIG2ArithmeticDecoderStats *iadsStats;
133 JBIG2ArithmeticDecoderStats *iardxStats;
134 JBIG2ArithmeticDecoderStats *iardyStats;
135 JBIG2ArithmeticDecoderStats *iardwStats;
136 JBIG2ArithmeticDecoderStats *iardhStats;
137 JBIG2ArithmeticDecoderStats *iariStats;
138 JBIG2ArithmeticDecoderStats *iaidStats;
139 JBIG2HuffmanDecoder *huffDecoder;
140 JBIG2MMRDecoder *mmrDecoder;