OpenJPEG  1.5.1
openjpeg.h
Go to the documentation of this file.
1  /*
2  * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
3  * Copyright (c) 2002-2007, Professor Benoit Macq
4  * Copyright (c) 2001-2003, David Janssens
5  * Copyright (c) 2002-2003, Yannick Verschueren
6  * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
7  * Copyright (c) 2005, Herve Drolon, FreeImage Team
8  * Copyright (c) 2006-2007, Parvatha Elangovan
9  * Copyright (c) 2010-2011, Kaori Hagihara
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 #ifndef OPENJPEG_H
34 #define OPENJPEG_H
35 
36 
37 /*
38 ==========================================================
39  Compiler directives
40 ==========================================================
41 */
42 
43 #if defined(OPJ_STATIC) || !defined(_WIN32)
44 #define OPJ_API
45 #define OPJ_CALLCONV
46 #else
47 #define OPJ_CALLCONV __stdcall
48 /*
49 The following ifdef block is the standard way of creating macros which make exporting
50 from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
51 symbol defined on the command line. this symbol should not be defined on any project
52 that uses this DLL. This way any other project whose source files include this file see
53 OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
54 defined with this macro as being exported.
55 */
56 #if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
57 #define OPJ_API __declspec(dllexport)
58 #else
59 #define OPJ_API __declspec(dllimport)
60 #endif /* OPJ_EXPORTS */
61 #endif /* !OPJ_STATIC || !_WIN32 */
62 
63 typedef int opj_bool;
64 #define OPJ_TRUE 1
65 #define OPJ_FALSE 0
66 
67 /* Avoid compile-time warning because parameter is not used */
68 #define OPJ_ARG_NOT_USED(x) (void)(x)
69 /*
70 ==========================================================
71  Useful constant definitions
72 ==========================================================
73 */
74 
75 #define OPJ_PATH_LEN 4096
77 #define J2K_MAXRLVLS 33
78 #define J2K_MAXBANDS (3*J2K_MAXRLVLS-2)
80 /* UniPG>> */
81 #define JPWL_MAX_NO_TILESPECS 16
82 #define JPWL_MAX_NO_PACKSPECS 16
83 #define JPWL_MAX_NO_MARKERS 512
84 #define JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename"
85 #define JPWL_EXPECTED_COMPONENTS 3
86 #define JPWL_MAXIMUM_TILES 8192
87 #define JPWL_MAXIMUM_HAMMING 2
88 #define JPWL_MAXIMUM_EPB_ROOM 65450
89 /* <<UniPG */
90 
91 /*
92 ==========================================================
93  enum definitions
94 ==========================================================
95 */
99 typedef enum RSIZ_CAPABILITIES {
100  STD_RSIZ = 0,
101  CINEMA2K = 3,
102  CINEMA4K = 4
104 
108 typedef enum CINEMA_MODE {
109  OFF = 0,
114 
118 typedef enum PROG_ORDER {
120  LRCP = 0,
121  RLCP = 1,
122  RPCL = 2,
123  PCRL = 3,
124  CPRL = 4
126 
130 typedef enum COLOR_SPACE {
137 
138 #define ENUMCS_SRGB 16
139 #define ENUMCS_GRAY 17
140 #define ENUMCS_SYCC 18
141 
145 typedef enum CODEC_FORMAT {
147  CODEC_J2K = 0,
148  CODEC_JPT = 1,
151 
155 typedef enum LIMIT_DECODING {
160 
161 /*
162 ==========================================================
163  event manager typedef definitions
164 ==========================================================
165 */
166 
172 typedef void (*opj_msg_callback) (const char *msg, void *client_data);
173 
183 typedef struct opj_event_mgr {
191 
192 
193 /*
194 ==========================================================
195  codec typedef definitions
196 ==========================================================
197 */
198 
202 typedef struct opj_poc {
212  char progorder[5];
214  int tile;
216  int tx0,tx1,ty0,ty1;
218  int layS, resS, compS, prcS;
220  int layE, resE, compE, prcE;
225 } opj_poc_t;
226 
230 typedef struct opj_cparameters {
234  int cp_tx0;
236  int cp_ty0;
238  int cp_tdx;
240  int cp_tdy;
250  char *cp_comment;
252  int csty;
258  int numpocs;
262  float tcp_rates[100];
264  float tcp_distoratio[100];
272  int mode;
279  /* number of precinct size specifications */
280  int res_spec;
285 
293  int index_on;
310 /* UniPG>> */
340 /* <<UniPG */
341 
349  char tp_on;
351  char tp_flag;
353  char tcp_mct;
357 
358 #define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001
359 
363 typedef struct opj_dparameters {
378  int cp_layer;
379 
392 /* UniPG>> */
402 /* <<UniPG */
403 
411 
412  unsigned int flags;
414 
417 #define opj_common_fields \
418  opj_event_mgr_t *event_mgr; \
419  void * client_data; \
420  opj_bool is_decompressor; \
421  OPJ_CODEC_FORMAT codec_format; \
422  void *j2k_handle; \
423  void *jp2_handle; \
424  void *mj2_handle
426 /* Routines that are to be used by both halves of the library are declared
427  * to receive a pointer to this structure. There are no actual instances of
428  * opj_common_struct_t, only of opj_cinfo_t and opj_dinfo_t.
429  */
430 typedef struct opj_common_struct {
431  opj_common_fields; /* Fields common to both master struct types */
432  /* Additional fields follow in an actual opj_cinfo_t or
433  * opj_dinfo_t. All three structs must agree on these
434  * initial fields! (This would be a lot cleaner in C++.)
435  */
437 
439 
443 typedef struct opj_cinfo {
446  /* other specific fields go here */
447 } opj_cinfo_t;
448 
452 typedef struct opj_dinfo {
455  /* other specific fields go here */
456 } opj_dinfo_t;
457 
458 /*
459 ==========================================================
460  I/O stream typedef definitions
461 ==========================================================
462 */
463 
464 /*
465  * Stream open flags.
466  */
468 #define OPJ_STREAM_READ 0x0001
469 
470 #define OPJ_STREAM_WRITE 0x0002
471 
475 typedef struct opj_cio {
478 
480  int openmode;
482  unsigned char *buffer;
484  int length;
485 
487  unsigned char *start;
489  unsigned char *end;
491  unsigned char *bp;
492 } opj_cio_t;
493 
494 /*
495 ==========================================================
496  image typedef definitions
497 ==========================================================
498 */
499 
503 typedef struct opj_image_comp {
505  int dx;
507  int dy;
509  int w;
511  int h;
513  int x0;
515  int y0;
517  int prec;
519  int bpp;
521  int sgnd;
525  int factor;
527  int *data;
529 
533 typedef struct opj_image {
535  int x0;
537  int y0;
539  int x1;
541  int y1;
543  int numcomps;
549  unsigned char *icc_profile_buf;
552 } opj_image_t;
553 
557 typedef struct opj_image_comptparm {
559  int dx;
561  int dy;
563  int w;
565  int h;
567  int x0;
569  int y0;
571  int prec;
573  int bpp;
575  int sgnd;
577 
578 /*
579 ==========================================================
580  Information on the JPEG 2000 codestream
581 ==========================================================
582 */
583 
587 typedef struct opj_packet_info {
593  int end_pos;
595  double disto;
597 
598 
599 /* UniPG>> */
603 typedef struct opj_marker_info_t {
605  unsigned short int type;
607  int pos;
609  int len;
611 /* <<UniPG */
612 
616 typedef struct opj_tp_info {
627 } opj_tp_info_t;
628 
632 typedef struct opj_tile_info {
634  double *thresh;
636  int tileno;
642  int end_pos;
644  int pw[33];
646  int ph[33];
648  int pdx[33];
650  int pdy[33];
654  int numpix;
656  double distotile;
658  int marknum;
664  int num_tps;
668 
672 typedef struct opj_codestream_info {
674  double D_max;
676  int packno;
680  int image_w;
682  int image_h;
686  int tile_x;
688  int tile_y;
690  int tile_Ox;
692  int tile_Oy;
694  int tw;
696  int th;
698  int numcomps;
703 /* UniPG>> */
705  int marknum;
710 /* <<UniPG */
720 
721 #ifdef __cplusplus
722 extern "C" {
723 #endif
724 
725 
726 /*
727 ==========================================================
728  openjpeg version
729 ==========================================================
730 */
731 
732 OPJ_API const char * OPJ_CALLCONV opj_version(void);
733 
734 /*
735 ==========================================================
736  image functions definitions
737 ==========================================================
738 */
739 
748 
754 
755 /*
756 ==========================================================
757  stream functions definitions
758 ==========================================================
759 */
760 
772 OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
773 
779 
791 OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
792 
793 /*
794 ==========================================================
795  event manager functions definitions
796 ==========================================================
797 */
798 
800 
801 /*
802 ==========================================================
803  codec functions definitions
804 ==========================================================
805 */
836 
893 OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
908 
909 
910 #ifdef __cplusplus
911 }
912 #endif
913 
914 #endif /* OPENJPEG_H */
int precno1
Definition: openjpeg.h:208
int jpwl_hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: openjpeg.h:316
void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters)
Set decoding parameters to default values.
Definition: openjpeg.c:118
int dx
Definition: openjpeg.h:222
opj_image_t *OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc)
Create an image.
Definition: image.c:34
int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (&gt;=0)
Definition: openjpeg.h:324
struct opj_dinfo opj_dinfo_t
Decompression context info.
int txE
Definition: openjpeg.h:222
int * cp_matrice
fixed layer
Definition: openjpeg.h:248
struct opj_common_struct opj_common_struct_t
opj_msg_callback info_handler
Debug message callback if available, NULL otherwise.
Definition: openjpeg.h:189
place-holder
Definition: openjpeg.h:119
int res_t
Definition: openjpeg.h:224
int cblockh_init
initial code block height, default to 64
Definition: openjpeg.h:270
int numcomps
number of components in the image
Definition: openjpeg.h:543
int max_comp_size
Maximum rate for each component.
Definition: openjpeg.h:345
int tx1
Definition: openjpeg.h:216
int decod_format
input file format 0: PGX, 1: PxM, 2: BMP 3:TIF
Definition: openjpeg.h:305
opj_image_t *OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio)
Decode an image from a JPEG-2000 codestream.
Definition: openjpeg.c:156
int comp_t
Definition: openjpeg.h:224
#define JPWL_MAX_NO_TILESPECS
Maximum number of tile parts expected by JPWL: increase at your will.
Definition: openjpeg.h:81
int res_spec
Definition: openjpeg.h:280
Decompression context info.
Definition: openjpeg.h:452
void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos)
Set position in byte stream.
Definition: cio.c:109
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:707
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
int cp_fixed_quality
add fixed_quality
Definition: openjpeg.h:246
float tcp_rates[100]
rates of layers
Definition: openjpeg.h:262
opj_event_mgr_t *OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context)
Definition: event.c:65
int tcp_numlayers
number of layers
Definition: openjpeg.h:260
double disto
packet distorsion
Definition: openjpeg.h:595
Message handler object used for.
Definition: openjpeg.h:183
int tile
Tile number.
Definition: openjpeg.h:214
precinct-component-resolution-layer order
Definition: openjpeg.h:123
Index structure : information regarding tiles.
Definition: openjpeg.h:632
int x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:539
Progression order changes.
Definition: openjpeg.h:202
int tile_Ox
Definition: openjpeg.h:690
int packno
packet number
Definition: openjpeg.h:676
int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: openjpeg.h:320
struct opj_codestream_info opj_codestream_info_t
Index structure of the codestream.
struct opj_dparameters opj_dparameters_t
Decompression parameters.
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:660
int start_pos
start position
Definition: openjpeg.h:638
int tyE
Definition: openjpeg.h:222
int cod_format
output file format 0: J2K, 1: JP2, 2: JPT
Definition: openjpeg.h:307
char index[OPJ_PATH_LEN]
DEPRECATED.
Definition: openjpeg.h:295
enum CODEC_FORMAT OPJ_CODEC_FORMAT
Supported codec.
int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (&gt;=0)
Definition: openjpeg.h:322
Not Digital Cinema.
Definition: openjpeg.h:110
int end_pos
end position
Definition: openjpeg.h:642
enum COLOR_SPACE OPJ_COLOR_SPACE
Supported image color spaces.
double distotile
add fixed_quality
Definition: openjpeg.h:656
int layS
Start value, initialised in pi_initialise_encode.
Definition: openjpeg.h:218
int dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid...
Definition: openjpeg.h:559
Index structure : Information concerning tile-parts.
Definition: openjpeg.h:616
int end_pos
packet end position
Definition: openjpeg.h:593
int tyS
Definition: openjpeg.h:222
int cp_tdx
XTsiz.
Definition: openjpeg.h:238
opj_common_fields
Fields shared with opj_cinfo_t.
Definition: openjpeg.h:454
struct opj_image opj_image_t
Defines image data and characteristics.
JPT-stream (JPEG 2000, JPIP) : read only.
Definition: openjpeg.h:148
int prec
precision
Definition: openjpeg.h:517
char infile[OPJ_PATH_LEN]
input file name
Definition: openjpeg.h:289
int index_on
DEPRECATED.
Definition: openjpeg.h:293
int dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid...
Definition: openjpeg.h:505
char * cp_comment
comment for coding
Definition: openjpeg.h:250
int main_head_end
main header position
Definition: openjpeg.h:714
int w
data width
Definition: openjpeg.h:563
opj_bool jpip_on
Enable JPIP indexing.
Definition: openjpeg.h:355
struct opj_cinfo opj_cinfo_t
Compression context info.
resolution-layer-component-precinct order
Definition: openjpeg.h:121
int * numdecompos
number of decomposition for each component
Definition: openjpeg.h:702
opj_cinfo_t *OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format)
Creates a J2K/JP2 compression structure.
Definition: openjpeg.c:177
opj_bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info)
Encode an image into a JPEG-2000 codestream and extract the codestream information.
Definition: openjpeg.c:313
struct opj_poc opj_poc_t
Progression order changes.
OPJ_COLOR_SPACE color_space
color space: sRGB, Greyscale or YUV
Definition: openjpeg.h:545
int prcw_init[J2K_MAXRLVLS]
initial precinct width
Definition: openjpeg.h:282
int layno0
Layer num start,Precinct num start, Precinct num end.
Definition: openjpeg.h:208
int th
number of tiles in Y
Definition: openjpeg.h:696
struct opj_cparameters opj_cparameters_t
Compression parameters.
opj_common_fields
Definition: openjpeg.h:431
int subsampling_dy
subsampling value for dy
Definition: openjpeg.h:303
int compS
Definition: openjpeg.h:218
int x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area...
Definition: openjpeg.h:535
CODEC_FORMAT
Supported codec.
Definition: openjpeg.h:145
int numpocs
number of progression order changes (POC), default to 0
Definition: openjpeg.h:258
OPJ_PROG_ORDER prog_order
progression order (default LRCP)
Definition: openjpeg.h:254
OPJ_CINEMA_MODE cp_cinema
Digital Cinema compliance 0-not compliant, 1-compliant.
Definition: openjpeg.h:343
float tcp_distoratio[100]
different psnr for successive layers
Definition: openjpeg.h:264
struct opj_marker_info_t opj_marker_info_t
Marker structure.
not specified in the codestream
Definition: openjpeg.h:132
component-precinct-resolution-layer order
Definition: openjpeg.h:124
int sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:521
int tile_Oy
Definition: openjpeg.h:692
int marknum
number of markers
Definition: openjpeg.h:705
int jpwl_sens_size
enables writing of ESD, (0=no/1/2 bytes)
Definition: openjpeg.h:328
Definition: openjpeg.h:109
Defines image data and characteristics.
Definition: openjpeg.h:533
void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image)
Setup the encoder parameters using the current image and using user parameters.
Definition: openjpeg.c:288
void OPJ_CALLCONV opj_cio_close(opj_cio_t *cio)
Close and free a CIO handle.
Definition: cio.c:83
layer-resolution-component-precinct order
Definition: openjpeg.h:120
struct opj_image_comptparm opj_image_cmptparm_t
Component parameters structure used by the opj_image_create function.
int w
data width
Definition: openjpeg.h:509
int x0
x component offset compared to the whole image
Definition: openjpeg.h:513
RSIZ_CAPABILITIES
Rsiz Capabilities.
Definition: openjpeg.h:99
unsigned int flags
Definition: openjpeg.h:412
int cp_ty0
YTOsiz.
Definition: openjpeg.h:236
#define OPJ_PATH_LEN
Maximum allowed size for filenames.
Definition: openjpeg.h:75
char tp_flag
Flag for Tile part generation.
Definition: openjpeg.h:351
void(* opj_msg_callback)(const char *msg, void *client_data)
Callback function prototype for events.
Definition: openjpeg.h:172
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1=no,0-7)
Definition: openjpeg.h:338
int resE
Definition: openjpeg.h:220
int jpwl_sens_MH
sensitivity method for MH (-1=no,0-7)
Definition: openjpeg.h:334
struct opj_tp_info opj_tp_info_t
Index structure : Information concerning tile-parts.
int bpp
image depth in bits
Definition: openjpeg.h:519
int prch_init[J2K_MAXRLVLS]
initial precinct height
Definition: openjpeg.h:284
opj_common_struct_t * opj_common_ptr
Definition: openjpeg.h:438
OPJ_PROG_ORDER prog
progression order
Definition: openjpeg.h:684
struct opj_tile_info opj_tile_info_t
Index structure : information regarding tiles.
int pos
position in codestream
Definition: openjpeg.h:607
int prcS
Definition: openjpeg.h:218
int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (&gt;=0)
Definition: openjpeg.h:336
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
Decompression parameters.
Definition: openjpeg.h:363
int lay_t
Temporary values for Tile parts, initialised in pi_create_encode.
Definition: openjpeg.h:224
int roi_compno
region of interest: affected component in [0..3], -1 means no ROI
Definition: openjpeg.h:276
int tile_x
tile size in x
Definition: openjpeg.h:686
int pdy[33]
precinct size (in power of 2), in Y for each resolution level
Definition: openjpeg.h:650
enum LIMIT_DECODING OPJ_LIMIT_DECODING
Limit decoding to certain portions of the codestream.
unsigned char * end
pointer to the end of the stream
Definition: openjpeg.h:489
int tp_end_pos
end position of tile part
Definition: openjpeg.h:622
int tile_y
tile size in y
Definition: openjpeg.h:688
place-holder
Definition: openjpeg.h:146
sRGB
Definition: openjpeg.h:133
int y0
y component offset compared to the whole image
Definition: openjpeg.h:515
int codestream_size
codestream&#39;s size
Definition: openjpeg.h:716
2K Digital Cinema at 24 fps
Definition: openjpeg.h:111
opj_msg_callback warning_handler
Warning message callback if available, NULL otherwise.
Definition: openjpeg.h:187
int y0
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area...
Definition: openjpeg.h:537
double D_max
maximum distortion reduction on the whole image (add for Marcela)
Definition: openjpeg.h:674
opj_poc_t POC[32]
progression order changes
Definition: openjpeg.h:256
int image_offset_y0
subimage encoding: origin image offset in y direction
Definition: openjpeg.h:299
int cod_format
output file format 0: PGX, 1: PxM, 2: BMP
Definition: openjpeg.h:389
JPEG-2000 codestream : read/write.
Definition: openjpeg.h:147
int jpwl_sens_range
sensitivity range (0-3)
Definition: openjpeg.h:332
opj_bool tile_size_on
size of tile: tile_size_on = false (not in argument) or = true (in argument)
Definition: openjpeg.h:232
Byte input-output stream (CIO)
Definition: openjpeg.h:475
struct opj_event_mgr opj_event_mgr_t
Message handler object used for.
int tw
number of tiles in X
Definition: openjpeg.h:694
int end_header
end position of the header
Definition: openjpeg.h:640
int tileno
number of tile
Definition: openjpeg.h:636
resolution-precinct-component-layer order
Definition: openjpeg.h:122
int ty1
Definition: openjpeg.h:216
opj_cio_t *OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length)
Open and allocate a memory stream for read / write.
Definition: cio.c:37
int numcomps
component numbers
Definition: openjpeg.h:698
int numresolution
number of resolutions
Definition: openjpeg.h:266
int prec
precision
Definition: openjpeg.h:571
void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: openjpeg.c:139
int jpwl_sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: openjpeg.h:330
OPJ_PROG_ORDER prg1
Progression order enum.
Definition: openjpeg.h:210
int tx0
Start and end values for Tile width and height.
Definition: openjpeg.h:216
int image_h
image height
Definition: openjpeg.h:682
int jpwl_exp_comps
expected number of components
Definition: openjpeg.h:398
int maxmarknum
actual size of markers array
Definition: openjpeg.h:662
int cp_layer
Set the maximum number of quality layers to decode.
Definition: openjpeg.h:378
enum PROG_ORDER OPJ_PROG_ORDER
Progression order.
void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
Deallocate any resources associated with an image.
Definition: image.c:73
JPEG-2000 file format : read/write.
Definition: openjpeg.h:149
opj_msg_callback error_handler
Error message callback if available, NULL otherwise.
Definition: openjpeg.h:185
grayscale
Definition: openjpeg.h:134
opj_bool jpwl_correct
activates the JPWL correction capabilities
Definition: openjpeg.h:396
int irreversible
1 : use the irreversible DWT 9-7, 0 : use lossless compression (default)
Definition: openjpeg.h:274
int * data
image component data
Definition: openjpeg.h:527
int jpwl_pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: openjpeg.h:326
int tp_numpacks
number of packets of tile part
Definition: openjpeg.h:626
int image_w
image width
Definition: openjpeg.h:680
int cp_fixed_alloc
allocation by fixed layer
Definition: openjpeg.h:244
void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info)
Destroy Codestream information after compression or decompression.
Definition: openjpeg.c:329
void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters)
Set encoding parameters to default values, that means :
Definition: openjpeg.c:230
int cp_disto_alloc
allocation by rate/distortion
Definition: openjpeg.h:242
enum RSIZ_CAPABILITIES OPJ_RSIZ_CAPABILITIES
Rsiz Capabilities.
opj_bool jpwl_epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: openjpeg.h:314
int tp_start_pack
start packet of tile part
Definition: openjpeg.h:624
char outfile[OPJ_PATH_LEN]
output file name
Definition: openjpeg.h:385
YUV.
Definition: openjpeg.h:135
Component parameters structure used by the opj_image_create function.
Definition: openjpeg.h:557
int pdx[33]
precinct size (in power of 2), in X for each resolution level
Definition: openjpeg.h:648
int main_head_start
main header position
Definition: openjpeg.h:712
Defines a single image component.
Definition: openjpeg.h:503
int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (&gt;=0)
Definition: openjpeg.h:318
double * thresh
value of thresh for each layer by tile cfr.
Definition: openjpeg.h:634
int tp_end_header
end position of tile part header
Definition: openjpeg.h:620
char progorder[5]
Progression order string.
Definition: openjpeg.h:212
int layE
End value, initialised in pi_initialise_encode.
Definition: openjpeg.h:220
int dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid...
Definition: openjpeg.h:507
No limitation for the decoding.
Definition: openjpeg.h:156
char infile[OPJ_PATH_LEN]
input file name
Definition: openjpeg.h:383
int resno_decoded
number of decoded resolution
Definition: openjpeg.h:523
COLOR_SPACE
Supported image color spaces.
Definition: openjpeg.h:130
struct opj_cio opj_cio_t
Byte input-output stream (CIO)
char tcp_mct
MCT (multiple component transform)
Definition: openjpeg.h:353
2K Digital Cinema at 48 fps
Definition: openjpeg.h:112
int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
int cblockw_init
initial code block width, default to 64
Definition: openjpeg.h:268
#define OPJ_CALLCONV
Definition: openjpeg.h:45
int cp_tdy
YTsiz.
Definition: openjpeg.h:240
int compno1
Definition: openjpeg.h:206
OPJ_LIMIT_DECODING cp_limit_decoding
Specify whether the decoding should be done on the entire codestream, or be limited to the main heade...
Definition: openjpeg.h:410
int csty
csty : coding style
Definition: openjpeg.h:252
int factor
number of division by 2 of the out image compared to the original size of image
Definition: openjpeg.h:525
PROG_ORDER
Progression order.
Definition: openjpeg.h:118
int subsampling_dx
subsampling value for dx
Definition: openjpeg.h:301
int prcE
Definition: openjpeg.h:220
int bpp
image depth in bits
Definition: openjpeg.h:573
int y0
y component offset compared to the whole image
Definition: openjpeg.h:569
int opj_bool
Definition: openjpeg.h:63
int length
buffer size in bytes
Definition: openjpeg.h:484
int maxmarknum
actual size of markers array
Definition: openjpeg.h:709
int num_tps
number of tile parts
Definition: openjpeg.h:664
int tx0_t
Definition: openjpeg.h:224
struct opj_image_comp opj_image_comp_t
Defines a single image component.
int numpix
add fixed_quality
Definition: openjpeg.h:654
opj_dinfo_t *OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format)
Creates a J2K/JPT/JP2 decompression structure.
Definition: openjpeg.c:65
OPJ_RSIZ_CAPABILITIES cp_rsiz
Profile name.
Definition: openjpeg.h:347
int index_write
writing the packet in the index with t2_encode_packets
Definition: openjpeg.h:678
void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo)
Destroy a decompressor handle.
Definition: openjpeg.c:98
#define OPJ_API
Definition: openjpeg.h:44
#define J2K_MAXRLVLS
Number of maximum resolution level authorized.
Definition: openjpeg.h:77
int jpwl_max_tiles
maximum number of tiles
Definition: openjpeg.h:400
unsigned char * icc_profile_buf
&#39;restricted&#39; ICC profile
Definition: openjpeg.h:549
opj_common_fields
Fields shared with opj_dinfo_t.
Definition: openjpeg.h:445
unsigned char * bp
pointer to the current position
Definition: openjpeg.h:491
int dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid...
Definition: openjpeg.h:561
Definition: openjpeg.h:100
int image_offset_x0
subimage encoding: origin image offset in x direction
Definition: openjpeg.h:297
Index structure : Information concerning a packet inside tile.
Definition: openjpeg.h:587
int numlayers
number of layer
Definition: openjpeg.h:700
OPJ_PROG_ORDER prg
Definition: openjpeg.h:210
int compno0
Definition: openjpeg.h:204
int ty0
Definition: openjpeg.h:216
int len
length, marker val included
Definition: openjpeg.h:609
int precno0
Definition: openjpeg.h:208
opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index)
Encode an image into a JPEG-2000 codestream 3.
Definition: openjpeg.c:305
int tp_start_pos
start position of tile part
Definition: openjpeg.h:618
int h
data height
Definition: openjpeg.h:511
char outfile[OPJ_PATH_LEN]
output file name
Definition: openjpeg.h:291
int roi_shift
region of interest: upshift value
Definition: openjpeg.h:278
int x0
x component offset compared to the whole image
Definition: openjpeg.h:567
int txS
Start and end values of Tile width and height, initialised in pi_initialise_encode.
Definition: openjpeg.h:222
int marknum
number of markers
Definition: openjpeg.h:658
Compression parameters.
Definition: openjpeg.h:230
Standard JPEG2000 profile.
Definition: openjpeg.h:101
int compE
Definition: openjpeg.h:220
Compression context info.
Definition: openjpeg.h:443
int dy
Definition: openjpeg.h:222
int pw[33]
precinct number for each resolution level (width)
Definition: openjpeg.h:644
Profile name for a 2K image.
Definition: openjpeg.h:102
int end_ph_pos
end of packet header position (including EPH marker if it exists)
Definition: openjpeg.h:591
enum CINEMA_MODE OPJ_CINEMA_MODE
Digital cinema operation mode.
CINEMA_MODE
Digital cinema operation mode.
Definition: openjpeg.h:108
Decode everything except the JPEG 2000 packets.
Definition: openjpeg.h:158
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
unsigned short int type
marker type
Definition: openjpeg.h:605
unsigned char * buffer
pointer to the start of the buffer
Definition: openjpeg.h:482
int resno0
Resolution num start, Component num start, given by POC.
Definition: openjpeg.h:204
int prc_t
Definition: openjpeg.h:224
void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo)
Destroy a compressor handle.
Definition: openjpeg.c:210
#define JPWL_MAX_NO_PACKSPECS
Maximum number of packet parts expected by JPWL: increase at your will.
Definition: openjpeg.h:82
int layno1
Layer num end,Resolution num end, Component num end, given by POC.
Definition: openjpeg.h:206
int openmode
open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE
Definition: openjpeg.h:480
not supported by the library
Definition: openjpeg.h:131
opj_common_ptr cinfo
codec context
Definition: openjpeg.h:477
int ph[33]
precinct number for each resolution level (height)
Definition: openjpeg.h:646
Index structure of the codestream.
Definition: openjpeg.h:672
Marker structure.
Definition: openjpeg.h:603
int cp_reduce
Set the number of highest resolution levels to be discarded.
Definition: openjpeg.h:371
int decod_format
input file format 0: J2K, 1: JP2, 2: JPT
Definition: openjpeg.h:387
opj_image_comp_t * comps
image components
Definition: openjpeg.h:547
int resS
Definition: openjpeg.h:218
LIMIT_DECODING
Limit decoding to certain portions of the codestream.
Definition: openjpeg.h:155
int resno1
Definition: openjpeg.h:206
int sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:575
unsigned char * start
pointer to the start of the stream
Definition: openjpeg.h:487
int icc_profile_len
size of ICC profile
Definition: openjpeg.h:551
int y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:541
int mode
mode switch (cblk_style)
Definition: openjpeg.h:272
struct opj_packet_info opj_packet_info_t
Index structure : Information concerning a packet inside tile.
int h
data height
Definition: openjpeg.h:565
Definition: openjpeg.h:430
The decoding is limited to the Main Header.
Definition: openjpeg.h:157
const char *OPJ_CALLCONV opj_version(void)
Definition: openjpeg.c:61
char tp_on
Tile part generation.
Definition: openjpeg.h:349
int cp_tx0
XTOsiz.
Definition: openjpeg.h:234
opj_image_t *OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
Decode an image from a JPEG-2000 codestream and extract the codestream information.
Definition: openjpeg.c:160
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:666
int ty0_t
Definition: openjpeg.h:224