use std::ffi::c_void;
use crate::common::types::JxlBool;
use super::color_encoding::JxlColorEncoding;
pub type JpegXlCmsSetFieldsFromIccFunc = extern "C-unwind" fn(
user_data: *mut c_void,
icc_data: *const u8,
icc_size: usize,
c: *mut JxlColorEncoding,
cmyk: *mut JxlBool,
) -> JxlBool;
#[repr(C)]
#[derive(Debug, Clone)]
pub struct JxlColorProfileIcc {
data: *const u8,
size: usize,
}
#[repr(C)]
#[derive(Debug, Clone)]
pub struct JxlColorProfile {
pub icc: JxlColorProfileIcc,
pub color_encoding: JxlColorEncoding,
pub num_channels: usize,
}
pub type JpegXlCmsInitFunc = extern "C-unwind" fn(
init_data: *mut c_void,
num_threads: usize,
pixels_per_thread: usize,
input_profile: *const JxlColorProfile,
output_profile: *const JxlColorProfile,
intensity_target: f32,
) -> *mut c_void;
pub type JpegXlCmsGetBufferFunc =
extern "C-unwind" fn(user_data: *mut c_void, thread: usize) -> *mut f32;
pub type JpegXlCmsRunFunc = extern "C-unwind" fn(
user_data: *mut c_void,
thread: usize,
input_buffer: *const f32,
output_buffer: *mut f32,
num_pixels: usize,
) -> JxlBool;
pub type JpegXlCmsDestroyFun = extern "C-unwind" fn(user_data: *mut c_void);
#[repr(C)]
#[derive(Debug, Clone)]
pub struct JxlCmsInterface {
pub set_fields_data: *mut c_void,
pub set_fields_from_icc: JpegXlCmsSetFieldsFromIccFunc,
pub init_data: *mut c_void,
pub init: JpegXlCmsInitFunc,
pub get_src_buf: JpegXlCmsGetBufferFunc,
pub get_dst_buf: JpegXlCmsGetBufferFunc,
pub run: JpegXlCmsRunFunc,
pub destroy: JpegXlCmsDestroyFun,
}