43 #if defined(OPJ_STATIC) || !defined(_WIN32) 47 #define OPJ_CALLCONV __stdcall 56 #if defined(OPJ_EXPORTS) || defined(DLL_EXPORT) 57 #define OPJ_API __declspec(dllexport) 59 #define OPJ_API __declspec(dllimport) 68 #define OPJ_ARG_NOT_USED(x) (void)(x) 75 #define OPJ_PATH_LEN 4096 77 #define J2K_MAXRLVLS 33 78 #define J2K_MAXBANDS (3*J2K_MAXRLVLS-2) 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 138 #define ENUMCS_SRGB 16 139 #define ENUMCS_GRAY 17 140 #define ENUMCS_SYCC 18 222 int txS,txE,
tyS,tyE,dx,dy;
224 int lay_t, res_t, comp_t, prc_t,tx0_t,
ty0_t;
262 float tcp_rates[100];
264 float tcp_distoratio[100];
358 #define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001 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; \ 468 #define OPJ_STREAM_READ 0x0001 470 #define OPJ_STREAM_WRITE 0x0002 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
struct opj_dinfo opj_dinfo_t
Decompression context info.
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
OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos)
Set position in byte stream.
Definition: cio.c:109
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 decod_format
input file format 0: PGX, 1: PxM, 2: BMP 3:TIF
Definition: openjpeg.h:305
#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
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
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
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 cod_format
output file format 0: J2K, 1: JP2, 2: JPT
Definition: openjpeg.h:307
OPJ_API 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
enum CODEC_FORMAT OPJ_CODEC_FORMAT
Supported codec.
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 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
OPJ_API void OPJ_CALLCONV opj_cio_close(opj_cio_t *cio)
Close and free a CIO handle.
Definition: cio.c:83
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
OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
Deallocate any resources associated with an image.
Definition: image.c:73
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
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 th
number of tiles in Y
Definition: openjpeg.h:696
struct opj_cparameters opj_cparameters_t
Compression parameters.
void(* opj_msg_callback)(const char *msg, void *client_data)
Callback function prototype for events.
Definition: openjpeg.h:172
opj_common_fields
Definition: openjpeg.h:431
int subsampling_dy
subsampling value for dy
Definition: openjpeg.h:303
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
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
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
int resE
Definition: openjpeg.h:220
OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo)
Destroy a decompressor handle.
Definition: openjpeg.c:98
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
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
OPJ_API 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
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters)
Set encoding parameters to default values, that means :
Definition: openjpeg.c:230
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
Decompression parameters.
Definition: openjpeg.h:363
OPJ_API 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 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
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'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
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
int numcomps
component numbers
Definition: openjpeg.h:698
OPJ_API const char *OPJ_CALLCONV opj_version(void)
Definition: openjpeg.c:61
OPJ_API opj_dinfo_t *OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format)
Creates a J2K/JPT/JP2 decompression structure.
Definition: openjpeg.c:65
int numresolution
number of resolutions
Definition: openjpeg.h:266
int prec
precision
Definition: openjpeg.h:571
OPJ_API 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 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 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.
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 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
OPJ_API 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
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
YUV.
Definition: openjpeg.h:135
Component parameters structure used by the opj_image_create function.
Definition: openjpeg.h:557
int main_head_start
main header position
Definition: openjpeg.h:712
Defines a single image component.
Definition: openjpeg.h:503
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
OPJ_API 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 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
int resno_decoded
number of decoded resolution
Definition: openjpeg.h:523
COLOR_SPACE
Supported image color spaces.
Definition: openjpeg.h:130
OPJ_API int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
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 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
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
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters)
Set decoding parameters to default values.
Definition: openjpeg.c:118
PROG_ORDER
Progression order.
Definition: openjpeg.h:118
int subsampling_dx
subsampling value for dx
Definition: openjpeg.h:301
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
struct opj_image_comp opj_image_comp_t
Defines a single image component.
int numpix
add fixed_quality
Definition: openjpeg.h:654
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
#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
'restricted' 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
int len
length, marker val included
Definition: openjpeg.h:609
int tp_start_pos
start position of tile part
Definition: openjpeg.h:618
int h
data height
Definition: openjpeg.h:511
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
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info)
Destroy Codestream information after compression or decompression.
Definition: openjpeg.c:329
int marknum
number of markers
Definition: openjpeg.h:658
Compression parameters.
Definition: openjpeg.h:230
Standard JPEG2000 profile.
Definition: openjpeg.h:101
Compression context info.
Definition: openjpeg.h:443
OPJ_API 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
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
#define JPWL_MAX_NO_PACKSPECS
Maximum number of packet parts expected by JPWL: increase at your will.
Definition: openjpeg.h:82
OPJ_API void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo)
Destroy a compressor handle.
Definition: openjpeg.c:210
OPJ_API 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 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
OPJ_API 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
OPJ_API opj_cinfo_t *OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format)
Creates a J2K/JP2 compression structure.
Definition: openjpeg.c:177
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
char tp_on
Tile part generation.
Definition: openjpeg.h:349
int cp_tx0
XTOsiz.
Definition: openjpeg.h:234
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:666
int ty0_t
Definition: openjpeg.h:224