shithub: jbig2

Download patch

ref: cdf26701fbd0fef2ef9f915aed0d76fc180fc47e
parent: f83d936965f28824360c79822b1c7eefeb3a3e36
author: Sebastian Rasmussen <sebras@gmail.com>
date: Sat May 26 11:00:00 EDT 2018

jbig2dec: Create jbig2_refinement.h with refinement declarations.

--- a/jbig2_generic.h
+++ b/jbig2_generic.h
@@ -43,20 +43,4 @@
 jbig2_decode_generic_region(Jbig2Ctx *ctx,
                             Jbig2Segment *segment, const Jbig2GenericRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats);
 
-/* 6.3 Table 6 */
-typedef struct {
-    /* GRW */
-    /* GRH */
-    bool GRTEMPLATE;
-    Jbig2Image *reference;
-    int32_t DX, DY;
-    bool TPGRON;
-    int8_t grat[4];
-} Jbig2RefinementRegionParams;
-
-int
-jbig2_decode_refinement_region(Jbig2Ctx *ctx,
-                               Jbig2Segment *segment,
-                               const Jbig2RefinementRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats);
-
 #endif /* _JBIG2_GENERIC_H */
--- a/jbig2_priv.h
+++ b/jbig2_priv.h
@@ -141,7 +141,6 @@
 
 /* 7.4 */
 int jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);
-int jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data);
 
 int jbig2_pattern_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data);
 int jbig2_halftone_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data);
--- a/jbig2_refinement.c
+++ b/jbig2_refinement.c
@@ -37,6 +37,7 @@
 #include "jbig2_generic.h"
 #include "jbig2_image.h"
 #include "jbig2_page.h"
+#include "jbig2_refinement.h"
 
 static int
 jbig2_decode_refinement_template0_unopt(Jbig2Ctx *ctx,
--- /dev/null
+++ b/jbig2_refinement.h
@@ -1,0 +1,43 @@
+/* Copyright (C) 2001-2018 Artifex Software, Inc.
+   All Rights Reserved.
+
+   This software is provided AS-IS with no warranty, either express or
+   implied.
+
+   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.
+
+   Refer to licensing information at http://www.artifex.com or contact
+   Artifex Software, Inc.,  1305 Grant Avenue - Suite 200, Novato,
+   CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/*
+    jbig2dec
+*/
+
+#ifndef _JBIG2_REFINEMENT_H
+#define _JBIG2_REFINEMENT_H
+
+/* 6.3 Table 6 */
+typedef struct {
+    /* GRW */
+    /* GRH */
+    bool GRTEMPLATE;
+    Jbig2Image *reference;
+    int32_t DX, DY;
+    bool TPGRON;
+    int8_t grat[4];
+} Jbig2RefinementRegionParams;
+
+int
+jbig2_decode_refinement_region(Jbig2Ctx *ctx,
+                               Jbig2Segment *segment,
+                               const Jbig2RefinementRegionParams *params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GB_stats);
+
+/* 7.4 */
+int jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data);
+
+#endif /* _JBIG2_REFINEMENT_H */
+
--- a/jbig2_segment.c
+++ b/jbig2_segment.c
@@ -32,6 +32,7 @@
 #include "jbig2_metadata.h"
 #include "jbig2_arith.h"
 #include "jbig2_halftone.h"
+#include "jbig2_refinement.h"
 
 Jbig2Segment *
 jbig2_parse_segment_header(Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size, size_t *p_header_size)
--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -37,6 +37,7 @@
 #include "jbig2_mmr.h"
 #include "jbig2_symbol_dict.h"
 #include "jbig2_text.h"
+#include "jbig2_refinement.h"
 
 #if defined(OUTPUT_PBM) || defined(DUMP_SYMDICT)
 #include <stdio.h>
--- a/jbig2_text.c
+++ b/jbig2_text.c
@@ -33,6 +33,7 @@
 #include "jbig2_huffman.h"
 #include "jbig2_generic.h"
 #include "jbig2_page.h"
+#include "jbig2_refinement.h"
 #include "jbig2_symbol_dict.h"
 #include "jbig2_text.h"