fixed opj_malloc.h for macosx (bugfix provided by janpeder, thanks)
[openjpeg.git] / libopenjpeg / jp2.h
index 2e4623f181780dbfa19e7a39b91b5e09e15bf187..7e363be2eee494346a359d4896339463a1bab609 100644 (file)
@@ -1,7 +1,8 @@
 /*
- * Copyright (c) 2004, Yannick Verschueren
- * Copyright (c) 2005, Herv� Drolon, FreeImage Team
- * Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
+ * Copyright (c) 2002-2003, Yannick Verschueren
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -84,7 +85,6 @@ typedef struct opj_jp2 {
        unsigned int numcl;
        unsigned int *cl;
        opj_jp2_comps_t *comps;
-       opj_image_t *image;
        unsigned int j2k_codestream_offset;
        unsigned int j2k_codestream_length;
 } opj_jp2_t;
@@ -102,6 +102,19 @@ typedef struct opj_jp2_box {
 /*@{*/
 /* ----------------------------------------------------------------------- */
 /**
+Write the JP2H box - JP2 Header box (used in MJ2)
+@param jp2 JP2 handle
+@param cio Output buffer stream
+*/
+void jp2_write_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
+/**
+Read the JP2H box - JP2 Header box (used in MJ2)
+@param jp2 JP2 handle
+@param cio Input buffer stream
+@return Returns true if successful, returns false otherwise
+*/
+bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
+/**
 Creates a JP2 decompression structure
 @param cinfo Codec context info
 @return Returns a handle to a JP2 decompressor if successful, returns NULL otherwise
@@ -123,9 +136,10 @@ 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
+@param cstr_info Codestream information structure if required, NULL otherwise
 @return Returns a decoded image if successful, returns NULL otherwise
 */
-opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio);
+opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
 /**
 Creates a JP2 compression structure
 @param cinfo Codec context info
@@ -150,10 +164,10 @@ 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
+@param cstr_info Codestream information structure 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);
+bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
 /* ----------------------------------------------------------------------- */
 /*@}*/