shithub: jbig2

Download patch

ref: ad85e74393cfb2667ea1f15756502ea2bc3cf3d9
parent: 41b78a49bf9e00d0d78532581b7e72836935f3d5
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue Feb 6 03:10:58 EST 2007

Add a new header for declaring the public text region functions.


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@454 ded80894-8fb9-0310-811b-c03f3676ab4d

--- /dev/null
+++ b/jbig2_text.h
@@ -1,0 +1,65 @@
+/*
+    jbig2dec
+    
+    Copyright (c) 2002-2006 artofcode LLC.
+    
+    This software is distributed under license and may not
+    be copied, modified or distributed except as expressly
+    authorized under the terms of the license contained in
+    the file LICENSE in this distribution.
+                                                                                
+    For information on commercial licensing, go to
+    http://www.artifex.com/licensing/ or contact
+    Artifex Software, Inc.,  101 Lucas Valley Road #110,
+    San Rafael, CA  94903, U.S.A., +1(415)492-9861.
+        
+    $Id: jbig2_priv.h 420 2005-07-27 23:55:54Z giles $
+    
+    text region header
+*/
+
+/* jbig2_symbol_dict.h must be included first */
+
+typedef enum {
+    JBIG2_CORNER_BOTTOMLEFT = 0,
+    JBIG2_CORNER_TOPLEFT = 1,
+    JBIG2_CORNER_BOTTOMRIGHT = 2,
+    JBIG2_CORNER_TOPRIGHT = 3
+} Jbig2RefCorner;
+
+typedef struct {
+    bool SBHUFF;
+    bool SBREFINE;
+    bool SBDEFPIXEL;
+    Jbig2ComposeOp SBCOMBOP;
+    bool TRANSPOSED;
+    Jbig2RefCorner REFCORNER;
+    int SBDSOFFSET;
+    /* SBW */
+    /* SBH */
+    uint32_t SBNUMINSTANCES;
+    int LOGSBSTRIPS;
+    int SBSTRIPS;
+    /* SBNUMSYMS */
+    /* SBSYMCODES */
+    /* SBSYMCODELEN */
+    /* SBSYMS */
+    Jbig2HuffmanTable *SBHUFFFS;
+    Jbig2HuffmanTable *SBHUFFDS;
+    Jbig2HuffmanTable *SBHUFFDT;
+    Jbig2HuffmanTable *SBHUFFRDW;
+    Jbig2HuffmanTable *SBHUFFRDH;
+    Jbig2HuffmanTable *SBHUFFRDX;
+    Jbig2HuffmanTable *SBHUFFRDY;
+    Jbig2HuffmanTable *SBHUFFRSIZE;
+    bool SBRTEMPLATE;
+    int8_t sbrat[4];
+} Jbig2TextRegionParams;
+
+int
+jbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,
+			     const Jbig2TextRegionParams *params,
+			     const Jbig2SymbolDict * const *dicts, const int n_dicts,
+			     Jbig2Image *image,
+			     const byte *data, const size_t size,
+			     Jbig2ArithCx *GR_stats);