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 #ifndef __JP2_H
00030 #define __JP2_H
00031
00039
00040 #define JPIP_JPIP 0x6a706970
00041
00042 #define JP2_JP 0x6a502020
00043 #define JP2_FTYP 0x66747970
00044 #define JP2_JP2H 0x6a703268
00045 #define JP2_IHDR 0x69686472
00046 #define JP2_COLR 0x636f6c72
00047 #define JP2_JP2C 0x6a703263
00048 #define JP2_URL 0x75726c20
00049 #define JP2_DBTL 0x6474626c
00050 #define JP2_BPCC 0x62706363
00051 #define JP2_JP2 0x6a703220
00053
00054
00058 typedef struct opj_jp2_comps {
00059 int depth;
00060 int sgnd;
00061 int bpcc;
00062 } opj_jp2_comps_t;
00063
00067 typedef struct opj_jp2 {
00069 opj_common_ptr cinfo;
00071 opj_j2k_t *j2k;
00072 unsigned int w;
00073 unsigned int h;
00074 unsigned int numcomps;
00075 unsigned int bpc;
00076 unsigned int C;
00077 unsigned int UnkC;
00078 unsigned int IPR;
00079 unsigned int meth;
00080 unsigned int approx;
00081 unsigned int enumcs;
00082 unsigned int precedence;
00083 unsigned int brand;
00084 unsigned int minversion;
00085 unsigned int numcl;
00086 unsigned int *cl;
00087 opj_jp2_comps_t *comps;
00088 unsigned int j2k_codestream_offset;
00089 unsigned int j2k_codestream_length;
00090 } opj_jp2_t;
00091
00095 typedef struct opj_jp2_box {
00096 int length;
00097 int type;
00098 int init_pos;
00099 } opj_jp2_box_t;
00100
00103
00109 void jp2_write_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
00116 bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
00122 opj_jp2_t* jp2_create_decompress(opj_common_ptr cinfo);
00127 void jp2_destroy_decompress(opj_jp2_t *jp2);
00134 void jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters);
00142 opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
00148 opj_jp2_t* jp2_create_compress(opj_common_ptr cinfo);
00153 void jp2_destroy_compress(opj_jp2_t *jp2);
00161 void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
00170 bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
00171
00175
00176 #endif
00177