1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4
5mod jerror;
6pub use jerror::*;
7
8pub const JPEG_LIB_VERSION: ::std::os::raw::c_int = 80;
10pub const MEM_SRCDST_SUPPORTED: u32 = 1;
11pub const BITS_IN_JSAMPLE: u32 = 8;
12pub const MAX_COMPONENTS: u32 = 10;
13pub const MAXJSAMPLE: u32 = 255;
14pub const CENTERJSAMPLE: u32 = 128;
15pub const JPEG_MAX_DIMENSION: u32 = 65500;
16pub const FALSE: u32 = 0;
17pub const TRUE: u32 = 1;
18pub const DCTSIZE: usize = 8;
19pub const DCTSIZE2: usize = 64;
20pub const NUM_QUANT_TBLS: u32 = 4;
21pub const NUM_HUFF_TBLS: u32 = 4;
22pub const NUM_ARITH_TBLS: u32 = 16;
23pub const MAX_COMPS_IN_SCAN: u32 = 4;
24pub const MAX_SAMP_FACTOR: u32 = 4;
25pub const C_MAX_BLOCKS_IN_MCU: u32 = 10;
26pub const D_MAX_BLOCKS_IN_MCU: u32 = 10;
27pub const JCS_EXTENSIONS: u32 = 1;
28pub const JCS_ALPHA_EXTENSIONS: u32 = 1;
29pub const JMSG_LENGTH_MAX: u32 = 200;
30pub const JMSG_STR_PARM_MAX: u32 = 80;
31pub const JPOOL_PERMANENT: u32 = 0;
32pub const JPOOL_IMAGE: u32 = 1;
33pub const JPOOL_NUMPOOLS: u32 = 2;
34pub const JPEG_SUSPENDED: u32 = 0;
35pub const JPEG_HEADER_OK: u32 = 1;
36pub const JPEG_HEADER_TABLES_ONLY: u32 = 2;
37pub const JPEG_REACHED_SOS: u32 = 1;
38pub const JPEG_REACHED_EOI: u32 = 2;
39pub const JPEG_ROW_COMPLETED: u32 = 3;
40pub const JPEG_SCAN_COMPLETED: u32 = 4;
41pub const JPEG_RST0: u32 = 208;
42pub const JPEG_EOI: u32 = 217;
43pub const JPEG_APP0: u32 = 224;
44pub const JPEG_COM: u32 = 254;
45pub type __off_t = ::std::os::raw::c_long;
46pub type __off64_t = ::std::os::raw::c_long;
47pub type FILE = libc::FILE;
48pub type JSAMPLE = ::std::os::raw::c_uchar;
49pub type JCOEF = ::std::os::raw::c_short;
50pub type JOCTET = ::std::os::raw::c_uchar;
51pub type UINT8 = ::std::os::raw::c_uchar;
52pub type UINT16 = ::std::os::raw::c_ushort;
53pub type INT16 = ::std::os::raw::c_short;
54pub type INT32 = ::std::os::raw::c_long;
55pub type JDIMENSION = ::std::os::raw::c_uint;
56pub type boolean = ::std::os::raw::c_int;
57pub type JSAMPROW = *const JSAMPLE;
58pub type JSAMPROW_MUT = *mut JSAMPLE;
59pub type JSAMPARRAY = *const JSAMPROW;
60pub type JSAMPARRAY_MUT = *mut JSAMPROW_MUT;
61pub type JSAMPIMAGE = *const JSAMPARRAY;
62pub type JSAMPIMAGE_MUT = *mut JSAMPARRAY_MUT;
63pub type JBLOCK = [JCOEF; 64usize];
64pub type JBLOCKROW = *mut JBLOCK;
65pub type JBLOCKARRAY = *mut JBLOCKROW;
66pub type JBLOCKIMAGE = *mut JBLOCKARRAY;
67pub type JCOEFPTR = *mut JCOEF;
68#[repr(C)]
69#[derive(Debug, Copy, Clone)]
70pub struct JQUANT_TBL {
71 pub quantval: [UINT16; 64usize],
72 pub sent_table: boolean,
73}
74#[repr(C)]
75#[derive(Debug, Copy, Clone)]
76pub struct JHUFF_TBL {
77 pub bits: [UINT8; 17usize],
78 pub huffval: [UINT8; 256usize],
79 pub sent_table: boolean,
80}
81#[repr(C)]
82#[derive(Debug, Copy, Clone)]
83pub struct jpegli_component_info {
84 pub component_id: ::std::os::raw::c_int,
85 pub component_index: ::std::os::raw::c_int,
86 pub h_samp_factor: ::std::os::raw::c_int,
87 pub v_samp_factor: ::std::os::raw::c_int,
88 pub quant_tbl_no: ::std::os::raw::c_int,
89 pub dc_tbl_no: ::std::os::raw::c_int,
90 pub ac_tbl_no: ::std::os::raw::c_int,
91 pub width_in_blocks: JDIMENSION,
92 pub height_in_blocks: JDIMENSION,
93 pub DCT_h_scaled_size: ::std::os::raw::c_int,
94 pub DCT_v_scaled_size: ::std::os::raw::c_int,
95 pub downsampled_width: JDIMENSION,
96 pub downsampled_height: JDIMENSION,
97 pub component_needed: boolean,
98 pub MCU_width: ::std::os::raw::c_int,
99 pub MCU_height: ::std::os::raw::c_int,
100 pub MCU_blocks: ::std::os::raw::c_int,
101 pub MCU_sample_width: ::std::os::raw::c_int,
102 pub last_col_width: ::std::os::raw::c_int,
103 pub last_row_height: ::std::os::raw::c_int,
104 pub quant_table: *mut JQUANT_TBL,
105 pub dct_table: *mut ::std::os::raw::c_void,
106}
107#[repr(C)]
108#[derive(Debug, Copy, Clone)]
109pub struct jpegli_scan_info {
110 pub comps_in_scan: ::std::os::raw::c_int,
111 pub component_index: [::std::os::raw::c_int; 4usize],
112 pub Ss: ::std::os::raw::c_int,
113 pub Se: ::std::os::raw::c_int,
114 pub Ah: ::std::os::raw::c_int,
115 pub Al: ::std::os::raw::c_int,
116}
117pub type jpegli_saved_marker_ptr = *mut jpegli_marker_struct;
118#[repr(C)]
119#[derive(Debug, Copy, Clone)]
120pub struct jpegli_marker_struct {
121 pub next: jpegli_saved_marker_ptr,
122 pub marker: UINT8,
123 pub original_length: ::std::os::raw::c_uint,
124 pub data_length: ::std::os::raw::c_uint,
125 pub data: *mut JOCTET,
126}
127
128pub enum jpegli_marker {
129 APP0 = 0xE0, COM = 0xFE, }
132
133#[repr(u32)]
134#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
135pub enum J_COLOR_SPACE {
136 JCS_UNKNOWN = 0,
137 JCS_GRAYSCALE = 1,
138 JCS_RGB = 2,
139 JCS_YCbCr = 3,
140 JCS_CMYK = 4,
141 JCS_YCCK = 5,
142 JCS_EXT_RGB = 6,
143 JCS_EXT_RGBX = 7,
144 JCS_EXT_BGR = 8,
145 JCS_EXT_BGRX = 9,
146 JCS_EXT_XBGR = 10,
147 JCS_EXT_XRGB = 11,
148 JCS_EXT_RGBA = 12,
149 JCS_EXT_BGRA = 13,
150 JCS_EXT_ABGR = 14,
151 JCS_EXT_ARGB = 15,
152 JCS_RGB565 = 16,
153}
154#[repr(u32)]
155#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
156pub enum J_DCT_METHOD {
157 JDCT_ISLOW = 0,
158 JDCT_IFAST = 1,
159 JDCT_FLOAT = 2,
160}
161#[repr(u32)]
162#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
163pub enum J_DITHER_MODE {
164 JDITHER_NONE = 0,
165 JDITHER_ORDERED = 1,
166 JDITHER_FS = 2,
167}
168#[repr(C)]
169#[derive(Debug, Copy, Clone)]
170pub struct jpegli_common_struct {
171 pub err: *mut jpegli_error_mgr,
172 pub mem: *mut jpegli_memory_mgr,
173 pub progress: *mut jpegli_progress_mgr,
174 pub client_data: *mut ::std::os::raw::c_void,
175 pub is_decompressor: boolean,
176 pub global_state: ::std::os::raw::c_int,
177}
178#[repr(C)]
179#[derive(Debug, Copy, Clone)]
180pub struct jpegli_compress_struct {
181 pub common: jpegli_common_struct,
182 pub dest: *mut jpegli_destination_mgr,
183 pub image_width: JDIMENSION,
184 pub image_height: JDIMENSION,
185 pub input_components: ::std::os::raw::c_int,
186 pub in_color_space: J_COLOR_SPACE,
187 pub input_gamma: f64,
188 pub scale_num: ::std::os::raw::c_uint,
189 pub scale_denom: ::std::os::raw::c_uint,
190 pub jpegli_width: JDIMENSION,
191 pub jpegli_height: JDIMENSION,
192 pub data_precision: ::std::os::raw::c_int,
193 pub num_components: ::std::os::raw::c_int,
194 pub jpegli_color_space: J_COLOR_SPACE,
195 pub comp_info: *mut jpegli_component_info,
196 pub quant_tbl_ptrs: [*mut JQUANT_TBL; 4usize],
197 pub q_scale_factor: [::std::os::raw::c_int; 4usize],
198 pub dc_huff_tbl_ptrs: [*mut JHUFF_TBL; 4usize],
199 pub ac_huff_tbl_ptrs: [*mut JHUFF_TBL; 4usize],
200 pub arith_dc_L: [UINT8; 16usize],
201 pub arith_dc_U: [UINT8; 16usize],
202 pub arith_ac_K: [UINT8; 16usize],
203 pub num_scans: ::std::os::raw::c_int,
204 pub scan_info: *const jpegli_scan_info,
205 pub raw_data_in: boolean,
206 pub arith_code: boolean,
207 pub optimize_coding: boolean,
208 pub CCIR601_sampling: boolean,
209 pub do_fancy_downsampling: boolean,
210 pub smoothing_factor: ::std::os::raw::c_int,
211 pub dct_method: J_DCT_METHOD,
212 pub restart_interval: ::std::os::raw::c_uint,
213 pub restart_in_rows: ::std::os::raw::c_int,
214 pub write_JFIF_header: boolean,
215 pub JFIF_major_version: UINT8,
216 pub JFIF_minor_version: UINT8,
217 pub density_unit: UINT8,
218 pub X_density: UINT16,
219 pub Y_density: UINT16,
220 pub write_Adobe_marker: boolean,
221 pub next_scanline: JDIMENSION,
222 pub progressive_mode: boolean,
223 pub max_h_samp_factor: ::std::os::raw::c_int,
224 pub max_v_samp_factor: ::std::os::raw::c_int,
225 pub min_DCT_h_scaled_size: ::std::os::raw::c_int,
226 pub min_DCT_v_scaled_size: ::std::os::raw::c_int,
227 pub total_iMCU_rows: JDIMENSION,
228 pub comps_in_scan: ::std::os::raw::c_int,
229 pub cur_comp_info: [*mut jpegli_component_info; 4usize],
230 pub MCUs_per_row: JDIMENSION,
231 pub MCU_rows_in_scan: JDIMENSION,
232 pub blocks_in_MCU: ::std::os::raw::c_int,
233 pub MCU_membership: [::std::os::raw::c_int; 10usize],
234 pub Ss: ::std::os::raw::c_int,
235 pub Se: ::std::os::raw::c_int,
236 pub Ah: ::std::os::raw::c_int,
237 pub Al: ::std::os::raw::c_int,
238 pub block_size: ::std::os::raw::c_int,
239 pub natural_order: *const ::std::os::raw::c_int,
240 pub lim_Se: ::std::os::raw::c_int,
241 pub master: *mut jpegli_comp_master,
242 pub main: *mut jpegli_c_main_controller,
243 pub prep: *mut jpegli_c_prep_controller,
244 pub coef: *mut jpegli_c_coef_controller,
245 pub marker: *mut jpegli_marker_writer,
246 pub cconvert: *mut jpegli_color_converter,
247 pub downsample: *mut jpegli_downsampler,
248 pub fdct: *mut jpegli_forward_dct,
249 pub entropy: *mut jpegli_entropy_encoder,
250 pub script_space: *mut jpegli_scan_info,
251 pub script_space_size: ::std::os::raw::c_int,
252}
253#[repr(C)]
254#[derive(Debug, Copy, Clone)]
255pub struct jpegli_decompress_struct {
256 pub common: jpegli_common_struct,
257 pub src: *mut jpegli_source_mgr,
258 pub image_width: JDIMENSION,
259 pub image_height: JDIMENSION,
260 pub num_components: ::std::os::raw::c_int,
261 pub jpegli_color_space: J_COLOR_SPACE,
262 pub out_color_space: J_COLOR_SPACE,
263 pub scale_num: ::std::os::raw::c_uint,
264 pub scale_denom: ::std::os::raw::c_uint,
265 pub output_gamma: f64,
266 pub buffered_image: boolean,
267 pub raw_data_out: boolean,
268 pub dct_method: J_DCT_METHOD,
269 pub do_fancy_upsampling: boolean,
270 pub do_block_smoothing: boolean,
271 pub quantize_colors: boolean,
272 pub dither_mode: J_DITHER_MODE,
273 pub two_pass_quantize: boolean,
274 pub desired_number_of_colors: ::std::os::raw::c_int,
275 pub enable_1pass_quant: boolean,
276 pub enable_external_quant: boolean,
277 pub enable_2pass_quant: boolean,
278 pub output_width: JDIMENSION,
279 pub output_height: JDIMENSION,
280 pub out_color_components: ::std::os::raw::c_int,
281 pub output_components: ::std::os::raw::c_int,
282 pub rec_outbuf_height: ::std::os::raw::c_int,
283 pub actual_number_of_colors: ::std::os::raw::c_int,
284 pub colormap: JSAMPARRAY_MUT,
285 pub output_scanline: JDIMENSION,
286 pub input_scan_number: ::std::os::raw::c_int,
287 pub input_iMCU_row: JDIMENSION,
288 pub output_scan_number: ::std::os::raw::c_int,
289 pub output_iMCU_row: JDIMENSION,
290 pub coef_bits: *mut [::std::os::raw::c_int; 64usize],
291 pub quant_tbl_ptrs: [*mut JQUANT_TBL; 4usize],
292 pub dc_huff_tbl_ptrs: [*mut JHUFF_TBL; 4usize],
293 pub ac_huff_tbl_ptrs: [*mut JHUFF_TBL; 4usize],
294 pub data_precision: ::std::os::raw::c_int,
295 pub comp_info: *mut jpegli_component_info,
296 pub is_baseline: boolean,
297 pub progressive_mode: boolean,
298 pub arith_code: boolean,
299 pub arith_dc_L: [UINT8; 16usize],
300 pub arith_dc_U: [UINT8; 16usize],
301 pub arith_ac_K: [UINT8; 16usize],
302 pub restart_interval: ::std::os::raw::c_uint,
303 pub saw_JFIF_marker: boolean,
304 pub JFIF_major_version: UINT8,
305 pub JFIF_minor_version: UINT8,
306 pub density_unit: UINT8,
307 pub X_density: UINT16,
308 pub Y_density: UINT16,
309 pub saw_Adobe_marker: boolean,
310 pub Adobe_transform: UINT8,
311 pub CCIR601_sampling: boolean,
312 pub marker_list: jpegli_saved_marker_ptr,
313 pub max_h_samp_factor: ::std::os::raw::c_int,
314 pub max_v_samp_factor: ::std::os::raw::c_int,
315 pub min_DCT_h_scaled_size: ::std::os::raw::c_int,
316 pub min_DCT_v_scaled_size: ::std::os::raw::c_int,
317 pub total_iMCU_rows: JDIMENSION,
318 pub sample_range_limit: *mut JSAMPLE,
319 pub comps_in_scan: ::std::os::raw::c_int,
320 pub cur_comp_info: [*mut jpegli_component_info; 4usize],
321 pub MCUs_per_row: JDIMENSION,
322 pub MCU_rows_in_scan: JDIMENSION,
323 pub blocks_in_MCU: ::std::os::raw::c_int,
324 pub MCU_membership: [::std::os::raw::c_int; 10usize],
325 pub Ss: ::std::os::raw::c_int,
326 pub Se: ::std::os::raw::c_int,
327 pub Ah: ::std::os::raw::c_int,
328 pub Al: ::std::os::raw::c_int,
329 pub block_size: ::std::os::raw::c_int,
330 pub natural_order: *const ::std::os::raw::c_int,
331 pub lim_Se: ::std::os::raw::c_int,
332 pub unread_marker: ::std::os::raw::c_int,
333 pub master: *mut jpegli_decomp_master,
334 pub main: *mut jpegli_d_main_controller,
335 pub coef: *mut jpegli_d_coef_controller,
336 pub post: *mut jpegli_d_post_controller,
337 pub inputctl: *mut jpegli_input_controller,
338 pub marker: *mut jpegli_marker_reader,
339 pub entropy: *mut jpegli_entropy_decoder,
340 pub idct: *mut jpegli_inverse_dct,
341 pub upsample: *mut jpegli_upsampler,
342 pub cconvert: *mut jpegli_color_deconverter,
343 pub cquantize: *mut jpegli_color_quantizer,
344}
345#[repr(C)]
346#[derive(Copy, Clone)]
347pub struct jpegli_error_mgr {
348 pub error_exit:
349 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct)>,
350 pub emit_message: ::std::option::Option<
351 unsafe extern "C-unwind" fn(
352 cinfo: &mut jpegli_common_struct,
353 msg_level: ::std::os::raw::c_int,
354 ),
355 >,
356 pub output_message:
357 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct)>,
358 pub format_message: ::std::option::Option<
359 unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct, buffer: &[u8; 80usize]),
360 >,
361 pub reset_error_mgr:
362 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct)>,
363 pub msg_code: ::std::os::raw::c_int,
364 pub msg_parm: jpegli_error_mgr__bindgen_ty_1,
365 pub trace_level: ::std::os::raw::c_int,
366 pub num_warnings: ::std::os::raw::c_long,
367 pub jpegli_message_table: *const *const ::std::os::raw::c_char,
368 pub last_jpegli_message: ::std::os::raw::c_int,
369 pub addon_message_table: *const *const ::std::os::raw::c_char,
370 pub first_addon_message: ::std::os::raw::c_int,
371 pub last_addon_message: ::std::os::raw::c_int,
372}
373#[repr(C)]
374#[derive(Copy, Clone)]
375pub union jpegli_error_mgr__bindgen_ty_1 {
376 pub i: [::std::os::raw::c_int; 8usize],
377 pub s: [::std::os::raw::c_char; 80usize],
378}
379#[repr(C)]
380#[derive(Debug, Copy, Clone)]
381pub struct jpegli_progress_mgr {
382 pub progress_monitor:
383 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct)>,
384 pub pass_counter: ::std::os::raw::c_long,
385 pub pass_limit: ::std::os::raw::c_long,
386 pub completed_passes: ::std::os::raw::c_int,
387 pub total_passes: ::std::os::raw::c_int,
388}
389#[repr(C)]
390#[derive(Debug, Copy, Clone)]
391pub struct jpegli_destination_mgr {
392 pub next_output_byte: *mut JOCTET,
393 pub free_in_buffer: usize,
394 pub init_destination:
395 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_compress_struct)>,
396 pub empty_output_buffer: ::std::option::Option<
397 unsafe extern "C-unwind" fn(cinfo: &mut jpegli_compress_struct) -> boolean,
398 >,
399 pub term_destination:
400 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_compress_struct)>,
401}
402#[repr(C)]
403#[derive(Debug, Copy, Clone)]
404pub struct jpegli_source_mgr {
405 pub next_input_byte: *const JOCTET,
406 pub bytes_in_buffer: usize,
407 pub init_source:
408 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_decompress_struct)>,
409 pub fill_input_buffer: ::std::option::Option<
410 unsafe extern "C-unwind" fn(cinfo: &mut jpegli_decompress_struct) -> boolean,
411 >,
412 pub skip_input_data: ::std::option::Option<
413 unsafe extern "C-unwind" fn(
414 cinfo: &mut jpegli_decompress_struct,
415 num_bytes: ::std::os::raw::c_long,
416 ),
417 >,
418 pub resync_to_restart: ::std::option::Option<
419 unsafe extern "C-unwind" fn(
420 cinfo: &mut jpegli_decompress_struct,
421 desired: ::std::os::raw::c_int,
422 ) -> boolean,
423 >,
424 pub term_source:
425 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_decompress_struct)>,
426}
427#[repr(C)]
428#[derive(Debug, Copy, Clone)]
429pub struct jvirt_sarray_control {
430 _unused: [u8; 0],
431}
432pub type jvirt_sarray_ptr = *mut jvirt_sarray_control;
433#[repr(C)]
434#[derive(Debug, Copy, Clone)]
435pub struct jvirt_barray_control {
436 _unused: [u8; 0],
437}
438pub type jvirt_barray_ptr = *mut jvirt_barray_control;
439#[repr(C)]
440#[derive(Debug, Copy, Clone)]
441pub struct jpegli_memory_mgr {
442 pub alloc_small: ::std::option::Option<
443 unsafe extern "C-unwind" fn(
444 cinfo: &mut jpegli_common_struct,
445 pool_id: ::std::os::raw::c_int,
446 sizeofobject: usize,
447 ) -> *mut ::std::os::raw::c_void,
448 >,
449 pub alloc_large: ::std::option::Option<
450 unsafe extern "C-unwind" fn(
451 cinfo: &mut jpegli_common_struct,
452 pool_id: ::std::os::raw::c_int,
453 sizeofobject: usize,
454 ) -> *mut ::std::os::raw::c_void,
455 >,
456 pub alloc_sarray: ::std::option::Option<
457 unsafe extern "C-unwind" fn(
458 cinfo: &mut jpegli_common_struct,
459 pool_id: ::std::os::raw::c_int,
460 samplesperrow: JDIMENSION,
461 numrows: JDIMENSION,
462 ) -> JSAMPARRAY_MUT,
463 >,
464 pub alloc_barray: ::std::option::Option<
465 unsafe extern "C-unwind" fn(
466 cinfo: &mut jpegli_common_struct,
467 pool_id: ::std::os::raw::c_int,
468 blocksperrow: JDIMENSION,
469 numrows: JDIMENSION,
470 ) -> JBLOCKARRAY,
471 >,
472 pub request_virt_sarray: ::std::option::Option<
473 unsafe extern "C-unwind" fn(
474 cinfo: &mut jpegli_common_struct,
475 pool_id: ::std::os::raw::c_int,
476 pre_zero: boolean,
477 samplesperrow: JDIMENSION,
478 numrows: JDIMENSION,
479 maxaccess: JDIMENSION,
480 ) -> jvirt_sarray_ptr,
481 >,
482 pub request_virt_barray: ::std::option::Option<
483 unsafe extern "C-unwind" fn(
484 cinfo: &mut jpegli_common_struct,
485 pool_id: ::std::os::raw::c_int,
486 pre_zero: boolean,
487 blocksperrow: JDIMENSION,
488 numrows: JDIMENSION,
489 maxaccess: JDIMENSION,
490 ) -> jvirt_barray_ptr,
491 >,
492 pub realize_virt_arrays:
493 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct)>,
494 pub access_virt_sarray: ::std::option::Option<
495 unsafe extern "C-unwind" fn(
496 cinfo: &mut jpegli_common_struct,
497 ptr: jvirt_sarray_ptr,
498 start_row: JDIMENSION,
499 num_rows: JDIMENSION,
500 writable: boolean,
501 ) -> JSAMPARRAY_MUT,
502 >,
503 pub access_virt_barray: ::std::option::Option<
504 unsafe extern "C-unwind" fn(
505 cinfo: &mut jpegli_common_struct,
506 ptr: jvirt_barray_ptr,
507 start_row: JDIMENSION,
508 num_rows: JDIMENSION,
509 writable: boolean,
510 ) -> JBLOCKARRAY,
511 >,
512 pub free_pool: ::std::option::Option<
513 unsafe extern "C-unwind" fn(
514 cinfo: &mut jpegli_common_struct,
515 pool_id: ::std::os::raw::c_int,
516 ),
517 >,
518 pub self_destruct:
519 ::std::option::Option<unsafe extern "C-unwind" fn(cinfo: &mut jpegli_common_struct)>,
520 pub max_memory_to_use: ::std::os::raw::c_long,
521 pub max_alloc_chunk: ::std::os::raw::c_long,
522}
523pub type jpegli_marker_parser_method = ::std::option::Option<
524 unsafe extern "C-unwind" fn(cinfo: &mut jpegli_decompress_struct) -> boolean,
525>;
526#[repr(C)]
527#[derive(Debug, Copy, Clone)]
528pub struct jpegli_comp_master {
529 pub _address: u8,
530}
531#[repr(C)]
532#[derive(Debug, Copy, Clone)]
533pub struct jpegli_c_main_controller {
534 pub _address: u8,
535}
536#[repr(C)]
537#[derive(Debug, Copy, Clone)]
538pub struct jpegli_c_prep_controller {
539 pub _address: u8,
540}
541#[repr(C)]
542#[derive(Debug, Copy, Clone)]
543pub struct jpegli_c_coef_controller {
544 pub _address: u8,
545}
546#[repr(C)]
547#[derive(Debug, Copy, Clone)]
548pub struct jpegli_marker_writer {
549 pub _address: u8,
550}
551#[repr(C)]
552#[derive(Debug, Copy, Clone)]
553pub struct jpegli_color_converter {
554 pub _address: u8,
555}
556#[repr(C)]
557#[derive(Debug, Copy, Clone)]
558pub struct jpegli_downsampler {
559 pub _address: u8,
560}
561#[repr(C)]
562#[derive(Debug, Copy, Clone)]
563pub struct jpegli_forward_dct {
564 pub _address: u8,
565}
566#[repr(C)]
567#[derive(Debug, Copy, Clone)]
568pub struct jpegli_entropy_encoder {
569 pub _address: u8,
570}
571#[repr(C)]
572#[derive(Debug, Copy, Clone)]
573pub struct jpegli_decomp_master {
574 pub _address: u8,
575}
576#[repr(C)]
577#[derive(Debug, Copy, Clone)]
578pub struct jpegli_d_main_controller {
579 pub _address: u8,
580}
581#[repr(C)]
582#[derive(Debug, Copy, Clone)]
583pub struct jpegli_d_coef_controller {
584 pub _address: u8,
585}
586#[repr(C)]
587#[derive(Debug, Copy, Clone)]
588pub struct jpegli_d_post_controller {
589 pub _address: u8,
590}
591#[repr(C)]
592#[derive(Debug, Copy, Clone)]
593pub struct jpegli_input_controller {
594 pub _address: u8,
595}
596#[repr(C)]
597#[derive(Debug, Copy, Clone)]
598pub struct jpegli_marker_reader {
599 pub _address: u8,
600}
601#[repr(C)]
602#[derive(Debug, Copy, Clone)]
603pub struct jpegli_entropy_decoder {
604 pub _address: u8,
605}
606#[repr(C)]
607#[derive(Debug, Copy, Clone)]
608pub struct jpegli_inverse_dct {
609 pub _address: u8,
610}
611#[repr(C)]
612#[derive(Debug, Copy, Clone)]
613pub struct jpegli_upsampler {
614 pub _address: u8,
615}
616#[repr(C)]
617#[derive(Debug, Copy, Clone)]
618pub struct jpegli_color_deconverter {
619 pub _address: u8,
620}
621#[repr(C)]
622#[derive(Debug, Copy, Clone)]
623pub struct jpegli_color_quantizer {
624 pub _address: u8,
625}
626extern "C-unwind" {
627 pub fn jpegli_std_error(err: &mut jpegli_error_mgr) -> *mut jpegli_error_mgr;
628 pub fn jpegli_CreateCompress(
629 cinfo: &mut jpegli_compress_struct,
630 version: ::std::os::raw::c_int,
631 structsize: usize,
632 );
633 pub fn jpegli_CreateDecompress(
634 cinfo: &mut jpegli_decompress_struct,
635 version: ::std::os::raw::c_int,
636 structsize: usize,
637 );
638 pub fn jpegli_destroy_compress(cinfo: &mut jpegli_compress_struct);
639 pub fn jpegli_destroy_decompress(cinfo: &mut jpegli_decompress_struct);
640 pub fn jpegli_stdio_dest(cinfo: &mut jpegli_compress_struct, outfile: *mut FILE);
641 pub fn jpegli_stdio_src(cinfo: &mut jpegli_decompress_struct, infile: *mut FILE);
642 pub fn jpegli_mem_dest(
643 cinfo: &mut jpegli_compress_struct,
644 outbuffer: *mut *mut ::std::os::raw::c_uchar,
645 outsize: *mut ::std::os::raw::c_ulong,
646 );
647 pub fn jpegli_mem_src(
648 cinfo: &mut jpegli_decompress_struct,
649 inbuffer: *const ::std::os::raw::c_uchar,
650 insize: ::std::os::raw::c_ulong,
651 );
652 pub fn jpegli_set_defaults(cinfo: &mut jpegli_compress_struct);
653 pub fn jpegli_set_colorspace(cinfo: &mut jpegli_compress_struct, colorspace: J_COLOR_SPACE);
654 pub fn jpegli_default_colorspace(cinfo: &mut jpegli_compress_struct);
655 pub fn jpegli_set_quality(
656 cinfo: &mut jpegli_compress_struct,
657 quality: ::std::os::raw::c_int,
658 force_baseline: boolean,
659 );
660 pub fn jpegli_set_linear_quality(
661 cinfo: &mut jpegli_compress_struct,
662 scale_factor: ::std::os::raw::c_int,
663 force_baseline: boolean,
664 );
665 pub fn jpegli_default_qtables(cinfo: &mut jpegli_compress_struct, force_baseline: boolean);
666 pub fn jpegli_add_quant_table(
667 cinfo: &mut jpegli_compress_struct,
668 which_tbl: ::std::os::raw::c_int,
669 basic_table: *const ::std::os::raw::c_uint,
670 scale_factor: ::std::os::raw::c_int,
671 force_baseline: boolean,
672 );
673 pub fn jpegli_quality_scaling(quality: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
674 pub fn jpegli_simple_progression(cinfo: &mut jpegli_compress_struct);
675 pub fn jpegli_suppress_tables(cinfo: &mut jpegli_compress_struct, suppress: boolean);
676 pub fn jpegli_alloc_quant_table(cinfo: &mut jpegli_common_struct) -> *mut JQUANT_TBL;
677 pub fn jpegli_alloc_huff_table(cinfo: &mut jpegli_common_struct) -> *mut JHUFF_TBL;
678 pub fn jpegli_start_compress(cinfo: &mut jpegli_compress_struct, write_all_tables: boolean);
679 pub fn jpegli_write_scanlines(
680 cinfo: &mut jpegli_compress_struct,
681 scanlines: JSAMPARRAY,
682 num_lines: JDIMENSION,
683 ) -> JDIMENSION;
684 pub fn jpegli_finish_compress(cinfo: &mut jpegli_compress_struct);
685 pub fn jpegli_calc_jpegli_dimensions(cinfo: &mut jpegli_compress_struct);
686 pub fn jpegli_write_raw_data(
687 cinfo: &mut jpegli_compress_struct,
688 data: JSAMPIMAGE,
689 num_lines: JDIMENSION,
690 ) -> JDIMENSION;
691 pub fn jpegli_write_marker(
692 cinfo: &mut jpegli_compress_struct,
693 marker: ::std::os::raw::c_int,
694 dataptr: *const JOCTET,
695 datalen: ::std::os::raw::c_uint,
696 );
697 pub fn jpegli_write_m_header(
698 cinfo: &mut jpegli_compress_struct,
699 marker: ::std::os::raw::c_int,
700 datalen: ::std::os::raw::c_uint,
701 );
702 pub fn jpegli_write_m_byte(cinfo: &mut jpegli_compress_struct, val: ::std::os::raw::c_int);
703 pub fn jpegli_write_tables(cinfo: &mut jpegli_compress_struct);
704 pub fn jpegli_write_icc_profile(
705 cinfo: &mut jpegli_compress_struct,
706 icc_data_ptr: *const JOCTET,
707 icc_data_len: ::std::os::raw::c_uint,
708 );
709 pub fn jpegli_read_header(
710 cinfo: &mut jpegli_decompress_struct,
711 require_image: boolean,
712 ) -> ::std::os::raw::c_int;
713 pub fn jpegli_start_decompress(cinfo: &mut jpegli_decompress_struct) -> boolean;
714 pub fn jpegli_read_scanlines(
715 cinfo: &mut jpegli_decompress_struct,
716 scanlines: JSAMPARRAY_MUT,
717 max_lines: JDIMENSION,
718 ) -> JDIMENSION;
719 pub fn jpegli_skip_scanlines(
720 cinfo: &mut jpegli_decompress_struct,
721 num_lines: JDIMENSION,
722 ) -> JDIMENSION;
723 pub fn jpegli_crop_scanline(
724 cinfo: &mut jpegli_decompress_struct,
725 xoffset: *mut JDIMENSION,
726 width: *mut JDIMENSION,
727 );
728 pub fn jpegli_finish_decompress(cinfo: &mut jpegli_decompress_struct) -> boolean;
729 pub fn jpegli_read_raw_data(
730 cinfo: &mut jpegli_decompress_struct,
731 data: JSAMPIMAGE_MUT,
732 max_lines: JDIMENSION,
733 ) -> JDIMENSION;
734 pub fn jpegli_has_multiple_scans(cinfo: &mut jpegli_decompress_struct) -> boolean;
735 pub fn jpegli_start_output(
736 cinfo: &mut jpegli_decompress_struct,
737 scan_number: ::std::os::raw::c_int,
738 ) -> boolean;
739 pub fn jpegli_finish_output(cinfo: &mut jpegli_decompress_struct) -> boolean;
740 pub fn jpegli_input_complete(cinfo: &mut jpegli_decompress_struct) -> boolean;
741 pub fn jpegli_new_colormap(cinfo: &mut jpegli_decompress_struct);
742 pub fn jpegli_consume_input(cinfo: &mut jpegli_decompress_struct) -> ::std::os::raw::c_int;
743 pub fn jpegli_core_output_dimensions(cinfo: &mut jpegli_decompress_struct);
744 pub fn jpegli_calc_output_dimensions(cinfo: &mut jpegli_decompress_struct);
745 pub fn jpegli_save_markers(
746 cinfo: &mut jpegli_decompress_struct,
747 marker_code: ::std::os::raw::c_int,
748 length_limit: ::std::os::raw::c_uint,
749 );
750 pub fn jpegli_set_marker_processor(
751 cinfo: &mut jpegli_decompress_struct,
752 marker_code: ::std::os::raw::c_int,
753 routine: jpegli_marker_parser_method,
754 );
755 pub fn jpegli_read_coefficients(cinfo: &mut jpegli_decompress_struct) -> *mut jvirt_barray_ptr;
756 pub fn jpegli_write_coefficients(
757 cinfo: &mut jpegli_compress_struct,
758 coef_arrays: *mut jvirt_barray_ptr,
759 );
760 pub fn jpegli_copy_critical_parameters(
761 srcinfo: &mut jpegli_decompress_struct,
762 dstinfo: &mut jpegli_compress_struct,
763 );
764 pub fn jpegli_abort_compress(cinfo: &mut jpegli_compress_struct);
765 pub fn jpegli_abort_decompress(cinfo: &mut jpegli_decompress_struct);
766 pub fn jpegli_abort(cinfo: &mut jpegli_common_struct);
767 pub fn jpegli_destroy(cinfo: &mut jpegli_common_struct);
768 pub fn jpegli_resync_to_restart(
769 cinfo: &mut jpegli_decompress_struct,
770 desired: ::std::os::raw::c_int,
771 ) -> boolean;
772 pub fn jpegli_read_icc_profile(
773 cinfo: &mut jpegli_decompress_struct,
774 icc_data_ptr: *mut *mut JOCTET,
775 icc_data_len: *mut ::std::os::raw::c_uint,
776 ) -> boolean;
777}
778
779pub unsafe fn jpegli_create_decompress(dinfo: &mut jpegli_decompress_struct) {
780 jpegli_CreateDecompress(
781 dinfo,
782 JPEG_LIB_VERSION,
783 std::mem::size_of::<jpegli_decompress_struct>(),
784 );
785}
786
787pub unsafe fn jpegli_create_compress(cinfo: &mut jpegli_compress_struct) {
788 jpegli_CreateCompress(
789 cinfo,
790 JPEG_LIB_VERSION,
791 std::mem::size_of::<jpegli_compress_struct>(),
792 );
793}