#ifndef OPENJPEG_H
#define OPENJPEG_H
-#define OPENJPEG_VERSION "1.2.0"
+#define OPENJPEG_VERSION "1.3.0"
/*
==========================================================
char infile[OPJ_PATH_LEN];
/** output file name */
char outfile[OPJ_PATH_LEN];
+ /** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */
+ int index_on;
+ /** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */
+ char index[OPJ_PATH_LEN];
/** subimage encoding: origin image offset in x direction */
int image_offset_x0;
/** subimage encoding: origin image offset in y direction */
/** pointer to the start of the buffer */
unsigned char *buffer;
/** buffer size in bytes */
- unsigned int length;
+ int length;
/** pointer to the start of the stream */
unsigned char *start;
int tp_end_header;
/** end position of tile part */
int tp_end_pos;
+ /** start packet of tile part */
+ int tp_start_pack;
/** number of packets of tile part */
int tp_numpacks;
} opj_tp_info_t;
int marknum;
/** list of markers */
opj_marker_info_t *marker;
+ /** actual size of markers array */
+ int maxmarknum;
/* <<UniPG */
/** main header position */
int main_head_start;
*/
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
/**
-Decode an image from a JPEG-2000 codestream
+Decode an image from a JPEG-2000 codestream
+@param dinfo decompressor handle
+@param cio Input buffer stream
+@return Returns a decoded image if successful, returns NULL otherwise
+*/
+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 and extract the codestream information
@param dinfo decompressor handle
@param cio Input buffer stream
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
-OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
+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);
/**
Creates a J2K/JP2 compression structure
@param format Coder to select
@param cinfo compressor handle
@param cio Output buffer stream
@param image Image to encode
+@param index Depreacted -> Set to NULL. To extract index, used opj_encode_wci()
+@return Returns true if successful, returns false otherwise
+*/
+OPJ_API 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 and extract the codestream information
+@param cinfo compressor handle
+@param cio Output buffer stream
+@param image Image to encode
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
-OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
+OPJ_API 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);
/**
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure