OpenJPEG: jp2.h Source File

OpenJPEG 2.3.1

jp2.h
Go to the documentation of this file.
1 /*
2 * The copyright in this software is being made available under the 2-clauses
3 * BSD License, included below. This software may be subject to other third
4 * party and contributor rights, including patent rights, and no such rights
5 * are granted under this license.
6 *
7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
8 * Copyright (c) 2002-2014, Professor Benoit Macq
9 * Copyright (c) 2002-2003, Yannick Verschueren
10 * Copyright (c) 2005, Herve Drolon, FreeImage Team
11 * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
12 * Copyright (c) 2012, CS Systemes d'Information, France
13 * All rights reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36 #ifndef OPJ_JP2_H
37 #define OPJ_JP2_H
38
46
47 /*#define JPIP_JPIP 0x6a706970*/
48
49 #define JP2_JP 0x6a502020
50 #define JP2_FTYP 0x66747970
51 #define JP2_JP2H 0x6a703268
52 #define JP2_IHDR 0x69686472
53 #define JP2_COLR 0x636f6c72
54 #define JP2_JP2C 0x6a703263
55 #define JP2_URL 0x75726c20
56 #define JP2_PCLR 0x70636c72
57 #define JP2_CMAP 0x636d6170
58 #define JP2_CDEF 0x63646566
59 #define JP2_DTBL 0x6474626c
60 #define JP2_BPCC 0x62706363
61 #define JP2_JP2 0x6a703220
63 /* For the future */
64 /* #define JP2_RES 0x72657320 */
65 /* #define JP2_JP2I 0x6a703269 */
66 /* #define JP2_XML 0x786d6c20 */
67 /* #define JP2_UUID 0x75756994 */
68 /* #define JP2_UINF 0x75696e66 */
69 /* #define JP2_ULST 0x756c7374 */
71 /* ----------------------------------------------------------------------- */
72
73 typedef enum {
74 JP2_STATE_NONE = 0x0,
75 JP2_STATE_SIGNATURE = 0x1,
76 JP2_STATE_FILE_TYPE = 0x2,
77 JP2_STATE_HEADER = 0x4,
78 JP2_STATE_CODESTREAM = 0x8,
79 JP2_STATE_END_CODESTREAM = 0x10,
80 JP2_STATE_UNKNOWN = 0x7fffffff /* ISO C restricts enumerator values to range of 'int' */
81 }
82 JP2_STATE;
83
84 typedef enum {
85 JP2_IMG_STATE_NONE = 0x0,
86 JP2_IMG_STATE_UNKNOWN = 0x7fffffff
87 }
88 JP2_IMG_STATE;
89
93 typedef struct opj_jp2_cdef_info {
94 OPJ_UINT16 cn, typ, asoc;
95 } opj_jp2_cdef_info_t;
96
100 typedef struct opj_jp2_cdef {
101 opj_jp2_cdef_info_t *info;
102 OPJ_UINT16 n;
103 } opj_jp2_cdef_t;
104
108 typedef struct opj_jp2_cmap_comp {
109 OPJ_UINT16 cmp;
110 OPJ_BYTE mtyp, pcol;
111 } opj_jp2_cmap_comp_t;
112
116 typedef struct opj_jp2_pclr {
117 OPJ_UINT32 *entries;
118 OPJ_BYTE *channel_sign;
119 OPJ_BYTE *channel_size;
120 opj_jp2_cmap_comp_t *cmap;
121 OPJ_UINT16 nr_entries;
122 OPJ_BYTE nr_channels;
123 } opj_jp2_pclr_t;
124
128 typedef struct opj_jp2_color {
129 OPJ_BYTE *icc_profile_buf;
130 OPJ_UINT32 icc_profile_len;
131
132 opj_jp2_cdef_t *jp2_cdef;
133 opj_jp2_pclr_t *jp2_pclr;
134 OPJ_BYTE jp2_has_colr;
135 } opj_jp2_color_t;
136
140 typedef struct opj_jp2_comps {
141 OPJ_UINT32 depth;
142 OPJ_UINT32 sgnd;
143 OPJ_UINT32 bpcc;
144 } opj_jp2_comps_t;
145
149 typedef struct opj_jp2 {
151 opj_j2k_t *j2k;
153 struct opj_procedure_list * m_validation_list;
155 struct opj_procedure_list * m_procedure_list;
156
157 /* width of image */
158 OPJ_UINT32 w;
159 /* height of image */
160 OPJ_UINT32 h;
161 /* number of components in the image */
162 OPJ_UINT32 numcomps;
163 OPJ_UINT32 bpc;
164 OPJ_UINT32 C;
165 OPJ_UINT32 UnkC;
166 OPJ_UINT32 IPR;
167 OPJ_UINT32 meth;
168 OPJ_UINT32 approx;
169 OPJ_UINT32 enumcs;
170 OPJ_UINT32 precedence;
171 OPJ_UINT32 brand;
172 OPJ_UINT32 minversion;
173 OPJ_UINT32 numcl;
174 OPJ_UINT32 *cl;
175 opj_jp2_comps_t *comps;
176 /* FIXME: The following two variables are used to save offset
177 as we write out a JP2 file to disk. This mechanism is not flexible
178 as codec writers will need to extand those fields as new part
179 of the standard are implemented.
180 */
181 OPJ_OFF_T j2k_codestream_offset;
182 OPJ_OFF_T jpip_iptr_offset;
183 OPJ_BOOL jpip_on;
184 OPJ_UINT32 jp2_state;
185 OPJ_UINT32 jp2_img_state;
186
187 opj_jp2_color_t color;
188
189 OPJ_BOOL ignore_pclr_cmap_cdef;
190 OPJ_BYTE has_jp2h;
191 OPJ_BYTE has_ihdr;
192 }
193 opj_jp2_t;
194
198 typedef struct opj_jp2_box {
199 OPJ_UINT32 length;
200 OPJ_UINT32 type;
201 OPJ_INT32 init_pos;
202 } opj_jp2_box_t;
203
204 typedef struct opj_jp2_header_handler {
205 /* marker value */
206 OPJ_UINT32 id;
207 /* action linked to the marker */
208 OPJ_BOOL(*handler)(opj_jp2_t *jp2,
209 OPJ_BYTE *p_header_data,
210 OPJ_UINT32 p_header_size,
211 opj_event_mgr_t * p_manager);
212 }
213 opj_jp2_header_handler_t;
214
215
216 typedef struct opj_jp2_img_header_writer_handler {
217 /* action to perform */
218 OPJ_BYTE* (*handler)(opj_jp2_t *jp2, OPJ_UINT32 * p_data_size);
219 /* result of the action : data */
220 OPJ_BYTE* m_data;
221 /* size of data */
222 OPJ_UINT32 m_size;
223 }
224 opj_jp2_img_header_writer_handler_t;
225
228 /* ----------------------------------------------------------------------- */
229
236 void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters);
237
244 OPJ_BOOL opj_jp2_set_threads(opj_jp2_t *jp2, OPJ_UINT32 num_threads);
245
255 OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2,
256 opj_stream_private_t *p_stream,
257 opj_image_t* p_image,
258 opj_event_mgr_t * p_manager);
259
270 OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2,
271 opj_cparameters_t *parameters,
272 opj_image_t *image,
273 opj_event_mgr_t * p_manager);
274
282 OPJ_BOOL opj_jp2_encode(opj_jp2_t *jp2,
283 opj_stream_private_t *stream,
284 opj_event_mgr_t * p_manager);
285
286
297 OPJ_BOOL opj_jp2_start_compress(opj_jp2_t *jp2,
298 opj_stream_private_t *stream,
299 opj_image_t * p_image,
300 opj_event_mgr_t * p_manager);
301
302
307 OPJ_BOOL opj_jp2_end_compress(opj_jp2_t *jp2,
308 opj_stream_private_t *cio,
309 opj_event_mgr_t * p_manager);
310
311 /* ----------------------------------------------------------------------- */
312
317 OPJ_BOOL opj_jp2_end_decompress(opj_jp2_t *jp2,
318 opj_stream_private_t *cio,
319 opj_event_mgr_t * p_manager);
320
331 OPJ_BOOL opj_jp2_read_header(opj_stream_private_t *p_stream,
332 opj_jp2_t *jp2,
333 opj_image_t ** p_image,
334 opj_event_mgr_t * p_manager);
335
346 OPJ_BOOL opj_jp2_set_decoded_components(opj_jp2_t *jp2,
347 OPJ_UINT32 numcomps,
348 const OPJ_UINT32* comps_indices,
349 opj_event_mgr_t * p_manager);
350
365 OPJ_BOOL opj_jp2_read_tile_header(opj_jp2_t * p_jp2,
366 OPJ_UINT32 * p_tile_index,
367 OPJ_UINT32 * p_data_size,
368 OPJ_INT32 * p_tile_x0,
369 OPJ_INT32 * p_tile_y0,
370 OPJ_INT32 * p_tile_x1,
371 OPJ_INT32 * p_tile_y1,
372 OPJ_UINT32 * p_nb_comps,
373 OPJ_BOOL * p_go_on,
374 opj_stream_private_t *p_stream,
375 opj_event_mgr_t * p_manager);
376
387 OPJ_BOOL opj_jp2_write_tile(opj_jp2_t *p_jp2,
388 OPJ_UINT32 p_tile_index,
389 OPJ_BYTE * p_data,
390 OPJ_UINT32 p_data_size,
391 opj_stream_private_t *p_stream,
392 opj_event_mgr_t * p_manager);
393
405 OPJ_BOOL opj_jp2_decode_tile(opj_jp2_t * p_jp2,
406 OPJ_UINT32 p_tile_index,
407 OPJ_BYTE * p_data,
408 OPJ_UINT32 p_data_size,
409 opj_stream_private_t *p_stream,
410 opj_event_mgr_t * p_manager);
411
417 opj_jp2_t* opj_jp2_create(OPJ_BOOL p_is_decoder);
418
423 void opj_jp2_destroy(opj_jp2_t *jp2);
424
425
439 OPJ_BOOL opj_jp2_set_decode_area(opj_jp2_t *p_jp2,
440 opj_image_t* p_image,
441 OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
442 OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,
443 opj_event_mgr_t * p_manager);
444
448 OPJ_BOOL opj_jp2_get_tile(opj_jp2_t *p_jp2,
449 opj_stream_private_t *p_stream,
450 opj_image_t* p_image,
451 opj_event_mgr_t * p_manager,
452 OPJ_UINT32 tile_index);
453
454
458 OPJ_BOOL opj_jp2_set_decoded_resolution_factor(opj_jp2_t *p_jp2,
459 OPJ_UINT32 res_factor,
460 opj_event_mgr_t * p_manager);
461
462
463 /* TODO MSD: clean these 3 functions */
472 void jp2_dump(opj_jp2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream);
473
481 opj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_t* p_jp2);
482
490 opj_codestream_index_t* jp2_get_cstr_index(opj_jp2_t* p_jp2);
491
492
496
497 #endif /* OPJ_JP2_H */
498
opj_jp2::approx
OPJ_UINT32 approx
Definition: jp2.h:168
opj_jp2_box_t
struct opj_jp2_box opj_jp2_box_t
JP2 Box.
opj_image::x1
OPJ_UINT32 x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:675
OPJ_BYTE
unsigned char OPJ_BYTE
Definition: openjpeg.h:117
JP2_STATE_SIGNATURE
@ JP2_STATE_SIGNATURE
Definition: jp2.h:75
opj_jp2_header_handler_t
struct opj_jp2_header_handler opj_jp2_header_handler_t
opj_j2k::m_decoder
opj_j2k_dec_t m_decoder
Definition: j2k.h:551
opj_stream_write_data
OPJ_SIZE_T opj_stream_write_data(opj_stream_private_t *p_stream, const OPJ_BYTE *p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t *p_event_mgr)
Writes some bytes to the stream.
Definition: cio.c:385
opj_calloc
void * opj_calloc(size_t num, size_t size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.c:198
opj_jp2_check_color
static OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj_jp2_color_t *color, opj_event_mgr_t *p_manager)
Definition: jp2.c:888
opj_jp2_encode
OPJ_BOOL opj_jp2_encode(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Encode an image into a JPEG-2000 file stream.
Definition: jp2.c:2096
opj_jp2_setup_encoder
OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Setup the encoder parameters using the current image and using user parameters.
Definition: jp2.c:1909
JP2_STATE
JP2_STATE
< Resolution box (super-box)
Definition: jp2.h:73
jp2_dump
void jp2_dump(opj_jp2_t *p_jp2, OPJ_INT32 flag, FILE *out_stream)
Dump some elements from the JP2 decompression structure .
Definition: jp2.c:3212
OPJ_CLRSPC_EYCC
@ OPJ_CLRSPC_EYCC
e-YCC
Definition: openjpeg.h:285
opj_jp2_pclr
Palette data: table entries, palette columns.
Definition: jp2.h:116
opj_jp2::w
OPJ_UINT32 w
Definition: jp2.h:158
opj_tcd::image
opj_image_t * image
image header
Definition: tcd.h:265
opj_jp2_read_bpcc
static OPJ_BOOL opj_jp2_read_bpcc(opj_jp2_t *jp2, OPJ_BYTE *p_bpc_header_data, OPJ_UINT32 p_bpc_header_size, opj_event_mgr_t *p_manager)
Reads a Bit per Component box.
Definition: jp2.c:721
opj_jp2_set_decode_area
OPJ_BOOL opj_jp2_set_decode_area(opj_jp2_t *p_jp2, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y, opj_event_mgr_t *p_manager)
Sets the given area to be decoded.
Definition: jp2.c:3086
opj_jp2_read_header_procedure
static OPJ_BOOL opj_jp2_read_header_procedure(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Reads a jpeg2000 file header structure.
Definition: jp2.c:2257
opj_jp2::precedence
OPJ_UINT32 precedence
Definition: jp2.h:170
jp2_header
static const opj_jp2_header_handler_t jp2_header[]
Definition: jp2.c:425
opj_jpip_skip_iptr
static OPJ_BOOL opj_jpip_skip_iptr(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Definition: jp2.c:2658
opj_j2k::m_cp
opj_cp_t m_cp
Coding parameters.
Definition: j2k.h:563
opj_write_double
#define opj_write_double
Definition: cio.h:66
opj_j2k_destroy
void opj_j2k_destroy(opj_j2k_t *p_j2k)
Destroys a jpeg2000 codec.
Definition: j2k.c:8277
opj_jp2_pclr::cmap
opj_jp2_cmap_comp_t * cmap
Definition: jp2.h:120
opj_jp2_read_cmap
static OPJ_BOOL opj_jp2_read_cmap(opj_jp2_t *jp2, OPJ_BYTE *p_cmap_header_data, OPJ_UINT32 p_cmap_header_size, opj_event_mgr_t *p_manager)
Collect component mapping data.
Definition: jp2.c:1260
opj_jp2_set_decode_area
OPJ_BOOL opj_jp2_set_decode_area(opj_jp2_t *p_jp2, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y, opj_event_mgr_t *p_manager)
Sets the given area to be decoded.
Definition: jp2.c:3086
JP2_JP2
#define JP2_JP2
File type fields.
Definition: jp2.h:61
opj_j2k
JPEG-2000 codestream reader/writer.
Definition: j2k.h:545
opj_jp2_set_decoded_components
OPJ_BOOL opj_jp2_set_decoded_components(opj_jp2_t *p_jp2, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
Sets the indices of the components to decode.
Definition: jp2.c:3076
opj_jp2::m_validation_list
struct opj_procedure_list * m_validation_list
list of validation procedures
Definition: jp2.h:153
opj_jp2::C
OPJ_UINT32 C
Definition: jp2.h:164
opj_stream_has_seek
OPJ_BOOL opj_stream_has_seek(const opj_stream_private_t *p_stream)
Tells if the given stream is seekable.
Definition: cio.c:648
opj_image::y1
OPJ_UINT32 y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:677
opj_j2k_end_decompress
OPJ_BOOL opj_j2k_end_decompress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Ends the decompression procedures and possibiliy add data to be read after the codestream.
Definition: j2k.c:7480
opj_jp2_pclr::entries
OPJ_UINT32 * entries
Definition: jp2.h:117
opj_procedure_list_destroy
void opj_procedure_list_destroy(opj_procedure_list_t *p_list)
Destroys a validation list.
Definition: function_list.c:58
opj_j2k_set_threads
OPJ_BOOL opj_j2k_set_threads(opj_j2k_t *j2k, OPJ_UINT32 num_threads)
Definition: j2k.c:6431
opj_image::numcomps
OPJ_UINT32 numcomps
number of components in the image
Definition: openjpeg.h:679
JP2_IMG_STATE_NONE
@ JP2_IMG_STATE_NONE
Definition: jp2.h:85
opj_jp2
JPEG-2000 file format reader/writer.
Definition: jp2.h:149
opj_j2k_end_compress
OPJ_BOOL opj_j2k_end_compress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Ends the compression procedures and possibiliy add data to be read after the codestream.
Definition: j2k.c:11293
opj_jp2_cmap_comp::mtyp
OPJ_BYTE mtyp
Definition: jp2.h:110
opj_image_comp::data
OPJ_INT32 * data
image component data
Definition: openjpeg.h:661
opj_jp2::ignore_pclr_cmap_cdef
OPJ_BOOL ignore_pclr_cmap_cdef
Definition: jp2.h:189
opj_event_msg
OPJ_BOOL opj_event_msg(opj_event_mgr_t *p_event_mgr, OPJ_INT32 event_type, const char *fmt,...)
Write formatted data to a string and send the string to a user callback.
Definition: event.c:91
jp2_img_header
static const opj_jp2_header_handler_t jp2_img_header[]
Definition: jp2.c:431
opj_stream_get_number_byte_left
OPJ_OFF_T opj_stream_get_number_byte_left(const opj_stream_private_t *p_stream)
Get the number of bytes left before the end of the stream (similar to cio_numbytesleft).
Definition: cio.c:584
opj_jp2_encode
OPJ_BOOL opj_jp2_encode(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Encode an image into a JPEG-2000 file stream.
Definition: jp2.c:2096
opj_jp2_apply_cdef
static void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color, opj_event_mgr_t *)
Definition: jp2.c:1323
opj_j2k::m_specific_param
union opj_j2k::@1 m_specific_param
opj_jp2_destroy
void opj_jp2_destroy(opj_jp2_t *jp2)
Destroy a JP2 decompressor handle.
Definition: jp2.c:3008
opj_jp2_read_tile_header
OPJ_BOOL opj_jp2_read_tile_header(opj_jp2_t *p_jp2, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_go_on, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a tile header.
Definition: jp2.c:2959
opj_jp2_cdef_info::cn
OPJ_UINT16 cn
Definition: jp2.h:94
opj_jp2_write_tile
OPJ_BOOL opj_jp2_write_tile(opj_jp2_t *p_jp2, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes a tile.
Definition: jp2.c:2983
opj_jp2_cdef_info_t
struct opj_jp2_cdef_info opj_jp2_cdef_info_t
Channel description: channel index, type, association.
opj_cparameters::jpip_on
OPJ_BOOL jpip_on
Enable JPIP indexing.
Definition: openjpeg.h:490
opj_jp2_decode_tile
OPJ_BOOL opj_jp2_decode_tile(opj_jp2_t *p_jp2, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Decode tile data.
Definition: jp2.c:2996
opj_procedure_list_get_nb_procedures
OPJ_UINT32 opj_procedure_list_get_nb_procedures(opj_procedure_list_t *p_validation_list)
Gets the number of validation procedures.
Definition: function_list.c:102
opj_j2k::ihdr_h
OPJ_UINT32 ihdr_h
Definition: j2k.h:587
opj_jp2_end_decompress
OPJ_BOOL opj_jp2_end_decompress(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Ends the decompression procedures and possibiliy add data to be read after the codestream.
Definition: jp2.c:2103
opj_j2k_get_tile
OPJ_BOOL opj_j2k_get_tile(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager, OPJ_UINT32 tile_index)
Definition: j2k.c:11039
opj_jp2_destroy
void opj_jp2_destroy(opj_jp2_t *jp2)
Destroy a JP2 decompressor handle.
Definition: jp2.c:3008
opj_image_data_alloc
void *OPJ_CALLCONV opj_image_data_alloc(OPJ_SIZE_T size)
Allocator for opj_image_t->comps[].data To be paired with opj_image_data_free.
Definition: openjpeg.c:1054
opj_jp2_skip_jp2c
static OPJ_BOOL opj_jp2_skip_jp2c(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Definition: jp2.c:2640
jp2_get_cstr_info
opj_codestream_info_v2_t * jp2_get_cstr_info(opj_jp2_t *p_jp2)
Get the codestream info from a JPEG2000 codec.
Definition: jp2.c:3227
opj_jp2_read_boxhdr
static OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box, OPJ_UINT32 *p_number_bytes_read, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Reads a box header.
Definition: jp2.c:473
opj_jp2_decode
OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Decode an image from a JPEG-2000 file stream.
Definition: jp2.c:1593
opj_jp2_apply_pclr
static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image, opj_jp2_color_t *color, opj_event_mgr_t *p_manager)
Apply collected palette data.
Definition: jp2.c:1030
opj_jp2::brand
OPJ_UINT32 brand
Definition: jp2.h:171
opj_jp2_cdef_info
Channel description: channel index, type, association.
Definition: jp2.h:93
OPJ_OFF_T
int64_t OPJ_OFF_T
Definition: openjpeg.h:130
opj_stream_skip
OPJ_OFF_T opj_stream_skip(opj_stream_private_t *p_stream, OPJ_OFF_T p_size, opj_event_mgr_t *p_event_mgr)
Skips a number of bytes from the stream.
Definition: cio.c:593
opj_stream_seek
OPJ_BOOL opj_stream_seek(opj_stream_private_t *p_stream, OPJ_OFF_T p_size, struct opj_event_mgr *p_event_mgr)
Seeks a number of bytes from the stream.
Definition: cio.c:641
opj_jp2_pclr_t
struct opj_jp2_pclr opj_jp2_pclr_t
Palette data: table entries, palette columns.
opj_jp2_color::jp2_pclr
opj_jp2_pclr_t * jp2_pclr
Definition: jp2.h:133
opj_event_mgr
Message handler object used for.
Definition: event.h:50
opj_jp2_pclr::nr_entries
OPJ_UINT16 nr_entries
Definition: jp2.h:121
opj_image::color_space
OPJ_COLOR_SPACE color_space
color space: sRGB, Greyscale or YUV
Definition: openjpeg.h:681
opj_jp2_end_decompress
OPJ_BOOL opj_jp2_end_decompress(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Ends the decompression procedures and possibiliy add data to be read after the codestream.
Definition: jp2.c:2103
opj_jp2::jpip_on
OPJ_BOOL jpip_on
Definition: jp2.h:183
opj_jp2_box::init_pos
OPJ_INT32 init_pos
Definition: jp2.h:201
opj_stream_tell
OPJ_OFF_T opj_stream_tell(const opj_stream_private_t *p_stream)
Tells the byte offset on the stream (similar to ftell).
Definition: cio.c:579
opj_cp::allow_different_bit_depth_sign
OPJ_BITFIELD allow_different_bit_depth_sign
whether different bit depth or sign per component is allowed.
Definition: j2k.h:452
JP2_URL
#define JP2_URL
Data entry URL box.
Definition: jp2.h:55
opj_j2k_encode
OPJ_BOOL opj_j2k_encode(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Encodes an image into a JPEG-2000 codestream.
Definition: j2k.c:11185
opj_jp2_cdef::n
OPJ_UINT16 n
Definition: jp2.h:102
jp2_get_cstr_index
opj_codestream_index_t * jp2_get_cstr_index(opj_jp2_t *p_jp2)
Get the codestream index from a JPEG2000 codec.
Definition: jp2.c:3222
opj_jp2_box::type
OPJ_UINT32 type
Definition: jp2.h:200
opj_image_comp
Defines a single image component.
Definition: openjpeg.h:637
opj_jp2_read_jp2h
static OPJ_BOOL opj_jp2_read_jp2h(opj_jp2_t *jp2, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
Definition: jp2.c:2686
JP2_STATE_END_CODESTREAM
@ JP2_STATE_END_CODESTREAM
Definition: jp2.h:79
OPJ_CLRSPC_GRAY
@ OPJ_CLRSPC_GRAY
grayscale
Definition: openjpeg.h:283
opj_stream_private
Byte input-output stream.
Definition: cio.h:81
opj_jp2::h
OPJ_UINT32 h
Definition: jp2.h:160
JP2_IMG_STATE_UNKNOWN
@ JP2_IMG_STATE_UNKNOWN
Definition: jp2.h:86
OPJ_CLRSPC_CMYK
@ OPJ_CLRSPC_CMYK
CMYK.
Definition: openjpeg.h:286
opj_jp2::cl
OPJ_UINT32 * cl
Definition: jp2.h:174
opj_jp2_write_ihdr
static OPJ_BYTE * opj_jp2_write_ihdr(opj_jp2_t *jp2, OPJ_UINT32 *p_nb_bytes_written)
Writes the Image Header box - Image Header box.
Definition: jp2.c:630
JP2_STATE_HEADER
@ JP2_STATE_HEADER
Definition: jp2.h:77
opj_jp2_pclr::nr_channels
OPJ_BYTE nr_channels
Definition: jp2.h:122
opj_jp2_cmap_comp_t
struct opj_jp2_cmap_comp opj_jp2_cmap_comp_t
Component mappings: channel index, mapping type, palette index.
opj_jp2_write_tile
OPJ_BOOL opj_jp2_write_tile(opj_jp2_t *p_jp2, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes a tile.
Definition: jp2.c:2983
opj_cparameters
Compression parameters.
Definition: openjpeg.h:353
opj_jp2_color::jp2_has_colr
OPJ_BYTE jp2_has_colr
Definition: jp2.h:134
opj_jp2::minversion
OPJ_UINT32 minversion
Definition: jp2.h:172
opj_jp2_comps_t
struct opj_jp2_comps opj_jp2_comps_t
JP2 component.
opj_jp2_color
Collector for ICC profile, palette, component mapping, channel description.
Definition: jp2.h:128
opj_jp2_find_handler
static const opj_jp2_header_handler_t * opj_jp2_find_handler(OPJ_UINT32 p_id)
Finds the execution function related to the given box id.
Definition: jp2.c:2488
OPJ_CLRSPC_UNKNOWN
@ OPJ_CLRSPC_UNKNOWN
not supported by the library
Definition: openjpeg.h:280
opj_jp2_get_tile
OPJ_BOOL opj_jp2_get_tile(opj_jp2_t *p_jp2, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager, OPJ_UINT32 tile_index)
Definition: jp2.c:3097
EVT_WARNING
#define EVT_WARNING
Warning event type.
Definition: event.h:67
opj_j2k::ihdr_w
OPJ_UINT32 ihdr_w
Definition: j2k.h:586
opj_image::icc_profile_buf
OPJ_BYTE * icc_profile_buf
'restricted' ICC profile
Definition: openjpeg.h:685
opj_j2k_set_decoded_resolution_factor
OPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Definition: j2k.c:11154
JP2_JP2H
#define JP2_JP2H
JP2 header box (super-box)
Definition: jp2.h:51
OPJ_CLRSPC_SRGB
@ OPJ_CLRSPC_SRGB
sRGB
Definition: openjpeg.h:282
opj_jp2_cmap_comp::pcol
OPJ_BYTE pcol
Definition: jp2.h:110
opj_jp2_end_compress
OPJ_BOOL opj_jp2_end_compress(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Ends the compression procedures and possibiliy add data to be read after the codestream.
Definition: jp2.c:2126
JP2_IHDR
#define JP2_IHDR
Image header box.
Definition: jp2.h:52
opj_jp2_setup_decoder
void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: jp2.c:1889
opj_j2k_set_decode_area
OPJ_BOOL opj_j2k_set_decode_area(opj_j2k_t *p_j2k, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_x, OPJ_INT32 p_end_y, opj_event_mgr_t *p_manager)
Sets the given area to be decoded.
Definition: j2k.c:9333
OPJ_UNUSED
#define OPJ_UNUSED(x)
Definition: jp2.c:47
opj_jp2_read_boxhdr_char
static OPJ_BOOL opj_jp2_read_boxhdr_char(opj_jp2_box_t *box, OPJ_BYTE *p_data, OPJ_UINT32 *p_number_bytes_read, OPJ_UINT32 p_box_max_size, opj_event_mgr_t *p_manager)
Reads a box header.
Definition: jp2.c:2760
OPJ_BOOL
int OPJ_BOOL
Definition: openjpeg.h:110
opj_jp2_set_decoded_resolution_factor
OPJ_BOOL opj_jp2_set_decoded_resolution_factor(opj_jp2_t *p_jp2, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Definition: jp2.c:3232
opj_dparameters::flags
unsigned int flags
Definition: openjpeg.h:570
opj_jp2_write_jp
static OPJ_BOOL opj_jp2_write_jp(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Writes a jpeg2000 file signature box.
Definition: jp2.c:1857
JP2_STATE_UNKNOWN
@ JP2_STATE_UNKNOWN
Definition: jp2.h:80
opj_includes.h
opj_jp2::jp2_state
OPJ_UINT32 jp2_state
Definition: jp2.h:184
jp2_get_cstr_index
opj_codestream_index_t * jp2_get_cstr_index(opj_jp2_t *p_jp2)
Get the codestream index from a JPEG2000 codec.
Definition: jp2.c:3222
opj_jp2_comps::sgnd
OPJ_UINT32 sgnd
Definition: jp2.h:142
opj_jp2_read_header
OPJ_BOOL opj_jp2_read_header(opj_stream_private_t *p_stream, opj_jp2_t *jp2, opj_image_t **p_image, opj_event_mgr_t *p_manager)
Reads a jpeg2000 file header structure.
Definition: jp2.c:2831
opj_jp2_setup_end_header_writing
static OPJ_BOOL opj_jp2_setup_end_header_writing(opj_jp2_t *jp2, opj_event_mgr_t *p_manager)
Sets up the procedures to do on writing header after the codestream.
Definition: jp2.c:2149
opj_procedure_list_create
opj_procedure_list_t * opj_procedure_list_create()
Creates a validation list.
Definition: function_list.c:39
opj_jp2_free_pclr
static void opj_jp2_free_pclr(opj_jp2_color_t *color)
Definition: jp2.c:874
opj_jp2_setup_encoding_validation
static OPJ_BOOL opj_jp2_setup_encoding_validation(opj_jp2_t *jp2, opj_event_mgr_t *p_manager)
Sets up the validation ,i.e.
Definition: jp2.c:2876
opj_procedure_list_add_procedure
OPJ_BOOL opj_procedure_list_add_procedure(opj_procedure_list_t *p_validation_list, opj_procedure p_procedure, opj_event_mgr_t *p_manager)
Adds a new validation procedure.
Definition: function_list.c:70
opj_jp2_set_decoded_resolution_factor
OPJ_BOOL opj_jp2_set_decoded_resolution_factor(opj_jp2_t *p_jp2, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Definition: jp2.c:3232
JP2_COLR
#define JP2_COLR
Colour specification box.
Definition: jp2.h:53
opj_jp2_pclr::channel_sign
OPJ_BYTE * channel_sign
Definition: jp2.h:118
opj_jp2_img_header_writer_handler::m_size
OPJ_UINT32 m_size
Definition: jp2.h:222
opj_j2k_decode_tile
OPJ_BOOL opj_j2k_decode_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Decode tile data.
Definition: j2k.c:8912
j2k_get_cstr_info
opj_codestream_info_v2_t * j2k_get_cstr_info(opj_j2k_t *p_j2k)
Get the codestream info from a JPEG2000 codec.
Definition: j2k.c:10444
opj_jp2_box
JP2 Box.
Definition: jp2.h:198
opj_jp2_default_validation
static OPJ_BOOL opj_jp2_default_validation(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Definition: jp2.c:2200
opj_j2k_dec::m_numcomps_to_decode
OPJ_UINT32 m_numcomps_to_decode
Definition: j2k.h:486
JP2_CMAP
#define JP2_CMAP
Component Mapping box.
Definition: jp2.h:57
opj_jp2_decode
OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Decode an image from a JPEG-2000 file stream.
Definition: jp2.c:1593
opj_jp2::j2k_codestream_offset
OPJ_OFF_T j2k_codestream_offset
Definition: jp2.h:181
opj_image_comp::sgnd
OPJ_UINT32 sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:655
opj_procedure_list_clear
void opj_procedure_list_clear(opj_procedure_list_t *p_validation_list)
Clears the list of validation procedures.
Definition: function_list.c:114
opj_codestream_info_v2
Information structure about the codestream (FIXME should be expand and enhance)
Definition: openjpeg.h:922
opj_j2k_start_compress
OPJ_BOOL opj_j2k_start_compress(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Starts a compression scheme, i.e.
Definition: j2k.c:11309
OPJ_INT32
int32_t OPJ_INT32
Definition: openjpeg.h:125
opj_jp2::bpc
OPJ_UINT32 bpc
Definition: jp2.h:163
opj_jp2_get_tile
OPJ_BOOL opj_jp2_get_tile(opj_jp2_t *p_jp2, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager, OPJ_UINT32 tile_index)
Definition: jp2.c:3097
opj_j2k_create_compress
opj_j2k_t * opj_j2k_create_compress(void)
Creates a J2K compression structure.
Definition: j2k.c:6479
opj_jp2::m_procedure_list
struct opj_procedure_list * m_procedure_list
list of execution procedures
Definition: jp2.h:155
opj_image_comp::h
OPJ_UINT32 h
data height
Definition: openjpeg.h:645
opj_procedure_list
A list of procedures.
Definition: function_list.h:57
opj_jp2_header_handler::id
OPJ_UINT32 id
Definition: jp2.h:206
JPIP_IPTR
#define JPIP_IPTR
Definition: indexbox_manager.h:55
opj_jp2_setup_decoder
void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: jp2.c:1889
opj_image_comp::prec
OPJ_UINT32 prec
precision
Definition: openjpeg.h:651
max
Byte4_t max(Byte4_t n1, Byte4_t n2)
Definition: index_manager.c:766
opj_jp2::color
opj_jp2_color_t color
Definition: jp2.h:187
opj_jp2_create
opj_jp2_t * opj_jp2_create(OPJ_BOOL p_is_decoder)
Creates a jpeg2000 file decompressor.
Definition: jp2.c:3170
opj_image::y0
OPJ_UINT32 y0
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area.
Definition: openjpeg.h:673
opj_jp2_comps::bpcc
OPJ_UINT32 bpcc
Definition: jp2.h:143
opj_jp2::jp2_img_state
OPJ_UINT32 jp2_img_state
Definition: jp2.h:185
opj_jp2_setup_header_reading
static OPJ_BOOL opj_jp2_setup_header_reading(opj_jp2_t *jp2, opj_event_mgr_t *p_manager)
Sets up the procedures to do on reading header.
Definition: jp2.c:2942
opj_realloc
void * opj_realloc(void *ptr, size_t new_size)
Reallocate memory blocks.
Definition: opj_malloc.c:239
opj_jp2_cdef_info::asoc
OPJ_UINT16 asoc
Definition: jp2.h:94
opj_jp2_color::icc_profile_len
OPJ_UINT32 icc_profile_len
Definition: jp2.h:130
opj_j2k_setup_decoder
void opj_j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:6416
opj_jp2_cdef_t
struct opj_jp2_cdef opj_jp2_cdef_t
Channel descriptions and number of descriptions.
OPJ_CLRSPC_SYCC
@ OPJ_CLRSPC_SYCC
YUV.
Definition: openjpeg.h:284
OPJ_BOX_SIZE
#define OPJ_BOX_SIZE
Definition: jp2.c:45
opj_jp2_read_header
OPJ_BOOL opj_jp2_read_header(opj_stream_private_t *p_stream, opj_jp2_t *jp2, opj_image_t **p_image, opj_event_mgr_t *p_manager)
Reads a jpeg2000 file header structure.
Definition: jp2.c:2831
OPJ_TRUE
#define OPJ_TRUE
Definition: openjpeg.h:111
opj_j2k_set_decoded_components
OPJ_BOOL opj_j2k_set_decoded_components(opj_j2k_t *p_j2k, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
Sets the indices of the components to decode.
Definition: j2k.c:9273
opj_jp2_set_decoded_components
OPJ_BOOL opj_jp2_set_decoded_components(opj_jp2_t *jp2, OPJ_UINT32 numcomps, const OPJ_UINT32 *comps_indices, opj_event_mgr_t *p_manager)
Sets the indices of the components to decode.
Definition: jp2.c:3076
opj_jp2::meth
OPJ_UINT32 meth
Definition: jp2.h:167
JP2_STATE_NONE
@ JP2_STATE_NONE
Definition: jp2.h:74
JP2_JP2C
#define JP2_JP2C
Contiguous codestream box.
Definition: jp2.h:54
opj_malloc
void * opj_malloc(size_t size)
Allocate an uninitialized memory block.
Definition: opj_malloc.c:191
opj_jp2::jpip_iptr_offset
OPJ_OFF_T jpip_iptr_offset
Definition: jp2.h:182
opj_image_data_free
void OPJ_CALLCONV opj_image_data_free(void *ptr)
Destructor for opj_image_t->comps[].data To be paired with opj_image_data_alloc.
Definition: openjpeg.c:1061
opj_jp2_read_tile_header
OPJ_BOOL opj_jp2_read_tile_header(opj_jp2_t *p_jp2, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_go_on, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a tile header.
Definition: jp2.c:2959
opj_jp2_cdef::info
opj_jp2_cdef_info_t * info
Definition: jp2.h:101
opj_jp2_start_compress
OPJ_BOOL opj_jp2_start_compress(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Starts a compression scheme, i.e.
Definition: jp2.c:2454
JPIP_FIDX
#define JPIP_FIDX
Definition: indexbox_manager.h:52
opj_jp2_img_header_writer_handler::m_data
OPJ_BYTE * m_data
Definition: jp2.h:220
opj_procedure_list_get_first_procedure
opj_procedure * opj_procedure_list_get_first_procedure(opj_procedure_list_t *p_validation_list)
Gets the pointer on the first validation procedure.
Definition: function_list.c:108
opj_jp2_t
struct opj_jp2 opj_jp2_t
JPEG-2000 file format reader/writer.
opj_free
void opj_free(void *ptr)
Deallocates or frees a memory block.
Definition: opj_malloc.c:246
JPIP_PRXY
#define JPIP_PRXY
Definition: indexbox_manager.h:54
JP2_STATE_FILE_TYPE
@ JP2_STATE_FILE_TYPE
Definition: jp2.h:76
opj_jp2_exec
static OPJ_BOOL opj_jp2_exec(opj_jp2_t *jp2, opj_procedure_list_t *p_procedure_list, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Executes the given procedures on the given codec.
Definition: jp2.c:2422
opj_jp2_comps::depth
OPJ_UINT32 depth
Definition: jp2.h:141
opj_jp2_img_header_writer_handler::handler
OPJ_BYTE *(* handler)(opj_jp2_t *jp2, OPJ_UINT32 *p_data_size)
Definition: jp2.h:218
opj_codestream_index
Index structure of the codestream (FIXME should be expand and enhance)
Definition: openjpeg.h:997
jp2_get_cstr_info
opj_codestream_info_v2_t * jp2_get_cstr_info(opj_jp2_t *p_jp2)
Get the codestream info from a JPEG2000 codec.
Definition: jp2.c:3227
opj_jp2_start_compress
OPJ_BOOL opj_jp2_start_compress(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Starts a compression scheme, i.e.
Definition: jp2.c:2454
opj_image_comp::alpha
OPJ_UINT16 alpha
alpha channel
Definition: openjpeg.h:663
j2k_get_cstr_index
opj_codestream_index_t * j2k_get_cstr_index(opj_j2k_t *p_j2k)
Get the codestream index from a JPEG2000 codec.
Definition: j2k.c:10520
JP2_CDEF
#define JP2_CDEF
Channel Definition box.
Definition: jp2.h:58
opj_j2k_create_decompress
opj_j2k_t * opj_j2k_create_decompress(void)
Creates a J2K decompression structure.
Definition: j2k.c:9488
opj_jp2_img_find_handler
static const opj_jp2_header_handler_t * opj_jp2_img_find_handler(OPJ_UINT32 p_id)
Finds the image execution function related to the given box id.
Definition: jp2.c:2508
opj_jp2_read_ihdr
static OPJ_BOOL opj_jp2_read_ihdr(opj_jp2_t *jp2, OPJ_BYTE *p_image_header_data, OPJ_UINT32 p_image_header_size, opj_event_mgr_t *p_manager)
Reads a IHDR box - Image Header box.
Definition: jp2.c:561
opj_jp2_read_pclr
static OPJ_BOOL opj_jp2_read_pclr(opj_jp2_t *jp2, OPJ_BYTE *p_pclr_header_data, OPJ_UINT32 p_pclr_header_size, opj_event_mgr_t *p_manager)
Collect palette data.
Definition: jp2.c:1146
opj_jp2::IPR
OPJ_UINT32 IPR
Definition: jp2.h:166
OPJ_UINT16
uint16_t OPJ_UINT16
Definition: openjpeg.h:124
opj_jp2_read_cdef
static OPJ_BOOL opj_jp2_read_cdef(opj_jp2_t *jp2, OPJ_BYTE *p_cdef_header_data, OPJ_UINT32 p_cdef_header_size, opj_event_mgr_t *p_manager)
Definition: jp2.c:1386
JP2_JP
#define JP2_JP
JPEG 2000 signature box.
Definition: jp2.h:49
opj_jp2::numcl
OPJ_UINT32 numcl
Definition: jp2.h:173
EVT_INFO
#define EVT_INFO
Debug event type.
Definition: event.h:68
opj_jp2::numcomps
OPJ_UINT32 numcomps
Definition: jp2.h:162
opj_jp2_setup_decoding_validation
static OPJ_BOOL opj_jp2_setup_decoding_validation(opj_jp2_t *jp2, opj_event_mgr_t *p_manager)
Sets up the validation ,i.e.
Definition: jp2.c:2892
opj_image_comp::w
OPJ_UINT32 w
data width
Definition: openjpeg.h:643
opj_jp2_pclr::channel_size
OPJ_BYTE * channel_size
Definition: jp2.h:119
opj_jp2_cdef
Channel descriptions and number of descriptions.
Definition: jp2.h:100
JP2_STATE_CODESTREAM
@ JP2_STATE_CODESTREAM
Definition: jp2.h:78
opj_image::x0
OPJ_UINT32 x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area.
Definition: openjpeg.h:671
JP2_PCLR
#define JP2_PCLR
Palette box.
Definition: jp2.h:56
opj_dparameters
Decompression parameters.
Definition: openjpeg.h:512
opj_jp2::UnkC
OPJ_UINT32 UnkC
Definition: jp2.h:165
opj_jp2_box::length
OPJ_UINT32 length
Definition: jp2.h:199
opj_image::comps
opj_image_comp_t * comps
image components
Definition: openjpeg.h:683
opj_image::icc_profile_len
OPJ_UINT32 icc_profile_len
size of ICC profile
Definition: openjpeg.h:687
opj_jp2_read_colr
static OPJ_BOOL opj_jp2_read_colr(opj_jp2_t *jp2, OPJ_BYTE *p_colr_header_data, OPJ_UINT32 p_colr_header_size, opj_event_mgr_t *p_manager)
Reads the Color Specification box.
Definition: jp2.c:1458
opj_jp2::enumcs
OPJ_UINT32 enumcs
Definition: jp2.h:169
opj_jp2_cmap_comp
Component mappings: channel index, mapping type, palette index.
Definition: jp2.h:108
opj_jp2_header_handler
Definition: jp2.h:204
JP2_FTYP
#define JP2_FTYP
File type box.
Definition: jp2.h:50
opj_jp2_end_compress
OPJ_BOOL opj_jp2_end_compress(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Ends the compression procedures and possibiliy add data to be read after the codestream.
Definition: jp2.c:2126
opj_jp2_write_ftyp
static OPJ_BOOL opj_jp2_write_ftyp(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Writes a FTYP box - File type box.
Definition: jp2.c:1767
opj_read_bytes
#define opj_read_bytes
Definition: cio.h:65
EVT_ERROR
#define EVT_ERROR
Error event type.
Definition: event.h:66
opj_jp2_write_cdef
static OPJ_BYTE * opj_jp2_write_cdef(opj_jp2_t *jp2, OPJ_UINT32 *p_nb_bytes_written)
Writes the Channel Definition box.
Definition: jp2.c:756
OPJ_UINT32
uint32_t OPJ_UINT32
Definition: openjpeg.h:126
opj_jp2_setup_encoder
OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Setup the encoder parameters using the current image and using user parameters.
Definition: jp2.c:1909
opj_jp2::j2k
opj_j2k_t * j2k
handle to the J2K codec
Definition: jp2.h:151
j2k_dump
void j2k_dump(opj_j2k_t *p_j2k, OPJ_INT32 flag, FILE *out_stream)
Dump some elements from the J2K decompression structure .
Definition: j2k.c:10253
opj_jp2_img_header_writer_handler
Definition: jp2.h:216
opj_j2k::enumcs
OPJ_UINT32 enumcs
Definition: j2k.h:588
opj_jp2_color_t
struct opj_jp2_color opj_jp2_color_t
Collector for ICC profile, palette, component mapping, channel description.
opj_j2k_setup_encoder
OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
Definition: j2k.c:6756
opj_jp2_color::jp2_cdef
opj_jp2_cdef_t * jp2_cdef
Definition: jp2.h:132
JPIP_CIDX
#define JPIP_CIDX
Definition: indexbox_manager.h:43
opj_j2k_decode
OPJ_BOOL opj_j2k_decode(opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_image_t *p_image, opj_event_mgr_t *p_manager)
Decode an image from a JPEG-2000 codestream.
Definition: j2k.c:10981
opj_jp2::comps
opj_jp2_comps_t * comps
Definition: jp2.h:175
opj_jp2_write_jp2c
static OPJ_BOOL opj_jp2_write_jp2c(opj_jp2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t *p_manager)
Writes the Jpeg2000 codestream Header box - JP2C Header box.
Definition: jp2.c:1819
opj_j2k_write_tile
OPJ_BOOL opj_j2k_write_tile(opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Writes a tile.
Definition: j2k.c:12098
opj_jp2_read_ftyp
static OPJ_BOOL opj_jp2_read_ftyp(opj_jp2_t *jp2, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a a FTYP box - File type box.
Definition: jp2.c:2581
OPJ_FALSE
#define OPJ_FALSE
Definition: openjpeg.h:112
opj_jp2_comps
JP2 component.
Definition: jp2.h:140
OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG
#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG
Definition: openjpeg.h:506
opj_jp2_img_header_writer_handler_t
struct opj_jp2_img_header_writer_handler opj_jp2_img_header_writer_handler_t
opj_jp2_color::icc_profile_buf
OPJ_BYTE * icc_profile_buf
Definition: jp2.h:129
opj_jp2::has_jp2h
OPJ_BYTE has_jp2h
Definition: jp2.h:190
opj_j2k_read_header
OPJ_BOOL opj_j2k_read_header(opj_stream_private_t *p_stream, opj_j2k_t *p_j2k, opj_image_t **p_image, opj_event_mgr_t *p_manager)
Reads a jpeg2000 codestream header structure.
Definition: j2k.c:7491
opj_j2k_read_tile_header
OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t *p_j2k, OPJ_UINT32 *p_tile_index, OPJ_UINT32 *p_data_size, OPJ_INT32 *p_tile_x0, OPJ_INT32 *p_tile_y0, OPJ_INT32 *p_tile_x1, OPJ_INT32 *p_tile_y1, OPJ_UINT32 *p_nb_comps, OPJ_BOOL *p_go_on, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Reads a tile header.
Definition: j2k.c:8617
opj_jp2_read_jp
static OPJ_BOOL opj_jp2_read_jp(opj_jp2_t *jp2, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Reads a jpeg2000 file signature box.
Definition: jp2.c:2532
opj_write_bytes
#define opj_write_bytes
Definition: cio.h:64
jp2_dump
void jp2_dump(opj_jp2_t *p_jp2, OPJ_INT32 flag, FILE *out_stream)
Dump some elements from the JP2 decompression structure .
Definition: jp2.c:3212
opj_jp2_cdef_info::typ
OPJ_UINT16 typ
Definition: jp2.h:94
opj_jp2_set_threads
OPJ_BOOL opj_jp2_set_threads(opj_jp2_t *jp2, OPJ_UINT32 num_threads)
Allocates worker threads for the compressor/decompressor.
Definition: jp2.c:1900
opj_jp2_write_colr
static OPJ_BYTE * opj_jp2_write_colr(opj_jp2_t *jp2, OPJ_UINT32 *p_nb_bytes_written)
Writes the Colour Specification box.
Definition: jp2.c:807
opj_image
Defines image data and characteristics.
Definition: openjpeg.h:669
opj_jp2_create
opj_jp2_t * opj_jp2_create(OPJ_BOOL p_is_decoder)
Creates a jpeg2000 file decompressor.
Definition: jp2.c:3170
opj_jp2_cmap_comp::cmp
OPJ_UINT16 cmp
Definition: jp2.h:109
JP2_BPCC
#define JP2_BPCC
Bits per component box.
Definition: jp2.h:60
opj_stream_read_data
OPJ_SIZE_T opj_stream_read_data(opj_stream_private_t *p_stream, OPJ_BYTE *p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t *p_event_mgr)
Reads some bytes from the stream.
Definition: cio.c:281
opj_jp2_write_jp2h
static OPJ_BOOL opj_jp2_write_jp2h(opj_jp2_t *jp2, opj_stream_private_t *stream, opj_event_mgr_t *p_manager)
Writes the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).
Definition: jp2.c:1660
opj_jp2::has_ihdr
OPJ_BYTE has_ihdr
Definition: jp2.h:191
opj_jp2_header_handler::handler
OPJ_BOOL(* handler)(opj_jp2_t *jp2, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
Definition: jp2.h:208
opj_jp2_set_threads
OPJ_BOOL opj_jp2_set_threads(opj_jp2_t *jp2, OPJ_UINT32 num_threads)
Allocates worker threads for the compressor/decompressor.
Definition: jp2.c:1900
opj_jp2_setup_end_header_reading
static OPJ_BOOL opj_jp2_setup_end_header_reading(opj_jp2_t *jp2, opj_event_mgr_t *p_manager)
Sets up the procedures to do on reading header after the codestream.
Definition: jp2.c:2184
opj_jp2_decode_tile
OPJ_BOOL opj_jp2_decode_tile(opj_jp2_t *p_jp2, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
Decode tile data.
Definition: jp2.c:2996
opj_jp2_write_bpcc
static OPJ_BYTE * opj_jp2_write_bpcc(opj_jp2_t *jp2, OPJ_UINT32 *p_nb_bytes_written)
Writes the Bit per Component box.
Definition: jp2.c:682
JP2_IMG_STATE
JP2_IMG_STATE
Definition: jp2.h:84
opj_procedure
void(* opj_procedure)(void)
declare a function pointer
Definition: function_list.h:52
opj_jp2_setup_header_writing
static OPJ_BOOL opj_jp2_setup_header_writing(opj_jp2_t *jp2, opj_event_mgr_t *p_manager)
Sets up the procedures to do on writing header.
Definition: jp2.c:2907