+
+
+/**
+Defines a single image component characteristics (uses in new API)
+*/
+typedef struct opj_image_comp_header {
+ /** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
+ int dx;
+ /** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
+ int dy;
+ /** data width */
+ int w;
+ /** data height */
+ int h;
+ /** x component offset compared to the whole image */
+ int x0;
+ /** y component offset compared to the whole image */
+ int y0;
+ /** precision */
+ int prec;
+ /** image depth in bits */
+ int bpp;
+ /** signed (1) / unsigned (0) */
+ int sgnd;
+ /** number of decoded resolution */
+ int resno_decoded;
+ /** number of division by 2 of the out image compared to the original size of image */
+ int factor;
+} opj_image_comp_header_t;
+
+/**
+Defines image characteristics (uses in new API)
+*/
+typedef struct opj_image_header {
+ /** XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area */
+ OPJ_UINT32 x0;
+ /** YOsiz: vertical offset from the origin of the reference grid to the top side of the image area */
+ OPJ_UINT32 y0;
+ /** Xsiz: width of the reference grid */
+ OPJ_UINT32 x1;
+ /** Ysiz: height of the reference grid */
+ OPJ_UINT32 y1;
+ /** number of components in the image */
+ OPJ_UINT16 numcomps;
+ /** color space: sRGB, Greyscale or YUV */
+ OPJ_COLOR_SPACE color_space;
+ /** image components */
+ opj_image_comp_header_t *comps;
+
+#ifdef TODO_MSD
+ /** XTOsiz */
+ OPJ_UINT32 tile_x0;
+ /** YTOsiz */
+ OPJ_UINT32 tile_y0;
+ /** XTsiz */
+ OPJ_UINT32 tile_width;
+ /** YTsiz */
+ OPJ_UINT32 tile_height;
+ /** number of tiles in width */
+ OPJ_UINT32 nb_tiles_x;
+ /** number of tiles in height */
+ OPJ_UINT32 nb_tiles_y;
+#endif
+
+ /** 'restricted' ICC profile */
+ unsigned char *icc_profile_buf;
+ /** size of ICC profile */
+ int icc_profile_len;
+} opj_image_header_t;
+
+
+/*
+==========================================================
+ Information on the JPEG 2000 codestream
+==========================================================
+*/
+
+/**
+Index structure : Information concerning a packet inside tile
+*/
+typedef struct opj_packet_info {
+ /** packet start position (including SOP marker if it exists) */
+ int start_pos;
+ /** end of packet header position (including EPH marker if it exists)*/
+ int end_ph_pos;
+ /** packet end position */
+ int end_pos;
+ /** packet distorsion */
+ double disto;
+} opj_packet_info_t;
+
+
+/* UniPG>> */
+/**
+Marker structure
+*/
+typedef struct opj_marker_info_t {
+ /** marker type */
+ unsigned short int type;
+ /** position in codestream */
+ int pos;
+ /** length, marker val included */
+ int len;
+} opj_marker_info_t;
+/* <<UniPG */
+
+/**
+Index structure : Information concerning tile-parts
+*/
+typedef struct opj_tp_info {
+ /** start position of tile part */
+ int tp_start_pos;
+ /** end position of tile part header */
+ int tp_end_header;
+ /** end position of tile part */
+ int tp_end_pos;
+ /** start packet of tile part */
+ int tp_start_pack;
+ /** number of packets of tile part */
+ int tp_numpacks;
+} opj_tp_info_t;
+
+/**
+Index structure : information regarding tiles
+*/
+typedef struct opj_tile_info {
+ /** value of thresh for each layer by tile cfr. Marcela */
+ double *thresh;
+ /** number of tile */
+ int tileno;
+ /** start position */
+ int start_pos;
+ /** end position of the header */
+ int end_header;
+ /** end position */
+ int end_pos;
+ /** precinct number for each resolution level (width) */
+ int pw[33];
+ /** precinct number for each resolution level (height) */
+ int ph[33];
+ /** precinct size (in power of 2), in X for each resolution level */
+ int pdx[33];
+ /** precinct size (in power of 2), in Y for each resolution level */
+ int pdy[33];
+ /** information concerning packets inside tile */
+ opj_packet_info_t *packet;
+ /** add fixed_quality */
+ int numpix;
+ /** add fixed_quality */
+ double distotile;
+ /** number of markers */
+ int marknum;
+ /** list of markers */
+ opj_marker_info_t *marker;
+ /** actual size of markers array */
+ int maxmarknum;
+ /** number of tile parts */
+ int num_tps;
+ /** information concerning tile parts */
+ opj_tp_info_t *tp;
+} opj_tile_info_t;
+
+/**
+Index structure of the codestream
+*/
+typedef struct opj_codestream_info {
+ /** maximum distortion reduction on the whole image (add for Marcela) */
+ double D_max;
+ /** packet number */
+ int packno;
+ /** writing the packet in the index with t2_encode_packets */
+ int index_write;
+ /** image width */
+ int image_w;
+ /** image height */
+ int image_h;
+ /** progression order */
+ OPJ_PROG_ORDER prog;
+ /** tile size in x */
+ int tile_x;
+ /** tile size in y */
+ int tile_y;
+ /** */
+ int tile_Ox;
+ /** */
+ int tile_Oy;
+ /** number of tiles in X */
+ int tw;
+ /** number of tiles in Y */
+ int th;
+ /** component numbers */
+ int numcomps;
+ /** number of layer */
+ int numlayers;
+ /** number of decomposition for each component */
+ int *numdecompos;
+/* UniPG>> */
+ /** number of markers */
+ int marknum;
+ /** list of markers */
+ opj_marker_info_t *marker;
+ /** actual size of markers array */
+ int maxmarknum;
+/* <<UniPG */
+ /** main header position */
+ int main_head_start;
+ /** main header position */
+ int main_head_end;
+ /** codestream's size */
+ int codestream_size;
+ /** information regarding tiles inside image */
+ opj_tile_info_t *tile;
+} opj_codestream_info_t;
+
+// NEW codestream
+
+/**
+Tile-component coding parameters
+*/
+typedef struct opj_tccp_info
+{
+ /** component index */
+ OPJ_UINT32 compno;
+ /** coding style */
+ OPJ_UINT32 csty;
+ /** number of resolutions */
+ OPJ_UINT32 numresolutions;
+ /** code-blocks width */
+ OPJ_UINT32 cblkw;
+ /** code-blocks height */
+ OPJ_UINT32 cblkh;
+ /** code-block coding style */
+ OPJ_UINT32 cblksty;
+ /** discrete wavelet transform identifier */
+ OPJ_UINT32 qmfbid;
+ /** quantisation style */
+ OPJ_UINT32 qntsty;
+ /** stepsizes used for quantization */
+ //FIXME opj_stepsize_t stepsizes[J2K_MAXBANDS];
+ /** number of guard bits */
+ OPJ_UINT32 numgbits;
+ /** Region Of Interest shift */
+ OPJ_INT32 roishift;
+ /** precinct width */
+ OPJ_UINT32 prcw[J2K_MAXRLVLS];
+ /** precinct height */
+ OPJ_UINT32 prch[J2K_MAXRLVLS];
+}
+opj_tccp_info_t;
+
+typedef struct opj_tile_v2_info {
+
+ /** number (index) of tile */
+ int tileno;
+
+ /** start position */
+ int start_pos;
+ /** end position of the header */
+ int end_header;
+ /** end position */
+ int end_pos;
+
+ /** add fixed_quality */
+ int numpix;
+ /** add fixed_quality */
+ double distotile;
+
+ /** coding style */
+ OPJ_UINT32 csty;
+ /** progression order */
+ OPJ_PROG_ORDER prg;
+ /** number of layers */
+ OPJ_UINT32 numlayers;
+ /** multi-component transform identifier */
+ OPJ_UINT32 mct;
+ /** rates of layers */
+ OPJ_FLOAT32 rates[100];
+
+ /** precinct number for each resolution level (width) */
+ int pw[33];
+ /** precinct number for each resolution level (height) */
+ int ph[33];
+ /** precinct size (in power of 2), in X for each resolution level */
+ int pdx[33];
+ /** precinct size (in power of 2), in Y for each resolution level */
+ int pdy[33];
+ /** information concerning packets inside tile */
+ opj_packet_info_t *packet;
+
+
+ /** number of tile parts */
+ int num_tps;
+ /** information concerning tile parts */
+ opj_tp_info_t *tp;
+
+ /** information concerning tile component parameters*/
+ opj_tccp_info_t *tccp_info;
+
+ /** value of thresh for each layer by tile cfr. Marcela */
+ double *thresh;
+} opj_tile_info_v2_t;
+
+/**
+Index structure of the codestream
+*/
+typedef struct opj_codestream_info_v2 {
+ /* Basic image info */
+ /** image width */
+ int image_w;
+ /** image height */
+ int image_h;
+ /** numbers of component */
+ int numcomps;
+
+ /* Codestream Info */
+ /** progression order */
+ OPJ_PROG_ORDER prog;
+ /** number of layer */
+ int numlayers;
+
+ /** tile origin in x */
+ int tx0;
+ /** tile origin in y */
+ int ty0;
+ /** tile size in x */
+ int tdx;
+ /** tile size in y */
+ int tdy;
+ /** number of tiles in X */
+ int tw;
+ /** number of tiles in Y */
+ int th;
+
+ /** number of decomposition for each component */
+ int *numdecompos;
+
+ /** maximum distortion reduction on the whole image (add for Marcela) */
+ double D_max;
+ /** packet number */
+ int packno;
+ /** writing the packet in the index with t2_encode_packets */
+ int index_write;
+
+
+
+/* UniPG>> */
+ /** number of markers */
+ int marknum;
+ /** list of markers */
+ opj_marker_info_t *marker;
+ /** actual size of markers array */
+ int maxmarknum;
+/* <<UniPG */
+
+ /** main header position */
+ int main_head_start;
+ /** main header position */
+ int main_head_end;
+ /** codestream's size */
+ int codestream_size;
+
+ /** information regarding tiles inside image */
+ opj_tile_info_v2_t *tile;
+} opj_codestream_info_v2_t;
+
+
+/*
+==========================================================
+ Metadata from the JP2file
+==========================================================
+*/
+
+/**
+Info structure of the file
+*/
+typedef struct opj_jp2_metadata {
+ /** */
+ OPJ_INT32 empty_fields;
+
+} opj_jp2_metadata_t;
+
+/*
+==========================================================
+ Information on the JPEG2000 file
+==========================================================
+*/
+
+/**
+Info structure of the file
+*/
+typedef struct opj_file_info {
+ /** file format */
+ OPJ_INT32 file_format;
+ /** file info level*/
+ OPJ_INT32 file_info_flag;
+ /** image info*/
+ opj_image_header_t img_info;
+ /** codestream info */
+ opj_codestream_info_v2_t codestream_info;
+ /** file info */
+ opj_jp2_metadata_t jp2_metadata;
+
+} opj_file_info_t;
+
+
+