00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef INDEX_MANAGER_H_
00032 # define INDEX_MANAGER_H_
00033
00034 #include "opj_config.h"
00035 #include "opj_includes.h"
00036
00037 #include "byte_manager.h"
00038 #include "faixbox_manager.h"
00039 #include "metadata_manager.h"
00040 #include "mhixbox_manager.h"
00041
00043 #if 0
00044 typedef enum porder {
00045 PROG_UNKNOWN = -1,
00046 LRCP = 0,
00047 RLCP = 1,
00048 RPCL = 2,
00049 PCRL = 3,
00050 CPRL = 4
00051 } porder_t;
00052 #endif
00053
00055 typedef struct SIZmarker_param {
00056 Byte2_t Lsiz;
00057 Byte2_t Rsiz;
00058 Byte4_t Xsiz;
00059 Byte4_t Ysiz;
00060 Byte4_t XOsiz;
00061 Byte4_t YOsiz;
00062 Byte4_t XTsiz;
00063 Byte4_t YTsiz;
00064 Byte4_t XTOsiz;
00065 Byte4_t YTOsiz;
00066 Byte4_t XTnum;
00067 Byte4_t YTnum;
00068 Byte2_t Csiz;
00069 Byte_t Ssiz[3];
00070 Byte_t XRsiz[3];
00071 Byte_t YRsiz[3];
00072 } SIZmarker_param_t;
00073
00075 typedef struct CODmarker_param {
00076 Byte2_t Lcod;
00077 Byte_t Scod;
00078 OPJ_PROG_ORDER prog_order;
00079 Byte2_t numOflayers;
00080 Byte_t numOfdecomp;
00081 Byte4_t *XPsiz;
00082 Byte4_t *YPsiz;
00083 } CODmarker_param_t;
00084
00086 typedef struct index_param {
00087 metadatalist_param_t *metadatalist;
00088 OPJ_OFF_T offset;
00089 Byte8_t length;
00090 Byte8_t mhead_length;
00091 SIZmarker_param_t SIZ;
00092 CODmarker_param_t COD;
00093 faixbox_param_t *tilepart;
00094 mhixbox_param_t
00095 **tileheader;
00096 faixbox_param_t
00097 **precpacket;
00098 } index_param_t;
00099
00100
00108 index_param_t * parse_jp2file(int fd);
00109
00115 void print_index(index_param_t index);
00116
00122 void print_SIZ(SIZmarker_param_t SIZ);
00123
00129 void print_COD(CODmarker_param_t COD);
00130
00136 void delete_index(index_param_t **index);
00137
00143 void delete_COD(CODmarker_param_t COD);
00144
00145
00147 typedef struct range_param {
00148 Byte4_t minvalue;
00149 Byte4_t maxvalue;
00150 } range_param_t;
00151
00160 range_param_t get_tile_Xrange(SIZmarker_param_t SIZ, Byte4_t tile_id,
00161 int level);
00162
00171 range_param_t get_tile_Yrange(SIZmarker_param_t SIZ, Byte4_t tile_id,
00172 int level);
00173
00174
00183 Byte4_t get_tile_XSiz(SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
00184 Byte4_t get_tile_YSiz(SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
00185
00186
00193 OPJ_BOOL isJPTfeasible(index_param_t index);
00194
00195 #endif