use std::os::raw::*;
pub const OPJ_TRUE: u32 = 1;
pub const OPJ_FALSE: u32 = 0;
pub const OPJ_HAVE_STDINT_H: u32 = 1;
pub const OPJ_VERSION_MAJOR: u32 = 2;
pub const OPJ_VERSION_MINOR: u32 = 4;
pub const OPJ_VERSION_BUILD: u32 = 0;
pub const OPJ_PATH_LEN: u32 = 4096;
pub const OPJ_J2K_MAXRLVLS: u32 = 33;
pub const OPJ_J2K_MAXBANDS: u32 = 97;
pub const OPJ_J2K_DEFAULT_NB_SEGS: u32 = 10;
pub const OPJ_J2K_STREAM_CHUNK_SIZE: u32 = 1048576;
pub const OPJ_J2K_DEFAULT_HEADER_SIZE: u32 = 1000;
pub const OPJ_J2K_MCC_DEFAULT_NB_RECORDS: u32 = 10;
pub const OPJ_J2K_MCT_DEFAULT_NB_RECORDS: u32 = 10;
pub const OPJ_IMG_INFO: u32 = 1;
pub const OPJ_J2K_MH_INFO: u32 = 2;
pub const OPJ_J2K_TH_INFO: u32 = 4;
pub const OPJ_J2K_TCH_INFO: u32 = 8;
pub const OPJ_J2K_MH_IND: u32 = 16;
pub const OPJ_J2K_TH_IND: u32 = 32;
pub const OPJ_JP2_INFO: u32 = 128;
pub const OPJ_JP2_IND: u32 = 256;
pub const OPJ_PROFILE_NONE: u32 = 0;
pub const OPJ_PROFILE_0: u32 = 1;
pub const OPJ_PROFILE_1: u32 = 2;
pub const OPJ_PROFILE_PART2: u32 = 32768;
pub const OPJ_PROFILE_CINEMA_2K: u32 = 3;
pub const OPJ_PROFILE_CINEMA_4K: u32 = 4;
pub const OPJ_PROFILE_CINEMA_S2K: u32 = 5;
pub const OPJ_PROFILE_CINEMA_S4K: u32 = 6;
pub const OPJ_PROFILE_CINEMA_LTS: u32 = 7;
pub const OPJ_PROFILE_BC_SINGLE: u32 = 256;
pub const OPJ_PROFILE_BC_MULTI: u32 = 512;
pub const OPJ_PROFILE_BC_MULTI_R: u32 = 768;
pub const OPJ_PROFILE_IMF_2K: u32 = 1024;
pub const OPJ_PROFILE_IMF_4K: u32 = 1280;
pub const OPJ_PROFILE_IMF_8K: u32 = 1536;
pub const OPJ_PROFILE_IMF_2K_R: u32 = 1792;
pub const OPJ_PROFILE_IMF_4K_R: u32 = 2048;
pub const OPJ_PROFILE_IMF_8K_R: u32 = 2304;
pub const OPJ_EXTENSION_NONE: u32 = 0;
pub const OPJ_EXTENSION_MCT: u32 = 256;
pub const OPJ_IMF_MAINLEVEL_MAX: u32 = 11;
pub const OPJ_IMF_MAINLEVEL_1_MSAMPLESEC: u32 = 65;
pub const OPJ_IMF_MAINLEVEL_2_MSAMPLESEC: u32 = 130;
pub const OPJ_IMF_MAINLEVEL_3_MSAMPLESEC: u32 = 195;
pub const OPJ_IMF_MAINLEVEL_4_MSAMPLESEC: u32 = 260;
pub const OPJ_IMF_MAINLEVEL_5_MSAMPLESEC: u32 = 520;
pub const OPJ_IMF_MAINLEVEL_6_MSAMPLESEC: u32 = 1200;
pub const OPJ_IMF_MAINLEVEL_7_MSAMPLESEC: u32 = 2400;
pub const OPJ_IMF_MAINLEVEL_8_MSAMPLESEC: u32 = 4800;
pub const OPJ_IMF_MAINLEVEL_9_MSAMPLESEC: u32 = 9600;
pub const OPJ_IMF_MAINLEVEL_10_MSAMPLESEC: u32 = 19200;
pub const OPJ_IMF_MAINLEVEL_11_MSAMPLESEC: u32 = 38400;
pub const OPJ_IMF_SUBLEVEL_1_MBITSSEC: u32 = 200;
pub const OPJ_IMF_SUBLEVEL_2_MBITSSEC: u32 = 400;
pub const OPJ_IMF_SUBLEVEL_3_MBITSSEC: u32 = 800;
pub const OPJ_IMF_SUBLEVEL_4_MBITSSEC: u32 = 1600;
pub const OPJ_IMF_SUBLEVEL_5_MBITSSEC: u32 = 3200;
pub const OPJ_IMF_SUBLEVEL_6_MBITSSEC: u32 = 6400;
pub const OPJ_IMF_SUBLEVEL_7_MBITSSEC: u32 = 12800;
pub const OPJ_IMF_SUBLEVEL_8_MBITSSEC: u32 = 25600;
pub const OPJ_IMF_SUBLEVEL_9_MBITSSEC: u32 = 51200;
pub const OPJ_CINEMA_24_CS: u32 = 1302083;
pub const OPJ_CINEMA_48_CS: u32 = 651041;
pub const OPJ_CINEMA_24_COMP: u32 = 1041666;
pub const OPJ_CINEMA_48_COMP: u32 = 520833;
pub const OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG: u32 = 1;
pub const OPJ_DPARAMETERS_DUMP_FLAG: u32 = 2;
pub const OPJ_STREAM_READ: u32 = 1;
pub const OPJ_STREAM_WRITE: u32 = 0;
pub type OPJ_BOOL = c_int;
pub type OPJ_CHAR = c_char;
pub type OPJ_FLOAT32 = f32;
pub type OPJ_BYTE = u8;
pub type OPJ_UINT16 = u16;
pub type OPJ_INT32 = i32;
pub type OPJ_UINT32 = u32;
pub type OPJ_UINT64 = u64;
pub type OPJ_OFF_T = i64;
use libc::FILE;
pub type OPJ_SIZE_T = usize;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum RSIZ_CAPABILITIES {
OPJ_STD_RSIZ = 0,
OPJ_CINEMA2K = 3,
OPJ_CINEMA4K = 4,
OPJ_MCT = 33024,
}
pub use self::RSIZ_CAPABILITIES as OPJ_RSIZ_CAPABILITIES;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum CINEMA_MODE {
OPJ_OFF = 0,
OPJ_CINEMA2K_24 = 1,
OPJ_CINEMA2K_48 = 2,
OPJ_CINEMA4K_24 = 3,
}
pub use self::CINEMA_MODE as OPJ_CINEMA_MODE;
#[repr(i32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PROG_ORDER {
OPJ_PROG_UNKNOWN = -1,
OPJ_LRCP = 0,
OPJ_RLCP = 1,
OPJ_RPCL = 2,
OPJ_PCRL = 3,
OPJ_CPRL = 4,
}
pub use self::PROG_ORDER as OPJ_PROG_ORDER;
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum COLOR_SPACE {
OPJ_CLRSPC_UNKNOWN = -1,
OPJ_CLRSPC_UNSPECIFIED = 0,
OPJ_CLRSPC_SRGB = 1,
OPJ_CLRSPC_GRAY = 2,
OPJ_CLRSPC_SYCC = 3,
OPJ_CLRSPC_EYCC = 4,
OPJ_CLRSPC_CMYK = 5,
}
pub use self::COLOR_SPACE as OPJ_COLOR_SPACE;
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum CODEC_FORMAT {
OPJ_CODEC_UNKNOWN = -1,
OPJ_CODEC_J2K = 0,
OPJ_CODEC_JPT = 1,
OPJ_CODEC_JP2 = 2,
OPJ_CODEC_JPP = 3,
OPJ_CODEC_JPX = 4,
}
pub use self::CODEC_FORMAT as OPJ_CODEC_FORMAT;
pub type opj_msg_callback = ::std::option::Option<
unsafe extern "C" fn(
msg: *const c_char,
client_data: *mut c_void,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_poc {
pub resno0: OPJ_UINT32,
pub compno0: OPJ_UINT32,
pub layno1: OPJ_UINT32,
pub resno1: OPJ_UINT32,
pub compno1: OPJ_UINT32,
pub layno0: OPJ_UINT32,
pub precno0: OPJ_UINT32,
pub precno1: OPJ_UINT32,
pub prg1: OPJ_PROG_ORDER,
pub prg: OPJ_PROG_ORDER,
pub progorder: [OPJ_CHAR; 5usize],
pub tile: OPJ_UINT32,
pub tx0: OPJ_INT32,
pub tx1: OPJ_INT32,
pub ty0: OPJ_INT32,
pub ty1: OPJ_INT32,
pub layS: OPJ_UINT32,
pub resS: OPJ_UINT32,
pub compS: OPJ_UINT32,
pub prcS: OPJ_UINT32,
pub layE: OPJ_UINT32,
pub resE: OPJ_UINT32,
pub compE: OPJ_UINT32,
pub prcE: OPJ_UINT32,
pub txS: OPJ_UINT32,
pub txE: OPJ_UINT32,
pub tyS: OPJ_UINT32,
pub tyE: OPJ_UINT32,
pub dx: OPJ_UINT32,
pub dy: OPJ_UINT32,
pub lay_t: OPJ_UINT32,
pub res_t: OPJ_UINT32,
pub comp_t: OPJ_UINT32,
pub prc_t: OPJ_UINT32,
pub tx0_t: OPJ_UINT32,
pub ty0_t: OPJ_UINT32,
}
pub type opj_poc_t = opj_poc;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_cparameters {
pub tile_size_on: OPJ_BOOL,
pub cp_tx0: c_int,
pub cp_ty0: c_int,
pub cp_tdx: c_int,
pub cp_tdy: c_int,
pub cp_disto_alloc: c_int,
pub cp_fixed_alloc: c_int,
pub cp_fixed_quality: c_int,
pub cp_matrice: *mut c_int,
pub cp_comment: *mut c_char,
pub csty: c_int,
pub prog_order: OPJ_PROG_ORDER,
pub POC: [opj_poc_t; 32usize],
pub numpocs: OPJ_UINT32,
pub tcp_numlayers: c_int,
pub tcp_rates: [f32; 100usize],
pub tcp_distoratio: [f32; 100usize],
pub numresolution: c_int,
pub cblockw_init: c_int,
pub cblockh_init: c_int,
pub mode: c_int,
pub irreversible: c_int,
pub roi_compno: c_int,
pub roi_shift: c_int,
pub res_spec: c_int,
pub prcw_init: [c_int; 33usize],
pub prch_init: [c_int; 33usize],
pub infile: [c_char; 4096usize],
pub outfile: [c_char; 4096usize],
pub index_on: c_int,
pub index: [c_char; 4096usize],
pub image_offset_x0: c_int,
pub image_offset_y0: c_int,
pub subsampling_dx: c_int,
pub subsampling_dy: c_int,
pub decod_format: c_int,
pub cod_format: c_int,
pub jpwl_epc_on: OPJ_BOOL,
pub jpwl_hprot_MH: c_int,
pub jpwl_hprot_TPH_tileno: [c_int; 16usize],
pub jpwl_hprot_TPH: [c_int; 16usize],
pub jpwl_pprot_tileno: [c_int; 16usize],
pub jpwl_pprot_packno: [c_int; 16usize],
pub jpwl_pprot: [c_int; 16usize],
pub jpwl_sens_size: c_int,
pub jpwl_sens_addr: c_int,
pub jpwl_sens_range: c_int,
pub jpwl_sens_MH: c_int,
pub jpwl_sens_TPH_tileno: [c_int; 16usize],
pub jpwl_sens_TPH: [c_int; 16usize],
pub cp_cinema: OPJ_CINEMA_MODE,
pub max_comp_size: c_int,
pub cp_rsiz: OPJ_RSIZ_CAPABILITIES,
pub tp_on: c_char,
pub tp_flag: c_char,
pub tcp_mct: c_char,
pub jpip_on: OPJ_BOOL,
pub mct_data: *mut c_void,
pub max_cs_size: c_int,
pub rsiz: OPJ_UINT16,
}
pub type opj_cparameters_t = opj_cparameters;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct opj_dparameters {
pub cp_reduce: OPJ_UINT32,
pub cp_layer: OPJ_UINT32,
pub infile: [c_char; 4096usize],
pub outfile: [c_char; 4096usize],
pub decod_format: c_int,
pub cod_format: c_int,
pub DA_x0: OPJ_UINT32,
pub DA_x1: OPJ_UINT32,
pub DA_y0: OPJ_UINT32,
pub DA_y1: OPJ_UINT32,
pub m_verbose: OPJ_BOOL,
pub tile_index: OPJ_UINT32,
pub nb_tile_to_decode: OPJ_UINT32,
pub jpwl_correct: OPJ_BOOL,
pub jpwl_exp_comps: c_int,
pub jpwl_max_tiles: c_int,
pub flags: c_uint,
}
pub type opj_dparameters_t = opj_dparameters;
pub type opj_codec_t = *mut c_void;
pub type opj_stream_read_fn = ::std::option::Option<
unsafe extern "C" fn(
p_buffer: *mut c_void,
p_nb_bytes: OPJ_SIZE_T,
p_user_data: *mut c_void,
) -> OPJ_SIZE_T,
>;
pub type opj_stream_write_fn = ::std::option::Option<
unsafe extern "C" fn(
p_buffer: *mut c_void,
p_nb_bytes: OPJ_SIZE_T,
p_user_data: *mut c_void,
) -> OPJ_SIZE_T,
>;
pub type opj_stream_skip_fn = ::std::option::Option<
unsafe extern "C" fn(
p_nb_bytes: OPJ_OFF_T,
p_user_data: *mut c_void,
) -> OPJ_OFF_T,
>;
pub type opj_stream_seek_fn = ::std::option::Option<
unsafe extern "C" fn(
p_nb_bytes: OPJ_OFF_T,
p_user_data: *mut c_void,
) -> OPJ_BOOL,
>;
pub type opj_stream_free_user_data_fn =
::std::option::Option<unsafe extern "C" fn(p_user_data: *mut c_void)>;
pub type opj_stream_t = *mut c_void;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_image_comp {
pub dx: OPJ_UINT32,
pub dy: OPJ_UINT32,
pub w: OPJ_UINT32,
pub h: OPJ_UINT32,
pub x0: OPJ_UINT32,
pub y0: OPJ_UINT32,
pub prec: OPJ_UINT32,
pub bpp: OPJ_UINT32,
pub sgnd: OPJ_UINT32,
pub resno_decoded: OPJ_UINT32,
pub factor: OPJ_UINT32,
pub data: *mut OPJ_INT32,
pub alpha: OPJ_UINT16,
}
pub type opj_image_comp_t = opj_image_comp;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_image {
pub x0: OPJ_UINT32,
pub y0: OPJ_UINT32,
pub x1: OPJ_UINT32,
pub y1: OPJ_UINT32,
pub numcomps: OPJ_UINT32,
pub color_space: OPJ_COLOR_SPACE,
pub comps: *mut opj_image_comp_t,
pub icc_profile_buf: *mut OPJ_BYTE,
pub icc_profile_len: OPJ_UINT32,
}
pub type opj_image_t = opj_image;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_image_comptparm {
pub dx: OPJ_UINT32,
pub dy: OPJ_UINT32,
pub w: OPJ_UINT32,
pub h: OPJ_UINT32,
pub x0: OPJ_UINT32,
pub y0: OPJ_UINT32,
pub prec: OPJ_UINT32,
pub bpp: OPJ_UINT32,
pub sgnd: OPJ_UINT32,
}
pub type opj_image_cmptparm_t = opj_image_comptparm;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_packet_info {
pub start_pos: OPJ_OFF_T,
pub end_ph_pos: OPJ_OFF_T,
pub end_pos: OPJ_OFF_T,
pub disto: f64,
}
pub type opj_packet_info_t = opj_packet_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_marker_info {
pub type_: c_ushort,
pub pos: OPJ_OFF_T,
pub len: c_int,
}
pub type opj_marker_info_t = opj_marker_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_tp_info {
pub tp_start_pos: c_int,
pub tp_end_header: c_int,
pub tp_end_pos: c_int,
pub tp_start_pack: c_int,
pub tp_numpacks: c_int,
}
pub type opj_tp_info_t = opj_tp_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_tile_info {
pub thresh: *mut f64,
pub tileno: c_int,
pub start_pos: c_int,
pub end_header: c_int,
pub end_pos: c_int,
pub pw: [c_int; 33usize],
pub ph: [c_int; 33usize],
pub pdx: [c_int; 33usize],
pub pdy: [c_int; 33usize],
pub packet: *mut opj_packet_info_t,
pub numpix: c_int,
pub distotile: f64,
pub marknum: c_int,
pub marker: *mut opj_marker_info_t,
pub maxmarknum: c_int,
pub num_tps: c_int,
pub tp: *mut opj_tp_info_t,
}
pub type opj_tile_info_t = opj_tile_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_codestream_info {
pub D_max: f64,
pub packno: c_int,
pub index_write: c_int,
pub image_w: c_int,
pub image_h: c_int,
pub prog: OPJ_PROG_ORDER,
pub tile_x: c_int,
pub tile_y: c_int,
pub tile_Ox: c_int,
pub tile_Oy: c_int,
pub tw: c_int,
pub th: c_int,
pub numcomps: c_int,
pub numlayers: c_int,
pub numdecompos: *mut c_int,
pub marknum: c_int,
pub marker: *mut opj_marker_info_t,
pub maxmarknum: c_int,
pub main_head_start: c_int,
pub main_head_end: c_int,
pub codestream_size: c_int,
pub tile: *mut opj_tile_info_t,
}
pub type opj_codestream_info_t = opj_codestream_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_tccp_info {
pub compno: OPJ_UINT32,
pub csty: OPJ_UINT32,
pub numresolutions: OPJ_UINT32,
pub cblkw: OPJ_UINT32,
pub cblkh: OPJ_UINT32,
pub cblksty: OPJ_UINT32,
pub qmfbid: OPJ_UINT32,
pub qntsty: OPJ_UINT32,
pub stepsizes_mant: [OPJ_UINT32; 97usize],
pub stepsizes_expn: [OPJ_UINT32; 97usize],
pub numgbits: OPJ_UINT32,
pub roishift: OPJ_INT32,
pub prcw: [OPJ_UINT32; 33usize],
pub prch: [OPJ_UINT32; 33usize],
}
pub type opj_tccp_info_t = opj_tccp_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_tile_v2_info {
pub tileno: c_int,
pub csty: OPJ_UINT32,
pub prg: OPJ_PROG_ORDER,
pub numlayers: OPJ_UINT32,
pub mct: OPJ_UINT32,
pub tccp_info: *mut opj_tccp_info_t,
}
pub type opj_tile_info_v2_t = opj_tile_v2_info;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_codestream_info_v2 {
pub tx0: OPJ_UINT32,
pub ty0: OPJ_UINT32,
pub tdx: OPJ_UINT32,
pub tdy: OPJ_UINT32,
pub tw: OPJ_UINT32,
pub th: OPJ_UINT32,
pub nbcomps: OPJ_UINT32,
pub m_default_tile_info: opj_tile_info_v2_t,
pub tile_info: *mut opj_tile_info_v2_t,
}
pub type opj_codestream_info_v2_t = opj_codestream_info_v2;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_tp_index {
pub start_pos: OPJ_OFF_T,
pub end_header: OPJ_OFF_T,
pub end_pos: OPJ_OFF_T,
}
pub type opj_tp_index_t = opj_tp_index;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_tile_index {
pub tileno: OPJ_UINT32,
pub nb_tps: OPJ_UINT32,
pub current_nb_tps: OPJ_UINT32,
pub current_tpsno: OPJ_UINT32,
pub tp_index: *mut opj_tp_index_t,
pub marknum: OPJ_UINT32,
pub marker: *mut opj_marker_info_t,
pub maxmarknum: OPJ_UINT32,
pub nb_packet: OPJ_UINT32,
pub packet_index: *mut opj_packet_info_t,
}
pub type opj_tile_index_t = opj_tile_index;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_codestream_index {
pub main_head_start: OPJ_OFF_T,
pub main_head_end: OPJ_OFF_T,
pub codestream_size: OPJ_UINT64,
pub marknum: OPJ_UINT32,
pub marker: *mut opj_marker_info_t,
pub maxmarknum: OPJ_UINT32,
pub nb_of_tiles: OPJ_UINT32,
pub tile_index: *mut opj_tile_index_t,
}
pub type opj_codestream_index_t = opj_codestream_index;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_jp2_metadata {
pub not_used: OPJ_INT32,
}
pub type opj_jp2_metadata_t = opj_jp2_metadata;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct opj_jp2_index {
pub not_used: OPJ_INT32,
}
pub type opj_jp2_index_t = opj_jp2_index;
extern "C" {
pub fn opj_version() -> *const c_char;
}
extern "C" {
pub fn opj_image_create(
numcmpts: OPJ_UINT32,
cmptparms: *mut opj_image_cmptparm_t,
clrspc: OPJ_COLOR_SPACE,
) -> *mut opj_image_t;
}
extern "C" {
pub fn opj_image_destroy(image: *mut opj_image_t);
}
extern "C" {
pub fn opj_image_tile_create(
numcmpts: OPJ_UINT32,
cmptparms: *mut opj_image_cmptparm_t,
clrspc: OPJ_COLOR_SPACE,
) -> *mut opj_image_t;
}
extern "C" {
pub fn opj_image_data_alloc(size: OPJ_SIZE_T) -> *mut c_void;
}
extern "C" {
pub fn opj_image_data_free(ptr: *mut c_void);
}
extern "C" {
pub fn opj_stream_default_create(p_is_input: OPJ_BOOL) -> *mut opj_stream_t;
}
extern "C" {
pub fn opj_stream_create(p_buffer_size: OPJ_SIZE_T, p_is_input: OPJ_BOOL) -> *mut opj_stream_t;
}
extern "C" {
pub fn opj_stream_destroy(p_stream: *mut opj_stream_t);
}
extern "C" {
pub fn opj_stream_set_read_function(
p_stream: *mut opj_stream_t,
p_function: opj_stream_read_fn,
);
}
extern "C" {
pub fn opj_stream_set_write_function(
p_stream: *mut opj_stream_t,
p_function: opj_stream_write_fn,
);
}
extern "C" {
pub fn opj_stream_set_skip_function(
p_stream: *mut opj_stream_t,
p_function: opj_stream_skip_fn,
);
}
extern "C" {
pub fn opj_stream_set_seek_function(
p_stream: *mut opj_stream_t,
p_function: opj_stream_seek_fn,
);
}
extern "C" {
pub fn opj_stream_set_user_data(
p_stream: *mut opj_stream_t,
p_data: *mut c_void,
p_function: opj_stream_free_user_data_fn,
);
}
extern "C" {
pub fn opj_stream_set_user_data_length(p_stream: *mut opj_stream_t, data_length: OPJ_UINT64);
}
extern "C" {
pub fn opj_stream_create_default_file_stream(
fname: *const c_char,
p_is_read_stream: OPJ_BOOL,
) -> *mut opj_stream_t;
}
extern "C" {
pub fn opj_stream_create_file_stream(
fname: *const c_char,
p_buffer_size: OPJ_SIZE_T,
p_is_read_stream: OPJ_BOOL,
) -> *mut opj_stream_t;
}
extern "C" {
pub fn opj_set_info_handler(
p_codec: *mut opj_codec_t,
p_callback: opj_msg_callback,
p_user_data: *mut c_void,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_set_warning_handler(
p_codec: *mut opj_codec_t,
p_callback: opj_msg_callback,
p_user_data: *mut c_void,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_set_error_handler(
p_codec: *mut opj_codec_t,
p_callback: opj_msg_callback,
p_user_data: *mut c_void,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_create_decompress(format: OPJ_CODEC_FORMAT) -> *mut opj_codec_t;
}
extern "C" {
pub fn opj_destroy_codec(p_codec: *mut opj_codec_t);
}
extern "C" {
pub fn opj_end_decompress(p_codec: *mut opj_codec_t, p_stream: *mut opj_stream_t) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_set_default_decoder_parameters(parameters: *mut opj_dparameters_t);
}
extern "C" {
pub fn opj_setup_decoder(
p_codec: *mut opj_codec_t,
parameters: *mut opj_dparameters_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_decoder_set_strict_mode(p_codec: *mut opj_codec_t, strict: OPJ_BOOL) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_codec_set_threads(
p_codec: *mut opj_codec_t,
num_threads: c_int,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_read_header(
p_stream: *mut opj_stream_t,
p_codec: *mut opj_codec_t,
p_image: *mut *mut opj_image_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_set_decoded_components(
p_codec: *mut opj_codec_t,
numcomps: OPJ_UINT32,
comps_indices: *const OPJ_UINT32,
apply_color_transforms: OPJ_BOOL,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_set_decode_area(
p_codec: *mut opj_codec_t,
p_image: *mut opj_image_t,
p_start_x: OPJ_INT32,
p_start_y: OPJ_INT32,
p_end_x: OPJ_INT32,
p_end_y: OPJ_INT32,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_decode(
p_decompressor: *mut opj_codec_t,
p_stream: *mut opj_stream_t,
p_image: *mut opj_image_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_get_decoded_tile(
p_codec: *mut opj_codec_t,
p_stream: *mut opj_stream_t,
p_image: *mut opj_image_t,
tile_index: OPJ_UINT32,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_set_decoded_resolution_factor(
p_codec: *mut opj_codec_t,
res_factor: OPJ_UINT32,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_write_tile(
p_codec: *mut opj_codec_t,
p_tile_index: OPJ_UINT32,
p_data: *mut OPJ_BYTE,
p_data_size: OPJ_UINT32,
p_stream: *mut opj_stream_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_read_tile_header(
p_codec: *mut opj_codec_t,
p_stream: *mut opj_stream_t,
p_tile_index: *mut OPJ_UINT32,
p_data_size: *mut OPJ_UINT32,
p_tile_x0: *mut OPJ_INT32,
p_tile_y0: *mut OPJ_INT32,
p_tile_x1: *mut OPJ_INT32,
p_tile_y1: *mut OPJ_INT32,
p_nb_comps: *mut OPJ_UINT32,
p_should_go_on: *mut OPJ_BOOL,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_decode_tile_data(
p_codec: *mut opj_codec_t,
p_tile_index: OPJ_UINT32,
p_data: *mut OPJ_BYTE,
p_data_size: OPJ_UINT32,
p_stream: *mut opj_stream_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_create_compress(format: OPJ_CODEC_FORMAT) -> *mut opj_codec_t;
}
extern "C" {
pub fn opj_set_default_encoder_parameters(parameters: *mut opj_cparameters_t);
}
extern "C" {
pub fn opj_setup_encoder(
p_codec: *mut opj_codec_t,
parameters: *mut opj_cparameters_t,
image: *mut opj_image_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_encoder_set_extra_options(
p_codec: *mut opj_codec_t,
p_options: *const *const c_char,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_start_compress(
p_codec: *mut opj_codec_t,
p_image: *mut opj_image_t,
p_stream: *mut opj_stream_t,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_end_compress(p_codec: *mut opj_codec_t, p_stream: *mut opj_stream_t) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_encode(p_codec: *mut opj_codec_t, p_stream: *mut opj_stream_t) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_destroy_cstr_info(cstr_info: *mut *mut opj_codestream_info_v2_t);
}
extern "C" {
pub fn opj_dump_codec(
p_codec: *mut opj_codec_t,
info_flag: OPJ_INT32,
output_stream: *mut FILE,
);
}
extern "C" {
pub fn opj_get_cstr_info(p_codec: *mut opj_codec_t) -> *mut opj_codestream_info_v2_t;
}
extern "C" {
pub fn opj_get_cstr_index(p_codec: *mut opj_codec_t) -> *mut opj_codestream_index_t;
}
extern "C" {
pub fn opj_destroy_cstr_index(p_cstr_index: *mut *mut opj_codestream_index_t);
}
extern "C" {
pub fn opj_get_jp2_metadata(p_codec: *mut opj_codec_t) -> *mut opj_jp2_metadata_t;
}
extern "C" {
pub fn opj_get_jp2_index(p_codec: *mut opj_codec_t) -> *mut opj_jp2_index_t;
}
extern "C" {
pub fn opj_set_MCT(
parameters: *mut opj_cparameters_t,
pEncodingMatrix: *mut OPJ_FLOAT32,
p_dc_shift: *mut OPJ_INT32,
pNbComp: OPJ_UINT32,
) -> OPJ_BOOL;
}
extern "C" {
pub fn opj_has_thread_support() -> OPJ_BOOL;
}
extern "C" {
pub fn opj_get_num_cpus() -> c_int;
}