2 '\" The line above instructs most `man' programs to invoke tbl
4 '\" Separate paragraphs; not the same as PP which resets indent level.
10 '\" Replacement em-dash for nroff (default is too short).
14 '\" Placeholder macro for if longer nroff arrow is needed.
17 '\" Decimal point set slightly raised
18 .if t .ds d \v'-.15m'.\v'+.15m'
21 '\" Enclosure macro for examples
32 .TH libopenjp2 3 "Oct 2010" "Version 1.4.0" "Oct 2010"
36 a library for reading and writing JPEG2000 image files.
40 .B #include <openjpeg.h>
42 .SS CONVERSION FORMATS
43 .B PGX: imagetopgx() \fR/\fB pgxtoimage()
45 .B PXM: imagetopnm() \fR/\fB pnmtoimage()
47 .B BMP: imagetobmp() \fR/\fB bmptoimage()
49 .B TIF: imagetotif() \fR/\fB tiftoimage()
51 .B RAW: imagetoraw() \fR/\fB rawtoimage()
53 .B TGA: imagetotga() \fR/\fB tgatoimage()
55 .B PNG: imagetopng() \fR/\fB pngtoimage()
57 .B YUV: imagetoyuv() \fR/\fB yuvtoimage() \fR(MJ2)
60 .B opj_set_default_decoder_parameters(opj_dparameters_t *\fIparams\fB);
62 .B opj_dinfo_t *opj_create_decompress(OPJ_CODEC_FORMAT \fIformat\fB);
64 .B opj_event_mgr_t *opj_set_event_mgr(opj_common_ptr \fIinfo\fB, opj_event_mgr_t *\fIevent_mgr\fB, void *\fIcontext\fB);
66 .B void opj_setup_decoder(opj_dinfo_t *\fIdinfo\fB, opj_dparameters_t * \fIparams\fB);
68 .B opj_cio_t *opj_cio_open(opj_common_ptr \fIinfo\fB, unsigned char *\fIbuf\fB, int \fIbuf_len\fB);
70 .B opj_image_t *opj_decode(opj_dinfo_t *\fIdinfo\fB, opj_cio_t *\fIcio\fB);
72 .B void opj_cio_close(opj_cio_t *\fIcio\fB);
74 .B void opj_destroy_decompress(opj_dinfo_t *\fIdinfo\fB);
76 .B void opj_image_destroy(opj_image_t *\fIimage\fB);
79 .B void opj_set_default_encoder_parameters(opj_cparameters_t *\fIparams\fB);
82 .B opj_image_t *FORMATtoimage(const char *\fIfname\fB, opj_cparameters_t *\fIparams\fB);
86 .B opj_cinfo_t* opj_create_compress(OPJ_CODEC_FORMAT \fIformat\fB);
88 .B opj_event_mgr_t *opj_set_event_mgr(opj_common_ptr \fIinfo\fB, opj_event_mgr_t *\fIevent_mgr\fB, void *\fIcontext\fB);
90 .B void opj_setup_encoder(opj_cinfo_t *\fIcinfo\fB, opj_cparameters_t *\fIparams\fB, opj_image_t *\fIimage\fB);
92 .B opj_cio_t *opj_cio_open(opj_common_ptr \fIcinfo\fB, \fINULL\fB, \fI0\fB);
94 .B bool opj_encode(opj_cinfo_t *\fIcinfo\fB, opj_cio_t *\fIcio\fB, opj_image_t *\fIimage\fB, char *\fIindex\fB);
96 .B void opj_cio_close(opj_cio_t *\fIcio\fB);
98 .B void opj_destroy_compress(opj_cinfo_t *\fIcinfo\fB);
100 .B void opj_image_destroy(opj_image_t *\fIimage\fB);
104 .B void opj_image_create(int \fInumcmpts\fB, opj_image_cmptparm_t *\fIcmptparms\fB, OPJ_COLOR_SPACE \fIclrspc\fB);
106 .B int cio_tell(opj_cio_t *\fIcio\fB);
108 .B void cio_seek(opj_cio_t *\fIcio\fB, int \fIpos\fB);
110 .B opj_image_t *opj_decode_with_info(opj_dinfo_t *\fIdinfo\fB, opj_cio_t *\fIcio\fB, opj_codestream_info_t *\fIcstr_info\fB);
112 .B bool opj_encode_with_info(opj_cinfo_t *\fIcinfo\fB, opj_cio_t *\fIcio\fB, opj_image_t *\fIimage\fB, opj_codestream_info_t *\fIcstr_info\fB);
114 .B void opj_destroy_cstr_info(opj_codestream_info_t *\fIcstr_info\fB);
116 .B const char *opj_version(\fIvoid\fB);
120 .B CODEC_J2K\fR or \fBCODEC_JPT\fR or \fBCODEC_JP2
124 .B CLRSPC_UNKNOWN\fR or \fBCLRSPC_UNSPECIFIED\fR or \fBCLRSPC_SRGB\fR or \fBCLRSPC_GRAY\fR or \fBCLRSPC_SYCC
126 .SH DECOMPRESSION PARAMETERS
128 typedef struct opj_dparameters
132 Set the number of highest resolution levels to be discarded.
133 The image resolution is effectively divided by 2 to the power
134 of the number of discarded levels.
135 The reduce factor is limited by the smallest total number of
136 decomposition levels among tiles.
137 if != 0, then original dimension divided by 2^(reduce);
138 if == 0 or not used, image is decoded to the full resolution
142 Set the maximum number of quality layers to decode.
143 If there are less quality layers than the specified number,
144 all the quality layers are decoded.
145 if != 0, then only the first "layer" layers are decoded;
146 if == 0 or not used, all the quality layers are decoded
150 /*command line encoder parameters (not used inside the library) */
151 /* input file name */
152 \fBchar\fR infile[OPJ_PATH_LEN];
153 /* output file name */
154 \fBchar\fR outfile[OPJ_PATH_LEN];
155 /* input file format: see OPJ_CODEC_FORMAT */
156 \fBint\fR decod_format;
157 /* output file format */
158 \fBint\fR cod_format;
160 /*JPWL decoding parameters */
161 /* activates the JPWL correction capabilities */
162 \fBbool\fR jpwl_correct;
163 /* expected number of components */
164 \fBint\fR jpwl_exp_comps;
165 /* maximum number of tiles */
166 \fBint\fR jpwl_max_tiles;
169 Specify whether the decoding should be done on the entire
170 codestream, or be limited to the main header
171 Limiting the decoding to the main header makes it possible
172 to extract the characteristics of the codestream
173 if == NO_LIMITATION, the entire codestream is decoded;
174 if == LIMIT_TO_MAIN_HEADER, only the main header is decoded;
176 \fBOPJ_LIMIT_DECODING\fR cp_limit_decoding;
180 .SH COMPRESSION PARAMETERS
182 typedef struct opj_cparameters
185 /* size of tile: tile_size_on = false (not in argument)
186 or tile_size_on = true (in argument) */
187 \fBbool\fR tile_size_on;
196 /* allocation by rate/distortion */
197 \fBint\fR cp_disto_alloc;
198 /* allocation by fixed layer */
199 \fBint\fR cp_fixed_alloc;
200 /* add fixed_quality */
201 \fBint\fR cp_fixed_quality;
203 \fBint *\fRcp_matrice;
204 /* comment for coding */
205 \fBchar *\fRcp_comment;
208 /* progression order:
209 PROG_UNKNOWN, LRCP(default), RLCP, RPCL, PCRL, CPRL */
210 \fBOPJ_PROG_ORDER\fR prog_order;
211 /* progression order changes */
212 \fBopj_poc_t\fR POC[32];
213 /* number of progression order changes (POC), default: 0 */
215 /* number of layers */
216 \fBint\fR tcp_numlayers;
217 /* rates of layers */
218 \fBfloat\fR tcp_rates[100];
219 /* different psnr for successive layers */
220 \fBfloat\fR tcp_distoratio[100];
221 /* number of resolutions */
222 \fBint\fR numresolution;
223 /* initial code block width, default: 64 */
224 \fBint\fR cblockw_init;
225 /* initial code block height, default: 64 */
226 \fBint\fR cblockh_init;
227 /* mode switch (cblk_style) */
228 /* 1 : use the irreversible DWT 9-7,
229 0 : use lossless compression (default) */
230 \fBint\fR irreversible;
231 /* region of interest: affected component in [0..3],
233 \fBint\fR roi_compno;
234 /* region of interest: upshift value */
236 /* number of precinct size specifications */
238 /* initial precinct width */
239 \fBint\fR prcw_init[J2K_MAXRLVLS];
240 /* initial precinct height */
241 \fBint\fR prch_init[J2K_MAXRLVLS];
243 /*command line encoder parameters (not used inside the library) */
244 /* input file name */
245 \fBchar\fR infile[OPJ_PATH_LEN];
246 /* output file name */
247 \fBchar\fR outfile[OPJ_PATH_LEN];
248 /* DEPRECATED. Index generation is now handeld with the
249 opj_encode_with_info() function. Set to NULL */
251 /* DEPRECATED. Index generation is now handeld with the
252 opj_encode_with_info() function. Set to NULL */
253 \fBchar\fR index[OPJ_PATH_LEN];
254 /* subimage encoding: origin image offset in x direction */
255 \fBint\fR image_offset_x0;
256 /* subimage encoding: origin image offset in y direction */
257 \fBint\fR image_offset_y0;
258 /* subsampling value for dx */
259 \fBint\fR subsampling_dx;
260 /* subsampling value for dy */
261 \fBint\fR subsampling_dy;
262 /* input file format */
263 \fBint\fR decod_format;
264 /* output file format: see OPJ_CODEC_FORMAT */
265 \fBint\fR cod_format;
267 /*JPWL encoding parameters */
268 /* enables writing of EPC in MH, thus activating JPWL */
269 \fBbool\fR jpwl_epc_on;
270 /* error protection method for MH (0,1,16,32,37-128) */
271 \fBint\fR jpwl_hprot_MH;
272 /* tile number of header protection specification (>=0) */
273 \fBint\fR jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
274 /* error protection methods for TPHs (0,1,16,32,37-128) */
275 \fBint\fR jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];
276 /* tile number of packet protection specification (>=0) */
277 \fBint\fR jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];
278 /* packet number of packet protection specification (>=0) */
279 \fBint\fR jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];
280 /* error protection methods for packets (0,1,16,32,37-128) */
281 \fBint\fR jpwl_pprot[JPWL_MAX_NO_PACKSPECS];
282 /* enables writing of ESD, (0=no/1/2 bytes) */
283 \fBint\fR jpwl_sens_size;
284 /* sensitivity addressing size (0=auto/2/4 bytes) */
285 \fBint\fR jpwl_sens_addr;
286 /* sensitivity range (0-3) */
287 \fBint\fR jpwl_sens_range;
288 /* sensitivity method for MH (-1=no,0-7) */
289 \fBint\fR jpwl_sens_MH;
290 /* tile number of sensitivity specification (>=0) */
291 \fBint\fR jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
292 /* sensitivity methods for TPHs (-1=no,0-7) */
293 \fBint\fR jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
295 /* Digital Cinema compliance: OFF-not compliant,
296 CINEMA2K_24, CINEMA2K_48, CINEMA4K_24 */
297 \fBOPJ_CINEMA_MODE\fR cp_cinema;
298 /* Maximum rate for each component.
299 If == 0, component size limitation is not considered */
300 \fBint\fR max_comp_size;
302 \fBOPJ_RSIZ_CAPABILITIES\fR cp_rsiz;
303 /* Tile part generation*/
305 /* Flag for Tile part generation*/
307 /* MCT (multiple component transform) */
316 Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
318 Copyright (c) 2002-2014, Professor Benoit Macq
320 Copyright (c) 2001-2003, David Janssens
322 Copyright (c) 2002-2003, Yannick Verschueren
324 Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
326 Copyright (c) 2005, Herve Drolon, FreeImage Team
328 Copyright (c) 2006-2007, Parvatha Elangovan
332 \fBimage_to_j2k\fR(1) \fBj2k_to_image\fR(1) \fBj2k_dump\fR(1)
334 \fBJPWL_image_to_j2k\fR(1) \fBJPWL_j2k_to_image\fR(1)
336 \fBextract_j2k_from_mj2\fR(1) \fBwrap_j2k_in_mj2\fR(1)
337 \fBframes_to_mj2\fR(1) \fBmj2_to_frames\fR(1)