Modifications made to enable the decoding of a J2K file headers without decoding...
[openjpeg.git] / libopenjpeg / j2k.h
index aafa9de6dc7c511a4438849e1b56e180ece8c15a..2ebdeb2c613c9574bd145298b73d427ca645409a 100644 (file)
 
 #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 */
+#define J2K_CFMT 0
+#define JP2_CFMT 1
+#define JPT_CFMT 2
+#define MJ2_CFMT 3
+#define PXM_DFMT 0
+#define PGX_DFMT 1
+#define BMP_DFMT 2
+#define YUV_DFMT 3
 
 #define J2K_CP_CSTY_PRT 0x01
 #define J2K_CP_CSTY_SOP 0x02
@@ -125,14 +133,14 @@ typedef struct {
 } j2k_tcp_t;
 
 typedef struct {
-  int JPEG2000_format;         /* 0: J2K   1:JP2 */
   int intermed_file;           /* 1: Store each encoded tile one by one in the output file (for mega-Images)*/
-  int image_type;              /* 0: PNM, PGM, PPM 1: PGX           */
+  int decod_format;            /* 0: PGX, 1: PxM, 2: BMP */
+  int cod_format;              /* 0: J2K, 1: JP2, 2: JPT */
   int disto_alloc;             /* Allocation by rate/distortion     */
   int fixed_alloc;             /* Allocation by fixed layer         */
   int fixed_quality;           /* add fixed_quality */
-  int reduce_on;               /* option reduce is used if reduce = 1 */
-  int reduce_value;            /* if option reduce is used -> original dimension divided by 2^value */
+  int reduce;                  /* if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */
+  int layer;                   /* if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
   int index_on;                        /* 0 = no index || 1 = index */
   int tx0, ty0;                        /* XTOsiz, YTOsiz                    */
   int tdx, tdy;                        /* XTsiz, YTsiz                      */
@@ -176,6 +184,7 @@ typedef struct {
   int Im_w, Im_h;              /* Image width and Height                                */
   int Prog;                    /* progression order                                     */
   int Tile_x, Tile_y;          /* Tile size in x and y                                  */
+  int Tile_Ox, Tile_Oy;
   int tw, th;                  /* Number of Tile in X and Y                             */
   int Comp;                    /* Component numbers                                     */
   int Layer;                   /* number of layer                                       */
@@ -220,4 +229,6 @@ LIBJ2K_API int j2k_decode(unsigned char *src, int len, j2k_image_t * img,
 int j2k_decode_jpt_stream(unsigned char *src, int len, j2k_image_t * img,
                          j2k_cp_t * cp);
 
+void j2k_dec_release();//antonin
+
 #endif