Skip to main content

blazediff_shared/
spng_ffi.rs

1/* automatically generated by rust-bindgen 0.72.1 */
2
3pub const SPNG_VERSION_MAJOR: u32 = 0;
4pub const SPNG_VERSION_MINOR: u32 = 7;
5pub const SPNG_VERSION_PATCH: u32 = 4;
6pub type __int64_t = ::std::os::raw::c_longlong;
7pub type __darwin_off_t = __int64_t;
8pub type fpos_t = __darwin_off_t;
9#[repr(C)]
10#[derive(Debug, Copy, Clone)]
11pub struct __sbuf {
12    pub _base: *mut ::std::os::raw::c_uchar,
13    pub _size: ::std::os::raw::c_int,
14}
15#[repr(C)]
16#[derive(Debug, Copy, Clone)]
17pub struct __sFILEX {
18    _unused: [u8; 0],
19}
20#[repr(C)]
21#[derive(Debug, Copy, Clone)]
22pub struct __sFILE {
23    pub _p: *mut ::std::os::raw::c_uchar,
24    pub _r: ::std::os::raw::c_int,
25    pub _w: ::std::os::raw::c_int,
26    pub _flags: ::std::os::raw::c_short,
27    pub _file: ::std::os::raw::c_short,
28    pub _bf: __sbuf,
29    pub _lbfsize: ::std::os::raw::c_int,
30    pub _cookie: *mut ::std::os::raw::c_void,
31    pub _close: ::std::option::Option<
32        unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
33    >,
34    pub _read: ::std::option::Option<
35        unsafe extern "C" fn(
36            arg1: *mut ::std::os::raw::c_void,
37            arg2: *mut ::std::os::raw::c_char,
38            __n: ::std::os::raw::c_int,
39        ) -> ::std::os::raw::c_int,
40    >,
41    pub _seek: ::std::option::Option<
42        unsafe extern "C" fn(
43            arg1: *mut ::std::os::raw::c_void,
44            arg2: fpos_t,
45            arg3: ::std::os::raw::c_int,
46        ) -> fpos_t,
47    >,
48    pub _write: ::std::option::Option<
49        unsafe extern "C" fn(
50            arg1: *mut ::std::os::raw::c_void,
51            arg2: *const ::std::os::raw::c_char,
52            __n: ::std::os::raw::c_int,
53        ) -> ::std::os::raw::c_int,
54    >,
55    pub _ub: __sbuf,
56    pub _extra: *mut __sFILEX,
57    pub _ur: ::std::os::raw::c_int,
58    pub _ubuf: [::std::os::raw::c_uchar; 3usize],
59    pub _nbuf: [::std::os::raw::c_uchar; 1usize],
60    pub _lb: __sbuf,
61    pub _blksize: ::std::os::raw::c_int,
62    pub _offset: fpos_t,
63}
64pub type FILE = __sFILE;
65pub const spng_errno_SPNG_IO_ERROR: spng_errno = -2;
66pub const spng_errno_SPNG_IO_EOF: spng_errno = -1;
67pub const spng_errno_SPNG_OK: spng_errno = 0;
68pub const spng_errno_SPNG_EINVAL: spng_errno = 1;
69pub const spng_errno_SPNG_EMEM: spng_errno = 2;
70pub const spng_errno_SPNG_EOVERFLOW: spng_errno = 3;
71pub const spng_errno_SPNG_ESIGNATURE: spng_errno = 4;
72pub const spng_errno_SPNG_EWIDTH: spng_errno = 5;
73pub const spng_errno_SPNG_EHEIGHT: spng_errno = 6;
74pub const spng_errno_SPNG_EUSER_WIDTH: spng_errno = 7;
75pub const spng_errno_SPNG_EUSER_HEIGHT: spng_errno = 8;
76pub const spng_errno_SPNG_EBIT_DEPTH: spng_errno = 9;
77pub const spng_errno_SPNG_ECOLOR_TYPE: spng_errno = 10;
78pub const spng_errno_SPNG_ECOMPRESSION_METHOD: spng_errno = 11;
79pub const spng_errno_SPNG_EFILTER_METHOD: spng_errno = 12;
80pub const spng_errno_SPNG_EINTERLACE_METHOD: spng_errno = 13;
81pub const spng_errno_SPNG_EIHDR_SIZE: spng_errno = 14;
82pub const spng_errno_SPNG_ENOIHDR: spng_errno = 15;
83pub const spng_errno_SPNG_ECHUNK_POS: spng_errno = 16;
84pub const spng_errno_SPNG_ECHUNK_SIZE: spng_errno = 17;
85pub const spng_errno_SPNG_ECHUNK_CRC: spng_errno = 18;
86pub const spng_errno_SPNG_ECHUNK_TYPE: spng_errno = 19;
87pub const spng_errno_SPNG_ECHUNK_UNKNOWN_CRITICAL: spng_errno = 20;
88pub const spng_errno_SPNG_EDUP_PLTE: spng_errno = 21;
89pub const spng_errno_SPNG_EDUP_CHRM: spng_errno = 22;
90pub const spng_errno_SPNG_EDUP_GAMA: spng_errno = 23;
91pub const spng_errno_SPNG_EDUP_ICCP: spng_errno = 24;
92pub const spng_errno_SPNG_EDUP_SBIT: spng_errno = 25;
93pub const spng_errno_SPNG_EDUP_SRGB: spng_errno = 26;
94pub const spng_errno_SPNG_EDUP_BKGD: spng_errno = 27;
95pub const spng_errno_SPNG_EDUP_HIST: spng_errno = 28;
96pub const spng_errno_SPNG_EDUP_TRNS: spng_errno = 29;
97pub const spng_errno_SPNG_EDUP_PHYS: spng_errno = 30;
98pub const spng_errno_SPNG_EDUP_TIME: spng_errno = 31;
99pub const spng_errno_SPNG_EDUP_OFFS: spng_errno = 32;
100pub const spng_errno_SPNG_EDUP_EXIF: spng_errno = 33;
101pub const spng_errno_SPNG_ECHRM: spng_errno = 34;
102pub const spng_errno_SPNG_EPLTE_IDX: spng_errno = 35;
103pub const spng_errno_SPNG_ETRNS_COLOR_TYPE: spng_errno = 36;
104pub const spng_errno_SPNG_ETRNS_NO_PLTE: spng_errno = 37;
105pub const spng_errno_SPNG_EGAMA: spng_errno = 38;
106pub const spng_errno_SPNG_EICCP_NAME: spng_errno = 39;
107pub const spng_errno_SPNG_EICCP_COMPRESSION_METHOD: spng_errno = 40;
108pub const spng_errno_SPNG_ESBIT: spng_errno = 41;
109pub const spng_errno_SPNG_ESRGB: spng_errno = 42;
110pub const spng_errno_SPNG_ETEXT: spng_errno = 43;
111pub const spng_errno_SPNG_ETEXT_KEYWORD: spng_errno = 44;
112pub const spng_errno_SPNG_EZTXT: spng_errno = 45;
113pub const spng_errno_SPNG_EZTXT_COMPRESSION_METHOD: spng_errno = 46;
114pub const spng_errno_SPNG_EITXT: spng_errno = 47;
115pub const spng_errno_SPNG_EITXT_COMPRESSION_FLAG: spng_errno = 48;
116pub const spng_errno_SPNG_EITXT_COMPRESSION_METHOD: spng_errno = 49;
117pub const spng_errno_SPNG_EITXT_LANG_TAG: spng_errno = 50;
118pub const spng_errno_SPNG_EITXT_TRANSLATED_KEY: spng_errno = 51;
119pub const spng_errno_SPNG_EBKGD_NO_PLTE: spng_errno = 52;
120pub const spng_errno_SPNG_EBKGD_PLTE_IDX: spng_errno = 53;
121pub const spng_errno_SPNG_EHIST_NO_PLTE: spng_errno = 54;
122pub const spng_errno_SPNG_EPHYS: spng_errno = 55;
123pub const spng_errno_SPNG_ESPLT_NAME: spng_errno = 56;
124pub const spng_errno_SPNG_ESPLT_DUP_NAME: spng_errno = 57;
125pub const spng_errno_SPNG_ESPLT_DEPTH: spng_errno = 58;
126pub const spng_errno_SPNG_ETIME: spng_errno = 59;
127pub const spng_errno_SPNG_EOFFS: spng_errno = 60;
128pub const spng_errno_SPNG_EEXIF: spng_errno = 61;
129pub const spng_errno_SPNG_EIDAT_TOO_SHORT: spng_errno = 62;
130pub const spng_errno_SPNG_EIDAT_STREAM: spng_errno = 63;
131pub const spng_errno_SPNG_EZLIB: spng_errno = 64;
132pub const spng_errno_SPNG_EFILTER: spng_errno = 65;
133pub const spng_errno_SPNG_EBUFSIZ: spng_errno = 66;
134pub const spng_errno_SPNG_EIO: spng_errno = 67;
135pub const spng_errno_SPNG_EOF: spng_errno = 68;
136pub const spng_errno_SPNG_EBUF_SET: spng_errno = 69;
137pub const spng_errno_SPNG_EBADSTATE: spng_errno = 70;
138pub const spng_errno_SPNG_EFMT: spng_errno = 71;
139pub const spng_errno_SPNG_EFLAGS: spng_errno = 72;
140pub const spng_errno_SPNG_ECHUNKAVAIL: spng_errno = 73;
141pub const spng_errno_SPNG_ENCODE_ONLY: spng_errno = 74;
142pub const spng_errno_SPNG_EOI: spng_errno = 75;
143pub const spng_errno_SPNG_ENOPLTE: spng_errno = 76;
144pub const spng_errno_SPNG_ECHUNK_LIMITS: spng_errno = 77;
145pub const spng_errno_SPNG_EZLIB_INIT: spng_errno = 78;
146pub const spng_errno_SPNG_ECHUNK_STDLEN: spng_errno = 79;
147pub const spng_errno_SPNG_EINTERNAL: spng_errno = 80;
148pub const spng_errno_SPNG_ECTXTYPE: spng_errno = 81;
149pub const spng_errno_SPNG_ENOSRC: spng_errno = 82;
150pub const spng_errno_SPNG_ENODST: spng_errno = 83;
151pub const spng_errno_SPNG_EOPSTATE: spng_errno = 84;
152pub const spng_errno_SPNG_ENOTFINAL: spng_errno = 85;
153pub type spng_errno = ::std::os::raw::c_int;
154pub const spng_text_type_SPNG_TEXT: spng_text_type = 1;
155pub const spng_text_type_SPNG_ZTXT: spng_text_type = 2;
156pub const spng_text_type_SPNG_ITXT: spng_text_type = 3;
157pub type spng_text_type = ::std::os::raw::c_uint;
158pub const spng_color_type_SPNG_COLOR_TYPE_GRAYSCALE: spng_color_type = 0;
159pub const spng_color_type_SPNG_COLOR_TYPE_TRUECOLOR: spng_color_type = 2;
160pub const spng_color_type_SPNG_COLOR_TYPE_INDEXED: spng_color_type = 3;
161pub const spng_color_type_SPNG_COLOR_TYPE_GRAYSCALE_ALPHA: spng_color_type = 4;
162pub const spng_color_type_SPNG_COLOR_TYPE_TRUECOLOR_ALPHA: spng_color_type = 6;
163pub type spng_color_type = ::std::os::raw::c_uint;
164pub const spng_filter_SPNG_FILTER_NONE: spng_filter = 0;
165pub const spng_filter_SPNG_FILTER_SUB: spng_filter = 1;
166pub const spng_filter_SPNG_FILTER_UP: spng_filter = 2;
167pub const spng_filter_SPNG_FILTER_AVERAGE: spng_filter = 3;
168pub const spng_filter_SPNG_FILTER_PAETH: spng_filter = 4;
169pub type spng_filter = ::std::os::raw::c_uint;
170pub const spng_filter_choice_SPNG_DISABLE_FILTERING: spng_filter_choice = 0;
171pub const spng_filter_choice_SPNG_FILTER_CHOICE_NONE: spng_filter_choice = 8;
172pub const spng_filter_choice_SPNG_FILTER_CHOICE_SUB: spng_filter_choice = 16;
173pub const spng_filter_choice_SPNG_FILTER_CHOICE_UP: spng_filter_choice = 32;
174pub const spng_filter_choice_SPNG_FILTER_CHOICE_AVG: spng_filter_choice = 64;
175pub const spng_filter_choice_SPNG_FILTER_CHOICE_PAETH: spng_filter_choice = 128;
176pub const spng_filter_choice_SPNG_FILTER_CHOICE_ALL: spng_filter_choice = 248;
177pub type spng_filter_choice = ::std::os::raw::c_uint;
178pub const spng_interlace_method_SPNG_INTERLACE_NONE: spng_interlace_method = 0;
179pub const spng_interlace_method_SPNG_INTERLACE_ADAM7: spng_interlace_method = 1;
180pub type spng_interlace_method = ::std::os::raw::c_uint;
181pub const spng_format_SPNG_FMT_RGBA8: spng_format = 1;
182pub const spng_format_SPNG_FMT_RGBA16: spng_format = 2;
183pub const spng_format_SPNG_FMT_RGB8: spng_format = 4;
184pub const spng_format_SPNG_FMT_GA8: spng_format = 16;
185pub const spng_format_SPNG_FMT_GA16: spng_format = 32;
186pub const spng_format_SPNG_FMT_G8: spng_format = 64;
187pub const spng_format_SPNG_FMT_PNG: spng_format = 256;
188pub const spng_format_SPNG_FMT_RAW: spng_format = 512;
189pub type spng_format = ::std::os::raw::c_uint;
190pub const spng_ctx_flags_SPNG_CTX_IGNORE_ADLER32: spng_ctx_flags = 1;
191pub const spng_ctx_flags_SPNG_CTX_ENCODER: spng_ctx_flags = 2;
192pub type spng_ctx_flags = ::std::os::raw::c_uint;
193pub const spng_decode_flags_SPNG_DECODE_USE_TRNS: spng_decode_flags = 1;
194pub const spng_decode_flags_SPNG_DECODE_USE_GAMA: spng_decode_flags = 2;
195pub const spng_decode_flags_SPNG_DECODE_USE_SBIT: spng_decode_flags = 8;
196pub const spng_decode_flags_SPNG_DECODE_TRNS: spng_decode_flags = 1;
197pub const spng_decode_flags_SPNG_DECODE_GAMMA: spng_decode_flags = 2;
198pub const spng_decode_flags_SPNG_DECODE_PROGRESSIVE: spng_decode_flags = 256;
199pub type spng_decode_flags = ::std::os::raw::c_uint;
200pub const spng_crc_action_SPNG_CRC_ERROR: spng_crc_action = 0;
201pub const spng_crc_action_SPNG_CRC_DISCARD: spng_crc_action = 1;
202pub const spng_crc_action_SPNG_CRC_USE: spng_crc_action = 2;
203pub type spng_crc_action = ::std::os::raw::c_uint;
204pub const spng_encode_flags_SPNG_ENCODE_PROGRESSIVE: spng_encode_flags = 1;
205pub const spng_encode_flags_SPNG_ENCODE_FINALIZE: spng_encode_flags = 2;
206pub type spng_encode_flags = ::std::os::raw::c_uint;
207#[repr(C)]
208#[derive(Debug, Copy, Clone)]
209pub struct spng_ihdr {
210    pub width: u32,
211    pub height: u32,
212    pub bit_depth: u8,
213    pub color_type: u8,
214    pub compression_method: u8,
215    pub filter_method: u8,
216    pub interlace_method: u8,
217}
218#[repr(C)]
219#[derive(Debug, Copy, Clone)]
220pub struct spng_plte_entry {
221    pub red: u8,
222    pub green: u8,
223    pub blue: u8,
224    pub alpha: u8,
225}
226#[repr(C)]
227#[derive(Debug, Copy, Clone)]
228pub struct spng_plte {
229    pub n_entries: u32,
230    pub entries: [spng_plte_entry; 256usize],
231}
232#[repr(C)]
233#[derive(Debug, Copy, Clone)]
234pub struct spng_trns {
235    pub gray: u16,
236    pub red: u16,
237    pub green: u16,
238    pub blue: u16,
239    pub n_type3_entries: u32,
240    pub type3_alpha: [u8; 256usize],
241}
242#[repr(C)]
243#[derive(Debug, Copy, Clone)]
244pub struct spng_chrm_int {
245    pub white_point_x: u32,
246    pub white_point_y: u32,
247    pub red_x: u32,
248    pub red_y: u32,
249    pub green_x: u32,
250    pub green_y: u32,
251    pub blue_x: u32,
252    pub blue_y: u32,
253}
254#[repr(C)]
255#[derive(Debug, Copy, Clone)]
256pub struct spng_chrm {
257    pub white_point_x: f64,
258    pub white_point_y: f64,
259    pub red_x: f64,
260    pub red_y: f64,
261    pub green_x: f64,
262    pub green_y: f64,
263    pub blue_x: f64,
264    pub blue_y: f64,
265}
266#[repr(C)]
267#[derive(Debug, Copy, Clone)]
268pub struct spng_iccp {
269    pub profile_name: [::std::os::raw::c_char; 80usize],
270    pub profile_len: usize,
271    pub profile: *mut ::std::os::raw::c_char,
272}
273#[repr(C)]
274#[derive(Debug, Copy, Clone)]
275pub struct spng_sbit {
276    pub grayscale_bits: u8,
277    pub red_bits: u8,
278    pub green_bits: u8,
279    pub blue_bits: u8,
280    pub alpha_bits: u8,
281}
282#[repr(C)]
283#[derive(Debug, Copy, Clone)]
284pub struct spng_text {
285    pub keyword: [::std::os::raw::c_char; 80usize],
286    pub type_: ::std::os::raw::c_int,
287    pub length: usize,
288    pub text: *mut ::std::os::raw::c_char,
289    pub compression_flag: u8,
290    pub compression_method: u8,
291    pub language_tag: *mut ::std::os::raw::c_char,
292    pub translated_keyword: *mut ::std::os::raw::c_char,
293}
294#[repr(C)]
295#[derive(Debug, Copy, Clone)]
296pub struct spng_bkgd {
297    pub gray: u16,
298    pub red: u16,
299    pub green: u16,
300    pub blue: u16,
301    pub plte_index: u16,
302}
303#[repr(C)]
304#[derive(Debug, Copy, Clone)]
305pub struct spng_hist {
306    pub frequency: [u16; 256usize],
307}
308#[repr(C)]
309#[derive(Debug, Copy, Clone)]
310pub struct spng_phys {
311    pub ppu_x: u32,
312    pub ppu_y: u32,
313    pub unit_specifier: u8,
314}
315#[repr(C)]
316#[derive(Debug, Copy, Clone)]
317pub struct spng_splt_entry {
318    pub red: u16,
319    pub green: u16,
320    pub blue: u16,
321    pub alpha: u16,
322    pub frequency: u16,
323}
324#[repr(C)]
325#[derive(Debug, Copy, Clone)]
326pub struct spng_splt {
327    pub name: [::std::os::raw::c_char; 80usize],
328    pub sample_depth: u8,
329    pub n_entries: u32,
330    pub entries: *mut spng_splt_entry,
331}
332#[repr(C)]
333#[derive(Debug, Copy, Clone)]
334pub struct spng_time {
335    pub year: u16,
336    pub month: u8,
337    pub day: u8,
338    pub hour: u8,
339    pub minute: u8,
340    pub second: u8,
341}
342#[repr(C)]
343#[derive(Debug, Copy, Clone)]
344pub struct spng_offs {
345    pub x: i32,
346    pub y: i32,
347    pub unit_specifier: u8,
348}
349#[repr(C)]
350#[derive(Debug, Copy, Clone)]
351pub struct spng_exif {
352    pub length: usize,
353    pub data: *mut ::std::os::raw::c_char,
354}
355#[repr(C)]
356#[derive(Debug, Copy, Clone)]
357pub struct spng_chunk {
358    pub offset: usize,
359    pub length: u32,
360    pub type_: [u8; 4usize],
361    pub crc: u32,
362}
363pub const spng_location_SPNG_AFTER_IHDR: spng_location = 1;
364pub const spng_location_SPNG_AFTER_PLTE: spng_location = 2;
365pub const spng_location_SPNG_AFTER_IDAT: spng_location = 8;
366pub type spng_location = ::std::os::raw::c_uint;
367#[repr(C)]
368#[derive(Debug, Copy, Clone)]
369pub struct spng_unknown_chunk {
370    pub type_: [u8; 4usize],
371    pub length: usize,
372    pub data: *mut ::std::os::raw::c_void,
373    pub location: spng_location,
374}
375pub const spng_option_SPNG_KEEP_UNKNOWN_CHUNKS: spng_option = 1;
376pub const spng_option_SPNG_IMG_COMPRESSION_LEVEL: spng_option = 2;
377pub const spng_option_SPNG_IMG_WINDOW_BITS: spng_option = 3;
378pub const spng_option_SPNG_IMG_MEM_LEVEL: spng_option = 4;
379pub const spng_option_SPNG_IMG_COMPRESSION_STRATEGY: spng_option = 5;
380pub const spng_option_SPNG_TEXT_COMPRESSION_LEVEL: spng_option = 6;
381pub const spng_option_SPNG_TEXT_WINDOW_BITS: spng_option = 7;
382pub const spng_option_SPNG_TEXT_MEM_LEVEL: spng_option = 8;
383pub const spng_option_SPNG_TEXT_COMPRESSION_STRATEGY: spng_option = 9;
384pub const spng_option_SPNG_FILTER_CHOICE: spng_option = 10;
385pub const spng_option_SPNG_CHUNK_COUNT_LIMIT: spng_option = 11;
386pub const spng_option_SPNG_ENCODE_TO_BUFFER: spng_option = 12;
387pub type spng_option = ::std::os::raw::c_uint;
388pub type spng_malloc_fn =
389    ::std::option::Option<unsafe extern "C" fn(size: usize) -> *mut ::std::os::raw::c_void>;
390pub type spng_realloc_fn = ::std::option::Option<
391    unsafe extern "C" fn(
392        ptr: *mut ::std::os::raw::c_void,
393        size: usize,
394    ) -> *mut ::std::os::raw::c_void,
395>;
396pub type spng_calloc_fn = ::std::option::Option<
397    unsafe extern "C" fn(count: usize, size: usize) -> *mut ::std::os::raw::c_void,
398>;
399pub type spng_free_fn =
400    ::std::option::Option<unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void)>;
401#[repr(C)]
402#[derive(Debug, Copy, Clone)]
403pub struct spng_alloc {
404    pub malloc_fn: spng_malloc_fn,
405    pub realloc_fn: spng_realloc_fn,
406    pub calloc_fn: spng_calloc_fn,
407    pub free_fn: spng_free_fn,
408}
409#[repr(C)]
410#[derive(Debug, Copy, Clone)]
411pub struct spng_row_info {
412    pub scanline_idx: u32,
413    pub row_num: u32,
414    pub pass: ::std::os::raw::c_int,
415    pub filter: u8,
416}
417#[repr(C)]
418#[derive(Debug, Copy, Clone)]
419pub struct spng_ctx {
420    _unused: [u8; 0],
421}
422pub type spng_read_fn = ::std::option::Option<
423    unsafe extern "C" fn(
424        ctx: *mut spng_ctx,
425        user: *mut ::std::os::raw::c_void,
426        dest: *mut ::std::os::raw::c_void,
427        length: usize,
428    ) -> ::std::os::raw::c_int,
429>;
430pub type spng_write_fn = ::std::option::Option<
431    unsafe extern "C" fn(
432        ctx: *mut spng_ctx,
433        user: *mut ::std::os::raw::c_void,
434        src: *mut ::std::os::raw::c_void,
435        length: usize,
436    ) -> ::std::os::raw::c_int,
437>;
438pub type spng_rw_fn = ::std::option::Option<
439    unsafe extern "C" fn(
440        ctx: *mut spng_ctx,
441        user: *mut ::std::os::raw::c_void,
442        dst_src: *mut ::std::os::raw::c_void,
443        length: usize,
444    ) -> ::std::os::raw::c_int,
445>;
446unsafe extern "C" {
447    pub fn spng_ctx_new(flags: ::std::os::raw::c_int) -> *mut spng_ctx;
448}
449unsafe extern "C" {
450    pub fn spng_ctx_new2(alloc: *mut spng_alloc, flags: ::std::os::raw::c_int) -> *mut spng_ctx;
451}
452unsafe extern "C" {
453    pub fn spng_ctx_free(ctx: *mut spng_ctx);
454}
455unsafe extern "C" {
456    pub fn spng_set_png_buffer(
457        ctx: *mut spng_ctx,
458        buf: *const ::std::os::raw::c_void,
459        size: usize,
460    ) -> ::std::os::raw::c_int;
461}
462unsafe extern "C" {
463    pub fn spng_set_png_stream(
464        ctx: *mut spng_ctx,
465        rw_func: spng_rw_fn,
466        user: *mut ::std::os::raw::c_void,
467    ) -> ::std::os::raw::c_int;
468}
469unsafe extern "C" {
470    pub fn spng_set_png_file(ctx: *mut spng_ctx, file: *mut FILE) -> ::std::os::raw::c_int;
471}
472unsafe extern "C" {
473    pub fn spng_get_png_buffer(
474        ctx: *mut spng_ctx,
475        len: *mut usize,
476        error: *mut ::std::os::raw::c_int,
477    ) -> *mut ::std::os::raw::c_void;
478}
479unsafe extern "C" {
480    pub fn spng_set_image_limits(
481        ctx: *mut spng_ctx,
482        width: u32,
483        height: u32,
484    ) -> ::std::os::raw::c_int;
485}
486unsafe extern "C" {
487    pub fn spng_get_image_limits(
488        ctx: *mut spng_ctx,
489        width: *mut u32,
490        height: *mut u32,
491    ) -> ::std::os::raw::c_int;
492}
493unsafe extern "C" {
494    pub fn spng_set_chunk_limits(
495        ctx: *mut spng_ctx,
496        chunk_size: usize,
497        cache_size: usize,
498    ) -> ::std::os::raw::c_int;
499}
500unsafe extern "C" {
501    pub fn spng_get_chunk_limits(
502        ctx: *mut spng_ctx,
503        chunk_size: *mut usize,
504        cache_size: *mut usize,
505    ) -> ::std::os::raw::c_int;
506}
507unsafe extern "C" {
508    pub fn spng_set_crc_action(
509        ctx: *mut spng_ctx,
510        critical: ::std::os::raw::c_int,
511        ancillary: ::std::os::raw::c_int,
512    ) -> ::std::os::raw::c_int;
513}
514unsafe extern "C" {
515    pub fn spng_set_option(
516        ctx: *mut spng_ctx,
517        option: spng_option,
518        value: ::std::os::raw::c_int,
519    ) -> ::std::os::raw::c_int;
520}
521unsafe extern "C" {
522    pub fn spng_get_option(
523        ctx: *mut spng_ctx,
524        option: spng_option,
525        value: *mut ::std::os::raw::c_int,
526    ) -> ::std::os::raw::c_int;
527}
528unsafe extern "C" {
529    pub fn spng_decoded_image_size(
530        ctx: *mut spng_ctx,
531        fmt: ::std::os::raw::c_int,
532        len: *mut usize,
533    ) -> ::std::os::raw::c_int;
534}
535unsafe extern "C" {
536    pub fn spng_decode_image(
537        ctx: *mut spng_ctx,
538        out: *mut ::std::os::raw::c_void,
539        len: usize,
540        fmt: ::std::os::raw::c_int,
541        flags: ::std::os::raw::c_int,
542    ) -> ::std::os::raw::c_int;
543}
544unsafe extern "C" {
545    pub fn spng_decode_scanline(
546        ctx: *mut spng_ctx,
547        out: *mut ::std::os::raw::c_void,
548        len: usize,
549    ) -> ::std::os::raw::c_int;
550}
551unsafe extern "C" {
552    pub fn spng_decode_row(
553        ctx: *mut spng_ctx,
554        out: *mut ::std::os::raw::c_void,
555        len: usize,
556    ) -> ::std::os::raw::c_int;
557}
558unsafe extern "C" {
559    pub fn spng_decode_chunks(ctx: *mut spng_ctx) -> ::std::os::raw::c_int;
560}
561unsafe extern "C" {
562    pub fn spng_get_row_info(
563        ctx: *mut spng_ctx,
564        row_info: *mut spng_row_info,
565    ) -> ::std::os::raw::c_int;
566}
567unsafe extern "C" {
568    pub fn spng_encode_image(
569        ctx: *mut spng_ctx,
570        img: *const ::std::os::raw::c_void,
571        len: usize,
572        fmt: ::std::os::raw::c_int,
573        flags: ::std::os::raw::c_int,
574    ) -> ::std::os::raw::c_int;
575}
576unsafe extern "C" {
577    pub fn spng_encode_scanline(
578        ctx: *mut spng_ctx,
579        scanline: *const ::std::os::raw::c_void,
580        len: usize,
581    ) -> ::std::os::raw::c_int;
582}
583unsafe extern "C" {
584    pub fn spng_encode_row(
585        ctx: *mut spng_ctx,
586        row: *const ::std::os::raw::c_void,
587        len: usize,
588    ) -> ::std::os::raw::c_int;
589}
590unsafe extern "C" {
591    pub fn spng_encode_chunks(ctx: *mut spng_ctx) -> ::std::os::raw::c_int;
592}
593unsafe extern "C" {
594    pub fn spng_get_ihdr(ctx: *mut spng_ctx, ihdr: *mut spng_ihdr) -> ::std::os::raw::c_int;
595}
596unsafe extern "C" {
597    pub fn spng_get_plte(ctx: *mut spng_ctx, plte: *mut spng_plte) -> ::std::os::raw::c_int;
598}
599unsafe extern "C" {
600    pub fn spng_get_trns(ctx: *mut spng_ctx, trns: *mut spng_trns) -> ::std::os::raw::c_int;
601}
602unsafe extern "C" {
603    pub fn spng_get_chrm(ctx: *mut spng_ctx, chrm: *mut spng_chrm) -> ::std::os::raw::c_int;
604}
605unsafe extern "C" {
606    pub fn spng_get_chrm_int(
607        ctx: *mut spng_ctx,
608        chrm_int: *mut spng_chrm_int,
609    ) -> ::std::os::raw::c_int;
610}
611unsafe extern "C" {
612    pub fn spng_get_gama(ctx: *mut spng_ctx, gamma: *mut f64) -> ::std::os::raw::c_int;
613}
614unsafe extern "C" {
615    pub fn spng_get_gama_int(ctx: *mut spng_ctx, gama_int: *mut u32) -> ::std::os::raw::c_int;
616}
617unsafe extern "C" {
618    pub fn spng_get_iccp(ctx: *mut spng_ctx, iccp: *mut spng_iccp) -> ::std::os::raw::c_int;
619}
620unsafe extern "C" {
621    pub fn spng_get_sbit(ctx: *mut spng_ctx, sbit: *mut spng_sbit) -> ::std::os::raw::c_int;
622}
623unsafe extern "C" {
624    pub fn spng_get_srgb(ctx: *mut spng_ctx, rendering_intent: *mut u8) -> ::std::os::raw::c_int;
625}
626unsafe extern "C" {
627    pub fn spng_get_text(
628        ctx: *mut spng_ctx,
629        text: *mut spng_text,
630        n_text: *mut u32,
631    ) -> ::std::os::raw::c_int;
632}
633unsafe extern "C" {
634    pub fn spng_get_bkgd(ctx: *mut spng_ctx, bkgd: *mut spng_bkgd) -> ::std::os::raw::c_int;
635}
636unsafe extern "C" {
637    pub fn spng_get_hist(ctx: *mut spng_ctx, hist: *mut spng_hist) -> ::std::os::raw::c_int;
638}
639unsafe extern "C" {
640    pub fn spng_get_phys(ctx: *mut spng_ctx, phys: *mut spng_phys) -> ::std::os::raw::c_int;
641}
642unsafe extern "C" {
643    pub fn spng_get_splt(
644        ctx: *mut spng_ctx,
645        splt: *mut spng_splt,
646        n_splt: *mut u32,
647    ) -> ::std::os::raw::c_int;
648}
649unsafe extern "C" {
650    pub fn spng_get_time(ctx: *mut spng_ctx, time: *mut spng_time) -> ::std::os::raw::c_int;
651}
652unsafe extern "C" {
653    pub fn spng_get_unknown_chunks(
654        ctx: *mut spng_ctx,
655        chunks: *mut spng_unknown_chunk,
656        n_chunks: *mut u32,
657    ) -> ::std::os::raw::c_int;
658}
659unsafe extern "C" {
660    pub fn spng_get_offs(ctx: *mut spng_ctx, offs: *mut spng_offs) -> ::std::os::raw::c_int;
661}
662unsafe extern "C" {
663    pub fn spng_get_exif(ctx: *mut spng_ctx, exif: *mut spng_exif) -> ::std::os::raw::c_int;
664}
665unsafe extern "C" {
666    pub fn spng_set_ihdr(ctx: *mut spng_ctx, ihdr: *mut spng_ihdr) -> ::std::os::raw::c_int;
667}
668unsafe extern "C" {
669    pub fn spng_set_plte(ctx: *mut spng_ctx, plte: *mut spng_plte) -> ::std::os::raw::c_int;
670}
671unsafe extern "C" {
672    pub fn spng_set_trns(ctx: *mut spng_ctx, trns: *mut spng_trns) -> ::std::os::raw::c_int;
673}
674unsafe extern "C" {
675    pub fn spng_set_chrm(ctx: *mut spng_ctx, chrm: *mut spng_chrm) -> ::std::os::raw::c_int;
676}
677unsafe extern "C" {
678    pub fn spng_set_chrm_int(
679        ctx: *mut spng_ctx,
680        chrm_int: *mut spng_chrm_int,
681    ) -> ::std::os::raw::c_int;
682}
683unsafe extern "C" {
684    pub fn spng_set_gama(ctx: *mut spng_ctx, gamma: f64) -> ::std::os::raw::c_int;
685}
686unsafe extern "C" {
687    pub fn spng_set_gama_int(ctx: *mut spng_ctx, gamma: u32) -> ::std::os::raw::c_int;
688}
689unsafe extern "C" {
690    pub fn spng_set_iccp(ctx: *mut spng_ctx, iccp: *mut spng_iccp) -> ::std::os::raw::c_int;
691}
692unsafe extern "C" {
693    pub fn spng_set_sbit(ctx: *mut spng_ctx, sbit: *mut spng_sbit) -> ::std::os::raw::c_int;
694}
695unsafe extern "C" {
696    pub fn spng_set_srgb(ctx: *mut spng_ctx, rendering_intent: u8) -> ::std::os::raw::c_int;
697}
698unsafe extern "C" {
699    pub fn spng_set_text(
700        ctx: *mut spng_ctx,
701        text: *mut spng_text,
702        n_text: u32,
703    ) -> ::std::os::raw::c_int;
704}
705unsafe extern "C" {
706    pub fn spng_set_bkgd(ctx: *mut spng_ctx, bkgd: *mut spng_bkgd) -> ::std::os::raw::c_int;
707}
708unsafe extern "C" {
709    pub fn spng_set_hist(ctx: *mut spng_ctx, hist: *mut spng_hist) -> ::std::os::raw::c_int;
710}
711unsafe extern "C" {
712    pub fn spng_set_phys(ctx: *mut spng_ctx, phys: *mut spng_phys) -> ::std::os::raw::c_int;
713}
714unsafe extern "C" {
715    pub fn spng_set_splt(
716        ctx: *mut spng_ctx,
717        splt: *mut spng_splt,
718        n_splt: u32,
719    ) -> ::std::os::raw::c_int;
720}
721unsafe extern "C" {
722    pub fn spng_set_time(ctx: *mut spng_ctx, time: *mut spng_time) -> ::std::os::raw::c_int;
723}
724unsafe extern "C" {
725    pub fn spng_set_unknown_chunks(
726        ctx: *mut spng_ctx,
727        chunks: *mut spng_unknown_chunk,
728        n_chunks: u32,
729    ) -> ::std::os::raw::c_int;
730}
731unsafe extern "C" {
732    pub fn spng_set_offs(ctx: *mut spng_ctx, offs: *mut spng_offs) -> ::std::os::raw::c_int;
733}
734unsafe extern "C" {
735    pub fn spng_set_exif(ctx: *mut spng_ctx, exif: *mut spng_exif) -> ::std::os::raw::c_int;
736}
737unsafe extern "C" {
738    pub fn spng_strerror(err: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
739}
740unsafe extern "C" {
741    pub fn spng_version_string() -> *const ::std::os::raw::c_char;
742}