-/* int jp2_write_jp2h(jp2_struct_t * jp2_struct);
- *
- * Write the jp2h header box
- * jp2_struct: the jp2 structure you are working with
- */
-void jp2_write_jp2h(jp2_struct_t * jp2_struct);
-
-/* int jp2_read_jp2h(jp2_struct_t * jp2_struct);
- *
- * Read the jp2h header box
- * jp2_struct: the jp2 structure you are working with
- */
-int jp2_read_jp2h(jp2_struct_t * jp2_struct);
-
-/* int jp2_wrap_j2k(jp2_struct_t * jp2_struct, char *j2k_codestream,
- int j2k_len, char *output)
- *
- * Wrap a J2K codestream in a JP2 file
- * jp2_struct: the jp2 structure used to create jp2 boxes
- * j2k_codestream: the j2k codestream to include in jp2 file
- * output: pointer to jp2 codestream that will be created
- */
-int jp2_wrap_j2k(jp2_struct_t * jp2_struct, char *j2k_codestream,
- char *output);
+/** @name Exported functions */
+/*@{*/
+/* ----------------------------------------------------------------------- */
+/**
+Creates a JP2 decompression structure
+@param cinfo Codec context info
+@return Returns a handle to a JP2 decompressor if successful, returns NULL otherwise
+*/
+opj_jp2_t* jp2_create_decompress(opj_common_ptr cinfo);
+/**
+Destroy a JP2 decompressor handle
+@param jp2 JP2 decompressor handle to destroy
+*/
+void jp2_destroy_decompress(opj_jp2_t *jp2);
+/**
+Setup the decoder decoding parameters using user parameters.
+Decoding parameters are returned in jp2->j2k->cp.
+@param jp2 JP2 decompressor handle
+@param parameters decompression parameters
+*/
+void jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters);
+/**
+Decode an image from a JPEG-2000 file stream
+@param jp2 JP2 decompressor handle
+@param cio Input buffer stream
+@return Returns a decoded image if successful, returns NULL otherwise
+*/
+opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio);
+/**
+Creates a JP2 compression structure
+@param cinfo Codec context info
+@return Returns a handle to a JP2 compressor if successful, returns NULL otherwise
+*/
+opj_jp2_t* jp2_create_compress(opj_common_ptr cinfo);
+/**
+Destroy a JP2 compressor handle
+@param jp2 JP2 compressor handle to destroy
+*/
+void jp2_destroy_compress(opj_jp2_t *jp2);
+/**
+Setup the encoder parameters using the current image and using user parameters.
+Coding parameters are returned in jp2->j2k->cp.
+@param jp2 JP2 compressor handle
+@param parameters compression parameters
+@param image input filled image
+*/
+void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
+/**
+Encode an image into a JPEG-2000 file stream
+@param jp2 JP2 compressor handle
+@param cio Output buffer stream
+@param image Image to encode
+@param index Name of the index file if required, NULL otherwise
+@return Returns true if successful, returns false otherwise
+*/
+bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, char *index);
+/* ----------------------------------------------------------------------- */
+/*@}*/