Added the default lossless parameter to opj_set_default_encoder_parameters in openjpeg.c
[openjpeg.git] / v2 / libopenjpeg / openjpeg.h
1  /*\r
2  * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium\r
3  * Copyright (c) 2002-2007, Professor Benoit Macq\r
4  * Copyright (c) 2001-2003, David Janssens\r
5  * Copyright (c) 2002-2003, Yannick Verschueren\r
6  * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe\r
7  * Copyright (c) 2005, Herve Drolon, FreeImage Team\r
8  * Copyright (c) 2006-2007, Parvatha Elangovan\r
9  * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\r
10  * All rights reserved.\r
11  *\r
12  * Redistribution and use in source and binary forms, with or without\r
13  * modification, are permitted provided that the following conditions\r
14  * are met:\r
15  * 1. Redistributions of source code must retain the above copyright\r
16  *    notice, this list of conditions and the following disclaimer.\r
17  * 2. Redistributions in binary form must reproduce the above copyright\r
18  *    notice, this list of conditions and the following disclaimer in the\r
19  *    documentation and/or other materials provided with the distribution.\r
20  *\r
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\r
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
31  * POSSIBILITY OF SUCH DAMAGE.\r
32  */\r
33 #ifndef OPENJPEG_H\r
34 #define OPENJPEG_H\r
35 \r
36 #if defined(OPJ_STATIC) || !(defined(WIN32) || defined(__WIN32__))\r
37         #define OPJ_API\r
38         #define OPJ_CALLCONV\r
39 #else\r
40         #define OPJ_CALLCONV __stdcall\r
41         #ifdef OPJ_EXPORTS\r
42                 #define OPJ_API __declspec(dllexport)\r
43         #else\r
44                 #define OPJ_API __declspec(dllimport)\r
45         #endif /* OPJ_EXPORTS */\r
46 #endif /* !OPJ_STATIC || !WIN32 */\r
47 \r
48 #ifndef __cplusplus\r
49         #if defined(HAVE_STDBOOL_H)\r
50                 #include <stdbool.h>\r
51         #else\r
52                 #if !defined(bool)\r
53                         #define bool    int\r
54                 #endif\r
55                 #if !defined(true)\r
56                         #define true    1\r
57                 #endif\r
58                 #if !defined(false)\r
59                         #define false   0\r
60                 #endif\r
61         #endif\r
62 #endif /* __cplusplus */\r
63 typedef unsigned int    OPJ_UINT32;\r
64 typedef int             OPJ_INT32;      \r
65 typedef unsigned short  OPJ_UINT16;     \r
66 typedef short           OPJ_INT16;      \r
67 typedef char            OPJ_CHAR;\r
68 typedef unsigned char   OPJ_BYTE;\r
69 typedef unsigned int    OPJ_SIZE_T;\r
70 typedef double          OPJ_FLOAT64;\r
71 typedef float           OPJ_FLOAT32;\r
72 #if defined(_MSC_VER) || defined(__BORLANDC__)\r
73         typedef __int64         OPJ_INT64;\r
74 #else\r
75         typedef long long       OPJ_INT64;\r
76 #endif\r
77 \r
78 #define OPENJPEG_VERSION "1.2.0"\r
79 /* \r
80 ==========================================================\r
81    Compiler directives\r
82 ==========================================================\r
83 */\r
84 #include <stdio.h>\r
85 \r
86 \r
87 \r
88 \r
89 \r
90 /* \r
91 ==========================================================\r
92    Useful constant definitions\r
93 ==========================================================\r
94 */\r
95 \r
96 #define OPJ_PATH_LEN                                    4096 /**< Maximum allowed size for filenames */\r
97 #define J2K_MAXRLVLS                                    33                                      /**< Number of maximum resolution level authorized */\r
98 #define J2K_MAXBANDS                                    (3*J2K_MAXRLVLS-2)      /**< Number of maximum sub-band linked to number of resolution level */\r
99 #define J2K_DEFAULT_NB_SEGS                             10\r
100 #define J2K_STREAM_CHUNK_SIZE                   0x100000 /** 1 mega by default */\r
101 #define J2K_DEFAULT_HEADER_SIZE                 1000\r
102 #define J2K_MCC_DEFAULT_NB_RECORDS              10\r
103 #define J2K_MCT_DEFAULT_NB_RECORDS              10\r
104 \r
105 /* UniPG>> */\r
106 #define JPWL_MAX_NO_TILESPECS   16 /**< Maximum number of tile parts expected by JPWL: increase at your will */\r
107 #define JPWL_MAX_NO_PACKSPECS   16 /**< Maximum number of packet parts expected by JPWL: increase at your will */\r
108 #define JPWL_MAX_NO_MARKERS     512 /**< Maximum number of JPWL markers: increase at your will */\r
109 #define JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename" /**< index file name used when JPWL is on */\r
110 #define JPWL_EXPECTED_COMPONENTS 3 /**< Expect this number of components, so you'll find better the first EPB */\r
111 #define JPWL_MAXIMUM_TILES 8192 /**< Expect this maximum number of tiles, to avoid some crashes */\r
112 #define JPWL_MAXIMUM_HAMMING 2 /**< Expect this maximum number of bit errors in marker id's */\r
113 #define JPWL_MAXIMUM_EPB_ROOM 65450 /**< Expect this maximum number of bytes for composition of EPBs */\r
114 /* <<UniPG */\r
115 \r
116 /* \r
117 ==========================================================\r
118    enum definitions\r
119 ==========================================================\r
120 */\r
121 /** \r
122 Rsiz Capabilities\r
123 */\r
124 typedef enum RSIZ_CAPABILITIES {\r
125         STD_RSIZ = 0,           /** Standard JPEG2000 profile*/\r
126         CINEMA2K = 3,           /** Profile name for a 2K image*/\r
127         CINEMA4K = 4,           /** Profile name for a 4K image*/\r
128         MCT = 0x8100\r
129 } OPJ_RSIZ_CAPABILITIES;\r
130 \r
131 /** \r
132 Digital cinema operation mode \r
133 */\r
134 typedef enum CINEMA_MODE {\r
135         OFF = 0,                                        /** Not Digital Cinema*/\r
136         CINEMA2K_24 = 1,        /** 2K Digital Cinema at 24 fps*/\r
137         CINEMA2K_48 = 2,        /** 2K Digital Cinema at 48 fps*/\r
138         CINEMA4K_24 = 3         /** 4K Digital Cinema at 24 fps*/\r
139 }OPJ_CINEMA_MODE;\r
140 \r
141 /** \r
142 Progression order \r
143 */\r
144 typedef enum PROG_ORDER {\r
145         PROG_UNKNOWN = -1,      /**< place-holder */\r
146         LRCP = 0,               /**< layer-resolution-component-precinct order */\r
147         RLCP = 1,               /**< resolution-layer-component-precinct order */\r
148         RPCL = 2,               /**< resolution-precinct-component-layer order */\r
149         PCRL = 3,               /**< precinct-component-resolution-layer order */\r
150         CPRL = 4                /**< component-precinct-resolution-layer order */\r
151 } OPJ_PROG_ORDER;\r
152 \r
153 /**\r
154 Supported image color spaces\r
155 */\r
156 typedef enum COLOR_SPACE {\r
157         CLRSPC_UNKNOWN = -1,    /**< place-holder */\r
158         CLRSPC_SRGB = 1,                /**< sRGB */\r
159         CLRSPC_GRAY = 2,                /**< grayscale */\r
160         CLRSPC_SYCC = 3                 /**< YUV */\r
161 } OPJ_COLOR_SPACE;\r
162 \r
163 /**\r
164 Supported codec\r
165 */\r
166 typedef enum CODEC_FORMAT {\r
167         CODEC_UNKNOWN = -1,     /**< place-holder */\r
168         CODEC_J2K = 0,          /**< JPEG-2000 codestream : read/write */\r
169         CODEC_JPT = 1,          /**< JPT-stream (JPEG 2000, JPIP) : read only */\r
170         CODEC_JP2 = 2           /**< JPEG-2000 file format : read/write */\r
171 } OPJ_CODEC_FORMAT;\r
172 \r
173 \r
174 \r
175 \r
176 /* \r
177 ==========================================================\r
178    event manager typedef definitions\r
179 ==========================================================\r
180 */\r
181 \r
182 /**\r
183 Callback function prototype for events\r
184 @param msg Event message\r
185 @param client_data \r
186 */\r
187 typedef void (*opj_msg_callback) (const OPJ_CHAR *msg, void *client_data);\r
188 \r
189 \r
190 \r
191 \r
192 /* \r
193 ==========================================================\r
194    codec typedef definitions\r
195 ==========================================================\r
196 */\r
197 \r
198 /**\r
199 Progression order changes\r
200 */\r
201 typedef struct opj_poc \r
202 {\r
203         /** Resolution num start, Component num start, given by POC */\r
204         OPJ_UINT32 resno0, compno0;\r
205         /** Layer num end,Resolution num end, Component num end, given by POC */\r
206         OPJ_UINT32 layno1, resno1, compno1;\r
207         /** Layer num start,Precinct num start, Precinct num end */\r
208         OPJ_UINT32 layno0, precno0, precno1;\r
209         /** Progression order enum*/\r
210         OPJ_PROG_ORDER prg1,prg;\r
211         /** Progression order string*/\r
212         OPJ_CHAR progorder[5];\r
213         /** Tile number */\r
214         OPJ_UINT32 tile;\r
215         /** Start and end values for Tile width and height*/\r
216         OPJ_INT32 tx0,tx1,ty0,ty1;\r
217         /** Start value, initialised in pi_initialise_encode*/\r
218         OPJ_UINT32 layS, resS, compS, prcS;\r
219         /** End value, initialised in pi_initialise_encode */\r
220         OPJ_UINT32 layE, resE, compE, prcE;\r
221         /** Start and end values of Tile width and height, initialised in pi_initialise_encode*/\r
222         OPJ_UINT32 txS,txE,tyS,tyE,dx,dy;\r
223         /** Temporary values for Tile parts, initialised in pi_create_encode */\r
224         OPJ_UINT32 lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;\r
225 } opj_poc_t;\r
226 \r
227 /**\r
228 Compression parameters\r
229 */\r
230 typedef struct opj_cparameters {\r
231         /** size of tile: tile_size_on = false (not in argument) or = true (in argument) */\r
232         bool tile_size_on;\r
233         /** XTOsiz */\r
234         int cp_tx0;\r
235         /** YTOsiz */\r
236         int cp_ty0;\r
237         /** XTsiz */\r
238         int cp_tdx;\r
239         /** YTsiz */\r
240         int cp_tdy;\r
241         /** allocation by rate/distortion */\r
242         int cp_disto_alloc;\r
243         /** allocation by fixed layer */\r
244         int cp_fixed_alloc;\r
245         /** add fixed_quality */\r
246         int cp_fixed_quality;\r
247         /** fixed layer */\r
248         int *cp_matrice;\r
249         /** comment for coding */\r
250         char *cp_comment;\r
251         /** csty : coding style */\r
252         int csty;\r
253         /** progression order (default LRCP) */\r
254         OPJ_PROG_ORDER prog_order;\r
255         /** progression order changes */\r
256         opj_poc_t POC[32];\r
257         /** number of progression order changes (POC), default to 0 */\r
258         int numpocs;\r
259         /** number of layers */\r
260         int tcp_numlayers;\r
261         /** rates of layers */\r
262         float tcp_rates[100];\r
263         /** different psnr for successive layers */\r
264         float tcp_distoratio[100];\r
265         /** number of resolutions */\r
266         int numresolution;\r
267         /** initial code block width, default to 64 */\r
268         int cblockw_init;\r
269         /** initial code block height, default to 64 */\r
270         int cblockh_init;\r
271         /** mode switch (cblk_style) */\r
272         int mode;\r
273         /** 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */\r
274         int irreversible;\r
275         /** region of interest: affected component in [0..3], -1 means no ROI */\r
276         int roi_compno;\r
277         /** region of interest: upshift value */\r
278         int roi_shift;\r
279         /* number of precinct size specifications */\r
280         int res_spec;\r
281         /** initial precinct width */\r
282         int prcw_init[J2K_MAXRLVLS];\r
283         /** initial precinct height */\r
284         int prch_init[J2K_MAXRLVLS];\r
285 \r
286         /**@name command line encoder parameters (not used inside the library) */\r
287         /*@{*/\r
288         /** input file name */\r
289         char infile[OPJ_PATH_LEN];\r
290         /** output file name */\r
291         char outfile[OPJ_PATH_LEN];\r
292         /** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */\r
293         int index_on;\r
294         /** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */\r
295         char index[OPJ_PATH_LEN];\r
296         /** subimage encoding: origin image offset in x direction */\r
297         int image_offset_x0;\r
298         /** subimage encoding: origin image offset in y direction */\r
299         int image_offset_y0;\r
300         /** subsampling value for dx */\r
301         int subsampling_dx;\r
302         /** subsampling value for dy */\r
303         int subsampling_dy;\r
304         /** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/\r
305         int decod_format;\r
306         /** output file format 0: J2K, 1: JP2, 2: JPT */\r
307         int cod_format;\r
308         /*@}*/\r
309 \r
310 /* UniPG>> */\r
311         /**@name JPWL encoding parameters */\r
312         /*@{*/\r
313         /** enables writing of EPC in MH, thus activating JPWL */\r
314         bool jpwl_epc_on;\r
315         /** error protection method for MH (0,1,16,32,37-128) */\r
316         int jpwl_hprot_MH;\r
317         /** tile number of header protection specification (>=0) */\r
318         int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];\r
319         /** error protection methods for TPHs (0,1,16,32,37-128) */\r
320         int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];\r
321         /** tile number of packet protection specification (>=0) */\r
322         int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];\r
323         /** packet number of packet protection specification (>=0) */\r
324         int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];\r
325         /** error protection methods for packets (0,1,16,32,37-128) */\r
326         int jpwl_pprot[JPWL_MAX_NO_PACKSPECS];\r
327         /** enables writing of ESD, (0=no/1/2 bytes) */\r
328         int jpwl_sens_size;\r
329         /** sensitivity addressing size (0=auto/2/4 bytes) */\r
330         int jpwl_sens_addr;\r
331         /** sensitivity range (0-3) */\r
332         int jpwl_sens_range;\r
333         /** sensitivity method for MH (-1=no,0-7) */\r
334         int jpwl_sens_MH;\r
335         /** tile number of sensitivity specification (>=0) */\r
336         int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];\r
337         /** sensitivity methods for TPHs (-1=no,0-7) */\r
338         int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];\r
339         /*@}*/\r
340 /* <<UniPG */\r
341 \r
342         /** Digital Cinema compliance 0-not compliant, 1-compliant*/\r
343         OPJ_CINEMA_MODE cp_cinema;\r
344         /** Maximum rate for each component. If == 0, component size limitation is not considered */\r
345         int max_comp_size;\r
346         /** Profile name*/\r
347         OPJ_RSIZ_CAPABILITIES cp_rsiz;\r
348         /** Tile part generation*/\r
349         char tp_on;\r
350         /** Flag for Tile part generation*/\r
351         char tp_flag;\r
352         /** MCT (multiple component transform) */\r
353         char tcp_mct;\r
354         /** Naive implementation of MCT restricted to a single reversible array based encoding without offset concerning all the components. */\r
355         void * mct_data;\r
356 \r
357 } opj_cparameters_t;\r
358 \r
359 /**\r
360 Decompression parameters\r
361 */\r
362 typedef struct opj_dparameters {\r
363         /** \r
364         Set the number of highest resolution levels to be discarded. \r
365         The image resolution is effectively divided by 2 to the power of the number of discarded levels. \r
366         The reduce factor is limited by the smallest total number of decomposition levels among tiles.\r
367         if != 0, then original dimension divided by 2^(reduce); \r
368         if == 0 or not used, image is decoded to the full resolution \r
369         */\r
370         int cp_reduce;\r
371         /** \r
372         Set the maximum number of quality layers to decode. \r
373         If there are less quality layers than the specified number, all the quality layers are decoded.\r
374         if != 0, then only the first "layer" layers are decoded; \r
375         if == 0 or not used, all the quality layers are decoded \r
376         */\r
377         int cp_layer;\r
378 \r
379         /**\r
380          * Restrictive decoding parameters.\r
381          */\r
382         OPJ_INT32 m_decode_start_x;\r
383         OPJ_INT32 m_decode_start_y ;\r
384         OPJ_INT32 m_decode_end_x ;\r
385         OPJ_INT32 m_decode_end_y ;\r
386 \r
387         /**@name command line encoder parameters (not used inside the library) */\r
388         /*@{*/\r
389         /** input file name */\r
390         char infile[OPJ_PATH_LEN];\r
391         /** output file name */\r
392         char outfile[OPJ_PATH_LEN];\r
393         /** input file format 0: J2K, 1: JP2, 2: JPT */\r
394         int decod_format;\r
395         /** output file format 0: PGX, 1: PxM, 2: BMP */\r
396         int cod_format;\r
397         /*@}*/\r
398 \r
399 /* UniPG>> */\r
400         /**@name JPWL decoding parameters */\r
401         /*@{*/\r
402         /** activates the JPWL correction capabilities */\r
403         bool jpwl_correct;\r
404         /** expected number of components */\r
405         int jpwl_exp_comps;\r
406         /** maximum number of tiles */\r
407         int jpwl_max_tiles;\r
408         \r
409         /** use restrictive decoding ? */\r
410         OPJ_UINT32 m_use_restrict_decode : 1;\r
411         /*@}*/\r
412 /* <<UniPG */\r
413 \r
414 } opj_dparameters_t;\r
415 \r
416 /**\r
417  * J2k codec.\r
418  */\r
419 typedef void * opj_codec_t;\r
420 \r
421 \r
422 /* \r
423 ==========================================================\r
424    I/O stream typedef definitions\r
425 ==========================================================\r
426 */\r
427 \r
428 /*\r
429  * Stream open flags.\r
430  */\r
431 /** The stream was opened for reading. */\r
432 #define OPJ_STREAM_READ 0x0001\r
433 /** The stream was opened for writing. */\r
434 #define OPJ_STREAM_WRITE 0x0002\r
435 \r
436 \r
437 typedef OPJ_UINT32 (* opj_stream_read_fn) (void * p_buffer, OPJ_UINT32 p_nb_bytes, void * p_user_data) ;\r
438 typedef OPJ_UINT32 (* opj_stream_write_fn) (void * p_buffer, OPJ_UINT32 p_nb_bytes, void * p_user_data) ;\r
439 typedef OPJ_SIZE_T (* opj_stream_skip_fn) (OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;\r
440 typedef bool (* opj_stream_seek_fn) (OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;\r
441 \r
442 \r
443 typedef void * opj_stream_t;\r
444 \r
445 /* \r
446 ==========================================================\r
447    image typedef definitions\r
448 ==========================================================\r
449 */\r
450 \r
451 /**\r
452 Defines a single image component\r
453 */\r
454 typedef struct opj_image_comp {\r
455         /** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */\r
456         OPJ_UINT32 dx;\r
457         /** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */\r
458         OPJ_UINT32 dy;\r
459         /** data width */\r
460         OPJ_UINT32 w;\r
461         /** data height */\r
462         OPJ_UINT32 h;\r
463         /** x component offset compared to the whole image */\r
464         OPJ_INT32 x0;\r
465         /** y component offset compared to the whole image */\r
466         OPJ_INT32 y0;\r
467         /** precision */\r
468         OPJ_UINT32 prec;\r
469         /** number of decoded resolution */\r
470         OPJ_UINT32 resno_decoded;\r
471         /** number of division by 2 of the out image compared to the original size of image */\r
472         OPJ_UINT32 factor;\r
473         /** image component data */\r
474         int *data;\r
475         /** signed (1) / unsigned (0) */\r
476         OPJ_UINT32 sgnd : 1;\r
477         \r
478 } opj_image_comp_t;\r
479 \r
480 /** \r
481 Defines image data and characteristics\r
482 */\r
483 typedef struct opj_image \r
484 {\r
485         /** XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area */\r
486         OPJ_INT32 x0;\r
487         /** YOsiz: vertical offset from the origin of the reference grid to the top side of the image area */\r
488         OPJ_INT32 y0;\r
489         /** Xsiz: width of the reference grid */\r
490         OPJ_INT32 x1;\r
491         /** Ysiz: height of the reference grid */\r
492         OPJ_INT32 y1;\r
493         /** number of components in the image */\r
494         OPJ_UINT32 numcomps;\r
495         /** color space: sRGB, Greyscale or YUV */\r
496         OPJ_COLOR_SPACE color_space;\r
497         /** image components */\r
498         opj_image_comp_t *comps;\r
499 } opj_image_t;\r
500 \r
501 /**\r
502 Component parameters structure used by the opj_image_create function\r
503 */\r
504 typedef struct opj_image_comptparm {\r
505         /** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */\r
506         unsigned int dx;\r
507         /** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */\r
508         unsigned int dy;\r
509         /** data width */\r
510         unsigned int w;\r
511         /** data height */\r
512         unsigned int h;\r
513         /** x component offset compared to the whole image */\r
514         int x0;\r
515         /** y component offset compared to the whole image */\r
516         int y0;\r
517         /** precision */\r
518         int prec;\r
519         /** image depth in bits */\r
520         int bpp;\r
521         /** signed (1) / unsigned (0) */\r
522         int sgnd;\r
523 } opj_image_cmptparm_t;\r
524 \r
525 /* \r
526 ==========================================================\r
527    Information on the JPEG 2000 codestream\r
528 ==========================================================\r
529 */\r
530 \r
531 /**\r
532 Index structure : Information concerning a packet inside tile\r
533 */\r
534 typedef struct opj_packet_info {\r
535         /** packet start position (including SOP marker if it exists) */\r
536         int start_pos;\r
537         /** end of packet header position (including EPH marker if it exists)*/\r
538         int end_ph_pos;\r
539         /** packet end position */\r
540         int end_pos;\r
541         /** packet distorsion */\r
542         double disto;\r
543 } opj_packet_info_t;\r
544 \r
545 /**\r
546 Index structure : Information concerning tile-parts\r
547 */\r
548 typedef struct opj_tp_info {\r
549         /** start position of tile part */\r
550         int tp_start_pos;\r
551         /** end position of tile part header */\r
552         int tp_end_header;\r
553         /** end position of tile part */\r
554         int tp_end_pos;\r
555         /** start packet of tile part */\r
556         int tp_start_pack;\r
557         /** number of packets of tile part */\r
558         int tp_numpacks;\r
559 } opj_tp_info_t;\r
560 \r
561 /**\r
562 Index structure : information regarding tiles \r
563 */\r
564 typedef struct opj_tile_info {\r
565         /** value of thresh for each layer by tile cfr. Marcela   */\r
566         double *thresh;\r
567         /** number of tile */\r
568         int tileno;\r
569         /** start position */\r
570         int start_pos;\r
571         /** end position of the header */\r
572         int end_header;\r
573         /** end position */\r
574         int end_pos;\r
575         /** precinct number for each resolution level (width) */\r
576         int pw[33];\r
577         /** precinct number for each resolution level (height) */\r
578         int ph[33];\r
579         /** precinct size (in power of 2), in X for each resolution level */\r
580         int pdx[33];\r
581         /** precinct size (in power of 2), in Y for each resolution level */\r
582         int pdy[33];\r
583         /** information concerning packets inside tile */\r
584         opj_packet_info_t *packet;\r
585         /** add fixed_quality */\r
586         int numpix;\r
587         /** add fixed_quality */\r
588         double distotile;\r
589         /** number of tile parts */\r
590         int num_tps;\r
591         /** information concerning tile parts */\r
592         opj_tp_info_t *tp;\r
593 } opj_tile_info_t;\r
594 \r
595 /* UniPG>> */\r
596 /**\r
597 Marker structure\r
598 */\r
599 typedef struct opj_marker_info_t {\r
600         /** marker type */\r
601         unsigned short int type;\r
602         /** position in codestream */\r
603         int pos;\r
604         /** length, marker val included */\r
605         int len;\r
606 } opj_marker_info_t;\r
607 /* <<UniPG */\r
608 \r
609 /**\r
610 Index structure of the codestream\r
611 */\r
612 typedef struct opj_codestream_info {\r
613         /** maximum distortion reduction on the whole image (add for Marcela) */\r
614         double D_max;\r
615         /** packet number */\r
616         int packno;\r
617         /** writing the packet in the index with t2_encode_packets */\r
618         int index_write;\r
619         /** image width */\r
620         int image_w;\r
621         /** image height */\r
622         int image_h;\r
623         /** progression order */\r
624         OPJ_PROG_ORDER prog;\r
625         /** tile size in x */\r
626         int tile_x;\r
627         /** tile size in y */\r
628         int tile_y;\r
629         /** */\r
630         int tile_Ox;\r
631         /** */\r
632         int tile_Oy;\r
633         /** number of tiles in X */\r
634         int tw;\r
635         /** number of tiles in Y */\r
636         int th;\r
637         /** component numbers */\r
638         int numcomps;\r
639         /** number of layer */\r
640         int numlayers;\r
641         /** number of decomposition for each component */\r
642         int *numdecompos;\r
643 /* UniPG>> */\r
644         /** number of markers */\r
645         int marknum;\r
646         /** list of markers */\r
647         opj_marker_info_t *marker;\r
648         /** actual size of markers array */\r
649         int maxmarknum;\r
650 /* <<UniPG */\r
651         /** main header position */\r
652         int main_head_start;\r
653         /** main header position */\r
654         int main_head_end;\r
655         /** codestream's size */\r
656         int codestream_size;\r
657         /** information regarding tiles inside image */\r
658         opj_tile_info_t *tile;\r
659 } opj_codestream_info_t;\r
660 \r
661 #ifdef __cplusplus\r
662 extern "C" {\r
663 #endif\r
664 \r
665 \r
666 /* \r
667 ==========================================================\r
668    openjpeg version\r
669 ==========================================================\r
670 */\r
671 \r
672 OPJ_API const OPJ_CHAR * OPJ_CALLCONV opj_version(void);\r
673 \r
674 /* \r
675 ==========================================================\r
676    image functions definitions\r
677 ==========================================================\r
678 */\r
679 \r
680 /**\r
681 Create an image\r
682 @param numcmpts number of components\r
683 @param cmptparms components parameters\r
684 @param clrspc image color space\r
685 @return returns a new image structure if successful, returns NULL otherwise\r
686 */\r
687 OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);\r
688 \r
689 /**\r
690  * Creates an image without allocating memory for the image (used in the new version of the library).\r
691  * \r
692  * @param       p_num_cmpts                     the number of components\r
693  * @param       p_cmpt_parms            the components parameters\r
694  * @param       p_clr_spc                       the image color space\r
695  * \r
696  * @return      a new image structure if successful, NULL otherwise.\r
697 */\r
698 OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);\r
699 \r
700 /**\r
701 Deallocate any resources associated with an image\r
702 @param image image to be destroyed\r
703 */\r
704 OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);\r
705 \r
706 /* \r
707 ==========================================================\r
708    stream functions definitions\r
709 ==========================================================\r
710 */\r
711 \r
712 /**\r
713  * Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.\r
714  *\r
715  * @param       l_is_reader             if set to true then the stream will be an input stream, an output stream else.\r
716  * \r
717  * @return      a stream object.\r
718 */\r
719 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(bool p_is_input);\r
720 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_UINT32 p_size,bool p_is_input);\r
721 \r
722 /**\r
723  * Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream. If needed the user must \r
724  * close its own implementation of the stream.\r
725  * \r
726  * @param       p_stream        the stream to destroy.\r
727  */\r
728 OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);\r
729 \r
730 /**\r
731  * Sets the given function to be used as a read function.\r
732  * @param               p_stream        the stream to modify\r
733  * @param               p_function      the function to use a read function.\r
734 */\r
735 OPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function);\r
736 \r
737 /**\r
738  * Sets the given function to be used as a write function.\r
739  * @param               p_stream        the stream to modify\r
740  * @param               p_function      the function to use a write function.\r
741 */\r
742 OPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream, opj_stream_write_fn p_function);\r
743 \r
744 /**\r
745  * Sets the given function to be used as a skip function.\r
746  * @param               p_stream        the stream to modify\r
747  * @param               p_function      the function to use a skip function.\r
748 */\r
749 OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_stream_skip_fn p_function);\r
750 \r
751 /**\r
752  * Sets the given function to be used as a seek function, the stream is then seekable.\r
753  * @param               p_stream        the stream to modify\r
754  * @param               p_function      the function to use a skip function.\r
755 */\r
756 OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function);\r
757 \r
758 \r
759 /**\r
760  * Sets the given data to be used as a user data for the stream.\r
761  * @param               p_stream        the stream to modify\r
762  * @param               p_data          the data to set.\r
763 */\r
764 OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data);\r
765 \r
766 /**\r
767  * Helper function.\r
768  * Sets the stream to be a file stream. The FILE must have been open previously.\r
769  * @param               p_stream        the stream to modify\r
770  * @param               p_file          handler to an already open file.\r
771 */\r
772 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (FILE * p_file,bool p_is_read_stream);\r
773 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (FILE * p_file,OPJ_UINT32 p_buffer_size, bool p_is_read_stream);\r
774 \r
775 \r
776 \r
777 /* \r
778 ==========================================================\r
779    event manager functions definitions\r
780 ==========================================================\r
781 */\r
782 OPJ_API bool OPJ_CALLCONV opj_set_info_handler(opj_codec_t * p_codec, opj_msg_callback p_callback,void * p_user_data);\r
783 OPJ_API bool OPJ_CALLCONV opj_set_warning_handler(opj_codec_t * p_codec, opj_msg_callback p_callback,void * p_user_data);\r
784 OPJ_API bool OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec, opj_msg_callback p_callback,void * p_user_data);\r
785 \r
786 \r
787 \r
788 /* \r
789 ==========================================================\r
790    codec functions definitions\r
791 ==========================================================\r
792 */\r
793 /**\r
794 Creates a J2K/JPT/JP2 decompression structure\r
795 @param format Decoder to select\r
796 @return Returns a handle to a decompressor if successful, returns NULL otherwise\r
797 */\r
798 OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);\r
799 \r
800 /**\r
801 Set decoding parameters to default values\r
802 @param parameters Decompression parameters\r
803 */\r
804 OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);\r
805 \r
806 #ifdef USE_OPJ_DEPRECATED\r
807 #ifdef _MSC_VER\r
808 #pragma message ( "warning, opj_setup_decoder is deprecated")\r
809 #else\r
810 #warning "warning, opj_setup_decoder is deprecated"\r
811 #endif\r
812 /**\r
813 Setup the decoder decoding parameters using user parameters.\r
814 Decoding parameters are returned in j2k->cp. \r
815 @param dinfo decompressor handle\r
816 @param parameters decompression parameters\r
817 */\r
818 OPJ_API bool OPJ_CALLCONV opj_setup_decoder(opj_codec_t *dinfo, opj_dparameters_t *parameters);\r
819 #endif\r
820 \r
821 /**\r
822 Decode an image from a JPEG-2000 codestream \r
823 @param dinfo decompressor handle\r
824 @param cio Input buffer stream\r
825 @return Returns a decoded image if successful, returns NULL otherwise\r
826 */\r
827 OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_codec_t *p_decompressor, opj_stream_t * cio);\r
828 \r
829 /**\r
830  * Writes a tile with the given data.\r
831  * \r
832  * @param       p_compressor            the jpeg2000 codec.\r
833  * @param       p_tile_index            the index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence.\r
834  * @param       p_data                          pointer to the data to write. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO INTERLEAVING should be set.\r
835  * @param       p_data_size                     this value os used to make sure the data being written is correct. The size must be equal to the sum for each component of tile_width * tile_height * component_size. component_size can be 1,2 or 4 bytes,\r
836  *                                                              depending on the precision of the given component.\r
837  * @param       p_stream                        the stream to write data to.\r
838  * \r
839  * @return      true if the data could be written.\r
840  */\r
841 OPJ_API bool OPJ_CALLCONV opj_write_tile (\r
842                                          opj_codec_t *p_codec,\r
843                                          OPJ_UINT32 p_tile_index,\r
844                                          OPJ_BYTE * p_data,\r
845                                          OPJ_UINT32 p_data_size,\r
846                                          opj_stream_t *p_stream\r
847                                         );\r
848 \r
849 /**\r
850  * Reads a tile header. This function is compulsory and allows one to know the size of the tile thta will be decoded.\r
851  * The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.\r
852  *\r
853  * @param       p_codec                 the jpeg2000 codec.\r
854  * @param       p_tile_index    pointer to a value that will hold the index of the tile being decoded, in case of success.\r
855  * @param       p_data_size             pointer to a value that will hold the maximum size of the decoded data, in case of success. In case\r
856  *                                                      of truncated codestreams, the actual number of bytes decoded may be lower. The computation of the size is the same\r
857  *                                                      as depicted in opj_write_tile.\r
858  * @param       p_tile_x0               pointer to a value that will hold the x0 pos of the tile (in the image).\r
859  * @param       p_tile_y0               pointer to a value that will hold the y0 pos of the tile (in the image).\r
860  * @param       p_tile_x1               pointer to a value that will hold the x1 pos of the tile (in the image).\r
861  * @param       p_tile_y1               pointer to a value that will hold the y1 pos of the tile (in the image).\r
862  * @param       p_nb_comps              pointer to a value that will hold the number of components in the tile.\r
863  * @param       p_should_go_on  pointer to a boolean that will hold the fact that the decoding should go on. In case the\r
864  *                                                      codestream is over at the time of the call, the value will be set to false. The user should then stop\r
865  *                                                      the decoding.\r
866  * @param       p_stream                the stream to decode.\r
867  * @return      true                    if the tile header could be decoded. In case the decoding should end, the returned value is still true.\r
868  *                                                      returning false may be the result of a shortage of memory or an internal error.\r
869  */                             \r
870 OPJ_API bool OPJ_CALLCONV opj_read_tile_header(\r
871                                         opj_codec_t *p_codec,\r
872                                         OPJ_UINT32 * p_tile_index,\r
873                                         OPJ_UINT32 * p_data_size,\r
874                                         OPJ_INT32 * p_tile_x0,\r
875                                         OPJ_INT32 * p_tile_y0,\r
876                                         OPJ_INT32 * p_tile_x1,\r
877                                         OPJ_INT32 * p_tile_y1,\r
878                                         OPJ_UINT32 * p_nb_comps,\r
879                                         bool * p_should_go_on,\r
880                                         opj_stream_t * p_stream);\r
881 \r
882 \r
883 /**\r
884  * Reads a tile data. This function is compulsory and allows one to decode tile data. opj_read_tile_header should be called before.\r
885  * The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.\r
886  *\r
887  * @param       p_codec                 the jpeg2000 codec.\r
888  * @param       p_tile_index    the index of the tile being decoded, this should be the value set by opj_read_tile_header.\r
889  * @param       p_data                  pointer to a memory block that will hold the decoded data.\r
890  * @param       p_data_size             size of p_data. p_data_size should be bigger or equal to the value set by opj_read_tile_header.\r
891  * @param       p_stream                the stream to decode.\r
892  *\r
893  * @return      true                    if the data could be decoded.\r
894  */                             \r
895 OPJ_API bool OPJ_CALLCONV opj_decode_tile_data(\r
896                                         opj_codec_t *p_codec,\r
897                                         OPJ_UINT32 p_tile_index,\r
898                                         OPJ_BYTE * p_data,\r
899                                         OPJ_UINT32 p_data_size,\r
900                                         opj_stream_t *p_stream\r
901                                         );\r
902 \r
903 /**\r
904  * Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.\r
905  * \r
906  * @param       p_codec                 the jpeg2000 codec.\r
907  * @param       p_start_x               the left position of the rectangle to decode (in image coordinates).\r
908  * @param       p_end_x                 the right position of the rectangle to decode (in image coordinates).\r
909  * @param       p_start_y               the up position of the rectangle to decode (in image coordinates).\r
910  * @param       p_end_y                 the bottom position of the rectangle to decode (in image coordinates).\r
911  *\r
912  * @return      true                    if the area could be set.\r
913  */                             \r
914 OPJ_API bool OPJ_CALLCONV opj_set_decode_area(\r
915                                         opj_codec_t *p_codec,\r
916                                         OPJ_INT32 p_start_x,\r
917                                         OPJ_INT32 p_start_y,\r
918                                         OPJ_INT32 p_end_x,\r
919                                         OPJ_INT32 p_end_y\r
920                                         );\r
921 \r
922 \r
923 /**\r
924 Decode an image from a JPEG-2000 codestream and extract the codestream information\r
925 @param dinfo decompressor handle\r
926 @param cio Input buffer stream\r
927 @param cstr_info Codestream information structure if needed afterwards, NULL otherwise\r
928 @return Returns a decoded image if successful, returns NULL otherwise\r
929 */\r
930 //OPJ_API opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_stream_t cio, opj_codestream_info_t *cstr_info);\r
931 /**\r
932 Creates a J2K/JP2 compression structure\r
933 @param format Coder to select\r
934 @return Returns a handle to a compressor if successful, returns NULL otherwise\r
935 */\r
936 OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format);\r
937 \r
938 /**\r
939 Destroy a decompressor handle\r
940 @param dinfo decompressor handle to destroy\r
941 */\r
942 OPJ_API void OPJ_CALLCONV opj_destroy_codec(opj_codec_t * p_codec);\r
943 \r
944 /**\r
945 Set encoding parameters to default values, that means : \r
946 <ul>\r
947 <li>Lossless\r
948 <li>1 tile\r
949 <li>Size of precinct : 2^15 x 2^15 (means 1 precinct)\r
950 <li>Size of code-block : 64 x 64\r
951 <li>Number of resolutions: 6\r
952 <li>No SOP marker in the codestream\r
953 <li>No EPH marker in the codestream\r
954 <li>No sub-sampling in x or y direction\r
955 <li>No mode switch activated\r
956 <li>Progression order: LRCP\r
957 <li>No index file\r
958 <li>No ROI upshifted\r
959 <li>No offset of the origin of the image\r
960 <li>No offset of the origin of the tiles\r
961 <li>Reversible DWT 5-3\r
962 </ul>\r
963 @param parameters Compression parameters\r
964 */\r
965 OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);\r
966 \r
967 /**\r
968  * Sets the MCT matrix to use.\r
969  * \r
970  * @param       parameters              the parameters to change.\r
971  * @param       pEncodingMatrix the encoding matrix.\r
972  * @param       p_dc_shift              the dc shift coefficients to use.\r
973  * @param       pNbComp                 the number of components of the image.\r
974  *\r
975  * @return      true if the parameters could be set.\r
976  */\r
977 OPJ_API bool OPJ_CALLCONV opj_set_MCT(opj_cparameters_t *parameters,OPJ_FLOAT32 * pEncodingMatrix,OPJ_INT32 * p_dc_shift,OPJ_UINT32 pNbComp);\r
978 \r
979 /**\r
980  * Restricts the decoding to the given image area.\r
981  * \r
982  * @param       parameters              the parameters to update.\r
983  * @param       p_start_x               the starting x position of the area to decode.\r
984  * @param       p_start_y               the starting y position of the area to decode.\r
985  * @param       p_end_x                 the x end position of the area to decode. \r
986  * @param       p_end_x                 the y end position of the area to decode.\r
987  */\r
988 OPJ_API bool OPJ_CALLCONV opj_restrict_decoding (opj_dparameters_t *parameters,OPJ_INT32 p_start_x,OPJ_INT32 p_start_y,OPJ_INT32 p_end_x,OPJ_INT32 p_end_y);\r
989 \r
990 #ifdef USE_OPJ_DEPRECATED\r
991 #ifdef _MSC_VER\r
992 #pragma message ("warning, opj_setup_encoder is deprecated")\r
993 #else\r
994 #warning "warning, opj_setup_encoder is deprecated"\r
995 #endif\r
996 /**\r
997 Setup the encoder parameters using the current image and using user parameters. \r
998 @param cinfo Compressor handle\r
999 @param parameters Compression parameters\r
1000 @param image Input filled image\r
1001 */\r
1002 OPJ_API bool OPJ_CALLCONV opj_setup_encoder(opj_codec_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);\r
1003 #endif\r
1004 \r
1005 /**\r
1006  * Decodes an image header.\r
1007  * \r
1008  * @param       p_codec                 codec to use to decode the image.\r
1009  * @param       p_image                 pointer to a previously created image.\r
1010  * @param       p_tile_x0               pointer to a value that will hold the reference point x0 of the tiling grid.\r
1011  * @param       p_tile_y0               pointer to a value that will hold the reference point y0 of the tiling grid.\r
1012  * @param       p_tile_width    pointer to a value that will hold the size in x of a tile in the grid.\r
1013  * @param       p_tile_height   pointer to a value that will hold the size in y of a tile in the grid.\r
1014  * @param       p_nb_tiles_x    pointer to a value that will hold the number of tiles in the x direction.\r
1015  * @param       p_nb_tiles_y    pointer to a value that will hold the number of tiles in the y direction.\r
1016  */\r
1017 OPJ_API bool OPJ_CALLCONV opj_read_header (\r
1018                                                                                 opj_codec_t *p_codec,\r
1019                                                                                 opj_image_t ** p_image,\r
1020                                                                                 OPJ_INT32 * p_tile_x0,\r
1021                                                                                 OPJ_INT32 * p_tile_y0,\r
1022                                                                                 OPJ_UINT32 * p_tile_width,\r
1023                                                                                 OPJ_UINT32 * p_tile_height,\r
1024                                                                                 OPJ_UINT32 * p_nb_tiles_x,\r
1025                                                                                 OPJ_UINT32 * p_nb_tiles_y,\r
1026                                                                                 opj_stream_t *p_cio);\r
1027 \r
1028 \r
1029 OPJ_API bool OPJ_CALLCONV opj_end_decompress (opj_codec_t *p_codec,opj_stream_t *p_cio);\r
1030 /**\r
1031 Encode an image into a JPEG-2000 codestream\r
1032 @param cinfo compressor handle\r
1033 @param cio Output buffer stream\r
1034 @param image Image to encode\r
1035 @param index Depreacted -> Set to NULL. To extract index, used opj_encode_wci()\r
1036 @return Returns true if successful, returns false otherwise\r
1037 */\r
1038 OPJ_API bool OPJ_CALLCONV opj_encode(opj_codec_t *cinfo, opj_stream_t * cio);\r
1039 \r
1040 OPJ_API bool OPJ_CALLCONV opj_start_compress (opj_codec_t *p_codec,opj_image_t * p_image,opj_stream_t *p_cio);\r
1041 \r
1042 OPJ_API bool OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec,opj_stream_t *p_cio);\r
1043 /**\r
1044 Encode an image into a JPEG-2000 codestream and extract the codestream information\r
1045 @param cinfo compressor handle\r
1046 @param cio Output buffer stream\r
1047 @param image Image to encode\r
1048 @param cstr_info Codestream information structure if needed afterwards, NULL otherwise\r
1049 @return Returns true if successful, returns false otherwise\r
1050 */\r
1051 //OPJ_API bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_stream_t cio, opj_image_t *image, opj_codestream_info_t *cstr_info);\r
1052 /**\r
1053 Destroy Codestream information after compression or decompression\r
1054 @param cstr_info Codestream information structure\r
1055 */\r
1056 OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info);\r
1057 \r
1058 //==============================================================================\r
1059 //==============================================================================\r
1060 /** profiling part */\r
1061 #ifdef _PROFILE\r
1062 void _ProfInit(void);\r
1063 void _ProfPrint(void);\r
1064 #define PROFINIT() _ProfInit();\r
1065 #define PROFSAVE(file) _ProfSave(file);\r
1066 #define PROFPRINT() _ProfPrint();\r
1067 #else\r
1068 #define PROFINIT()\r
1069 #define PROFSAVE(file)\r
1070 #define PROFPRINT() \r
1071 #endif // !_PROFILE\r
1072 \r
1073 #ifdef __cplusplus\r
1074 }\r
1075 #endif\r
1076 \r
1077 #endif /* OPENJPEG_H */\r
1078 \r
1079 \r