#endif
#if defined(OPJ_STATIC) || !defined(_WIN32)
+/* http://gcc.gnu.org/wiki/Visibility */
+#if __GNUC__ >= 4
+#define OPJ_API __attribute__ ((visibility ("default")))
+#define OPJ_LOCAL __attribute__ ((visibility ("hidden")))
+#else
#define OPJ_API
+#define OPJ_LOCAL
+#endif
#define OPJ_CALLCONV
#else
#define OPJ_CALLCONV __stdcall
-/** SHOULD BE MOVE IN EVET.H when we remove old functions
+/** SHOULD BE MOVE IN EVET.H when we remove old functions TODO MSD
Message handler object
used for
<ul>
/**
* Creates an image without allocating memory for the image (used in the new version of the library).
*
- * @param p_num_cmpts the number of components
- * @param p_cmpt_parms the components parameters
- * @param p_clr_spc the image color space
+ * @param numcmpts the number of components
+ * @param cmptparms the components parameters
+ * @param clrspc the image color space
*
* @return a new image structure if successful, NULL otherwise.
*/
/**
* Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.
*
- * @param l_is_reader if set to true then the stream will be an input stream, an output stream else.
+ * @param p_is_input if set to true then the stream will be an input stream, an output stream else.
*
* @return a stream object.
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(opj_bool p_is_input);
+
+/**
+ * Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.
+ *
+ * @param p_buffer_size FIXME DOC
+ * @param p_is_input if set to true then the stream will be an input stream, an output stream else.
+ *
+ * @return a stream object.
+*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size, opj_bool p_is_input);
/**
/**
* Sets the length of the user data for the stream.
- * @param p_stream the stream to modify
- * @param data_length length of the user_data.
+ *
+ * @param p_stream the stream to modify
+ * @param data_length length of the user_data.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream, OPJ_UINT64 data_length);
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (FILE * p_file, opj_bool p_is_read_stream);
+
+/**
+ * FIXME DOC
+ * @param p_file the file stream to operate on
+ * @param p_buffer_size FIXME DOC
+ * @param p_is_read_stream FIXME DOC
+*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (FILE * p_file, OPJ_SIZE_T p_buffer_size, opj_bool p_is_read_stream);
/* -----------> */
OPJ_API opj_bool OPJ_CALLCONV opj_set_warning_handler(opj_codec_t * p_codec, opj_msg_callback p_callback,void * p_user_data);
OPJ_API opj_bool OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec, opj_msg_callback p_callback,void * p_user_data);
-/**
- */
-DEPRECATED( OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context));
-
/*
==========================================================
codec functions definitions
* */
OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
-/**
-Destroy a decompressor handle
-@param dinfo decompressor handle to destroy
-*/
-DEPRECATED( OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo) );
-
/**
* Destroy a decompressor handle
*
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
-/**
-Setup the decoder decoding parameters using user parameters.
-Decoding parameters are returned in j2k->cp.
-@param dinfo decompressor handle
-@param parameters decompression parameters
-*/
-DEPRECATED( OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters) );
-
-
/**
* Setup the decoder with decompression parameters provided by the user and with the message handler
* provided by the user.
*
* @return true if the decoder is correctly set
*/
-OPJ_API opj_bool OPJ_CALLCONV opj_setup_decoder_v2( opj_codec_t *p_codec,
- opj_dparameters_t *parameters );
+OPJ_API opj_bool OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec,
+ opj_dparameters_t *parameters );
/**
* Decodes an image header.
* Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.
*
* @param p_codec the jpeg2000 codec.
+ * @param p_image FIXME DOC
* @param p_start_x the left position of the rectangle to decode (in image coordinates).
* @param p_end_x the right position of the rectangle to decode (in image coordinates).
* @param p_start_y the up position of the rectangle to decode (in image coordinates).
OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
OPJ_INT32 p_end_x, OPJ_INT32 p_end_y );
-/**
-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
-*/
-DEPRECATED( 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
* @param p_decompressor decompressor handle
* @param p_image the decoded image
* @return true if success, otherwise false
* */
-OPJ_API opj_bool OPJ_CALLCONV opj_decode_v2(opj_codec_t *p_decompressor,
- opj_stream_t *p_stream,
- opj_image_t *p_image);
+OPJ_API opj_bool OPJ_CALLCONV opj_decode( opj_codec_t *p_decompressor,
+ opj_stream_t *p_stream,
+ opj_image_t *p_image);
/**
* Get the decoded tile from the codec
/**
* Writes a tile with the given data.
*
- * @param p_compressor the jpeg2000 codec.
+ * @param p_codec the jpeg2000 codec.
* @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.
* @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.
- * @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,
- * depending on the precision of the given component.
+ * @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, depending on the precision of the given component.
* @param p_stream the stream to write data to.
*
* @return true if the data could be written.
OPJ_UINT32 p_data_size,
opj_stream_t *p_stream );
-/**
-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
-*/
-DEPRECATED( 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) );
-
/* COMPRESSION FUNCTIONS*/
-/**
-Creates a J2K/JP2 compression structure
-@param format Coder to select
-@return Returns a handle to a compressor if successful, returns NULL otherwise
-*/
-DEPRECATED( OPJ_API opj_cinfo_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format));
-
/**
* Creates a J2K/JP2 compression structure
* @param format Coder to select
* @return Returns a handle to a compressor if successful, returns NULL otherwise
*/
-OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress_v2(OPJ_CODEC_FORMAT format);
-
-/**
-Destroy a compressor handle
-@param cinfo compressor handle to destroy
-*/
-DEPRECATED(OPJ_API void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo) );
+OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format);
/**
Set encoding parameters to default values, that means :
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
-/**
-Setup the encoder parameters using the current image and using user parameters.
-@param cinfo Compressor handle
-@param parameters Compression parameters
-@param image Input filled image
-*/
-DEPRECATED(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.
* @param p_codec Compressor handle
* @param parameters Compression parameters
* @param image Input filled image
*/
-OPJ_API opj_bool OPJ_CALLCONV opj_setup_encoder_v2( opj_codec_t *p_codec,
- opj_cparameters_t *parameters,
- opj_image_t *image);
+OPJ_API opj_bool OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec,
+ opj_cparameters_t *parameters,
+ opj_image_t *image);
/**
*/
* Encode an image into a JPEG-2000 codestream
* @param p_codec compressor handle
* @param p_stream Output buffer stream
- * @param image Image to encode
*
* @return Returns true if successful, returns false otherwise
*/
-OPJ_API opj_bool OPJ_CALLCONV opj_encode_v2(opj_codec_t *p_codec,
- opj_stream_t *p_stream);
-
-/**
-Encode an image into a JPEG-2000 codestream
-3@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
-*/
-DEPRECATED( 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 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
-*/
-DEPRECATED( 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) );
+OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_codec_t *p_codec,
+ opj_stream_t *p_stream);
/**
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure
*/
-OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info);
-
-OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info_v2(opj_codestream_info_v2_t **cstr_info);
+OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_info);