]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/mobile/jni/thirdparty/jbig2dec/jbig2_text.h
Add MuPDF native source codes
[hornmich/skoda-qr-demo.git] / QRScanner / mobile / jni / thirdparty / jbig2dec / jbig2_text.h
1 /* Copyright (C) 2001-2012 Artifex Software, Inc.
2    All Rights Reserved.
3
4    This software is provided AS-IS with no warranty, either express or
5    implied.
6
7    This software is distributed under license and may not be copied,
8    modified or distributed except as expressly authorized under the terms
9    of the license contained in the file LICENSE in this distribution.
10
11    Refer to licensing information at http://www.artifex.com or contact
12    Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,
13    CA  94903, U.S.A., +1(415)492-9861, for further information.
14 */
15
16 /*
17     jbig2dec
18 */
19
20 /**
21  * Headers for Text region handling
22  **/
23
24 typedef enum {
25     JBIG2_CORNER_BOTTOMLEFT = 0,
26     JBIG2_CORNER_TOPLEFT = 1,
27     JBIG2_CORNER_BOTTOMRIGHT = 2,
28     JBIG2_CORNER_TOPRIGHT = 3
29 } Jbig2RefCorner;
30
31 typedef struct {
32     bool SBHUFF;
33     bool SBREFINE;
34     bool SBDEFPIXEL;
35     Jbig2ComposeOp SBCOMBOP;
36     bool TRANSPOSED;
37     Jbig2RefCorner REFCORNER;
38     int SBDSOFFSET;
39     /* int SBW; */
40     /* int SBH; */
41     uint32_t SBNUMINSTANCES;
42     int LOGSBSTRIPS;
43     int SBSTRIPS;
44     /* int SBNUMSYMS; */
45     /* SBSYMCODES */
46     /* SBSYMCODELEN */
47     /* SBSYMS */
48     Jbig2HuffmanTable *SBHUFFFS;
49     Jbig2HuffmanTable *SBHUFFDS;
50     Jbig2HuffmanTable *SBHUFFDT;
51     Jbig2HuffmanTable *SBHUFFRDW;
52     Jbig2HuffmanTable *SBHUFFRDH;
53     Jbig2HuffmanTable *SBHUFFRDX;
54     Jbig2HuffmanTable *SBHUFFRDY;
55     Jbig2HuffmanTable *SBHUFFRSIZE;
56     Jbig2ArithIntCtx *IADT;
57     Jbig2ArithIntCtx *IAFS;
58     Jbig2ArithIntCtx *IADS;
59     Jbig2ArithIntCtx *IAIT;
60     Jbig2ArithIaidCtx *IAID;
61     Jbig2ArithIntCtx *IARI;
62     Jbig2ArithIntCtx *IARDW;
63     Jbig2ArithIntCtx *IARDH;
64     Jbig2ArithIntCtx *IARDX;
65     Jbig2ArithIntCtx *IARDY;
66     bool SBRTEMPLATE;
67     int8_t sbrat[4];
68 } Jbig2TextRegionParams;
69
70 int
71 jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
72                              const Jbig2TextRegionParams *params,
73                              const Jbig2SymbolDict * const *dicts, const int n_dicts,
74                              Jbig2Image *image,
75                              const byte *data, const size_t size,
76                              Jbig2ArithCx *GR_stats,
77                              Jbig2ArithState *as, Jbig2WordStream *ws);