Added option for Digital cinema profile compliant codestream. This can be chosen...
[openjpeg.git] / libopenjpeg / openjpeg.h
index 92caa5615c0c9bd04fc50491f40b7422a4a9b75c..d5543b926d2d9a9ee30db923ecfe74c718cf680a 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef OPENJPEG_H
 #define OPENJPEG_H
 
-#define OPENJPEG_VERSION "1.1.0"
+#define OPENJPEG_VERSION "1.1.1"
 
 /* 
 ==========================================================
@@ -90,9 +90,7 @@ braindamage below.
 ==========================================================
 */
 
-#ifndef MAX_PATH
-#define MAX_PATH 260   /**< Maximum allowed size for filenames */
-#endif /* MAX_PATH */
+#define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */
 
 #define J2K_MAXRLVLS 33                                        /**< Number of maximum resolution level authorized */
 #define J2K_MAXBANDS (3*J2K_MAXRLVLS-2)        /**< Number of maximum sub-band linked to number of resolution level */
@@ -115,6 +113,19 @@ braindamage below.
 ==========================================================
 */
 
+typedef enum RSIZ_CAPABILITIES {
+       STD_RSIZ = 0,
+       CINEMA2K = 3,           /** Profile name for a 2K image*/
+       CINEMA4K = 4            /** Profile name for a 4K image*/
+} OPJ_RSIZ_CAPABILITIES;
+
+typedef enum CINEMA_MODE {
+       OFF = 0,
+       CINEMA2K_24 = 1,
+       CINEMA2K_48 = 2,
+       CINEMA4K_24 = 3
+}OPJ_CINEMA_MODE;
+
 /** Progression order */
 typedef enum PROG_ORDER {
        PROG_UNKNOWN = -1,      /**< place-holder */
@@ -145,6 +156,14 @@ typedef enum CODEC_FORMAT {
        CODEC_JP2 = 2           /**< JPEG-2000 file format : read/write */
 } OPJ_CODEC_FORMAT;
 
+/** 
+Limit decoding to certain portions of the codestream. 
+*/
+typedef enum LIMIT_DECODING {
+       NO_LIMITATION = 0,                              /**< No limitation for the decoding. The entire codestream will de decoded */
+       LIMIT_TO_MAIN_HEADER = 1        /**< The decoding is limited to the Main Header */
+} OPJ_LIMIT_DECODING;
+
 /* 
 ==========================================================
    event manager typedef definitions
@@ -198,6 +217,12 @@ typedef struct opj_poc {
 Compression parameters
 */
 typedef struct opj_cparameters {
+       /** Digital Cinema compliance 0-not compliant, 1-compliant*/
+       OPJ_CINEMA_MODE cp_cinema;
+       /** Progression order*/
+       char cp_prog[4];
+       /** Profile name*/
+       OPJ_RSIZ_CAPABILITIES cp_rsiz;
        /** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
        bool tile_size_on;
        /** XTOsiz */
@@ -256,13 +281,13 @@ typedef struct opj_cparameters {
        /**@name command line encoder parameters (not used inside the library) */
        /*@{*/
        /** input file name */
-       char infile[MAX_PATH];
+       char infile[OPJ_PATH_LEN];
        /** output file name */
-       char outfile[MAX_PATH];
+       char outfile[OPJ_PATH_LEN];
        /** creation of an index file, default to 0 (false) */
        int index_on;
        /** index file name */
-       char index[MAX_PATH];
+       char index[OPJ_PATH_LEN];
        /** subimage encoding: origin image offset in x direction */
        int image_offset_x0;
        /** subimage encoding: origin image offset in y direction */
@@ -271,7 +296,7 @@ typedef struct opj_cparameters {
        int subsampling_dx;
        /** subsampling value for dy */
        int subsampling_dy;
-       /** input file format 0: PGX, 1: PxM, 2: BMP */
+       /** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/
        int decod_format;
        /** output file format 0: J2K, 1: JP2, 2: JPT */
        int cod_format;
@@ -333,12 +358,20 @@ typedef struct opj_dparameters {
        */
        int cp_layer;
 
+       /** 
+       Specify whether the decoding should be done on the entire codestream, or be limited to the main header
+       Limiting the decoding to the main header makes it possible to extract the characteristics of the codestream
+       if == NO_LIMITATION, the entire codestream is decoded; 
+       if == LIMIT_TO_MAIN_HEADER, only the main header is decoded; 
+       */
+       OPJ_LIMIT_DECODING cp_limit_decoding;
+
        /**@name command line encoder parameters (not used inside the library) */
        /*@{*/
        /** input file name */
-       char infile[MAX_PATH];
+       char infile[OPJ_PATH_LEN];
        /** output file name */
-       char outfile[MAX_PATH];
+       char outfile[OPJ_PATH_LEN];
        /** input file format 0: J2K, 1: JP2, 2: JPT */
        int decod_format;
        /** output file format 0: PGX, 1: PxM, 2: BMP */
@@ -352,9 +385,9 @@ typedef struct opj_dparameters {
        /** activates the JPWL correction capabilities */
        bool jpwl_correct;
        /** expected number of components */
-       bool jpwl_exp_comps;
+       int jpwl_exp_comps;
        /** maximum number of tiles */
-       bool jpwl_max_tiles;
+       int jpwl_max_tiles;
        /*@}*/
 #endif /* USE_JPWL */
 /* <<UniPG */