img-rs 2.27.0

safe bindings for stb_image
Documentation
/* automatically generated by rust-bindgen 0.60.1 */

pub type stbi_uc = cty::c_uchar;
pub type stbi_us = cty::c_ushort;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct stbi_io_callbacks {
    pub read: ::core::option::Option<
        unsafe extern "C" fn(
            user: *mut cty::c_void,
            data: *mut cty::c_char,
            size: cty::c_int,
        ) -> cty::c_int,
    >,
    pub skip: ::core::option::Option<unsafe extern "C" fn(user: *mut cty::c_void, n: cty::c_int)>,
    pub eof: ::core::option::Option<unsafe extern "C" fn(user: *mut cty::c_void) -> cty::c_int>,
}
extern "C" {
    pub fn stbi_load_from_memory(
        buffer: *const stbi_uc,
        len: cty::c_int,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut stbi_uc;
}
extern "C" {
    pub fn stbi_load_from_callbacks(
        clbk: *const stbi_io_callbacks,
        user: *mut cty::c_void,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut stbi_uc;
}
extern "C" {
    pub fn stbi_load(
        filename: *const cty::c_char,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut stbi_uc;
}
extern "C" {
    pub fn stbi_load_gif_from_memory(
        buffer: *const stbi_uc,
        len: cty::c_int,
        delays: *mut *mut cty::c_int,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        z: *mut cty::c_int,
        comp: *mut cty::c_int,
        req_comp: cty::c_int,
    ) -> *mut stbi_uc;
}
extern "C" {
    pub fn stbi_load_16_from_memory(
        buffer: *const stbi_uc,
        len: cty::c_int,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut stbi_us;
}
extern "C" {
    pub fn stbi_load_16_from_callbacks(
        clbk: *const stbi_io_callbacks,
        user: *mut cty::c_void,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut stbi_us;
}
extern "C" {
    pub fn stbi_load_16(
        filename: *const cty::c_char,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut stbi_us;
}
extern "C" {
    pub fn stbi_loadf_from_memory(
        buffer: *const stbi_uc,
        len: cty::c_int,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut f32;
}
extern "C" {
    pub fn stbi_loadf_from_callbacks(
        clbk: *const stbi_io_callbacks,
        user: *mut cty::c_void,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut f32;
}
extern "C" {
    pub fn stbi_loadf(
        filename: *const cty::c_char,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        channels_in_file: *mut cty::c_int,
        desired_channels: cty::c_int,
    ) -> *mut f32;
}
extern "C" {
    pub fn stbi_hdr_to_ldr_gamma(gamma: f32);
}
extern "C" {
    pub fn stbi_hdr_to_ldr_scale(scale: f32);
}
extern "C" {
    pub fn stbi_ldr_to_hdr_gamma(gamma: f32);
}
extern "C" {
    pub fn stbi_ldr_to_hdr_scale(scale: f32);
}
extern "C" {
    pub fn stbi_is_hdr_from_callbacks(
        clbk: *const stbi_io_callbacks,
        user: *mut cty::c_void,
    ) -> cty::c_int;
}
extern "C" {
    pub fn stbi_is_hdr_from_memory(buffer: *const stbi_uc, len: cty::c_int) -> cty::c_int;
}
extern "C" {
    pub fn stbi_is_hdr(filename: *const cty::c_char) -> cty::c_int;
}
extern "C" {
    pub fn stbi_failure_reason() -> *const cty::c_char;
}
extern "C" {
    pub fn stbi_image_free(retval_from_stbi_load: *mut cty::c_void);
}
extern "C" {
    pub fn stbi_info_from_memory(
        buffer: *const stbi_uc,
        len: cty::c_int,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        comp: *mut cty::c_int,
    ) -> cty::c_int;
}
extern "C" {
    pub fn stbi_info_from_callbacks(
        clbk: *const stbi_io_callbacks,
        user: *mut cty::c_void,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        comp: *mut cty::c_int,
    ) -> cty::c_int;
}
extern "C" {
    pub fn stbi_is_16_bit_from_memory(buffer: *const stbi_uc, len: cty::c_int) -> cty::c_int;
}
extern "C" {
    pub fn stbi_is_16_bit_from_callbacks(
        clbk: *const stbi_io_callbacks,
        user: *mut cty::c_void,
    ) -> cty::c_int;
}
extern "C" {
    pub fn stbi_info(
        filename: *const cty::c_char,
        x: *mut cty::c_int,
        y: *mut cty::c_int,
        comp: *mut cty::c_int,
    ) -> cty::c_int;
}
extern "C" {
    pub fn stbi_is_16_bit(filename: *const cty::c_char) -> cty::c_int;
}
extern "C" {
    pub fn stbi_set_unpremultiply_on_load(flag_true_if_should_unpremultiply: cty::c_int);
}
extern "C" {
    pub fn stbi_convert_iphone_png_to_rgb(flag_true_if_should_convert: cty::c_int);
}
extern "C" {
    pub fn stbi_set_flip_vertically_on_load(flag_true_if_should_flip: cty::c_int);
}
extern "C" {
    pub fn stbi_set_unpremultiply_on_load_thread(flag_true_if_should_unpremultiply: cty::c_int);
}
extern "C" {
    pub fn stbi_convert_iphone_png_to_rgb_thread(flag_true_if_should_convert: cty::c_int);
}
extern "C" {
    pub fn stbi_set_flip_vertically_on_load_thread(flag_true_if_should_flip: cty::c_int);
}
extern "C" {
    pub fn stbi_zlib_decode_malloc_guesssize(
        buffer: *const cty::c_char,
        len: cty::c_int,
        initial_size: cty::c_int,
        outlen: *mut cty::c_int,
    ) -> *mut cty::c_char;
}
extern "C" {
    pub fn stbi_zlib_decode_malloc_guesssize_headerflag(
        buffer: *const cty::c_char,
        len: cty::c_int,
        initial_size: cty::c_int,
        outlen: *mut cty::c_int,
        parse_header: cty::c_int,
    ) -> *mut cty::c_char;
}
extern "C" {
    pub fn stbi_zlib_decode_malloc(
        buffer: *const cty::c_char,
        len: cty::c_int,
        outlen: *mut cty::c_int,
    ) -> *mut cty::c_char;
}
extern "C" {
    pub fn stbi_zlib_decode_buffer(
        obuffer: *mut cty::c_char,
        olen: cty::c_int,
        ibuffer: *const cty::c_char,
        ilen: cty::c_int,
    ) -> cty::c_int;
}
extern "C" {
    pub fn stbi_zlib_decode_noheader_malloc(
        buffer: *const cty::c_char,
        len: cty::c_int,
        outlen: *mut cty::c_int,
    ) -> *mut cty::c_char;
}
extern "C" {
    pub fn stbi_zlib_decode_noheader_buffer(
        obuffer: *mut cty::c_char,
        olen: cty::c_int,
        ibuffer: *const cty::c_char,
        ilen: cty::c_int,
    ) -> cty::c_int;
}