/* automatically generated by rust-bindgen 0.72.1 */

pub const SPNG_VERSION_MAJOR: u32 = 0;
pub const SPNG_VERSION_MINOR: u32 = 7;
pub const SPNG_VERSION_PATCH: u32 = 4;
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __darwin_off_t = __int64_t;
pub type fpos_t = __darwin_off_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __sbuf {
    pub _base: *mut ::std::os::raw::c_uchar,
    pub _size: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __sFILEX {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __sFILE {
    pub _p: *mut ::std::os::raw::c_uchar,
    pub _r: ::std::os::raw::c_int,
    pub _w: ::std::os::raw::c_int,
    pub _flags: ::std::os::raw::c_short,
    pub _file: ::std::os::raw::c_short,
    pub _bf: __sbuf,
    pub _lbfsize: ::std::os::raw::c_int,
    pub _cookie: *mut ::std::os::raw::c_void,
    pub _close: ::std::option::Option<
        unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
    >,
    pub _read: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: *mut ::std::os::raw::c_void,
            arg2: *mut ::std::os::raw::c_char,
            __n: ::std::os::raw::c_int,
        ) -> ::std::os::raw::c_int,
    >,
    pub _seek: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: *mut ::std::os::raw::c_void,
            arg2: fpos_t,
            arg3: ::std::os::raw::c_int,
        ) -> fpos_t,
    >,
    pub _write: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: *mut ::std::os::raw::c_void,
            arg2: *const ::std::os::raw::c_char,
            __n: ::std::os::raw::c_int,
        ) -> ::std::os::raw::c_int,
    >,
    pub _ub: __sbuf,
    pub _extra: *mut __sFILEX,
    pub _ur: ::std::os::raw::c_int,
    pub _ubuf: [::std::os::raw::c_uchar; 3usize],
    pub _nbuf: [::std::os::raw::c_uchar; 1usize],
    pub _lb: __sbuf,
    pub _blksize: ::std::os::raw::c_int,
    pub _offset: fpos_t,
}
pub type FILE = __sFILE;
pub const spng_errno_SPNG_IO_ERROR: spng_errno = -2;
pub const spng_errno_SPNG_IO_EOF: spng_errno = -1;
pub const spng_errno_SPNG_OK: spng_errno = 0;
pub const spng_errno_SPNG_EINVAL: spng_errno = 1;
pub const spng_errno_SPNG_EMEM: spng_errno = 2;
pub const spng_errno_SPNG_EOVERFLOW: spng_errno = 3;
pub const spng_errno_SPNG_ESIGNATURE: spng_errno = 4;
pub const spng_errno_SPNG_EWIDTH: spng_errno = 5;
pub const spng_errno_SPNG_EHEIGHT: spng_errno = 6;
pub const spng_errno_SPNG_EUSER_WIDTH: spng_errno = 7;
pub const spng_errno_SPNG_EUSER_HEIGHT: spng_errno = 8;
pub const spng_errno_SPNG_EBIT_DEPTH: spng_errno = 9;
pub const spng_errno_SPNG_ECOLOR_TYPE: spng_errno = 10;
pub const spng_errno_SPNG_ECOMPRESSION_METHOD: spng_errno = 11;
pub const spng_errno_SPNG_EFILTER_METHOD: spng_errno = 12;
pub const spng_errno_SPNG_EINTERLACE_METHOD: spng_errno = 13;
pub const spng_errno_SPNG_EIHDR_SIZE: spng_errno = 14;
pub const spng_errno_SPNG_ENOIHDR: spng_errno = 15;
pub const spng_errno_SPNG_ECHUNK_POS: spng_errno = 16;
pub const spng_errno_SPNG_ECHUNK_SIZE: spng_errno = 17;
pub const spng_errno_SPNG_ECHUNK_CRC: spng_errno = 18;
pub const spng_errno_SPNG_ECHUNK_TYPE: spng_errno = 19;
pub const spng_errno_SPNG_ECHUNK_UNKNOWN_CRITICAL: spng_errno = 20;
pub const spng_errno_SPNG_EDUP_PLTE: spng_errno = 21;
pub const spng_errno_SPNG_EDUP_CHRM: spng_errno = 22;
pub const spng_errno_SPNG_EDUP_GAMA: spng_errno = 23;
pub const spng_errno_SPNG_EDUP_ICCP: spng_errno = 24;
pub const spng_errno_SPNG_EDUP_SBIT: spng_errno = 25;
pub const spng_errno_SPNG_EDUP_SRGB: spng_errno = 26;
pub const spng_errno_SPNG_EDUP_BKGD: spng_errno = 27;
pub const spng_errno_SPNG_EDUP_HIST: spng_errno = 28;
pub const spng_errno_SPNG_EDUP_TRNS: spng_errno = 29;
pub const spng_errno_SPNG_EDUP_PHYS: spng_errno = 30;
pub const spng_errno_SPNG_EDUP_TIME: spng_errno = 31;
pub const spng_errno_SPNG_EDUP_OFFS: spng_errno = 32;
pub const spng_errno_SPNG_EDUP_EXIF: spng_errno = 33;
pub const spng_errno_SPNG_ECHRM: spng_errno = 34;
pub const spng_errno_SPNG_EPLTE_IDX: spng_errno = 35;
pub const spng_errno_SPNG_ETRNS_COLOR_TYPE: spng_errno = 36;
pub const spng_errno_SPNG_ETRNS_NO_PLTE: spng_errno = 37;
pub const spng_errno_SPNG_EGAMA: spng_errno = 38;
pub const spng_errno_SPNG_EICCP_NAME: spng_errno = 39;
pub const spng_errno_SPNG_EICCP_COMPRESSION_METHOD: spng_errno = 40;
pub const spng_errno_SPNG_ESBIT: spng_errno = 41;
pub const spng_errno_SPNG_ESRGB: spng_errno = 42;
pub const spng_errno_SPNG_ETEXT: spng_errno = 43;
pub const spng_errno_SPNG_ETEXT_KEYWORD: spng_errno = 44;
pub const spng_errno_SPNG_EZTXT: spng_errno = 45;
pub const spng_errno_SPNG_EZTXT_COMPRESSION_METHOD: spng_errno = 46;
pub const spng_errno_SPNG_EITXT: spng_errno = 47;
pub const spng_errno_SPNG_EITXT_COMPRESSION_FLAG: spng_errno = 48;
pub const spng_errno_SPNG_EITXT_COMPRESSION_METHOD: spng_errno = 49;
pub const spng_errno_SPNG_EITXT_LANG_TAG: spng_errno = 50;
pub const spng_errno_SPNG_EITXT_TRANSLATED_KEY: spng_errno = 51;
pub const spng_errno_SPNG_EBKGD_NO_PLTE: spng_errno = 52;
pub const spng_errno_SPNG_EBKGD_PLTE_IDX: spng_errno = 53;
pub const spng_errno_SPNG_EHIST_NO_PLTE: spng_errno = 54;
pub const spng_errno_SPNG_EPHYS: spng_errno = 55;
pub const spng_errno_SPNG_ESPLT_NAME: spng_errno = 56;
pub const spng_errno_SPNG_ESPLT_DUP_NAME: spng_errno = 57;
pub const spng_errno_SPNG_ESPLT_DEPTH: spng_errno = 58;
pub const spng_errno_SPNG_ETIME: spng_errno = 59;
pub const spng_errno_SPNG_EOFFS: spng_errno = 60;
pub const spng_errno_SPNG_EEXIF: spng_errno = 61;
pub const spng_errno_SPNG_EIDAT_TOO_SHORT: spng_errno = 62;
pub const spng_errno_SPNG_EIDAT_STREAM: spng_errno = 63;
pub const spng_errno_SPNG_EZLIB: spng_errno = 64;
pub const spng_errno_SPNG_EFILTER: spng_errno = 65;
pub const spng_errno_SPNG_EBUFSIZ: spng_errno = 66;
pub const spng_errno_SPNG_EIO: spng_errno = 67;
pub const spng_errno_SPNG_EOF: spng_errno = 68;
pub const spng_errno_SPNG_EBUF_SET: spng_errno = 69;
pub const spng_errno_SPNG_EBADSTATE: spng_errno = 70;
pub const spng_errno_SPNG_EFMT: spng_errno = 71;
pub const spng_errno_SPNG_EFLAGS: spng_errno = 72;
pub const spng_errno_SPNG_ECHUNKAVAIL: spng_errno = 73;
pub const spng_errno_SPNG_ENCODE_ONLY: spng_errno = 74;
pub const spng_errno_SPNG_EOI: spng_errno = 75;
pub const spng_errno_SPNG_ENOPLTE: spng_errno = 76;
pub const spng_errno_SPNG_ECHUNK_LIMITS: spng_errno = 77;
pub const spng_errno_SPNG_EZLIB_INIT: spng_errno = 78;
pub const spng_errno_SPNG_ECHUNK_STDLEN: spng_errno = 79;
pub const spng_errno_SPNG_EINTERNAL: spng_errno = 80;
pub const spng_errno_SPNG_ECTXTYPE: spng_errno = 81;
pub const spng_errno_SPNG_ENOSRC: spng_errno = 82;
pub const spng_errno_SPNG_ENODST: spng_errno = 83;
pub const spng_errno_SPNG_EOPSTATE: spng_errno = 84;
pub const spng_errno_SPNG_ENOTFINAL: spng_errno = 85;
pub type spng_errno = ::std::os::raw::c_int;
pub const spng_text_type_SPNG_TEXT: spng_text_type = 1;
pub const spng_text_type_SPNG_ZTXT: spng_text_type = 2;
pub const spng_text_type_SPNG_ITXT: spng_text_type = 3;
pub type spng_text_type = ::std::os::raw::c_uint;
pub const spng_color_type_SPNG_COLOR_TYPE_GRAYSCALE: spng_color_type = 0;
pub const spng_color_type_SPNG_COLOR_TYPE_TRUECOLOR: spng_color_type = 2;
pub const spng_color_type_SPNG_COLOR_TYPE_INDEXED: spng_color_type = 3;
pub const spng_color_type_SPNG_COLOR_TYPE_GRAYSCALE_ALPHA: spng_color_type = 4;
pub const spng_color_type_SPNG_COLOR_TYPE_TRUECOLOR_ALPHA: spng_color_type = 6;
pub type spng_color_type = ::std::os::raw::c_uint;
pub const spng_filter_SPNG_FILTER_NONE: spng_filter = 0;
pub const spng_filter_SPNG_FILTER_SUB: spng_filter = 1;
pub const spng_filter_SPNG_FILTER_UP: spng_filter = 2;
pub const spng_filter_SPNG_FILTER_AVERAGE: spng_filter = 3;
pub const spng_filter_SPNG_FILTER_PAETH: spng_filter = 4;
pub type spng_filter = ::std::os::raw::c_uint;
pub const spng_filter_choice_SPNG_DISABLE_FILTERING: spng_filter_choice = 0;
pub const spng_filter_choice_SPNG_FILTER_CHOICE_NONE: spng_filter_choice = 8;
pub const spng_filter_choice_SPNG_FILTER_CHOICE_SUB: spng_filter_choice = 16;
pub const spng_filter_choice_SPNG_FILTER_CHOICE_UP: spng_filter_choice = 32;
pub const spng_filter_choice_SPNG_FILTER_CHOICE_AVG: spng_filter_choice = 64;
pub const spng_filter_choice_SPNG_FILTER_CHOICE_PAETH: spng_filter_choice = 128;
pub const spng_filter_choice_SPNG_FILTER_CHOICE_ALL: spng_filter_choice = 248;
pub type spng_filter_choice = ::std::os::raw::c_uint;
pub const spng_interlace_method_SPNG_INTERLACE_NONE: spng_interlace_method = 0;
pub const spng_interlace_method_SPNG_INTERLACE_ADAM7: spng_interlace_method = 1;
pub type spng_interlace_method = ::std::os::raw::c_uint;
pub const spng_format_SPNG_FMT_RGBA8: spng_format = 1;
pub const spng_format_SPNG_FMT_RGBA16: spng_format = 2;
pub const spng_format_SPNG_FMT_RGB8: spng_format = 4;
pub const spng_format_SPNG_FMT_GA8: spng_format = 16;
pub const spng_format_SPNG_FMT_GA16: spng_format = 32;
pub const spng_format_SPNG_FMT_G8: spng_format = 64;
pub const spng_format_SPNG_FMT_PNG: spng_format = 256;
pub const spng_format_SPNG_FMT_RAW: spng_format = 512;
pub type spng_format = ::std::os::raw::c_uint;
pub const spng_ctx_flags_SPNG_CTX_IGNORE_ADLER32: spng_ctx_flags = 1;
pub const spng_ctx_flags_SPNG_CTX_ENCODER: spng_ctx_flags = 2;
pub type spng_ctx_flags = ::std::os::raw::c_uint;
pub const spng_decode_flags_SPNG_DECODE_USE_TRNS: spng_decode_flags = 1;
pub const spng_decode_flags_SPNG_DECODE_USE_GAMA: spng_decode_flags = 2;
pub const spng_decode_flags_SPNG_DECODE_USE_SBIT: spng_decode_flags = 8;
pub const spng_decode_flags_SPNG_DECODE_TRNS: spng_decode_flags = 1;
pub const spng_decode_flags_SPNG_DECODE_GAMMA: spng_decode_flags = 2;
pub const spng_decode_flags_SPNG_DECODE_PROGRESSIVE: spng_decode_flags = 256;
pub type spng_decode_flags = ::std::os::raw::c_uint;
pub const spng_crc_action_SPNG_CRC_ERROR: spng_crc_action = 0;
pub const spng_crc_action_SPNG_CRC_DISCARD: spng_crc_action = 1;
pub const spng_crc_action_SPNG_CRC_USE: spng_crc_action = 2;
pub type spng_crc_action = ::std::os::raw::c_uint;
pub const spng_encode_flags_SPNG_ENCODE_PROGRESSIVE: spng_encode_flags = 1;
pub const spng_encode_flags_SPNG_ENCODE_FINALIZE: spng_encode_flags = 2;
pub type spng_encode_flags = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_ihdr {
    pub width: u32,
    pub height: u32,
    pub bit_depth: u8,
    pub color_type: u8,
    pub compression_method: u8,
    pub filter_method: u8,
    pub interlace_method: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_plte_entry {
    pub red: u8,
    pub green: u8,
    pub blue: u8,
    pub alpha: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_plte {
    pub n_entries: u32,
    pub entries: [spng_plte_entry; 256usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_trns {
    pub gray: u16,
    pub red: u16,
    pub green: u16,
    pub blue: u16,
    pub n_type3_entries: u32,
    pub type3_alpha: [u8; 256usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_chrm_int {
    pub white_point_x: u32,
    pub white_point_y: u32,
    pub red_x: u32,
    pub red_y: u32,
    pub green_x: u32,
    pub green_y: u32,
    pub blue_x: u32,
    pub blue_y: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_chrm {
    pub white_point_x: f64,
    pub white_point_y: f64,
    pub red_x: f64,
    pub red_y: f64,
    pub green_x: f64,
    pub green_y: f64,
    pub blue_x: f64,
    pub blue_y: f64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_iccp {
    pub profile_name: [::std::os::raw::c_char; 80usize],
    pub profile_len: usize,
    pub profile: *mut ::std::os::raw::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_sbit {
    pub grayscale_bits: u8,
    pub red_bits: u8,
    pub green_bits: u8,
    pub blue_bits: u8,
    pub alpha_bits: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_text {
    pub keyword: [::std::os::raw::c_char; 80usize],
    pub type_: ::std::os::raw::c_int,
    pub length: usize,
    pub text: *mut ::std::os::raw::c_char,
    pub compression_flag: u8,
    pub compression_method: u8,
    pub language_tag: *mut ::std::os::raw::c_char,
    pub translated_keyword: *mut ::std::os::raw::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_bkgd {
    pub gray: u16,
    pub red: u16,
    pub green: u16,
    pub blue: u16,
    pub plte_index: u16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_hist {
    pub frequency: [u16; 256usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_phys {
    pub ppu_x: u32,
    pub ppu_y: u32,
    pub unit_specifier: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_splt_entry {
    pub red: u16,
    pub green: u16,
    pub blue: u16,
    pub alpha: u16,
    pub frequency: u16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_splt {
    pub name: [::std::os::raw::c_char; 80usize],
    pub sample_depth: u8,
    pub n_entries: u32,
    pub entries: *mut spng_splt_entry,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_time {
    pub year: u16,
    pub month: u8,
    pub day: u8,
    pub hour: u8,
    pub minute: u8,
    pub second: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_offs {
    pub x: i32,
    pub y: i32,
    pub unit_specifier: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_exif {
    pub length: usize,
    pub data: *mut ::std::os::raw::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_chunk {
    pub offset: usize,
    pub length: u32,
    pub type_: [u8; 4usize],
    pub crc: u32,
}
pub const spng_location_SPNG_AFTER_IHDR: spng_location = 1;
pub const spng_location_SPNG_AFTER_PLTE: spng_location = 2;
pub const spng_location_SPNG_AFTER_IDAT: spng_location = 8;
pub type spng_location = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_unknown_chunk {
    pub type_: [u8; 4usize],
    pub length: usize,
    pub data: *mut ::std::os::raw::c_void,
    pub location: spng_location,
}
pub const spng_option_SPNG_KEEP_UNKNOWN_CHUNKS: spng_option = 1;
pub const spng_option_SPNG_IMG_COMPRESSION_LEVEL: spng_option = 2;
pub const spng_option_SPNG_IMG_WINDOW_BITS: spng_option = 3;
pub const spng_option_SPNG_IMG_MEM_LEVEL: spng_option = 4;
pub const spng_option_SPNG_IMG_COMPRESSION_STRATEGY: spng_option = 5;
pub const spng_option_SPNG_TEXT_COMPRESSION_LEVEL: spng_option = 6;
pub const spng_option_SPNG_TEXT_WINDOW_BITS: spng_option = 7;
pub const spng_option_SPNG_TEXT_MEM_LEVEL: spng_option = 8;
pub const spng_option_SPNG_TEXT_COMPRESSION_STRATEGY: spng_option = 9;
pub const spng_option_SPNG_FILTER_CHOICE: spng_option = 10;
pub const spng_option_SPNG_CHUNK_COUNT_LIMIT: spng_option = 11;
pub const spng_option_SPNG_ENCODE_TO_BUFFER: spng_option = 12;
pub type spng_option = ::std::os::raw::c_uint;
pub type spng_malloc_fn =
    ::std::option::Option<unsafe extern "C" fn(size: usize) -> *mut ::std::os::raw::c_void>;
pub type spng_realloc_fn = ::std::option::Option<
    unsafe extern "C" fn(
        ptr: *mut ::std::os::raw::c_void,
        size: usize,
    ) -> *mut ::std::os::raw::c_void,
>;
pub type spng_calloc_fn = ::std::option::Option<
    unsafe extern "C" fn(count: usize, size: usize) -> *mut ::std::os::raw::c_void,
>;
pub type spng_free_fn =
    ::std::option::Option<unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_alloc {
    pub malloc_fn: spng_malloc_fn,
    pub realloc_fn: spng_realloc_fn,
    pub calloc_fn: spng_calloc_fn,
    pub free_fn: spng_free_fn,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_row_info {
    pub scanline_idx: u32,
    pub row_num: u32,
    pub pass: ::std::os::raw::c_int,
    pub filter: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spng_ctx {
    _unused: [u8; 0],
}
pub type spng_read_fn = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut spng_ctx,
        user: *mut ::std::os::raw::c_void,
        dest: *mut ::std::os::raw::c_void,
        length: usize,
    ) -> ::std::os::raw::c_int,
>;
pub type spng_write_fn = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut spng_ctx,
        user: *mut ::std::os::raw::c_void,
        src: *mut ::std::os::raw::c_void,
        length: usize,
    ) -> ::std::os::raw::c_int,
>;
pub type spng_rw_fn = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut spng_ctx,
        user: *mut ::std::os::raw::c_void,
        dst_src: *mut ::std::os::raw::c_void,
        length: usize,
    ) -> ::std::os::raw::c_int,
>;
unsafe extern "C" {
    pub fn spng_ctx_new(flags: ::std::os::raw::c_int) -> *mut spng_ctx;
}
unsafe extern "C" {
    pub fn spng_ctx_new2(alloc: *mut spng_alloc, flags: ::std::os::raw::c_int) -> *mut spng_ctx;
}
unsafe extern "C" {
    pub fn spng_ctx_free(ctx: *mut spng_ctx);
}
unsafe extern "C" {
    pub fn spng_set_png_buffer(
        ctx: *mut spng_ctx,
        buf: *const ::std::os::raw::c_void,
        size: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_png_stream(
        ctx: *mut spng_ctx,
        rw_func: spng_rw_fn,
        user: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_png_file(ctx: *mut spng_ctx, file: *mut FILE) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_png_buffer(
        ctx: *mut spng_ctx,
        len: *mut usize,
        error: *mut ::std::os::raw::c_int,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn spng_set_image_limits(
        ctx: *mut spng_ctx,
        width: u32,
        height: u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_image_limits(
        ctx: *mut spng_ctx,
        width: *mut u32,
        height: *mut u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_chunk_limits(
        ctx: *mut spng_ctx,
        chunk_size: usize,
        cache_size: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_chunk_limits(
        ctx: *mut spng_ctx,
        chunk_size: *mut usize,
        cache_size: *mut usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_crc_action(
        ctx: *mut spng_ctx,
        critical: ::std::os::raw::c_int,
        ancillary: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_option(
        ctx: *mut spng_ctx,
        option: spng_option,
        value: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_option(
        ctx: *mut spng_ctx,
        option: spng_option,
        value: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_decoded_image_size(
        ctx: *mut spng_ctx,
        fmt: ::std::os::raw::c_int,
        len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_decode_image(
        ctx: *mut spng_ctx,
        out: *mut ::std::os::raw::c_void,
        len: usize,
        fmt: ::std::os::raw::c_int,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_decode_scanline(
        ctx: *mut spng_ctx,
        out: *mut ::std::os::raw::c_void,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_decode_row(
        ctx: *mut spng_ctx,
        out: *mut ::std::os::raw::c_void,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_decode_chunks(ctx: *mut spng_ctx) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_row_info(
        ctx: *mut spng_ctx,
        row_info: *mut spng_row_info,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_encode_image(
        ctx: *mut spng_ctx,
        img: *const ::std::os::raw::c_void,
        len: usize,
        fmt: ::std::os::raw::c_int,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_encode_scanline(
        ctx: *mut spng_ctx,
        scanline: *const ::std::os::raw::c_void,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_encode_row(
        ctx: *mut spng_ctx,
        row: *const ::std::os::raw::c_void,
        len: usize,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_encode_chunks(ctx: *mut spng_ctx) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_ihdr(ctx: *mut spng_ctx, ihdr: *mut spng_ihdr) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_plte(ctx: *mut spng_ctx, plte: *mut spng_plte) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_trns(ctx: *mut spng_ctx, trns: *mut spng_trns) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_chrm(ctx: *mut spng_ctx, chrm: *mut spng_chrm) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_chrm_int(
        ctx: *mut spng_ctx,
        chrm_int: *mut spng_chrm_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_gama(ctx: *mut spng_ctx, gamma: *mut f64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_gama_int(ctx: *mut spng_ctx, gama_int: *mut u32) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_iccp(ctx: *mut spng_ctx, iccp: *mut spng_iccp) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_sbit(ctx: *mut spng_ctx, sbit: *mut spng_sbit) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_srgb(ctx: *mut spng_ctx, rendering_intent: *mut u8) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_text(
        ctx: *mut spng_ctx,
        text: *mut spng_text,
        n_text: *mut u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_bkgd(ctx: *mut spng_ctx, bkgd: *mut spng_bkgd) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_hist(ctx: *mut spng_ctx, hist: *mut spng_hist) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_phys(ctx: *mut spng_ctx, phys: *mut spng_phys) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_splt(
        ctx: *mut spng_ctx,
        splt: *mut spng_splt,
        n_splt: *mut u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_time(ctx: *mut spng_ctx, time: *mut spng_time) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_unknown_chunks(
        ctx: *mut spng_ctx,
        chunks: *mut spng_unknown_chunk,
        n_chunks: *mut u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_offs(ctx: *mut spng_ctx, offs: *mut spng_offs) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_get_exif(ctx: *mut spng_ctx, exif: *mut spng_exif) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_ihdr(ctx: *mut spng_ctx, ihdr: *mut spng_ihdr) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_plte(ctx: *mut spng_ctx, plte: *mut spng_plte) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_trns(ctx: *mut spng_ctx, trns: *mut spng_trns) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_chrm(ctx: *mut spng_ctx, chrm: *mut spng_chrm) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_chrm_int(
        ctx: *mut spng_ctx,
        chrm_int: *mut spng_chrm_int,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_gama(ctx: *mut spng_ctx, gamma: f64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_gama_int(ctx: *mut spng_ctx, gamma: u32) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_iccp(ctx: *mut spng_ctx, iccp: *mut spng_iccp) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_sbit(ctx: *mut spng_ctx, sbit: *mut spng_sbit) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_srgb(ctx: *mut spng_ctx, rendering_intent: u8) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_text(
        ctx: *mut spng_ctx,
        text: *mut spng_text,
        n_text: u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_bkgd(ctx: *mut spng_ctx, bkgd: *mut spng_bkgd) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_hist(ctx: *mut spng_ctx, hist: *mut spng_hist) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_phys(ctx: *mut spng_ctx, phys: *mut spng_phys) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_splt(
        ctx: *mut spng_ctx,
        splt: *mut spng_splt,
        n_splt: u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_time(ctx: *mut spng_ctx, time: *mut spng_time) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_unknown_chunks(
        ctx: *mut spng_ctx,
        chunks: *mut spng_unknown_chunk,
        n_chunks: u32,
    ) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_offs(ctx: *mut spng_ctx, offs: *mut spng_offs) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_set_exif(ctx: *mut spng_ctx, exif: *mut spng_exif) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    pub fn spng_strerror(err: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    pub fn spng_version_string() -> *const ::std::os::raw::c_char;
}
