fixed "tiffio" header inclusion to use user version on Win32 system only (otherwise...
[openjpeg.git] / jpwl / jpwl.h
index a533e3a371439a90eae2763780dae6e9811f23fe..a96840ccf9f4ab8b5a013948a5b33cb4d74ccc24 100644 (file)
@@ -179,7 +179,7 @@ typedef struct jpwl_marker {
        /** marker value (J2K_MS_EPC, etc.) */
        int id;
        /** union keeping the pointer to the real marker struct */
-       union {
+       union jpwl_marks {
                /** pointer to EPB marker */
                jpwl_epb_ms_t *epbmark;
                /** pointer to EPC marker */
@@ -188,7 +188,7 @@ typedef struct jpwl_marker {
                jpwl_esd_ms_t *esdmark;
                /** pointer to RED marker */
                jpwl_red_ms_t *redmark;
-       };
+       } m;
        /** position where the marker should go, in the pre-JPWL codestream */ 
        unsigned long int pos;
        /** same as before, only written as a double, so we can sort it better */
@@ -205,6 +205,14 @@ typedef struct jpwl_marker {
        bool data_ready;
 }      jpwl_marker_t;
 
+/**
+Encode according to JPWL specs
+@param j2k J2K handle
+@param cio codestream handle
+@param image image handle
+*/
+void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
+
 /**
 Prepare the list of JPWL markers, after the Part 1 codestream
 has been finalized (index struct is full)
@@ -227,6 +235,7 @@ Read the EPC marker (Error Protection Capability)
 @param j2k J2K handle
 */
 void j2k_read_epc(opj_j2k_t *j2k);
+
 /**
 Write the EPC marker (Error Protection Capability), BUT the DL field is always set to 0
 (this simplifies the management of EPBs and it is openly stated in the standard
@@ -235,21 +244,25 @@ are not yet implemented
 @param j2k J2K handle
 */
 void j2k_write_epc(opj_j2k_t *j2k);
+
 /**
 Read the EPB marker (Error Protection Block)
 @param j2k J2K handle
 */
 void j2k_read_epb(opj_j2k_t *j2k);
+
 /**
 Write the EPB marker (Error Protection Block)
 @param j2k J2K handle
 */
 void j2k_write_epb(opj_j2k_t *j2k);
+
 /**
 Read the ESD marker (Error Sensitivity Descriptor)
 @param j2k J2K handle
 */
 void j2k_read_esd(opj_j2k_t *j2k);
+
 /**
 Read the RED marker (Residual Error Descriptor)
 @param j2k J2K handle
@@ -321,6 +334,8 @@ bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf);
 
 bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf);
 
+void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len);
+
 /** corrects the data in the JPWL codestream
 @param j2k J2K compressor handle
 @return true if correction is performed correctly
@@ -365,8 +380,46 @@ and get the CRC at the end
 */
 #define jpwl_updateCRC32(CRC, DATA) updateCRC32(CRC, DATA)
 
+/**
+Computes the minimum between two integers
+@param a first integer to compare
+@param b second integer to compare
+@return returns the minimum integer between a and b
+*/
+#ifndef min
+#define min(a,b)    (((a) < (b)) ? (a) : (b))
+#endif /* min */
+
 /*@}*/
 
 #endif /* USE_JPWL */
 
+#ifdef USE_JPSEC
+
+/** @defgroup JPSEC JPSEC - JPEG-2000 Part 8 (JPSEC) codestream manager */
+/*@{*/
+
+/**
+Read the SEC marker (SEcured Codestream)
+@param j2k J2K handle
+*/
+void j2k_read_sec(opj_j2k_t *j2k);
+
+/**
+Write the SEC marker (SEcured Codestream)
+@param j2k J2K handle
+*/
+void j2k_write_sec(opj_j2k_t *j2k);
+
+/**
+Read the INSEC marker (SEcured Codestream)
+@param j2k J2K handle
+*/
+void j2k_read_insec(opj_j2k_t *j2k);
+
+/*@}*/
+
+#endif /* USE_JPSEC */
+
 #endif /* __JPWL_H */
+