[trunk]remove t2_init_seg
[openjpeg.git] / libopenjpeg / openjpeg.h
index 6473b2c8a89c19b001b4cc246457a7900ae69e49..de1576ff6755420c797e998e147f6f68dd185777 100644 (file)
 #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
@@ -221,7 +228,7 @@ typedef void (*opj_msg_callback) (const char *msg, void *client_data);
 
 
 
-/** 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>
@@ -1051,9 +1058,9 @@ OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
 /**
  * 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.
 */
@@ -1104,11 +1111,20 @@ OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
 /**
  * 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);
 
 /**
@@ -1156,8 +1172,9 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void
 
 /**
  * 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);
 
@@ -1168,6 +1185,13 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream
  * @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);
 
 /* -----------> */
@@ -1181,10 +1205,6 @@ OPJ_API opj_bool OPJ_CALLCONV opj_set_info_handler(opj_codec_t * p_codec, opj_ms
 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
@@ -1199,12 +1219,6 @@ DEPRECATED( OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_p
  * */
 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
  *
@@ -1227,15 +1241,6 @@ OPJ_API opj_bool OPJ_CALLCONV opj_end_decompress (       opj_codec_t *p_codec,
  */
 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.
@@ -1245,8 +1250,8 @@ DEPRECATED( OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_
  *
  * @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.
@@ -1265,6 +1270,7 @@ OPJ_API opj_bool OPJ_CALLCONV opj_read_header (   opj_stream_t *p_stream,
  * 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).
@@ -1277,14 +1283,6 @@ OPJ_API opj_bool OPJ_CALLCONV opj_set_decode_area(       opj_codec_t *p_codec,
                                                                                                        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
@@ -1292,9 +1290,9 @@ DEPRECATED( OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj
  * @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
@@ -1322,11 +1320,10 @@ OPJ_API opj_bool OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_c
 /**
  * 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.
@@ -1385,36 +1382,14 @@ OPJ_API opj_bool OPJ_CALLCONV opj_decode_tile_data(     opj_codec_t *p_codec,
                                                                                                        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 : 
@@ -1439,23 +1414,15 @@ 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);
 
 /**
  */
@@ -1472,40 +1439,18 @@ OPJ_API opj_bool OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec,
  * 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);