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
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef OPENJPEG_H
00043 #define OPENJPEG_H
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #ifndef INLINE
00057 #if defined(_MSC_VER)
00058 #define INLINE __forceinline
00059 #elif defined(__GNUC__)
00060 #define INLINE __inline__
00061 #elif defined(__MWERKS__)
00062 #define INLINE inline
00063 #else
00064
00065 #define INLINE
00066 #endif
00067 #endif
00068
00069
00070 #ifdef __GNUC__
00071 #define OPJ_DEPRECATED(func) func __attribute__ ((deprecated))
00072 #elif defined(_MSC_VER)
00073 #define OPJ_DEPRECATED(func) __declspec(deprecated) func
00074 #else
00075 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
00076 #define OPJ_DEPRECATED(func) func
00077 #endif
00078
00079 #if defined(OPJ_STATIC) || !defined(_WIN32)
00080
00081 # if __GNUC__ >= 4
00082 # if defined(OPJ_STATIC)
00083 # define OPJ_API __attribute__ ((visibility ("hidden")))
00084 # else
00085 # define OPJ_API __attribute__ ((visibility ("default")))
00086 # endif
00087 # define OPJ_LOCAL __attribute__ ((visibility ("hidden")))
00088 # else
00089 # define OPJ_API
00090 # define OPJ_LOCAL
00091 # endif
00092 # define OPJ_CALLCONV
00093 #else
00094 # define OPJ_CALLCONV __stdcall
00095
00096
00097
00098
00099
00100
00101
00102
00103 # if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
00104 # define OPJ_API __declspec(dllexport)
00105 # else
00106 # define OPJ_API __declspec(dllimport)
00107 # endif
00108 #endif
00109
00110 typedef int OPJ_BOOL;
00111 #define OPJ_TRUE 1
00112 #define OPJ_FALSE 0
00113
00114 typedef char OPJ_CHAR;
00115 typedef float OPJ_FLOAT32;
00116 typedef double OPJ_FLOAT64;
00117 typedef unsigned char OPJ_BYTE;
00118
00119 #include "opj_stdint.h"
00120
00121 typedef int8_t OPJ_INT8;
00122 typedef uint8_t OPJ_UINT8;
00123 typedef int16_t OPJ_INT16;
00124 typedef uint16_t OPJ_UINT16;
00125 typedef int32_t OPJ_INT32;
00126 typedef uint32_t OPJ_UINT32;
00127 typedef int64_t OPJ_INT64;
00128 typedef uint64_t OPJ_UINT64;
00129
00130 typedef int64_t OPJ_OFF_T;
00131
00132 #include <stdio.h>
00133 typedef size_t OPJ_SIZE_T;
00134
00135
00136 #define OPJ_ARG_NOT_USED(x) (void)(x)
00137
00138
00139
00140
00141
00142
00143
00144 #define OPJ_PATH_LEN 4096
00146 #define OPJ_J2K_MAXRLVLS 33
00147 #define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2)
00149 #define OPJ_J2K_DEFAULT_NB_SEGS 10
00150 #define OPJ_J2K_STREAM_CHUNK_SIZE 0x100000
00151 #define OPJ_J2K_DEFAULT_HEADER_SIZE 1000
00152 #define OPJ_J2K_MCC_DEFAULT_NB_RECORDS 10
00153 #define OPJ_J2K_MCT_DEFAULT_NB_RECORDS 10
00154
00155
00156 #define JPWL_MAX_NO_TILESPECS 16
00157 #define JPWL_MAX_NO_PACKSPECS 16
00158 #define JPWL_MAX_NO_MARKERS 512
00159 #define JPWL_PRIVATEINDEX_NAME "jpwl_index_privatefilename"
00160 #define JPWL_EXPECTED_COMPONENTS 3
00161 #define JPWL_MAXIMUM_TILES 8192
00162 #define JPWL_MAXIMUM_HAMMING 2
00163 #define JPWL_MAXIMUM_EPB_ROOM 65450
00164
00165
00170 #define OPJ_IMG_INFO 1
00171 #define OPJ_J2K_MH_INFO 2
00172 #define OPJ_J2K_TH_INFO 4
00173 #define OPJ_J2K_TCH_INFO 8
00174 #define OPJ_J2K_MH_IND 16
00175 #define OPJ_J2K_TH_IND 32
00176
00177 #define OPJ_JP2_INFO 128
00178 #define OPJ_JP2_IND 256
00194 #define OPJ_PROFILE_NONE 0x0000
00195 #define OPJ_PROFILE_0 0x0001
00196 #define OPJ_PROFILE_1 0x0002
00197 #define OPJ_PROFILE_PART2 0x8000
00198 #define OPJ_PROFILE_CINEMA_2K 0x0003
00199 #define OPJ_PROFILE_CINEMA_4K 0x0004
00200 #define OPJ_PROFILE_CINEMA_S2K 0x0005
00201 #define OPJ_PROFILE_CINEMA_S4K 0x0006
00202 #define OPJ_PROFILE_CINEMA_LTS 0x0007
00203 #define OPJ_PROFILE_BC_SINGLE 0x0100
00204 #define OPJ_PROFILE_BC_MULTI 0x0200
00205 #define OPJ_PROFILE_BC_MULTI_R 0x0300
00206 #define OPJ_PROFILE_IMF_2K 0x0400
00207 #define OPJ_PROFILE_IMF_4K 0x0401
00208 #define OPJ_PROFILE_IMF_8K 0x0402
00209 #define OPJ_PROFILE_IMF_2K_R 0x0403
00210 #define OPJ_PROFILE_IMF_4K_R 0x0800
00211 #define OPJ_PROFILE_IMF_8K_R 0x0801
00216 #define OPJ_EXTENSION_NONE 0x0000
00217 #define OPJ_EXTENSION_MCT 0x0100
00222 #define OPJ_IS_CINEMA(v) (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))
00223 #define OPJ_IS_STORAGE(v) ((v) == OPJ_PROFILE_CINEMA_LTS)
00224 #define OPJ_IS_BROADCAST(v) (((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))
00225 #define OPJ_IS_IMF(v) (((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))
00226 #define OPJ_IS_PART2(v) ((v) & OPJ_PROFILE_PART2)
00227
00231 #define OPJ_CINEMA_24_CS 1302083
00232 #define OPJ_CINEMA_48_CS 651041
00233 #define OPJ_CINEMA_24_COMP 1041666
00234 #define OPJ_CINEMA_48_COMP 520833
00236
00237
00238
00239
00240
00241
00246 typedef enum RSIZ_CAPABILITIES {
00247 OPJ_STD_RSIZ = 0,
00248 OPJ_CINEMA2K = 3,
00249 OPJ_CINEMA4K = 4,
00250 OPJ_MCT = 0x8100
00251 } OPJ_RSIZ_CAPABILITIES;
00252
00257 typedef enum CINEMA_MODE {
00258 OPJ_OFF = 0,
00259 OPJ_CINEMA2K_24 = 1,
00260 OPJ_CINEMA2K_48 = 2,
00261 OPJ_CINEMA4K_24 = 3
00262 } OPJ_CINEMA_MODE;
00263
00267 typedef enum PROG_ORDER {
00268 OPJ_PROG_UNKNOWN = -1,
00269 OPJ_LRCP = 0,
00270 OPJ_RLCP = 1,
00271 OPJ_RPCL = 2,
00272 OPJ_PCRL = 3,
00273 OPJ_CPRL = 4
00274 } OPJ_PROG_ORDER;
00275
00279 typedef enum COLOR_SPACE {
00280 OPJ_CLRSPC_UNKNOWN = -1,
00281 OPJ_CLRSPC_UNSPECIFIED = 0,
00282 OPJ_CLRSPC_SRGB = 1,
00283 OPJ_CLRSPC_GRAY = 2,
00284 OPJ_CLRSPC_SYCC = 3,
00285 OPJ_CLRSPC_EYCC = 4,
00286 OPJ_CLRSPC_CMYK = 5
00287 } OPJ_COLOR_SPACE;
00288
00292 typedef enum CODEC_FORMAT {
00293 OPJ_CODEC_UNKNOWN = -1,
00294 OPJ_CODEC_J2K = 0,
00295 OPJ_CODEC_JPT = 1,
00296 OPJ_CODEC_JP2 = 2,
00297 OPJ_CODEC_JPP = 3,
00298 OPJ_CODEC_JPX = 4
00299 } OPJ_CODEC_FORMAT;
00300
00301
00302
00303
00304
00305
00306
00307
00313 typedef void (*opj_msg_callback)(const char *msg, void *client_data);
00314
00315
00316
00317
00318
00319
00320
00325 typedef struct opj_poc {
00327 OPJ_UINT32 resno0, compno0;
00329 OPJ_UINT32 layno1, resno1, compno1;
00331 OPJ_UINT32 layno0, precno0, precno1;
00333 OPJ_PROG_ORDER prg1, prg;
00335 OPJ_CHAR progorder[5];
00337 OPJ_UINT32 tile;
00339 OPJ_INT32 tx0, tx1, ty0, ty1;
00341 OPJ_UINT32 layS, resS, compS, prcS;
00343 OPJ_UINT32 layE, resE, compE, prcE;
00345 OPJ_UINT32 txS, txE, tyS, tyE, dx, dy;
00347 OPJ_UINT32 lay_t, res_t, comp_t, prc_t, tx0_t, ty0_t;
00348 } opj_poc_t;
00349
00353 typedef struct opj_cparameters {
00355 OPJ_BOOL tile_size_on;
00357 int cp_tx0;
00359 int cp_ty0;
00361 int cp_tdx;
00363 int cp_tdy;
00365 int cp_disto_alloc;
00367 int cp_fixed_alloc;
00369 int cp_fixed_quality;
00371 int *cp_matrice;
00373 char *cp_comment;
00375 int csty;
00377 OPJ_PROG_ORDER prog_order;
00379 opj_poc_t POC[32];
00381 OPJ_UINT32 numpocs;
00383 int tcp_numlayers;
00387 float tcp_rates[100];
00390 float tcp_distoratio[100];
00392 int numresolution;
00394 int cblockw_init;
00396 int cblockh_init;
00398 int mode;
00400 int irreversible;
00402 int roi_compno;
00404 int roi_shift;
00405
00406 int res_spec;
00408 int prcw_init[OPJ_J2K_MAXRLVLS];
00410 int prch_init[OPJ_J2K_MAXRLVLS];
00411
00415 char infile[OPJ_PATH_LEN];
00417 char outfile[OPJ_PATH_LEN];
00419 int index_on;
00421 char index[OPJ_PATH_LEN];
00423 int image_offset_x0;
00425 int image_offset_y0;
00427 int subsampling_dx;
00429 int subsampling_dy;
00431 int decod_format;
00433 int cod_format;
00436
00440 OPJ_BOOL jpwl_epc_on;
00442 int jpwl_hprot_MH;
00444 int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
00446 int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];
00448 int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];
00450 int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];
00452 int jpwl_pprot[JPWL_MAX_NO_PACKSPECS];
00454 int jpwl_sens_size;
00456 int jpwl_sens_addr;
00458 int jpwl_sens_range;
00460 int jpwl_sens_MH;
00462 int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];
00464 int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
00466
00467
00472 OPJ_CINEMA_MODE cp_cinema;
00477 int max_comp_size;
00482 OPJ_RSIZ_CAPABILITIES cp_rsiz;
00484 char tp_on;
00486 char tp_flag;
00488 char tcp_mct;
00490 OPJ_BOOL jpip_on;
00493 void * mct_data;
00500 int max_cs_size;
00503 OPJ_UINT16 rsiz;
00504 } opj_cparameters_t;
00505
00506 #define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001
00507 #define OPJ_DPARAMETERS_DUMP_FLAG 0x0002
00508
00512 typedef struct opj_dparameters {
00520 OPJ_UINT32 cp_reduce;
00527 OPJ_UINT32 cp_layer;
00528
00532 char infile[OPJ_PATH_LEN];
00534 char outfile[OPJ_PATH_LEN];
00536 int decod_format;
00538 int cod_format;
00539
00541 OPJ_UINT32 DA_x0;
00543 OPJ_UINT32 DA_x1;
00545 OPJ_UINT32 DA_y0;
00547 OPJ_UINT32 DA_y1;
00549 OPJ_BOOL m_verbose;
00550
00552 OPJ_UINT32 tile_index;
00554 OPJ_UINT32 nb_tile_to_decode;
00555
00558
00562 OPJ_BOOL jpwl_correct;
00564 int jpwl_exp_comps;
00566 int jpwl_max_tiles;
00568
00569
00570 unsigned int flags;
00571
00572 } opj_dparameters_t;
00573
00574
00578 typedef void * opj_codec_t;
00579
00580
00581
00582
00583
00584
00585
00590 #define OPJ_STREAM_READ OPJ_TRUE
00591
00592 #define OPJ_STREAM_WRITE OPJ_FALSE
00593
00594
00595
00596
00597 typedef OPJ_SIZE_T(* opj_stream_read_fn)(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
00598 void * p_user_data) ;
00599
00600
00601
00602
00603 typedef OPJ_SIZE_T(* opj_stream_write_fn)(void * p_buffer,
00604 OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
00605
00606
00607
00608
00609 typedef OPJ_OFF_T(* opj_stream_skip_fn)(OPJ_OFF_T p_nb_bytes,
00610 void * p_user_data) ;
00611
00612
00613
00614
00615 typedef OPJ_BOOL(* opj_stream_seek_fn)(OPJ_OFF_T p_nb_bytes,
00616 void * p_user_data) ;
00617
00618
00619
00620
00621 typedef void (* opj_stream_free_user_data_fn)(void * p_user_data) ;
00622
00623
00624
00625
00626 typedef void * opj_stream_t;
00627
00628
00629
00630
00631
00632
00633
00637 typedef struct opj_image_comp {
00639 OPJ_UINT32 dx;
00641 OPJ_UINT32 dy;
00643 OPJ_UINT32 w;
00645 OPJ_UINT32 h;
00647 OPJ_UINT32 x0;
00649 OPJ_UINT32 y0;
00651 OPJ_UINT32 prec;
00653 OPJ_UINT32 bpp;
00655 OPJ_UINT32 sgnd;
00657 OPJ_UINT32 resno_decoded;
00659 OPJ_UINT32 factor;
00661 OPJ_INT32 *data;
00663 OPJ_UINT16 alpha;
00664 } opj_image_comp_t;
00665
00669 typedef struct opj_image {
00671 OPJ_UINT32 x0;
00673 OPJ_UINT32 y0;
00675 OPJ_UINT32 x1;
00677 OPJ_UINT32 y1;
00679 OPJ_UINT32 numcomps;
00681 OPJ_COLOR_SPACE color_space;
00683 opj_image_comp_t *comps;
00685 OPJ_BYTE *icc_profile_buf;
00687 OPJ_UINT32 icc_profile_len;
00688 } opj_image_t;
00689
00690
00694 typedef struct opj_image_comptparm {
00696 OPJ_UINT32 dx;
00698 OPJ_UINT32 dy;
00700 OPJ_UINT32 w;
00702 OPJ_UINT32 h;
00704 OPJ_UINT32 x0;
00706 OPJ_UINT32 y0;
00708 OPJ_UINT32 prec;
00710 OPJ_UINT32 bpp;
00712 OPJ_UINT32 sgnd;
00713 } opj_image_cmptparm_t;
00714
00715
00716
00717
00718
00719
00720
00721
00722
00726 typedef struct opj_packet_info {
00728 OPJ_OFF_T start_pos;
00730 OPJ_OFF_T end_ph_pos;
00732 OPJ_OFF_T end_pos;
00734 double disto;
00735 } opj_packet_info_t;
00736
00737
00738
00742 typedef struct opj_marker_info {
00744 unsigned short int type;
00746 OPJ_OFF_T pos;
00748 int len;
00749 } opj_marker_info_t;
00750
00751
00755 typedef struct opj_tp_info {
00757 int tp_start_pos;
00759 int tp_end_header;
00761 int tp_end_pos;
00763 int tp_start_pack;
00765 int tp_numpacks;
00766 } opj_tp_info_t;
00767
00771 typedef struct opj_tile_info {
00773 double *thresh;
00775 int tileno;
00777 int start_pos;
00779 int end_header;
00781 int end_pos;
00783 int pw[33];
00785 int ph[33];
00787 int pdx[33];
00789 int pdy[33];
00791 opj_packet_info_t *packet;
00793 int numpix;
00795 double distotile;
00797 int marknum;
00799 opj_marker_info_t *marker;
00801 int maxmarknum;
00803 int num_tps;
00805 opj_tp_info_t *tp;
00806 } opj_tile_info_t;
00807
00811 typedef struct opj_codestream_info {
00813 double D_max;
00815 int packno;
00817 int index_write;
00819 int image_w;
00821 int image_h;
00823 OPJ_PROG_ORDER prog;
00825 int tile_x;
00827 int tile_y;
00829 int tile_Ox;
00831 int tile_Oy;
00833 int tw;
00835 int th;
00837 int numcomps;
00839 int numlayers;
00841 int *numdecompos;
00842
00844 int marknum;
00846 opj_marker_info_t *marker;
00848 int maxmarknum;
00849
00851 int main_head_start;
00853 int main_head_end;
00855 int codestream_size;
00857 opj_tile_info_t *tile;
00858 } opj_codestream_info_t;
00859
00860
00861
00862
00866 typedef struct opj_tccp_info {
00868 OPJ_UINT32 compno;
00870 OPJ_UINT32 csty;
00872 OPJ_UINT32 numresolutions;
00874 OPJ_UINT32 cblkw;
00876 OPJ_UINT32 cblkh;
00878 OPJ_UINT32 cblksty;
00880 OPJ_UINT32 qmfbid;
00882 OPJ_UINT32 qntsty;
00884 OPJ_UINT32 stepsizes_mant[OPJ_J2K_MAXBANDS];
00886 OPJ_UINT32 stepsizes_expn[OPJ_J2K_MAXBANDS];
00888 OPJ_UINT32 numgbits;
00890 OPJ_INT32 roishift;
00892 OPJ_UINT32 prcw[OPJ_J2K_MAXRLVLS];
00894 OPJ_UINT32 prch[OPJ_J2K_MAXRLVLS];
00895 }
00896 opj_tccp_info_t;
00897
00901 typedef struct opj_tile_v2_info {
00902
00904 int tileno;
00906 OPJ_UINT32 csty;
00908 OPJ_PROG_ORDER prg;
00910 OPJ_UINT32 numlayers;
00912 OPJ_UINT32 mct;
00913
00915 opj_tccp_info_t *tccp_info;
00916
00917 } opj_tile_info_v2_t;
00918
00922 typedef struct opj_codestream_info_v2 {
00923
00925 OPJ_UINT32 tx0;
00927 OPJ_UINT32 ty0;
00929 OPJ_UINT32 tdx;
00931 OPJ_UINT32 tdy;
00933 OPJ_UINT32 tw;
00935 OPJ_UINT32 th;
00936
00938 OPJ_UINT32 nbcomps;
00939
00941 opj_tile_info_v2_t m_default_tile_info;
00942
00944 opj_tile_info_v2_t *tile_info;
00945
00946 } opj_codestream_info_v2_t;
00947
00948
00952 typedef struct opj_tp_index {
00954 OPJ_OFF_T start_pos;
00956 OPJ_OFF_T end_header;
00958 OPJ_OFF_T end_pos;
00959
00960 } opj_tp_index_t;
00961
00965 typedef struct opj_tile_index {
00967 OPJ_UINT32 tileno;
00968
00970 OPJ_UINT32 nb_tps;
00972 OPJ_UINT32 current_nb_tps;
00974 OPJ_UINT32 current_tpsno;
00976 opj_tp_index_t *tp_index;
00977
00978
00980 OPJ_UINT32 marknum;
00982 opj_marker_info_t *marker;
00984 OPJ_UINT32 maxmarknum;
00985
00986
00988 OPJ_UINT32 nb_packet;
00990 opj_packet_info_t *packet_index;
00991
00992 } opj_tile_index_t;
00993
00997 typedef struct opj_codestream_index {
00999 OPJ_OFF_T main_head_start;
01001 OPJ_OFF_T main_head_end;
01002
01004 OPJ_UINT64 codestream_size;
01005
01006
01008 OPJ_UINT32 marknum;
01010 opj_marker_info_t *marker;
01012 OPJ_UINT32 maxmarknum;
01013
01014
01016 OPJ_UINT32 nb_of_tiles;
01018 opj_tile_index_t *tile_index;
01019
01020 } opj_codestream_index_t;
01021
01022
01023
01024
01025
01026
01027
01028
01033 typedef struct opj_jp2_metadata {
01035 OPJ_INT32 not_used;
01036
01037 } opj_jp2_metadata_t;
01038
01043 typedef struct opj_jp2_index {
01045 OPJ_INT32 not_used;
01046
01047 } opj_jp2_index_t;
01048
01049
01050 #ifdef __cplusplus
01051 extern "C" {
01052 #endif
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062 OPJ_API const char * OPJ_CALLCONV opj_version(void);
01063
01064
01065
01066
01067
01068
01069
01078 OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts,
01079 opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
01080
01086 OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
01087
01097 OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts,
01098 opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
01099
01109 OPJ_API void* OPJ_CALLCONV opj_image_data_alloc(OPJ_SIZE_T size);
01110
01119 OPJ_API void OPJ_CALLCONV opj_image_data_free(void* ptr);
01120
01121
01122
01123
01124
01125
01126
01134 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(
01135 OPJ_BOOL p_is_input);
01136
01145 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,
01146 OPJ_BOOL p_is_input);
01147
01154 OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);
01155
01161 OPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream,
01162 opj_stream_read_fn p_function);
01163
01169 OPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream,
01170 opj_stream_write_fn p_function);
01171
01177 OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream,
01178 opj_stream_skip_fn p_function);
01179
01185 OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream,
01186 opj_stream_seek_fn p_function);
01187
01194 OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
01195 void * p_data, opj_stream_free_user_data_fn p_function);
01196
01203 OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(
01204 opj_stream_t* p_stream, OPJ_UINT64 data_length);
01205
01211 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream(
01212 const char *fname, OPJ_BOOL p_is_read_stream);
01213
01219 OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream(
01220 const char *fname,
01221 OPJ_SIZE_T p_buffer_size,
01222 OPJ_BOOL p_is_read_stream);
01223
01224
01225
01226
01227
01228
01235 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_info_handler(opj_codec_t * p_codec,
01236 opj_msg_callback p_callback,
01237 void * p_user_data);
01244 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_warning_handler(opj_codec_t * p_codec,
01245 opj_msg_callback p_callback,
01246 void * p_user_data);
01253 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec,
01254 opj_msg_callback p_callback,
01255 void * p_user_data);
01256
01257
01258
01259
01260
01261
01262
01269 OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(
01270 OPJ_CODEC_FORMAT format);
01271
01277 OPJ_API void OPJ_CALLCONV opj_destroy_codec(opj_codec_t * p_codec);
01278
01284 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress(opj_codec_t *p_codec,
01285 opj_stream_t *p_stream);
01286
01287
01292 OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
01293 opj_dparameters_t *parameters);
01294
01304 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec,
01305 opj_dparameters_t *parameters);
01306
01323 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_codec_set_threads(opj_codec_t *p_codec,
01324 int num_threads);
01325
01335 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header(opj_stream_t *p_stream,
01336 opj_codec_t *p_codec,
01337 opj_image_t **p_image);
01338
01339
01365 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_components(opj_codec_t *p_codec,
01366 OPJ_UINT32 numcomps,
01367 const OPJ_UINT32* comps_indices,
01368 OPJ_BOOL apply_color_transforms);
01369
01392 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area(opj_codec_t *p_codec,
01393 opj_image_t* p_image,
01394 OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
01395 OPJ_INT32 p_end_x, OPJ_INT32 p_end_y);
01396
01405 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode(opj_codec_t *p_decompressor,
01406 opj_stream_t *p_stream,
01407 opj_image_t *p_image);
01408
01419 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile(opj_codec_t *p_codec,
01420 opj_stream_t *p_stream,
01421 opj_image_t *p_image,
01422 OPJ_UINT32 tile_index);
01423
01431 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(
01432 opj_codec_t *p_codec, OPJ_UINT32 res_factor);
01433
01446 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile(opj_codec_t *p_codec,
01447 OPJ_UINT32 p_tile_index,
01448 OPJ_BYTE * p_data,
01449 OPJ_UINT32 p_data_size,
01450 opj_stream_t *p_stream);
01451
01473 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header(opj_codec_t *p_codec,
01474 opj_stream_t * p_stream,
01475 OPJ_UINT32 * p_tile_index,
01476 OPJ_UINT32 * p_data_size,
01477 OPJ_INT32 * p_tile_x0, OPJ_INT32 * p_tile_y0,
01478 OPJ_INT32 * p_tile_x1, OPJ_INT32 * p_tile_y1,
01479 OPJ_UINT32 * p_nb_comps,
01480 OPJ_BOOL * p_should_go_on);
01481
01496 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(opj_codec_t *p_codec,
01497 OPJ_UINT32 p_tile_index,
01498 OPJ_BYTE * p_data,
01499 OPJ_UINT32 p_data_size,
01500 opj_stream_t *p_stream);
01501
01502
01503
01509 OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format);
01510
01532 OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
01533 opj_cparameters_t *parameters);
01534
01541 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec,
01542 opj_cparameters_t *parameters,
01543 opj_image_t *image);
01544
01551 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress(opj_codec_t *p_codec,
01552 opj_image_t * p_image,
01553 opj_stream_t *p_stream);
01554
01560 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress(opj_codec_t *p_codec,
01561 opj_stream_t *p_stream);
01562
01570 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode(opj_codec_t *p_codec,
01571 opj_stream_t *p_stream);
01572
01573
01574
01575
01576
01577
01578
01583 OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t
01584 **cstr_info);
01585
01586
01595 OPJ_API void OPJ_CALLCONV opj_dump_codec(opj_codec_t *p_codec,
01596 OPJ_INT32 info_flag,
01597 FILE* output_stream);
01598
01607 OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(
01608 opj_codec_t *p_codec);
01609
01618 OPJ_API opj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(
01619 opj_codec_t *p_codec);
01620
01621 OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t
01622 **p_cstr_index);
01623
01624
01633 OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(
01634 opj_codec_t *p_codec);
01635
01644 OPJ_API opj_jp2_index_t* OPJ_CALLCONV opj_get_jp2_index(opj_codec_t *p_codec);
01645
01646
01647
01648
01649
01650
01651
01652
01663 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_MCT(opj_cparameters_t *parameters,
01664 OPJ_FLOAT32 * pEncodingMatrix,
01665 OPJ_INT32 * p_dc_shift,
01666 OPJ_UINT32 pNbComp);
01667
01668
01669
01670
01671
01672
01673
01677 OPJ_API OPJ_BOOL OPJ_CALLCONV opj_has_thread_support(void);
01678
01680 OPJ_API int OPJ_CALLCONV opj_get_num_cpus(void);
01681
01682
01683 #ifdef __cplusplus
01684 }
01685 #endif
01686
01687 #endif