diff options
-rw-r--r-- | jbig2dec/jbig2.c | 1 | ||||
-rw-r--r-- | jbig2dec/jbig2_generic.c | 1 | ||||
-rw-r--r-- | jbig2dec/jbig2_halftone.c | 1 | ||||
-rw-r--r-- | jbig2dec/jbig2_page.c | 1 | ||||
-rw-r--r-- | jbig2dec/jbig2_page.h | 53 | ||||
-rw-r--r-- | jbig2dec/jbig2_priv.h | 30 | ||||
-rw-r--r-- | jbig2dec/jbig2_refinement.c | 1 | ||||
-rw-r--r-- | jbig2dec/jbig2_segment.c | 1 | ||||
-rw-r--r-- | jbig2dec/jbig2_text.c | 1 |
9 files changed, 60 insertions, 30 deletions
diff --git a/jbig2dec/jbig2.c b/jbig2dec/jbig2.c index cdb49cd3b..ef6d20f87 100644 --- a/jbig2dec/jbig2.c +++ b/jbig2dec/jbig2.c | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include "jbig2.h" | 30 | #include "jbig2.h" |
31 | #include "jbig2_priv.h" | 31 | #include "jbig2_priv.h" |
32 | #include "jbig2_page.h" | ||
32 | 33 | ||
33 | static void * | 34 | static void * |
34 | jbig2_default_alloc(Jbig2Allocator *allocator, size_t size) | 35 | jbig2_default_alloc(Jbig2Allocator *allocator, size_t size) |
diff --git a/jbig2dec/jbig2_generic.c b/jbig2dec/jbig2_generic.c index be185616a..eda5bf755 100644 --- a/jbig2dec/jbig2_generic.c +++ b/jbig2dec/jbig2_generic.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "jbig2_arith.h" | 39 | #include "jbig2_arith.h" |
40 | #include "jbig2_generic.h" | 40 | #include "jbig2_generic.h" |
41 | #include "jbig2_mmr.h" | 41 | #include "jbig2_mmr.h" |
42 | #include "jbig2_page.h" | ||
42 | 43 | ||
43 | /* return the appropriate context size for the given template */ | 44 | /* return the appropriate context size for the given template */ |
44 | int | 45 | int |
diff --git a/jbig2dec/jbig2_halftone.c b/jbig2dec/jbig2_halftone.c index ccb8b48de..a737457a2 100644 --- a/jbig2dec/jbig2_halftone.c +++ b/jbig2dec/jbig2_halftone.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "jbig2_mmr.h" | 33 | #include "jbig2_mmr.h" |
34 | #include "jbig2_image.h" | 34 | #include "jbig2_image.h" |
35 | #include "jbig2_halftone.h" | 35 | #include "jbig2_halftone.h" |
36 | #include "jbig2_page.h" | ||
36 | 37 | ||
37 | /** | 38 | /** |
38 | * jbig2_hd_new: create a new dictionary from a collective bitmap | 39 | * jbig2_hd_new: create a new dictionary from a collective bitmap |
diff --git a/jbig2dec/jbig2_page.c b/jbig2dec/jbig2_page.c index 43e17c945..93fd44129 100644 --- a/jbig2dec/jbig2_page.c +++ b/jbig2dec/jbig2_page.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include "jbig2.h" | 27 | #include "jbig2.h" |
28 | #include "jbig2_priv.h" | 28 | #include "jbig2_priv.h" |
29 | #include "jbig2_page.h" | ||
29 | 30 | ||
30 | #ifdef OUTPUT_PBM | 31 | #ifdef OUTPUT_PBM |
31 | #include <stdio.h> | 32 | #include <stdio.h> |
diff --git a/jbig2dec/jbig2_page.h b/jbig2dec/jbig2_page.h new file mode 100644 index 000000000..316824f04 --- /dev/null +++ b/jbig2dec/jbig2_page.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* Copyright (C) 2001-2018 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., 1305 Grant Avenue - Suite 200, Novato, | ||
13 | CA 94945, U.S.A., +1(415)492-9861, for further information. | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | jbig2dec | ||
18 | */ | ||
19 | |||
20 | #ifndef _JBIG2_PAGE_H | ||
21 | #define _JBIG2_PAGE_H | ||
22 | |||
23 | /* the page structure handles decoded page | ||
24 | results. it's allocated by a 'page info' | ||
25 | segment and marked complete by an 'end of page' | ||
26 | segment. | ||
27 | */ | ||
28 | typedef enum { | ||
29 | JBIG2_PAGE_FREE, | ||
30 | JBIG2_PAGE_NEW, | ||
31 | JBIG2_PAGE_COMPLETE, | ||
32 | JBIG2_PAGE_RETURNED, | ||
33 | JBIG2_PAGE_RELEASED | ||
34 | } Jbig2PageState; | ||
35 | |||
36 | struct _Jbig2Page { | ||
37 | Jbig2PageState state; | ||
38 | uint32_t number; | ||
39 | uint32_t height, width; /* in pixels */ | ||
40 | uint32_t x_resolution, y_resolution; /* in pixels per meter */ | ||
41 | uint16_t stripe_size; | ||
42 | bool striped; | ||
43 | uint32_t end_row; | ||
44 | uint8_t flags; | ||
45 | Jbig2Image *image; | ||
46 | }; | ||
47 | |||
48 | int jbig2_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data); | ||
49 | int jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data); | ||
50 | int jbig2_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data); | ||
51 | int jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *src, int x, int y, Jbig2ComposeOp op); | ||
52 | |||
53 | #endif /* _JBIG2_PAGE_H */ | ||
diff --git a/jbig2dec/jbig2_priv.h b/jbig2dec/jbig2_priv.h index 4217f5ae8..a3809f1ec 100644 --- a/jbig2dec/jbig2_priv.h +++ b/jbig2dec/jbig2_priv.h | |||
@@ -115,35 +115,6 @@ void *jbig2_realloc(Jbig2Allocator *allocator, void *p, size_t size, size_t num) | |||
115 | 115 | ||
116 | int jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t seg_idx, const char *fmt, ...); | 116 | int jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t seg_idx, const char *fmt, ...); |
117 | 117 | ||
118 | /* the page structure handles decoded page | ||
119 | results. it's allocated by a 'page info' | ||
120 | segment and marked complete by an 'end of page' | ||
121 | segment. | ||
122 | */ | ||
123 | typedef enum { | ||
124 | JBIG2_PAGE_FREE, | ||
125 | JBIG2_PAGE_NEW, | ||
126 | JBIG2_PAGE_COMPLETE, | ||
127 | JBIG2_PAGE_RETURNED, | ||
128 | JBIG2_PAGE_RELEASED | ||
129 | } Jbig2PageState; | ||
130 | |||
131 | struct _Jbig2Page { | ||
132 | Jbig2PageState state; | ||
133 | uint32_t number; | ||
134 | uint32_t height, width; /* in pixels */ | ||
135 | uint32_t x_resolution, y_resolution; /* in pixels per meter */ | ||
136 | uint16_t stripe_size; | ||
137 | bool striped; | ||
138 | uint32_t end_row; | ||
139 | uint8_t flags; | ||
140 | Jbig2Image *image; | ||
141 | }; | ||
142 | |||
143 | int jbig2_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data); | ||
144 | int jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data); | ||
145 | int jbig2_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data); | ||
146 | |||
147 | typedef enum { | 118 | typedef enum { |
148 | JBIG2_COMPOSE_OR = 0, | 119 | JBIG2_COMPOSE_OR = 0, |
149 | JBIG2_COMPOSE_AND = 1, | 120 | JBIG2_COMPOSE_AND = 1, |
@@ -153,7 +124,6 @@ typedef enum { | |||
153 | } Jbig2ComposeOp; | 124 | } Jbig2ComposeOp; |
154 | 125 | ||
155 | int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op); | 126 | int jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op); |
156 | int jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *src, int x, int y, Jbig2ComposeOp op); | ||
157 | 127 | ||
158 | /* region segment info */ | 128 | /* region segment info */ |
159 | 129 | ||
diff --git a/jbig2dec/jbig2_refinement.c b/jbig2dec/jbig2_refinement.c index b05c6dff1..0c6b793e8 100644 --- a/jbig2dec/jbig2_refinement.c +++ b/jbig2dec/jbig2_refinement.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "jbig2_arith.h" | 36 | #include "jbig2_arith.h" |
37 | #include "jbig2_generic.h" | 37 | #include "jbig2_generic.h" |
38 | #include "jbig2_image.h" | 38 | #include "jbig2_image.h" |
39 | #include "jbig2_page.h" | ||
39 | 40 | ||
40 | static int | 41 | static int |
41 | jbig2_decode_refinement_template0_unopt(Jbig2Ctx *ctx, | 42 | jbig2_decode_refinement_template0_unopt(Jbig2Ctx *ctx, |
diff --git a/jbig2dec/jbig2_segment.c b/jbig2dec/jbig2_segment.c index c2e238f96..742967a52 100644 --- a/jbig2dec/jbig2_segment.c +++ b/jbig2dec/jbig2_segment.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "jbig2.h" | 27 | #include "jbig2.h" |
28 | #include "jbig2_priv.h" | 28 | #include "jbig2_priv.h" |
29 | #include "jbig2_huffman.h" | 29 | #include "jbig2_huffman.h" |
30 | #include "jbig2_page.h" | ||
30 | #include "jbig2_symbol_dict.h" | 31 | #include "jbig2_symbol_dict.h" |
31 | #include "jbig2_metadata.h" | 32 | #include "jbig2_metadata.h" |
32 | #include "jbig2_arith.h" | 33 | #include "jbig2_arith.h" |
diff --git a/jbig2dec/jbig2_text.c b/jbig2dec/jbig2_text.c index f545fb738..13372f4d6 100644 --- a/jbig2dec/jbig2_text.c +++ b/jbig2dec/jbig2_text.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "jbig2_arith_iaid.h" | 32 | #include "jbig2_arith_iaid.h" |
33 | #include "jbig2_huffman.h" | 33 | #include "jbig2_huffman.h" |
34 | #include "jbig2_generic.h" | 34 | #include "jbig2_generic.h" |
35 | #include "jbig2_page.h" | ||
35 | #include "jbig2_symbol_dict.h" | 36 | #include "jbig2_symbol_dict.h" |
36 | #include "jbig2_text.h" | 37 | #include "jbig2_text.h" |
37 | 38 | ||