#define J2K_MS_CRG 0xff63 /**< CRG marker value */
#define J2K_MS_COM 0xff64 /**< COM marker value */
+#define J2K_MS_UNK 0 /**< UNKNOWN marker value */
+
#ifdef TODO_MS
#define J2K_MS_CBD 0xff78 /**< CBD marker value */
#define J2K_MS_MCC 0xff75 /**< MCC marker value */
OPJ_UINT32 tw;
/** number of tiles in heigth */
OPJ_UINT32 th;
- /** packet header storage original buffer */
- OPJ_BYTE *ppm_buffer;
+
+
+
+
/** packet header store there for futur use in t2_decode_packet */
OPJ_BYTE *ppm_data;
/** size of the ppm_data*/
OPJ_UINT32 ppm_len;
+ /** size of the ppm_data*/
+ OPJ_UINT32 ppm_data_read;
+
+ OPJ_BYTE *ppm_data_current;
+
+ /** packet header storage original buffer */
+ OPJ_BYTE *ppm_buffer;
+ /** pointer remaining on the first byte of the first header if ppm is used */
+ OPJ_BYTE *ppm_data_first;
/** Number of bytes actually stored inside the ppm_data */
OPJ_UINT32 ppm_data_size;
+ /** use in case of multiple marker PPM (number of info already store) */
+ OPJ_INT32 ppm_store;
+ /** use in case of multiple marker PPM (case on non-finished previous info) */
+ OPJ_INT32 ppm_previous;
+
/** tile coding parameters */
opj_tcp_v2_t *tcps;
union
OPJ_UINT32 m_current_tile_number;
/** pointer to the encoded / decoded image */
- opj_image_t *m_image;
+ //opj_image_t *m_image;
+ opj_image_header_t* m_image_header;
/** Coding parameters */
opj_cp_v2_t m_cp;
struct opj_procedure_list * m_validation_list;
/** helper used to write the index file */
- opj_codestream_info_t *cstr_info;
+ opj_codestream_info_v2_t *cstr_info;
/** the current tile coder/decoder **/
struct opj_tcd_v2 * m_tcd;
@param parameters decompression parameters
*/
void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters);
+
+void j2k_setup_decoder_v2(opj_j2k_v2_t *j2k, opj_dparameters_t *parameters);
+
/**
Decode an image from a JPEG-2000 codestream
@param j2k J2K decompressor handle
@return Returns a handle to a J2K compressor if successful, returns NULL otherwise
*/
opj_j2k_t* j2k_create_compress(opj_common_ptr cinfo);
+
+/**
+Creates a J2K compression structure
+@param cinfo Codec context info
+@return Returns a handle to a J2K compressor if successful, returns NULL otherwise
+*/
+opj_j2k_v2_t* j2k_create_compress_v2();
+
/**
Destroy a J2K compressor handle
@param j2k J2K compressor handle to destroy
* Ends the decompression procedures and possibiliy add data to be read after the
* codestream.
*/
-opj_bool j2k_end_decompress(opj_j2k_t *j2k, struct opj_stream_private *cio, struct opj_event_mgr * p_manager);
+opj_bool j2k_end_decompress(opj_j2k_v2_t *j2k, struct opj_stream_private *cio, struct opj_event_mgr * p_manager);
/**
* Reads a jpeg2000 codestream header structure.
*
* @return true if the box is valid.
*/
-opj_bool j2k_read_header(
- opj_j2k_v2_t *p_j2k,
- struct opj_image ** p_image,
- OPJ_INT32 * p_tile_x0,
- OPJ_INT32 * p_tile_y0,
- OPJ_UINT32 * p_tile_width,
- OPJ_UINT32 * p_tile_height,
- OPJ_UINT32 * p_nb_tiles_x,
- OPJ_UINT32 * p_nb_tiles_y,
- struct opj_stream_private *cio,
- struct opj_event_mgr * p_manager
- );
+opj_bool j2k_read_header( struct opj_stream_private *p_stream,
+ opj_j2k_v2_t* p_j2k,
+ opj_file_info_t * p_file_info,
+ struct opj_event_mgr* p_manager );
+
/**
* Destroys a jpeg2000 codec.