OpenJPEG  2.1.2
opj_codec.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  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in the
18  * documentation and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef __OPJ_CODEC_H
33 #define __OPJ_CODEC_H
34 
42 typedef struct opj_codec_private
43 {
45  union
46  {
50  struct opj_decompression
51  {
54  void * p_codec,
55  opj_image_t **p_image,
56  struct opj_event_mgr * p_manager);
57 
59  OPJ_BOOL (*opj_decode) ( void * p_codec,
60  struct opj_stream_private * p_cio,
61  opj_image_t * p_image,
62  struct opj_event_mgr * p_manager);
63 
65  OPJ_BOOL (*opj_read_tile_header)( void * p_codec,
66  OPJ_UINT32 * p_tile_index,
67  OPJ_UINT32 * p_data_size,
68  OPJ_INT32 * p_tile_x0,
69  OPJ_INT32 * p_tile_y0,
70  OPJ_INT32 * p_tile_x1,
71  OPJ_INT32 * p_tile_y1,
72  OPJ_UINT32 * p_nb_comps,
73  OPJ_BOOL * p_should_go_on,
74  struct opj_stream_private * p_cio,
75  struct opj_event_mgr * p_manager);
76 
78  OPJ_BOOL (*opj_decode_tile_data)( void * p_codec,
79  OPJ_UINT32 p_tile_index,
80  OPJ_BYTE * p_data,
81  OPJ_UINT32 p_data_size,
82  struct opj_stream_private * p_cio,
83  struct opj_event_mgr * p_manager);
84 
86  OPJ_BOOL (* opj_end_decompress) ( void *p_codec,
87  struct opj_stream_private * cio,
88  struct opj_event_mgr * p_manager);
89 
91  void (*opj_destroy) (void * p_codec);
92 
94  void (*opj_setup_decoder) ( void * p_codec, opj_dparameters_t * p_param);
95 
97  OPJ_BOOL (*opj_set_decode_area) ( void * p_codec,
98  opj_image_t * p_image,
99  OPJ_INT32 p_start_x,
100  OPJ_INT32 p_end_x,
101  OPJ_INT32 p_start_y,
102  OPJ_INT32 p_end_y,
103  struct opj_event_mgr * p_manager);
104 
106  OPJ_BOOL (*opj_get_decoded_tile) ( void *p_codec,
107  opj_stream_private_t * p_cio,
108  opj_image_t *p_image,
109  struct opj_event_mgr * p_manager,
110  OPJ_UINT32 tile_index);
111 
114  OPJ_UINT32 res_factor,
115  opj_event_mgr_t * p_manager);
116  } m_decompression;
117 
121  struct opj_compression
122  {
123  OPJ_BOOL (* opj_start_compress) ( void *p_codec,
124  struct opj_stream_private * cio,
125  struct opj_image * p_image,
126  struct opj_event_mgr * p_manager);
127 
128  OPJ_BOOL (* opj_encode) ( void * p_codec,
129  struct opj_stream_private *p_cio,
130  struct opj_event_mgr * p_manager);
131 
132  OPJ_BOOL (* opj_write_tile) ( void * p_codec,
133  OPJ_UINT32 p_tile_index,
134  OPJ_BYTE * p_data,
135  OPJ_UINT32 p_data_size,
136  struct opj_stream_private * p_cio,
137  struct opj_event_mgr * p_manager);
138 
139  OPJ_BOOL (* opj_end_compress) ( void * p_codec,
140  struct opj_stream_private * p_cio,
141  struct opj_event_mgr * p_manager);
142 
143  void (* opj_destroy) (void * p_codec);
144 
145  OPJ_BOOL (* opj_setup_encoder) ( void * p_codec,
146  opj_cparameters_t * p_param,
147  struct opj_image * p_image,
148  struct opj_event_mgr * p_manager);
149  } m_compression;
150  } m_codec_data;
152  void * m_codec;
157  void (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream);
158  opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);
159  opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);
160 }
162 
163 
164 #endif /* __OPJ_CODEC_H */
165 
OPJ_BOOL(* opj_end_decompress)(void *p_codec, struct opj_stream_private *cio, struct opj_event_mgr *p_manager)
Reading function used after codestream if necessary.
Definition: opj_codec.h:86
void(* opj_dump_codec)(void *p_codec, OPJ_INT32 info_flag, FILE *output_stream)
Definition: opj_codec.h:157
OPJ_BOOL(* opj_end_compress)(void *p_codec, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
Definition: opj_codec.h:139
OPJ_BOOL(* opj_setup_encoder)(void *p_codec, opj_cparameters_t *p_param, struct opj_image *p_image, struct opj_event_mgr *p_manager)
Definition: opj_codec.h:145
OPJ_BOOL(* opj_read_tile_header)(void *p_codec, 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_should_go_on, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
FIXME DOC.
Definition: opj_codec.h:65
void * m_codec
FIXME DOC.
Definition: opj_codec.h:152
void(* opj_destroy)(void *p_codec)
Codec destroy function handler.
Definition: opj_codec.h:91
Message handler object used for.
Definition: event.h:50
OPJ_BOOL(* opj_encode)(void *p_codec, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
Definition: opj_codec.h:128
OPJ_BOOL is_decompressor
Flag to indicate if the codec is used to decode or encode.
Definition: opj_codec.h:156
int OPJ_BOOL
Definition: openjpeg.h:110
OPJ_BOOL(* opj_get_decoded_tile)(void *p_codec, opj_stream_private_t *p_cio, opj_image_t *p_image, struct opj_event_mgr *p_manager, OPJ_UINT32 tile_index)
Get tile function.
Definition: opj_codec.h:106
Byte input-output stream.
Definition: cio.h:81
unsigned char OPJ_BYTE
Definition: openjpeg.h:117
OPJ_BOOL(* opj_decode)(void *p_codec, struct opj_stream_private *p_cio, opj_image_t *p_image, struct opj_event_mgr *p_manager)
Decoding function.
Definition: opj_codec.h:59
void(* opj_setup_decoder)(void *p_codec, opj_dparameters_t *p_param)
Setup decoder function handler.
Definition: opj_codec.h:94
int32_t OPJ_INT32
Definition: openjpeg.h:125
Information structure about the codestream (FIXME should be expand and enhance)
Definition: openjpeg.h:915
struct opj_codec_private::@2::opj_compression m_compression
Defines image data and characteristics.
Definition: openjpeg.h:661
OPJ_BOOL(* opj_decode_tile_data)(void *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
FIXME DOC.
Definition: opj_codec.h:78
Decompression parameters.
Definition: openjpeg.h:508
struct opj_codec_private opj_codec_private_t
Main codec handler used for compression or decompression.
OPJ_BOOL(* opj_set_decode_area)(void *p_codec, opj_image_t *p_image, OPJ_INT32 p_start_x, OPJ_INT32 p_end_x, OPJ_INT32 p_start_y, OPJ_INT32 p_end_y, struct opj_event_mgr *p_manager)
Set decode area function handler.
Definition: opj_codec.h:97
struct opj_codec_private::@2::opj_decompression m_decompression
OPJ_BOOL(* opj_start_compress)(void *p_codec, struct opj_stream_private *cio, struct opj_image *p_image, struct opj_event_mgr *p_manager)
Definition: opj_codec.h:123
union opj_codec_private::@2 m_codec_data
FIXME DOC.
OPJ_BOOL(* opj_read_header)(struct opj_stream_private *cio, void *p_codec, opj_image_t **p_image, struct opj_event_mgr *p_manager)
Main header reading function handler.
Definition: opj_codec.h:53
OPJ_BOOL(* opj_write_tile)(void *p_codec, OPJ_UINT32 p_tile_index, OPJ_BYTE *p_data, OPJ_UINT32 p_data_size, struct opj_stream_private *p_cio, struct opj_event_mgr *p_manager)
Definition: opj_codec.h:132
Index structure of the codestream (FIXME should be expand and enhance)
Definition: openjpeg.h:990
uint32_t OPJ_UINT32
Definition: openjpeg.h:126
OPJ_BOOL(* opj_set_decoded_resolution_factor)(void *p_codec, OPJ_UINT32 res_factor, opj_event_mgr_t *p_manager)
Set the decoded resolution factor.
Definition: opj_codec.h:113
opj_event_mgr_t m_event_mgr
Event handler.
Definition: opj_codec.h:154
Compression parameters.
Definition: openjpeg.h:353
Main codec handler used for compression or decompression.
Definition: opj_codec.h:42