1#[doc = " Everything ok, no error occurred."]
4pub const heif_error_code_heif_error_Ok: heif_error_code = 0;
5#[doc = " Input file does not exist."]
6pub const heif_error_code_heif_error_Input_does_not_exist: heif_error_code = 1;
7#[doc = " Error in input file. Corrupted or invalid content."]
8pub const heif_error_code_heif_error_Invalid_input: heif_error_code = 2;
9#[doc = " Input file type is not supported."]
10pub const heif_error_code_heif_error_Unsupported_filetype: heif_error_code = 3;
11#[doc = " Image requires an unsupported decoder feature."]
12pub const heif_error_code_heif_error_Unsupported_feature: heif_error_code = 4;
13#[doc = " Library API has been used in an invalid way."]
14pub const heif_error_code_heif_error_Usage_error: heif_error_code = 5;
15#[doc = " Could not allocate enough memory."]
16pub const heif_error_code_heif_error_Memory_allocation_error: heif_error_code = 6;
17#[doc = " The decoder plugin generated an error"]
18pub const heif_error_code_heif_error_Decoder_plugin_error: heif_error_code = 7;
19#[doc = " The encoder plugin generated an error"]
20pub const heif_error_code_heif_error_Encoder_plugin_error: heif_error_code = 8;
21#[doc = " Error during encoding or when writing to the output"]
22pub const heif_error_code_heif_error_Encoding_error: heif_error_code = 9;
23#[doc = " Application has asked for a color profile type that does not exist"]
24pub const heif_error_code_heif_error_Color_profile_does_not_exist: heif_error_code = 10;
25#[doc = " Error loading a dynamic plugin"]
26pub const heif_error_code_heif_error_Plugin_loading_error: heif_error_code = 11;
27#[doc = " Operation has been canceled"]
28pub const heif_error_code_heif_error_Canceled: heif_error_code = 12;
29#[doc = " Operation has been canceled"]
30pub const heif_error_code_heif_error_End_of_sequence: heif_error_code = 13;
31pub type heif_error_code = libc::c_uint;
32#[doc = " no further information available"]
33pub const heif_suberror_code_heif_suberror_Unspecified: heif_suberror_code = 0;
34#[doc = " End of data reached unexpectedly."]
35pub const heif_suberror_code_heif_suberror_End_of_data: heif_suberror_code = 100;
36#[doc = " Size of box (defined in header) is wrong"]
37pub const heif_suberror_code_heif_suberror_Invalid_box_size: heif_suberror_code = 101;
38#[doc = " Mandatory 'ftyp' box is missing"]
39pub const heif_suberror_code_heif_suberror_No_ftyp_box: heif_suberror_code = 102;
40#[doc = " Mandatory 'ftyp' box is missing"]
41pub const heif_suberror_code_heif_suberror_No_idat_box: heif_suberror_code = 103;
42#[doc = " Mandatory 'ftyp' box is missing"]
43pub const heif_suberror_code_heif_suberror_No_meta_box: heif_suberror_code = 104;
44#[doc = " Mandatory 'ftyp' box is missing"]
45pub const heif_suberror_code_heif_suberror_No_hdlr_box: heif_suberror_code = 105;
46#[doc = " Mandatory 'ftyp' box is missing"]
47pub const heif_suberror_code_heif_suberror_No_hvcC_box: heif_suberror_code = 106;
48#[doc = " Mandatory 'ftyp' box is missing"]
49pub const heif_suberror_code_heif_suberror_No_pitm_box: heif_suberror_code = 107;
50#[doc = " Mandatory 'ftyp' box is missing"]
51pub const heif_suberror_code_heif_suberror_No_ipco_box: heif_suberror_code = 108;
52#[doc = " Mandatory 'ftyp' box is missing"]
53pub const heif_suberror_code_heif_suberror_No_ipma_box: heif_suberror_code = 109;
54#[doc = " Mandatory 'ftyp' box is missing"]
55pub const heif_suberror_code_heif_suberror_No_iloc_box: heif_suberror_code = 110;
56#[doc = " Mandatory 'ftyp' box is missing"]
57pub const heif_suberror_code_heif_suberror_No_iinf_box: heif_suberror_code = 111;
58#[doc = " Mandatory 'ftyp' box is missing"]
59pub const heif_suberror_code_heif_suberror_No_iprp_box: heif_suberror_code = 112;
60#[doc = " Mandatory 'ftyp' box is missing"]
61pub const heif_suberror_code_heif_suberror_No_iref_box: heif_suberror_code = 113;
62#[doc = " Mandatory 'ftyp' box is missing"]
63pub const heif_suberror_code_heif_suberror_No_pict_handler: heif_suberror_code = 114;
64#[doc = " An item property referenced in the 'ipma' box is not existing in the 'ipco' container."]
65pub const heif_suberror_code_heif_suberror_Ipma_box_references_nonexisting_property:
66 heif_suberror_code = 115;
67#[doc = " No properties have been assigned to an item."]
68pub const heif_suberror_code_heif_suberror_No_properties_assigned_to_item: heif_suberror_code = 116;
69#[doc = " Image has no (compressed) data"]
70pub const heif_suberror_code_heif_suberror_No_item_data: heif_suberror_code = 117;
71#[doc = " Invalid specification of image grid (tiled image)"]
72pub const heif_suberror_code_heif_suberror_Invalid_grid_data: heif_suberror_code = 118;
73#[doc = " Tile-images in a grid image are missing"]
74pub const heif_suberror_code_heif_suberror_Missing_grid_images: heif_suberror_code = 119;
75#[doc = " Tile-images in a grid image are missing"]
76pub const heif_suberror_code_heif_suberror_Invalid_clean_aperture: heif_suberror_code = 120;
77#[doc = " Invalid specification of overlay image"]
78pub const heif_suberror_code_heif_suberror_Invalid_overlay_data: heif_suberror_code = 121;
79#[doc = " Overlay image completely outside of visible canvas area"]
80pub const heif_suberror_code_heif_suberror_Overlay_image_outside_of_canvas: heif_suberror_code =
81 122;
82#[doc = " Overlay image completely outside of visible canvas area"]
83pub const heif_suberror_code_heif_suberror_Auxiliary_image_type_unspecified: heif_suberror_code =
84 123;
85#[doc = " Overlay image completely outside of visible canvas area"]
86pub const heif_suberror_code_heif_suberror_No_or_invalid_primary_item: heif_suberror_code = 124;
87#[doc = " Overlay image completely outside of visible canvas area"]
88pub const heif_suberror_code_heif_suberror_No_infe_box: heif_suberror_code = 125;
89#[doc = " Overlay image completely outside of visible canvas area"]
90pub const heif_suberror_code_heif_suberror_Unknown_color_profile_type: heif_suberror_code = 126;
91#[doc = " Overlay image completely outside of visible canvas area"]
92pub const heif_suberror_code_heif_suberror_Wrong_tile_image_chroma_format: heif_suberror_code = 127;
93#[doc = " Overlay image completely outside of visible canvas area"]
94pub const heif_suberror_code_heif_suberror_Invalid_fractional_number: heif_suberror_code = 128;
95#[doc = " Overlay image completely outside of visible canvas area"]
96pub const heif_suberror_code_heif_suberror_Invalid_image_size: heif_suberror_code = 129;
97#[doc = " Overlay image completely outside of visible canvas area"]
98pub const heif_suberror_code_heif_suberror_Invalid_pixi_box: heif_suberror_code = 130;
99#[doc = " Overlay image completely outside of visible canvas area"]
100pub const heif_suberror_code_heif_suberror_No_av1C_box: heif_suberror_code = 131;
101#[doc = " Overlay image completely outside of visible canvas area"]
102pub const heif_suberror_code_heif_suberror_Wrong_tile_image_pixel_depth: heif_suberror_code = 132;
103#[doc = " Overlay image completely outside of visible canvas area"]
104pub const heif_suberror_code_heif_suberror_Unknown_NCLX_color_primaries: heif_suberror_code = 133;
105#[doc = " Overlay image completely outside of visible canvas area"]
106pub const heif_suberror_code_heif_suberror_Unknown_NCLX_transfer_characteristics:
107 heif_suberror_code = 134;
108#[doc = " Overlay image completely outside of visible canvas area"]
109pub const heif_suberror_code_heif_suberror_Unknown_NCLX_matrix_coefficients: heif_suberror_code =
110 135;
111#[doc = " Invalid specification of region item"]
112pub const heif_suberror_code_heif_suberror_Invalid_region_data: heif_suberror_code = 136;
113#[doc = " Image has no ispe property"]
114pub const heif_suberror_code_heif_suberror_No_ispe_property: heif_suberror_code = 137;
115#[doc = " Image has no ispe property"]
116pub const heif_suberror_code_heif_suberror_Camera_intrinsic_matrix_undefined: heif_suberror_code =
117 138;
118#[doc = " Image has no ispe property"]
119pub const heif_suberror_code_heif_suberror_Camera_extrinsic_matrix_undefined: heif_suberror_code =
120 139;
121#[doc = " Invalid JPEG 2000 codestream - usually a missing marker"]
122pub const heif_suberror_code_heif_suberror_Invalid_J2K_codestream: heif_suberror_code = 140;
123#[doc = " Invalid JPEG 2000 codestream - usually a missing marker"]
124pub const heif_suberror_code_heif_suberror_No_vvcC_box: heif_suberror_code = 141;
125#[doc = " icbr is only needed in some situations, this error is for those cases"]
126pub const heif_suberror_code_heif_suberror_No_icbr_box: heif_suberror_code = 142;
127#[doc = " icbr is only needed in some situations, this error is for those cases"]
128pub const heif_suberror_code_heif_suberror_No_avcC_box: heif_suberror_code = 143;
129#[doc = " we got a mini box, but could not read it properly"]
130pub const heif_suberror_code_heif_suberror_Invalid_mini_box: heif_suberror_code = 149;
131#[doc = " Decompressing generic compression or header compression data failed (e.g. bitstream corruption)"]
132pub const heif_suberror_code_heif_suberror_Decompression_invalid_data: heif_suberror_code = 150;
133#[doc = " Decompressing generic compression or header compression data failed (e.g. bitstream corruption)"]
134pub const heif_suberror_code_heif_suberror_No_moov_box: heif_suberror_code = 151;
135#[doc = " The colr (NCLX) box and the codec bitstream VUI/color signalling disagree.\n Per ISO/IEC 14496-12 and ISO/IEC 23000-22 (MIAF) the colr box takes precedence,\n but the conflict is reported as a warning."]
136pub const heif_suberror_code_heif_suberror_NCLX_colr_VUI_mismatch: heif_suberror_code = 152;
137#[doc = " A security limit preventing unreasonable memory allocations was exceeded by the input file.\n Please check whether the file is valid. If it is, contact us so that we could increase the\n security limits further."]
138pub const heif_suberror_code_heif_suberror_Security_limit_exceeded: heif_suberror_code = 1000;
139#[doc = " There was an error from the underlying compression / decompression library.\n One possibility is lack of resources (e.g. memory)."]
140pub const heif_suberror_code_heif_suberror_Compression_initialisation_error: heif_suberror_code =
141 1001;
142#[doc = " also used for Invalid_input"]
143pub const heif_suberror_code_heif_suberror_Nonexisting_item_referenced: heif_suberror_code = 2000;
144#[doc = " An API argument was given a NULL pointer, which is not allowed for that function."]
145pub const heif_suberror_code_heif_suberror_Null_pointer_argument: heif_suberror_code = 2001;
146#[doc = " Image channel referenced that does not exist in the image"]
147pub const heif_suberror_code_heif_suberror_Nonexisting_image_channel_referenced:
148 heif_suberror_code = 2002;
149#[doc = " The version of the passed plugin is not supported."]
150pub const heif_suberror_code_heif_suberror_Unsupported_plugin_version: heif_suberror_code = 2003;
151#[doc = " The version of the passed writer is not supported."]
152pub const heif_suberror_code_heif_suberror_Unsupported_writer_version: heif_suberror_code = 2004;
153#[doc = " The given (encoder) parameter name does not exist."]
154pub const heif_suberror_code_heif_suberror_Unsupported_parameter: heif_suberror_code = 2005;
155#[doc = " The value for the given parameter is not in the valid range."]
156pub const heif_suberror_code_heif_suberror_Invalid_parameter_value: heif_suberror_code = 2006;
157#[doc = " Error in property specification"]
158pub const heif_suberror_code_heif_suberror_Invalid_property: heif_suberror_code = 2007;
159#[doc = " Image reference cycle found in iref"]
160pub const heif_suberror_code_heif_suberror_Item_reference_cycle: heif_suberror_code = 2008;
161#[doc = " Image was coded with an unsupported compression method."]
162pub const heif_suberror_code_heif_suberror_Unsupported_codec: heif_suberror_code = 3000;
163#[doc = " Image is specified in an unknown way, e.g. as tiled grid image (which is supported)"]
164pub const heif_suberror_code_heif_suberror_Unsupported_image_type: heif_suberror_code = 3001;
165#[doc = " Image is specified in an unknown way, e.g. as tiled grid image (which is supported)"]
166pub const heif_suberror_code_heif_suberror_Unsupported_data_version: heif_suberror_code = 3002;
167#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
168pub const heif_suberror_code_heif_suberror_Unsupported_color_conversion: heif_suberror_code = 3003;
169#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
170pub const heif_suberror_code_heif_suberror_Unsupported_item_construction_method:
171 heif_suberror_code = 3004;
172#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
173pub const heif_suberror_code_heif_suberror_Unsupported_header_compression_method:
174 heif_suberror_code = 3005;
175#[doc = " Generically compressed data used an unsupported compression method"]
176pub const heif_suberror_code_heif_suberror_Unsupported_generic_compression_method:
177 heif_suberror_code = 3006;
178#[doc = " Generically compressed data used an unsupported compression method"]
179pub const heif_suberror_code_heif_suberror_Unsupported_essential_property: heif_suberror_code =
180 3007;
181#[doc = " Generically compressed data used an unsupported compression method"]
182pub const heif_suberror_code_heif_suberror_Unsupported_track_type: heif_suberror_code = 3008;
183#[doc = " --- Encoder_plugin_error ---"]
184pub const heif_suberror_code_heif_suberror_Unsupported_bit_depth: heif_suberror_code = 4000;
185#[doc = " --- Encoding_error ---"]
186pub const heif_suberror_code_heif_suberror_Cannot_write_output_data: heif_suberror_code = 5000;
187#[doc = " --- Encoding_error ---"]
188pub const heif_suberror_code_heif_suberror_Encoder_initialization: heif_suberror_code = 5001;
189#[doc = " --- Encoding_error ---"]
190pub const heif_suberror_code_heif_suberror_Encoder_encoding: heif_suberror_code = 5002;
191#[doc = " --- Encoding_error ---"]
192pub const heif_suberror_code_heif_suberror_Encoder_cleanup: heif_suberror_code = 5003;
193#[doc = " --- Encoding_error ---"]
194pub const heif_suberror_code_heif_suberror_Too_many_regions: heif_suberror_code = 5004;
195#[doc = " a specific plugin file cannot be loaded"]
196pub const heif_suberror_code_heif_suberror_Plugin_loading_error: heif_suberror_code = 6000;
197#[doc = " trying to remove a plugin that is not loaded"]
198pub const heif_suberror_code_heif_suberror_Plugin_is_not_loaded: heif_suberror_code = 6001;
199#[doc = " error while scanning the directory for plugins"]
200pub const heif_suberror_code_heif_suberror_Cannot_read_plugin_directory: heif_suberror_code = 6002;
201#[doc = " no decoder found for that compression format"]
202pub const heif_suberror_code_heif_suberror_No_matching_decoder_installed: heif_suberror_code = 6003;
203pub type heif_suberror_code = libc::c_uint;
204#[repr(C)]
205#[derive(Debug, Copy, Clone)]
206pub struct heif_error {
207 #[doc = " main error category"]
208 pub code: heif_error_code,
209 #[doc = " more detailed error code"]
210 pub subcode: heif_suberror_code,
211 #[doc = " textual error message (is always defined, you do not have to check for NULL)"]
212 pub message: *const libc::c_char,
213}
214unsafe extern "C" {
215 #[doc = " Version string of linked libheif library."]
216 pub fn heif_get_version() -> *const libc::c_char;
217}
218unsafe extern "C" {
219 #[doc = " Numeric version of linked libheif library, encoded as 0xHHMMLL00 = hh.mm.ll, where hh, mm, ll is the decimal representation of HH, MM, LL.\n For example: 0x02150300 is version 2.21.3"]
220 pub fn heif_get_version_number() -> u32;
221}
222unsafe extern "C" {
223 #[doc = " Numeric part \"HH\" from above. Returned as a decimal number."]
224 pub fn heif_get_version_number_major() -> libc::c_int;
225}
226unsafe extern "C" {
227 #[doc = " Numeric part \"MM\" from above. Returned as a decimal number."]
228 pub fn heif_get_version_number_minor() -> libc::c_int;
229}
230unsafe extern "C" {
231 #[doc = " Numeric part \"LL\" from above. Returned as a decimal number."]
232 pub fn heif_get_version_number_maintenance() -> libc::c_int;
233}
234#[repr(C)]
235#[derive(Debug)]
236pub struct heif_context {
237 _unused: [u8; 0],
238}
239#[repr(C)]
240#[derive(Debug)]
241pub struct heif_image_handle {
242 _unused: [u8; 0],
243}
244pub type heif_item_id = u32;
245pub type heif_property_id = u32;
246unsafe extern "C" {
247 #[doc = " Free a string returned by libheif in various API functions.\n You may pass NULL."]
248 pub fn heif_string_release(arg1: *const libc::c_char);
249}
250#[doc = " ========================= library initialization ======================"]
251#[repr(C)]
252#[derive(Debug, Copy, Clone)]
253pub struct heif_init_params {
254 pub version: libc::c_int,
255}
256unsafe extern "C" {
257 #[doc = " Initialise library.\n\n You should call heif_init() when you start using libheif and heif_deinit() when you are finished.\n These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().\n\n For backwards compatibility, it is not really necessary to call heif_init(), but some library memory objects\n will never be freed if you do not call heif_init()/heif_deinit().\n\n heif_init() will load the external modules installed in the default plugin path. Thus, you need it when you\n want to load external plugins from the default path.\n Codec plugins that are compiled into the library directly (selected by the compile-time parameters of libheif)\n will be available even without heif_init().\n\n Make sure that you do not have one part of your program use heif_init()/heif_deinit() and another part that does\n not use it as the latter may try to use an uninitialized library. If in doubt, enclose everything with init/deinit.\n\n You may pass nullptr to get default parameters. Currently, no parameters are supported."]
258 pub fn heif_init(arg1: *mut heif_init_params) -> heif_error;
259}
260unsafe extern "C" {
261 #[doc = " Deinitialise and clean up library.\n\n You should call heif_init() when you start using libheif and heif_deinit() when you are finished.\n These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().\n\n Note: heif_deinit() must not be called after exit(), for example in a global C++ object's destructor.\n If you do, global variables in libheif might have already been released when heif_deinit() is running,\n leading to a crash.\n\n \\sa heif_init()"]
262 pub fn heif_deinit();
263}
264pub const heif_plugin_type_heif_plugin_type_encoder: heif_plugin_type = 0;
265pub const heif_plugin_type_heif_plugin_type_decoder: heif_plugin_type = 1;
266#[doc = " --- Plugins are currently only supported on Unix platforms."]
267pub type heif_plugin_type = libc::c_uint;
268#[repr(C)]
269#[derive(Debug)]
270pub struct heif_plugin_info {
271 #[doc = " version of this info struct"]
272 pub version: libc::c_int,
273 pub type_: heif_plugin_type,
274 pub plugin: *const libc::c_void,
275 #[doc = " for internal use only"]
276 pub internal_handle: *mut libc::c_void,
277}
278unsafe extern "C" {
279 pub fn heif_load_plugin(
280 filename: *const libc::c_char,
281 out_plugin: *mut *const heif_plugin_info,
282 ) -> heif_error;
283}
284unsafe extern "C" {
285 pub fn heif_load_plugins(
286 directory: *const libc::c_char,
287 out_plugins: *mut *const heif_plugin_info,
288 out_nPluginsLoaded: *mut libc::c_int,
289 output_array_size: libc::c_int,
290 ) -> heif_error;
291}
292unsafe extern "C" {
293 pub fn heif_unload_plugin(plugin: *const heif_plugin_info) -> heif_error;
294}
295unsafe extern "C" {
296 #[doc = " Get a NULL terminated array of the plugin directories that are searched by libheif.\n This includes the paths specified in the environment variable LIBHEIF_PLUGIN_PATHS and the built-in path\n (if not overridden by the environment variable)."]
297 pub fn heif_get_plugin_directories() -> *const *const libc::c_char;
298}
299unsafe extern "C" {
300 pub fn heif_free_plugin_directories(arg1: *const *const libc::c_char);
301}
302#[repr(C)]
303#[derive(Debug)]
304pub struct heif_decoder_plugin {
305 _unused: [u8; 0],
306}
307#[repr(C)]
308#[derive(Debug)]
309pub struct heif_encoder_plugin {
310 _unused: [u8; 0],
311}
312unsafe extern "C" {
313 pub fn heif_register_decoder_plugin(arg1: *const heif_decoder_plugin) -> heif_error;
314}
315unsafe extern "C" {
316 pub fn heif_register_encoder_plugin(arg1: *const heif_encoder_plugin) -> heif_error;
317}
318unsafe extern "C" {
319 #[doc = " DEPRECATED. Use heif_register_decoder_plugin(const struct heif_decoder_plugin*) instead."]
320 pub fn heif_register_decoder(
321 heif: *mut heif_context,
322 arg1: *const heif_decoder_plugin,
323 ) -> heif_error;
324}
325pub const heif_chroma_heif_chroma_undefined: heif_chroma = 99;
326#[deprecated(
327 since = "5.3.0",
328 note = "use `heif_chroma_heif_chroma_planar` instead."
329)]
330pub const heif_chroma_heif_chroma_monochrome: heif_chroma = 0;
331pub const heif_chroma_heif_chroma_planar: heif_chroma = 0;
332pub const heif_chroma_heif_chroma_420: heif_chroma = 1;
333pub const heif_chroma_heif_chroma_422: heif_chroma = 2;
334pub const heif_chroma_heif_chroma_444: heif_chroma = 3;
335pub const heif_chroma_heif_chroma_interleaved_RGB: heif_chroma = 10;
336pub const heif_chroma_heif_chroma_interleaved_RGBA: heif_chroma = 11;
337#[doc = " HDR, big endian."]
338pub const heif_chroma_heif_chroma_interleaved_RRGGBB_BE: heif_chroma = 12;
339#[doc = " HDR, big endian."]
340pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_BE: heif_chroma = 13;
341#[doc = " HDR, little endian."]
342pub const heif_chroma_heif_chroma_interleaved_RRGGBB_LE: heif_chroma = 14;
343#[doc = " HDR, little endian."]
344pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_LE: heif_chroma = 15;
345#[doc = " The heif_chroma enum describes pixel layout (planar vs interleaved, and any\n YUV chroma subsampling). It does NOT describe pixel semantics; the semantic\n interpretation of the planes comes from heif_colorspace.\n\n heif_chroma_planar covers \"one or more planar components, no subsampling\".\n It is used for:\n - heif_colorspace_monochrome (single luma plane)\n - heif_colorspace_filter_array (single CFA mosaic plane)\n - heif_colorspace_custom (any number of planar components)\n For heif_colorspace_RGB the historical name heif_chroma_444 is the\n canonical form for planar RGB. heif_chroma_planar is accepted as a\n synonym at the C API boundary and is internally canonicalized to\n heif_chroma_444 so existing callers and internal code paths keep seeing\n heif_chroma_444 on read-back. Callers should also accept a returned\n heif_chroma_planar as a synonym. We might switch to this as the\n canonical name in the future.\n\n The YUV subsampling names (heif_chroma_420 / _422 / _444) are kept for\n heif_colorspace_YCbCr."]
346pub type heif_chroma = libc::c_uint;
347pub const heif_colorspace_heif_colorspace_undefined: heif_colorspace = 99;
348#[doc = " heif_colorspace_YCbCr should be used with one of these heif_chroma values:\n * heif_chroma_444\n * heif_chroma_422\n * heif_chroma_420"]
349pub const heif_colorspace_heif_colorspace_YCbCr: heif_colorspace = 0;
350#[doc = " heif_colorspace_RGB should be used with one of these heif_chroma values:\n * heif_chroma_444 (for planar RGB)\n * heif_chroma_planar is accepted as a synonym and is internally canonicalized to heif_chroma_444.\n It is the preferred, future-proof value.\n * heif_chroma_interleaved_RGB\n * heif_chroma_interleaved_RGBA\n * heif_chroma_interleaved_RRGGBB_BE\n * heif_chroma_interleaved_RRGGBBAA_BE\n * heif_chroma_interleaved_RRGGBB_LE\n * heif_chroma_interleaved_RRGGBBAA_LE"]
351pub const heif_colorspace_heif_colorspace_RGB: heif_colorspace = 1;
352#[doc = " heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_planar."]
353pub const heif_colorspace_heif_colorspace_monochrome: heif_colorspace = 2;
354#[deprecated(
355 since = "5.3.0",
356 note = "use `heif_colorspace_heif_colorspace_custom` instead."
357)]
358pub const heif_colorspace_heif_colorspace_nonvisual: heif_colorspace = 3;
359#[doc = " Indicates that this image has a special, custom arrangement of components.\n For example, it can have several monochrome channels or just a depth component with no color image.\n Images of this type are always planar and use heif_chroma_planar."]
360pub const heif_colorspace_heif_colorspace_custom: heif_colorspace = 3;
361#[doc = " Images of this type are filter-array (CFA / Bayer) mosaics. The single\n mosaicked plane is described as heif_chroma_planar."]
362pub const heif_colorspace_heif_colorspace_filter_array: heif_colorspace = 4;
363pub type heif_colorspace = libc::c_uint;
364pub const heif_channel_heif_channel_Y: heif_channel = 0;
365pub const heif_channel_heif_channel_Cb: heif_channel = 1;
366pub const heif_channel_heif_channel_Cr: heif_channel = 2;
367pub const heif_channel_heif_channel_R: heif_channel = 3;
368pub const heif_channel_heif_channel_G: heif_channel = 4;
369pub const heif_channel_heif_channel_B: heif_channel = 5;
370pub const heif_channel_heif_channel_Alpha: heif_channel = 6;
371pub const heif_channel_heif_channel_interleaved: heif_channel = 10;
372pub const heif_channel_heif_channel_filter_array: heif_channel = 11;
373pub const heif_channel_heif_channel_depth: heif_channel = 12;
374pub const heif_channel_heif_channel_disparity: heif_channel = 13;
375pub const heif_channel_heif_channel_unknown: heif_channel = 65535;
376pub type heif_channel = libc::c_uint;
377#[repr(C)]
378#[derive(Debug)]
379pub struct heif_image {
380 _unused: [u8; 0],
381}
382unsafe extern "C" {
383 #[doc = " Get the colorspace format of the image."]
384 pub fn heif_image_get_colorspace(arg1: *const heif_image) -> heif_colorspace;
385}
386unsafe extern "C" {
387 #[doc = " Get the chroma format of the image."]
388 pub fn heif_image_get_chroma_format(arg1: *const heif_image) -> heif_chroma;
389}
390unsafe extern "C" {
391 #[doc = " Get the width of a specified image channel.\n\n @param img the image to get the width for\n @param channel the channel to select\n @return the width of the channel in pixels, or -1 the channel does not exist in the image"]
392 pub fn heif_image_get_width(img: *const heif_image, channel: heif_channel) -> libc::c_int;
393}
394unsafe extern "C" {
395 #[doc = " Get the height of a specified image channel.\n\n @param img the image to get the height for\n @param channel the channel to select\n @return the height of the channel in pixels, or -1 the channel does not exist in the image"]
396 pub fn heif_image_get_height(img: *const heif_image, channel: heif_channel) -> libc::c_int;
397}
398unsafe extern "C" {
399 #[doc = " Get the logical width of the image.\n\n For well-formed images this equals the size of the main channel (the Y channel\n in YCbCr or mono, or the RGB channels). Subsampled chroma channels may be smaller.\n\n @param img the image to get the primary width for\n @return the width in pixels"]
400 pub fn heif_image_get_primary_width(img: *const heif_image) -> libc::c_int;
401}
402unsafe extern "C" {
403 #[doc = " Get the logical height of the image.\n\n For well-formed images this equals the size of the main channel (the Y channel\n in YCbCr or mono, or the RGB channels). Subsampled chroma channels may be smaller.\n\n @param img the image to get the primary height for\n @return the height in pixels"]
404 pub fn heif_image_get_primary_height(img: *const heif_image) -> libc::c_int;
405}
406unsafe extern "C" {
407 #[doc = " Crop the image in place by removing margins from each edge.\n\n The four parameters specify the number of pixels to remove from each side,\n not absolute pixel coordinates. For example, to crop a 100x100 image down\n to its central 80x80 region, pass `left=10, right=10, top=10, bottom=10`.\n Passing all zeros leaves the image unchanged.\n\n The resulting image has dimensions `(w - left - right) x (h - top - bottom)`,\n which must be at least 1x1. All four values must be non-negative and the\n sums `left + right` and `top + bottom` must each be strictly less than the\n corresponding image dimension; otherwise `heif_error_Usage_error` /\n `heif_suberror_Invalid_parameter_value` is returned and the image is left\n unchanged.\n\n @param img the image to crop (modified in place on success)\n @param left number of pixels to remove from the left edge\n @param right number of pixels to remove from the right edge\n @param top number of pixels to remove from the top edge\n @param bottom number of pixels to remove from the bottom edge"]
408 pub fn heif_image_crop(
409 img: *mut heif_image,
410 left: libc::c_int,
411 right: libc::c_int,
412 top: libc::c_int,
413 bottom: libc::c_int,
414 ) -> heif_error;
415}
416unsafe extern "C" {
417 pub fn heif_image_extract_area(
418 arg1: *const heif_image,
419 x0: u32,
420 y0: u32,
421 w: u32,
422 h: u32,
423 limits: *const heif_security_limits,
424 out_image: *mut *mut heif_image,
425 ) -> heif_error;
426}
427unsafe extern "C" {
428 #[doc = " Get the number of bits per pixel in the given image channel. Returns -1 if\n a non-existing channel was given.\n Note that the number of bits per pixel may be different for each color channel.\n This function returns the number of bits used for storage of each pixel.\n Especially for HDR images, this is probably not what you want. Have a look at\n heif_image_get_bits_per_pixel_range() instead."]
429 pub fn heif_image_get_bits_per_pixel(
430 arg1: *const heif_image,
431 channel: heif_channel,
432 ) -> libc::c_int;
433}
434unsafe extern "C" {
435 #[doc = " Get the number of bits per pixel in the given image channel. This function returns\n the number of bits used for representing the pixel value, which might be smaller\n than the number of bits used in memory.\n For example, in 12bit HDR images, this function returns '12', while still 16 bits\n are reserved for storage. For interleaved RGBA with 12 bit, this function also returns\n '12', not '48' or '64' (heif_image_get_bits_per_pixel returns 64 in this case)."]
436 pub fn heif_image_get_bits_per_pixel_range(
437 arg1: *const heif_image,
438 channel: heif_channel,
439 ) -> libc::c_int;
440}
441unsafe extern "C" {
442 pub fn heif_image_has_channel(arg1: *const heif_image, channel: heif_channel) -> libc::c_int;
443}
444unsafe extern "C" {
445 #[doc = " Get a pointer to the actual pixel data.\n The 'out_stride' is returned as \"bytes per line\".\n When out_stride is NULL, no value will be written.\n Returns NULL if a non-existing channel was given.\n Deprecated, use the safer version heif_image_get_plane_readonly2() instead."]
446 pub fn heif_image_get_plane_readonly(
447 arg1: *const heif_image,
448 channel: heif_channel,
449 out_stride: *mut libc::c_int,
450 ) -> *const u8;
451}
452unsafe extern "C" {
453 #[doc = " Deprecated, use the safer version heif_image_get_plane2() instead."]
454 pub fn heif_image_get_plane(
455 arg1: *mut heif_image,
456 channel: heif_channel,
457 out_stride: *mut libc::c_int,
458 ) -> *mut u8;
459}
460unsafe extern "C" {
461 #[doc = " These are safer variants of the two functions above.\n The 'stride' parameter is often multiplied by the image height in the client application.\n For very large images, this can lead to integer overflows and, consequently, illegal memory accesses.\n The changed 'stride' parameter type eliminates this common error."]
462 pub fn heif_image_get_plane_readonly2(
463 arg1: *const heif_image,
464 channel: heif_channel,
465 out_stride: *mut usize,
466 ) -> *const u8;
467}
468unsafe extern "C" {
469 pub fn heif_image_get_plane2(
470 arg1: *mut heif_image,
471 channel: heif_channel,
472 out_stride: *mut usize,
473 ) -> *mut u8;
474}
475#[repr(C)]
476#[derive(Debug)]
477pub struct heif_scaling_options {
478 _unused: [u8; 0],
479}
480unsafe extern "C" {
481 #[doc = " Currently, heif_scaling_options is not defined yet. Pass a NULL pointer."]
482 pub fn heif_image_scale_image(
483 input: *const heif_image,
484 output: *mut *mut heif_image,
485 width: libc::c_int,
486 height: libc::c_int,
487 options: *const heif_scaling_options,
488 ) -> heif_error;
489}
490unsafe extern "C" {
491 #[doc = " Extends the image size to match the given size by extending the right and bottom borders.\n The border areas are filled with zero."]
492 pub fn heif_image_extend_to_size_fill_with_zero(
493 image: *mut heif_image,
494 width: u32,
495 height: u32,
496 ) -> heif_error;
497}
498unsafe extern "C" {
499 #[doc = " Fills the image decoding warnings into the provided 'out_warnings' array.\n The size of the array has to be provided in max_output_buffer_entries.\n If max_output_buffer_entries==0, the number of decoder warnings is returned.\n The function fills the warnings into the provided buffer, starting with 'first_warning_idx'.\n It returns the number of warnings filled into the buffer.\n Note: you can iterate through all warnings by using 'max_output_buffer_entries=1' and iterate 'first_warning_idx'."]
500 pub fn heif_image_get_decoding_warnings(
501 image: *mut heif_image,
502 first_warning_idx: libc::c_int,
503 out_warnings: *mut heif_error,
504 max_output_buffer_entries: libc::c_int,
505 ) -> libc::c_int;
506}
507unsafe extern "C" {
508 #[doc = " This function is only for decoder plugin implementors."]
509 pub fn heif_image_add_decoding_warning(image: *mut heif_image, err: heif_error);
510}
511unsafe extern "C" {
512 #[doc = " Release heif_image."]
513 pub fn heif_image_release(arg1: *const heif_image);
514}
515unsafe extern "C" {
516 pub fn heif_image_get_pixel_aspect_ratio(
517 arg1: *const heif_image,
518 aspect_h: *mut u32,
519 aspect_v: *mut u32,
520 );
521}
522unsafe extern "C" {
523 pub fn heif_image_set_pixel_aspect_ratio(arg1: *mut heif_image, aspect_h: u32, aspect_v: u32);
524}
525unsafe extern "C" {
526 pub fn heif_image_handle_set_pixel_aspect_ratio(
527 arg1: *mut heif_image_handle,
528 aspect_h: u32,
529 aspect_v: u32,
530 );
531}
532unsafe extern "C" {
533 #[doc = " Create a new image of the specified resolution and colorspace.\n\n <p>This does not allocate memory for the image data. Use {@link heif_image_add_plane} to\n add the corresponding planes to match the specified {@code colorspace} and {@code chroma}.\n\n @param width the width of the image in pixels\n @param height the height of the image in pixels\n @param colorspace the colorspace of the image\n @param chroma the chroma of the image\n @param out_image pointer to pointer of the resulting image\n @return whether the creation succeeded or there was an error"]
534 pub fn heif_image_create(
535 width: libc::c_int,
536 height: libc::c_int,
537 colorspace: heif_colorspace,
538 chroma: heif_chroma,
539 out_image: *mut *mut heif_image,
540 ) -> heif_error;
541}
542unsafe extern "C" {
543 #[doc = " Add an image plane to the image.\n\n <p>The image plane needs to match the colorspace and chroma of the image. Note\n that this does not need to be a single \"planar\" format - interleaved pixel channels\n can also be used if the chroma is interleaved.\n\n <p>The indicated bit_depth corresponds to the bit depth per channel. For example,\n with an interleaved format like RRGGBB where each color is represented by 10 bits,\n the {@code bit_depth} would be {@code 10} rather than {@code 30}.\n\n <p>For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA,\n instead of the preferred 8 bits. However, this use is deprecated.\n\n @param image the parent image to add the channel plane to\n @param channel the channel of the plane to add\n @param width the width of the plane\n @param height the height of the plane\n @param bit_depth the bit depth per color channel\n @return whether the addition succeeded or there was an error\n\n @note The width and height are usually the same as the parent image, but can be\n less for subsampling.\n\n @note The specified width can differ from the row stride of the resulting image plane.\n Always use the result of {@link heif_image_get_plane} or {@link heif_image_get_plane_readonly}\n to determine row stride."]
544 pub fn heif_image_add_plane(
545 image: *mut heif_image,
546 channel: heif_channel,
547 width: libc::c_int,
548 height: libc::c_int,
549 bit_depth: libc::c_int,
550 ) -> heif_error;
551}
552unsafe extern "C" {
553 #[doc = " The security limits should preferably be the limits from a heif_context.\n The memory allocated will then be registered in the memory budget of that context."]
554 pub fn heif_image_add_plane_safe(
555 image: *mut heif_image,
556 channel: heif_channel,
557 width: libc::c_int,
558 height: libc::c_int,
559 bit_depth: libc::c_int,
560 limits: *const heif_security_limits,
561 ) -> heif_error;
562}
563unsafe extern "C" {
564 #[doc = " Signal that the image is premultiplied by the alpha pixel values."]
565 pub fn heif_image_set_premultiplied_alpha(
566 image: *mut heif_image,
567 is_premultiplied_alpha: libc::c_int,
568 );
569}
570unsafe extern "C" {
571 pub fn heif_image_is_premultiplied_alpha(image: *mut heif_image) -> libc::c_int;
572}
573unsafe extern "C" {
574 #[doc = " This function extends the padding of the image so that it has at least the given physical size.\n The padding border is filled with the pixels along the right/bottom border.\n This function may be useful if you want to process the image, but have some external padding requirements.\n The image size will not be modified if it is already larger/equal than the given physical size.\n I.e. you cannot assume that after calling this function, the stride will be equal to min_physical_width."]
575 pub fn heif_image_extend_padding_to_size(
576 image: *mut heif_image,
577 min_physical_width: libc::c_int,
578 min_physical_height: libc::c_int,
579 ) -> heif_error;
580}
581pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_nearest_neighbor:
582 heif_chroma_downsampling_algorithm = 1;
583pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_average:
584 heif_chroma_downsampling_algorithm = 2;
585#[doc = " Combine with 'heif_chroma_upsampling_bilinear' for best quality.\n Makes edges look sharper when using YUV 420 with bilinear chroma upsampling."]
586pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_sharp_yuv:
587 heif_chroma_downsampling_algorithm = 3;
588pub type heif_chroma_downsampling_algorithm = libc::c_uint;
589pub const heif_chroma_upsampling_algorithm_heif_chroma_upsampling_nearest_neighbor:
590 heif_chroma_upsampling_algorithm = 1;
591pub const heif_chroma_upsampling_algorithm_heif_chroma_upsampling_bilinear:
592 heif_chroma_upsampling_algorithm = 2;
593pub type heif_chroma_upsampling_algorithm = libc::c_uint;
594#[repr(C)]
595#[derive(Debug, Copy, Clone)]
596pub struct heif_color_conversion_options {
597 #[doc = " 'version' must be 1."]
598 pub version: u8,
599 #[doc = " --- version 1 options"]
600 pub preferred_chroma_downsampling_algorithm: heif_chroma_downsampling_algorithm,
601 pub preferred_chroma_upsampling_algorithm: heif_chroma_upsampling_algorithm,
602 #[doc = " When set to 'false' libheif may also use a different algorithm if the preferred one is not available\n or using a different algorithm is computationally less complex. Note that currently (v1.17.0) this\n means that for RGB input it will usually choose nearest-neighbor sampling because this is computationally\n the simplest.\n Set this field to 'true' if you want to make sure that the specified algorithm is used even\n at the cost of slightly higher computation times."]
603 pub only_use_preferred_chroma_algorithm: u8,
604}
605pub const heif_alpha_composition_mode_heif_alpha_composition_mode_none:
606 heif_alpha_composition_mode = 0;
607pub const heif_alpha_composition_mode_heif_alpha_composition_mode_solid_color:
608 heif_alpha_composition_mode = 1;
609pub const heif_alpha_composition_mode_heif_alpha_composition_mode_checkerboard:
610 heif_alpha_composition_mode = 2;
611pub type heif_alpha_composition_mode = libc::c_uint;
612#[repr(C)]
613#[derive(Debug, Copy, Clone)]
614pub struct heif_color_conversion_options_ext {
615 pub version: u8,
616 #[doc = " --- version 1 options"]
617 pub alpha_composition_mode: heif_alpha_composition_mode,
618 #[doc = " color values should be specified in the range [0, 65535]"]
619 pub background_red: u16,
620 #[doc = " color values should be specified in the range [0, 65535]"]
621 pub background_green: u16,
622 #[doc = " color values should be specified in the range [0, 65535]"]
623 pub background_blue: u16,
624 pub secondary_background_red: u16,
625 pub secondary_background_green: u16,
626 pub secondary_background_blue: u16,
627 pub checkerboard_square_size: u16,
628}
629unsafe extern "C" {
630 #[doc = " Assumes that it is a version=1 struct."]
631 pub fn heif_color_conversion_options_set_defaults(arg1: *mut heif_color_conversion_options);
632}
633unsafe extern "C" {
634 pub fn heif_color_conversion_options_ext_alloc() -> *mut heif_color_conversion_options_ext;
635}
636unsafe extern "C" {
637 pub fn heif_color_conversion_options_ext_copy(
638 dst: *mut heif_color_conversion_options_ext,
639 src: *const heif_color_conversion_options_ext,
640 );
641}
642unsafe extern "C" {
643 pub fn heif_color_conversion_options_ext_free(arg1: *mut heif_color_conversion_options_ext);
644}
645pub const heif_color_profile_type_heif_color_profile_type_not_present: heif_color_profile_type = 0;
646pub const heif_color_profile_type_heif_color_profile_type_nclx: heif_color_profile_type =
647 1852009592;
648pub const heif_color_profile_type_heif_color_profile_type_rICC: heif_color_profile_type =
649 1917403971;
650pub const heif_color_profile_type_heif_color_profile_type_prof: heif_color_profile_type =
651 1886547814;
652#[doc = " ------------------------- color profiles -------------------------"]
653pub type heif_color_profile_type = libc::c_uint;
654unsafe extern "C" {
655 #[doc = " Returns 'heif_color_profile_type_not_present' if there is no color profile.\n If there is an ICC profile and an NCLX profile, the ICC profile is returned.\n TODO: we need a new API for this function as images can contain both NCLX and ICC at the same time.\n However, you can still use heif_image_handle_get_raw_color_profile() and\n heif_image_handle_get_nclx_color_profile() to access both profiles."]
656 pub fn heif_image_handle_get_color_profile_type(
657 handle: *const heif_image_handle,
658 ) -> heif_color_profile_type;
659}
660unsafe extern "C" {
661 pub fn heif_image_handle_get_raw_color_profile_size(handle: *const heif_image_handle) -> usize;
662}
663unsafe extern "C" {
664 #[doc = " Returns 'heif_error_Color_profile_does_not_exist' when there is no ICC profile."]
665 pub fn heif_image_handle_get_raw_color_profile(
666 handle: *const heif_image_handle,
667 out_data: *mut libc::c_void,
668 ) -> heif_error;
669}
670#[doc = " g=0.3;0.6, b=0.15;0.06, r=0.64;0.33, w=0.3127,0.3290"]
671pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_709_5: heif_color_primaries = 1;
672pub const heif_color_primaries_heif_color_primaries_unspecified: heif_color_primaries = 2;
673pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_470_6_System_M: heif_color_primaries =
674 4;
675pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_470_6_System_B_G:
676 heif_color_primaries = 5;
677pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_601_6: heif_color_primaries = 6;
678pub const heif_color_primaries_heif_color_primaries_SMPTE_240M: heif_color_primaries = 7;
679pub const heif_color_primaries_heif_color_primaries_generic_film: heif_color_primaries = 8;
680pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_2020_2_and_2100_0:
681 heif_color_primaries = 9;
682pub const heif_color_primaries_heif_color_primaries_SMPTE_ST_428_1: heif_color_primaries = 10;
683pub const heif_color_primaries_heif_color_primaries_SMPTE_RP_431_2: heif_color_primaries = 11;
684pub const heif_color_primaries_heif_color_primaries_SMPTE_EG_432_1: heif_color_primaries = 12;
685pub const heif_color_primaries_heif_color_primaries_EBU_Tech_3213_E: heif_color_primaries = 22;
686pub type heif_color_primaries = libc::c_uint;
687pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_709_5:
688 heif_transfer_characteristics = 1;
689pub const heif_transfer_characteristics_heif_transfer_characteristic_unspecified:
690 heif_transfer_characteristics = 2;
691pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_470_6_System_M:
692 heif_transfer_characteristics = 4;
693pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_470_6_System_B_G:
694 heif_transfer_characteristics = 5;
695pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_601_6:
696 heif_transfer_characteristics = 6;
697pub const heif_transfer_characteristics_heif_transfer_characteristic_SMPTE_240M:
698 heif_transfer_characteristics = 7;
699pub const heif_transfer_characteristics_heif_transfer_characteristic_linear:
700 heif_transfer_characteristics = 8;
701pub const heif_transfer_characteristics_heif_transfer_characteristic_logarithmic_100:
702 heif_transfer_characteristics = 9;
703pub const heif_transfer_characteristics_heif_transfer_characteristic_logarithmic_100_sqrt10:
704 heif_transfer_characteristics = 10;
705pub const heif_transfer_characteristics_heif_transfer_characteristic_IEC_61966_2_4:
706 heif_transfer_characteristics = 11;
707pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_1361:
708 heif_transfer_characteristics = 12;
709pub const heif_transfer_characteristics_heif_transfer_characteristic_IEC_61966_2_1:
710 heif_transfer_characteristics = 13;
711pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2020_2_10bit:
712 heif_transfer_characteristics = 14;
713pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2020_2_12bit:
714 heif_transfer_characteristics = 15;
715pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2100_0_PQ:
716 heif_transfer_characteristics = 16;
717pub const heif_transfer_characteristics_heif_transfer_characteristic_SMPTE_ST_428_1:
718 heif_transfer_characteristics = 17;
719pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2100_0_HLG:
720 heif_transfer_characteristics = 18;
721pub type heif_transfer_characteristics = libc::c_uint;
722pub const heif_matrix_coefficients_heif_matrix_coefficients_RGB_GBR: heif_matrix_coefficients = 0;
723#[doc = " TODO: or 709-6 according to h.273"]
724pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_709_5:
725 heif_matrix_coefficients = 1;
726pub const heif_matrix_coefficients_heif_matrix_coefficients_unspecified: heif_matrix_coefficients =
727 2;
728pub const heif_matrix_coefficients_heif_matrix_coefficients_US_FCC_T47: heif_matrix_coefficients =
729 4;
730pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G:
731 heif_matrix_coefficients = 5;
732#[doc = " TODO: or 601-7 according to h.273"]
733pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_601_6:
734 heif_matrix_coefficients = 6;
735pub const heif_matrix_coefficients_heif_matrix_coefficients_SMPTE_240M: heif_matrix_coefficients =
736 7;
737pub const heif_matrix_coefficients_heif_matrix_coefficients_YCgCo: heif_matrix_coefficients = 8;
738pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance : heif_matrix_coefficients = 9 ;
739pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_2020_2_constant_luminance:
740 heif_matrix_coefficients = 10;
741pub const heif_matrix_coefficients_heif_matrix_coefficients_SMPTE_ST_2085:
742 heif_matrix_coefficients = 11;
743pub const heif_matrix_coefficients_heif_matrix_coefficients_chromaticity_derived_non_constant_luminance : heif_matrix_coefficients = 12 ;
744pub const heif_matrix_coefficients_heif_matrix_coefficients_chromaticity_derived_constant_luminance : heif_matrix_coefficients = 13 ;
745pub const heif_matrix_coefficients_heif_matrix_coefficients_ICtCp: heif_matrix_coefficients = 14;
746pub type heif_matrix_coefficients = libc::c_uint;
747#[repr(C)]
748#[derive(Debug, Copy, Clone)]
749pub struct heif_color_profile_nclx {
750 #[doc = " === version 1 fields"]
751 pub version: u8,
752 pub color_primaries: heif_color_primaries,
753 pub transfer_characteristics: heif_transfer_characteristics,
754 pub matrix_coefficients: heif_matrix_coefficients,
755 pub full_range_flag: u8,
756 #[doc = " --- decoded values (not used when saving nclx)"]
757 pub color_primary_red_x: f32,
758 #[doc = " --- decoded values (not used when saving nclx)"]
759 pub color_primary_red_y: f32,
760 pub color_primary_green_x: f32,
761 pub color_primary_green_y: f32,
762 pub color_primary_blue_x: f32,
763 pub color_primary_blue_y: f32,
764 pub color_primary_white_x: f32,
765 pub color_primary_white_y: f32,
766}
767unsafe extern "C" {
768 pub fn heif_nclx_color_profile_set_color_primaries(
769 nclx: *mut heif_color_profile_nclx,
770 cp: u16,
771 ) -> heif_error;
772}
773unsafe extern "C" {
774 pub fn heif_nclx_color_profile_set_transfer_characteristics(
775 nclx: *mut heif_color_profile_nclx,
776 transfer_characteristics: u16,
777 ) -> heif_error;
778}
779unsafe extern "C" {
780 pub fn heif_nclx_color_profile_set_matrix_coefficients(
781 nclx: *mut heif_color_profile_nclx,
782 matrix_coefficients: u16,
783 ) -> heif_error;
784}
785unsafe extern "C" {
786 #[doc = " Returns 'heif_error_Color_profile_does_not_exist' when there is no NCLX profile.\n TODO: This function does currently not return an NCLX profile if it is stored in the image bitstream.\n Only NCLX profiles stored as colr boxes are returned. This may change in the future."]
787 pub fn heif_image_handle_get_nclx_color_profile(
788 handle: *const heif_image_handle,
789 out_data: *mut *mut heif_color_profile_nclx,
790 ) -> heif_error;
791}
792unsafe extern "C" {
793 #[doc = " Returned color profile has 'version' field set to the maximum allowed.\n Do not fill values for higher versions as these might be outside the allocated structure size.\n May return NULL."]
794 pub fn heif_nclx_color_profile_alloc() -> *mut heif_color_profile_nclx;
795}
796unsafe extern "C" {
797 pub fn heif_nclx_color_profile_free(nclx_profile: *mut heif_color_profile_nclx);
798}
799unsafe extern "C" {
800 #[doc = " Note: in early versions of HEIF, there could only be one color profile per image. However, this has been changed.\n This function will now return ICC if one is present and NCLX only if there is no ICC.\n You may better avoid this function and simply query for NCLX and ICC directly."]
801 pub fn heif_image_get_color_profile_type(image: *const heif_image) -> heif_color_profile_type;
802}
803unsafe extern "C" {
804 #[doc = " Returns the size of the ICC profile if one is assigned to the image. Otherwise, it returns 0."]
805 pub fn heif_image_get_raw_color_profile_size(image: *const heif_image) -> usize;
806}
807unsafe extern "C" {
808 #[doc = " Returns the ICC profile if one is assigned to the image. Otherwise, it returns an error."]
809 pub fn heif_image_get_raw_color_profile(
810 image: *const heif_image,
811 out_data: *mut libc::c_void,
812 ) -> heif_error;
813}
814unsafe extern "C" {
815 pub fn heif_image_get_nclx_color_profile(
816 image: *const heif_image,
817 out_data: *mut *mut heif_color_profile_nclx,
818 ) -> heif_error;
819}
820unsafe extern "C" {
821 #[doc = " The color profile is not attached to the image handle because we might need it\n for color space transform and encoding."]
822 pub fn heif_image_set_raw_color_profile(
823 image: *mut heif_image,
824 profile_type_fourcc_string: *const libc::c_char,
825 profile_data: *const libc::c_void,
826 profile_size: usize,
827 ) -> heif_error;
828}
829unsafe extern "C" {
830 pub fn heif_image_set_nclx_color_profile(
831 image: *mut heif_image,
832 color_profile: *const heif_color_profile_nclx,
833 ) -> heif_error;
834}
835#[doc = " Semantics follow the H.265 'Content light level information' SEI message\n (ITU-T H.265 Annex D.3.35). Identifies upper bounds for the nominal\n target brightness light level of the pictures. The bounds are defined\n against samples in a 4:4:4 RGB representation in the linear light domain,\n in units of candelas per square metre (cd/m^2 = nits). A field value\n of 0 means \"no upper bound indicated\" (i.e. undefined)."]
836#[repr(C)]
837#[derive(Debug, Copy, Clone)]
838pub struct heif_content_light_level {
839 #[doc = " Upper bound on the maximum light level among all individual linear-light\n 4:4:4 RGB samples across the sequence, in cd/m^2 (= field).\n Also called MaxCLL."]
840 pub max_content_light_level: u16,
841 #[doc = " Upper bound on the maximum per-picture average light level among the\n linear-light 4:4:4 RGB samples (averaged over any individual picture),\n in cd/m^2 (= field). Also called MaxFALL (or MaxPALL).\n For letterboxed content the average is expected to be taken only over\n the visually relevant region (H.265 D.3.35 NOTE 3)."]
842 pub max_pic_average_light_level: u16,
843}
844unsafe extern "C" {
845 pub fn heif_image_has_content_light_level(arg1: *const heif_image) -> libc::c_int;
846}
847unsafe extern "C" {
848 pub fn heif_image_handle_has_content_light_level(arg1: *const heif_image_handle)
849 -> libc::c_int;
850}
851unsafe extern "C" {
852 #[doc = " TODO: this function should also return 'int' to be consistent to heif_image_handle_get_content_light_level."]
853 pub fn heif_image_get_content_light_level(
854 arg1: *const heif_image,
855 out: *mut heif_content_light_level,
856 );
857}
858unsafe extern "C" {
859 #[doc = " Returns whether the image has 'content light level' information. If 0 is returned, the output is not filled."]
860 pub fn heif_image_handle_get_content_light_level(
861 arg1: *const heif_image_handle,
862 out: *mut heif_content_light_level,
863 ) -> libc::c_int;
864}
865unsafe extern "C" {
866 pub fn heif_image_set_content_light_level(
867 arg1: *const heif_image,
868 in_: *const heif_content_light_level,
869 );
870}
871unsafe extern "C" {
872 pub fn heif_image_handle_set_content_light_level(
873 arg1: *const heif_image_handle,
874 in_: *const heif_content_light_level,
875 );
876}
877#[doc = " Semantics follow the H.265 'Mastering display colour volume' SEI message\n (ITU-T H.265 Annex D.3.28) and SMPTE ST 2086. Identifies the colour\n volume (primaries, white point, luminance range) of the mastering display\n for the associated content. CIE 1931 chromaticity coordinates are defined\n by ISO 11664-1 (see also ISO 11664-3 and CIE 15).\n\n For RGB mastering displays, H.265 suggests the index order\n [0]=green, [1]=blue, [2]=red\n (see H.265 Annex E, Table E.3)."]
878#[repr(C)]
879#[derive(Debug, Copy, Clone)]
880pub struct heif_mastering_display_colour_volume {
881 #[doc = " CIE 1931 chromaticity coordinates of the three colour primaries, in\n normalized increments of 0.00002 (CIE value = field / 50000).\n Valid ranges per H.265: x in 5..37000, y in 5..42000 inclusive; values\n outside indicate \"unknown / unspecified\".\n Note: SMPTE ST 2086 uses four-decimal-place coordinates, i.e. multiples\n of 5 in this encoding."]
882 pub display_primaries_x: [u16; 3usize],
883 pub display_primaries_y: [u16; 3usize],
884 #[doc = " CIE 1931 chromaticity coordinates of the mastering display's white\n point, in normalized increments of 0.00002. Valid ranges as for the\n primaries (x in 5..37000, y in 5..42000).\n Note: ANSI/CTA 861-G uses (0,0) to indicate that the white point\n chromaticity is unknown."]
885 pub white_point_x: u16,
886 pub white_point_y: u16,
887 #[doc = " Nominal maximum / minimum display luminance of the mastering display,\n in units of 0.0001 candelas per square metre (cd/m^2 = field / 10000).\n Valid ranges per H.265:\n max in 50000..100000000 (5..10000 cd/m^2)\n min in 1..50000 (0.0001..5 cd/m^2)\n When max == 50000, min shall not equal 50000.\n Note: ANSI/CTA 861-G uses 0 to indicate \"unknown\".\n Note: SMPTE ST 2086 (2018) specifies max as a multiple of 1 cd/m^2, i.e.\n a multiple of 10000 in this encoding."]
888 pub max_display_mastering_luminance: u32,
889 pub min_display_mastering_luminance: u32,
890}
891#[doc = " The units for max_display_mastering_luminance and min_display_mastering_luminance is Candelas per square meter."]
892#[repr(C)]
893#[derive(Debug, Copy, Clone)]
894pub struct heif_decoded_mastering_display_colour_volume {
895 pub display_primaries_x: [f32; 3usize],
896 pub display_primaries_y: [f32; 3usize],
897 pub white_point_x: f32,
898 pub white_point_y: f32,
899 pub max_display_mastering_luminance: f64,
900 pub min_display_mastering_luminance: f64,
901}
902#[doc = " Semantics follow the H.265 'Ambient viewing environment' SEI message\n (ITU-T H.265 Annex D.3.39). Identifies the nominal ambient viewing\n environment intended for display of the associated content."]
903#[repr(C)]
904#[derive(Debug, Copy, Clone)]
905pub struct heif_ambient_viewing_environment {
906 #[doc = " Environmental illuminance of the ambient viewing environment, in units\n of 0.0001 lux (i.e. lux = value / 10000). In H.265 this field is called\n 'ambient_illuminance' and is required to be non-zero; 0 is treated here\n as \"undefined\"."]
907 pub ambient_illumination: u32,
908 #[doc = " Normalized CIE 1931 chromaticity coordinates of the environmental\n ambient light, in units of 0.00002 (i.e. CIE x = value / 50000).\n Valid range per H.265 is 0..50000 inclusive. CIE 1931 x/y are defined\n by ISO 11664-1 (see also ISO 11664-3 and CIE 15).\n\n Example (Rec. ITU-R BT.2035, D65 background): ambient_illumination=100000,\n ambient_light_x=15635, ambient_light_y=16450."]
909 pub ambient_light_x: u16,
910 pub ambient_light_y: u16,
911}
912unsafe extern "C" {
913 pub fn heif_image_has_mastering_display_colour_volume(arg1: *const heif_image) -> libc::c_int;
914}
915unsafe extern "C" {
916 pub fn heif_image_handle_has_mastering_display_colour_volume(
917 arg1: *const heif_image_handle,
918 ) -> libc::c_int;
919}
920unsafe extern "C" {
921 pub fn heif_image_get_mastering_display_colour_volume(
922 arg1: *const heif_image,
923 out: *mut heif_mastering_display_colour_volume,
924 );
925}
926unsafe extern "C" {
927 #[doc = " Returns whether the image has 'mastering display colour volume' information. If 0 is returned, the output is not filled."]
928 pub fn heif_image_handle_get_mastering_display_colour_volume(
929 arg1: *const heif_image_handle,
930 out: *mut heif_mastering_display_colour_volume,
931 ) -> libc::c_int;
932}
933unsafe extern "C" {
934 pub fn heif_image_set_mastering_display_colour_volume(
935 arg1: *const heif_image,
936 in_: *const heif_mastering_display_colour_volume,
937 );
938}
939unsafe extern "C" {
940 pub fn heif_image_handle_set_mastering_display_colour_volume(
941 arg1: *const heif_image_handle,
942 in_: *const heif_mastering_display_colour_volume,
943 );
944}
945unsafe extern "C" {
946 #[doc = " --- ambient viewing environment ---"]
947 pub fn heif_image_has_ambient_viewing_environment(arg1: *const heif_image) -> libc::c_int;
948}
949unsafe extern "C" {
950 pub fn heif_image_handle_has_ambient_viewing_environment(
951 arg1: *const heif_image_handle,
952 ) -> libc::c_int;
953}
954unsafe extern "C" {
955 #[doc = " Returns whether the image has 'ambient viewing environment' information. If 0 is returned, the output is not filled."]
956 pub fn heif_image_get_ambient_viewing_environment(
957 arg1: *const heif_image,
958 out: *mut heif_ambient_viewing_environment,
959 ) -> libc::c_int;
960}
961unsafe extern "C" {
962 #[doc = " Returns whether the image has 'ambient viewing environment' information. If 0 is returned, the output is not filled."]
963 pub fn heif_image_handle_get_ambient_viewing_environment(
964 arg1: *const heif_image_handle,
965 out: *mut heif_ambient_viewing_environment,
966 ) -> libc::c_int;
967}
968unsafe extern "C" {
969 pub fn heif_image_set_ambient_viewing_environment(
970 arg1: *const heif_image,
971 in_: *const heif_ambient_viewing_environment,
972 );
973}
974unsafe extern "C" {
975 pub fn heif_image_handle_set_ambient_viewing_environment(
976 arg1: *const heif_image_handle,
977 in_: *const heif_ambient_viewing_environment,
978 );
979}
980unsafe extern "C" {
981 #[doc = " If the image has no 'nominal diffuse white' information, the getter returns 0,\n which is indistinguishable from a stored luminance of 0. Use the has_ function\n to disambiguate."]
982 pub fn heif_image_has_nominal_diffuse_white_luminance(arg1: *const heif_image) -> libc::c_int;
983}
984unsafe extern "C" {
985 pub fn heif_image_get_nominal_diffuse_white_luminance(arg1: *const heif_image) -> u32;
986}
987unsafe extern "C" {
988 pub fn heif_image_set_nominal_diffuse_white_luminance(arg1: *const heif_image, luminance: u32);
989}
990unsafe extern "C" {
991 pub fn heif_image_handle_has_nominal_diffuse_white_luminance(
992 arg1: *const heif_image_handle,
993 ) -> libc::c_int;
994}
995unsafe extern "C" {
996 pub fn heif_image_handle_get_nominal_diffuse_white_luminance(
997 arg1: *const heif_image_handle,
998 ) -> u32;
999}
1000unsafe extern "C" {
1001 pub fn heif_image_handle_set_nominal_diffuse_white_luminance(
1002 arg1: *const heif_image_handle,
1003 luminance: u32,
1004 );
1005}
1006unsafe extern "C" {
1007 #[doc = " Converts the internal numeric representation of heif_mastering_display_colour_volume to the\n normalized values, collected in heif_decoded_mastering_display_colour_volume.\n Values that are out-of-range are decoded to 0, indicating an undefined value (as specified in ISO/IEC 23008-2)."]
1008 pub fn heif_mastering_display_colour_volume_decode(
1009 in_: *const heif_mastering_display_colour_volume,
1010 out: *mut heif_decoded_mastering_display_colour_volume,
1011 ) -> heif_error;
1012}
1013pub type heif_brand2 = u32;
1014unsafe extern "C" {
1015 #[doc = " input data should be at least 12 bytes"]
1016 pub fn heif_read_main_brand(data: *const u8, len: libc::c_int) -> heif_brand2;
1017}
1018unsafe extern "C" {
1019 #[doc = " input data should be at least 16 bytes"]
1020 pub fn heif_read_minor_version_brand(data: *const u8, len: libc::c_int) -> heif_brand2;
1021}
1022unsafe extern "C" {
1023 #[doc = " 'brand_fourcc' must be 4 character long, but need not be 0-terminated"]
1024 pub fn heif_fourcc_to_brand(brand_fourcc: *const libc::c_char) -> heif_brand2;
1025}
1026unsafe extern "C" {
1027 #[doc = " the output buffer must be at least 4 bytes long"]
1028 pub fn heif_brand_to_fourcc(brand: heif_brand2, out_fourcc: *mut libc::c_char);
1029}
1030unsafe extern "C" {
1031 #[doc = " 'brand_fourcc' must be 4 character long, but need not be 0-terminated\n returns 1 if file includes the brand, and 0 if it does not\n returns -1 if the provided data is not sufficient\n (you should input at least as many bytes as indicated in the first 4 bytes of the file, usually ~50 bytes will do)\n returns -2 on other errors"]
1032 pub fn heif_has_compatible_brand(
1033 data: *const u8,
1034 len: libc::c_int,
1035 brand_fourcc: *const libc::c_char,
1036 ) -> libc::c_int;
1037}
1038unsafe extern "C" {
1039 #[doc = " Returns an array of compatible brands. The array is allocated by this function and has to be freed with 'heif_free_list_of_compatible_brands()'.\n The number of entries is returned in out_size."]
1040 pub fn heif_list_compatible_brands(
1041 data: *const u8,
1042 len: libc::c_int,
1043 out_brands: *mut *mut heif_brand2,
1044 out_size: *mut libc::c_int,
1045 ) -> heif_error;
1046}
1047unsafe extern "C" {
1048 pub fn heif_free_list_of_compatible_brands(brands_list: *mut heif_brand2);
1049}
1050unsafe extern "C" {
1051 #[doc = " Returns one of these MIME types:\n - image/heic HEIF file using h265 compression\n - image/heif HEIF file using any other compression\n - image/heic-sequence HEIF image sequence using h265 compression\n - image/heif-sequence HEIF image sequence using any other compression\n - image/avif AVIF image\n - image/avif-sequence AVIF sequence\n - image/jpeg JPEG image\n - image/png PNG image\n If the format could not be detected, an empty string is returned.\n\n Provide at least 12 bytes of input. With less input, its format might not\n be detected. You may also provide more input to increase detection accuracy.\n\n Note that JPEG and PNG images cannot be decoded by libheif even though the\n formats are detected by this function."]
1052 pub fn heif_get_file_mime_type(data: *const u8, len: libc::c_int) -> *const libc::c_char;
1053}
1054pub const heif_filetype_result_heif_filetype_no: heif_filetype_result = 0;
1055#[doc = " it is heif and can be read by libheif"]
1056pub const heif_filetype_result_heif_filetype_yes_supported: heif_filetype_result = 1;
1057#[doc = " it is heif, but cannot be read by libheif"]
1058pub const heif_filetype_result_heif_filetype_yes_unsupported: heif_filetype_result = 2;
1059#[doc = " not sure whether it is an heif, try detection with more input data"]
1060pub const heif_filetype_result_heif_filetype_maybe: heif_filetype_result = 3;
1061#[doc = " ========================= file type check ======================"]
1062pub type heif_filetype_result = libc::c_uint;
1063unsafe extern "C" {
1064 #[doc = " input data should be at least 12 bytes"]
1065 pub fn heif_check_filetype(data: *const u8, len: libc::c_int) -> heif_filetype_result;
1066}
1067unsafe extern "C" {
1068 #[doc = " Check the filetype box content for a supported file type.\n\n <p>The data is assumed to start from the start of the `ftyp` box.\n\n <p>This function checks the compatible brands.\n\n @returns heif_error_ok if a supported brand is found, or other error if not."]
1069 pub fn heif_has_compatible_filetype(data: *const u8, len: libc::c_int) -> heif_error;
1070}
1071unsafe extern "C" {
1072 pub fn heif_check_jpeg_filetype(data: *const u8, len: libc::c_int) -> libc::c_int;
1073}
1074pub const heif_brand_heif_unknown_brand: heif_brand = 0;
1075#[doc = " HEIF image with h265"]
1076pub const heif_brand_heif_heic: heif_brand = 1;
1077#[doc = " 10bit images, or anything that uses h265 with range extension"]
1078pub const heif_brand_heif_heix: heif_brand = 2;
1079#[doc = " brands for image sequences"]
1080pub const heif_brand_heif_hevc: heif_brand = 3;
1081#[doc = " brands for image sequences"]
1082pub const heif_brand_heif_hevx: heif_brand = 4;
1083#[doc = " multiview"]
1084pub const heif_brand_heif_heim: heif_brand = 5;
1085#[doc = " scalable"]
1086pub const heif_brand_heif_heis: heif_brand = 6;
1087#[doc = " multiview sequence"]
1088pub const heif_brand_heif_hevm: heif_brand = 7;
1089#[doc = " scalable sequence"]
1090pub const heif_brand_heif_hevs: heif_brand = 8;
1091#[doc = " image, any coding algorithm"]
1092pub const heif_brand_heif_mif1: heif_brand = 9;
1093#[doc = " sequence, any coding algorithm"]
1094pub const heif_brand_heif_msf1: heif_brand = 10;
1095#[doc = " HEIF image with AV1"]
1096pub const heif_brand_heif_avif: heif_brand = 11;
1097pub const heif_brand_heif_avis: heif_brand = 12;
1098#[doc = " VVC image"]
1099pub const heif_brand_heif_vvic: heif_brand = 13;
1100#[doc = " VVC sequence"]
1101pub const heif_brand_heif_vvis: heif_brand = 14;
1102#[doc = " EVC image"]
1103pub const heif_brand_heif_evbi: heif_brand = 15;
1104#[doc = " EVC sequence"]
1105pub const heif_brand_heif_evbs: heif_brand = 16;
1106#[doc = " JPEG2000 image"]
1107pub const heif_brand_heif_j2ki: heif_brand = 17;
1108#[doc = " JPEG2000 image sequence"]
1109pub const heif_brand_heif_j2is: heif_brand = 18;
1110#[doc = " DEPRECATED, use heif_brand2 and the heif_brand2_* constants instead"]
1111pub type heif_brand = libc::c_uint;
1112unsafe extern "C" {
1113 #[doc = " input data should be at least 12 bytes\n DEPRECATED, use heif_read_main_brand() instead"]
1114 pub fn heif_main_brand(data: *const u8, len: libc::c_int) -> heif_brand;
1115}
1116pub const heif_metadata_compression_heif_metadata_compression_off: heif_metadata_compression = 0;
1117pub const heif_metadata_compression_heif_metadata_compression_auto: heif_metadata_compression = 1;
1118#[doc = " only used when reading unknown method from input file"]
1119pub const heif_metadata_compression_heif_metadata_compression_unknown: heif_metadata_compression =
1120 2;
1121pub const heif_metadata_compression_heif_metadata_compression_deflate: heif_metadata_compression =
1122 3;
1123#[doc = " do not use for header data"]
1124pub const heif_metadata_compression_heif_metadata_compression_zlib: heif_metadata_compression = 4;
1125pub const heif_metadata_compression_heif_metadata_compression_brotli: heif_metadata_compression = 5;
1126pub type heif_metadata_compression = libc::c_uint;
1127unsafe extern "C" {
1128 pub fn heif_metadata_compression_method_supported(
1129 method: heif_metadata_compression,
1130 ) -> libc::c_int;
1131}
1132unsafe extern "C" {
1133 #[doc = " How many metadata blocks are attached to an image. If you only want to get EXIF data,\n set the type_filter to \"Exif\". Otherwise, set the type_filter to NULL."]
1134 pub fn heif_image_handle_get_number_of_metadata_blocks(
1135 handle: *const heif_image_handle,
1136 type_filter: *const libc::c_char,
1137 ) -> libc::c_int;
1138}
1139unsafe extern "C" {
1140 #[doc = " 'type_filter' can be used to get only metadata of specific types, like \"Exif\".\n If 'type_filter' is NULL, it will return all types of metadata IDs."]
1141 pub fn heif_image_handle_get_list_of_metadata_block_IDs(
1142 handle: *const heif_image_handle,
1143 type_filter: *const libc::c_char,
1144 ids: *mut heif_item_id,
1145 count: libc::c_int,
1146 ) -> libc::c_int;
1147}
1148unsafe extern "C" {
1149 #[doc = " Return a string indicating the type of the metadata, as specified in the HEIF file.\n Exif data will have the type string \"Exif\".\n This string will be valid until the next call to a libheif function.\n You do not have to free this string."]
1150 pub fn heif_image_handle_get_metadata_type(
1151 handle: *const heif_image_handle,
1152 metadata_id: heif_item_id,
1153 ) -> *const libc::c_char;
1154}
1155unsafe extern "C" {
1156 #[doc = " For EXIF, the content type is empty.\n For XMP, the content type is \"application/rdf+xml\"."]
1157 pub fn heif_image_handle_get_metadata_content_type(
1158 handle: *const heif_image_handle,
1159 metadata_id: heif_item_id,
1160 ) -> *const libc::c_char;
1161}
1162unsafe extern "C" {
1163 #[doc = " Get the size of the raw metadata, as stored in the HEIF file."]
1164 pub fn heif_image_handle_get_metadata_size(
1165 handle: *const heif_image_handle,
1166 metadata_id: heif_item_id,
1167 ) -> usize;
1168}
1169unsafe extern "C" {
1170 #[doc = " 'out_data' must point to a memory area of the size reported by heif_image_handle_get_metadata_size().\n The data is returned exactly as stored in the HEIF file.\n For Exif data, you probably have to skip the first four bytes of the data, since they\n indicate the offset to the start of the TIFF header of the Exif data."]
1171 pub fn heif_image_handle_get_metadata(
1172 handle: *const heif_image_handle,
1173 metadata_id: heif_item_id,
1174 out_data: *mut libc::c_void,
1175 ) -> heif_error;
1176}
1177unsafe extern "C" {
1178 #[doc = " Only valid for item type == \"uri \", an absolute URI"]
1179 pub fn heif_image_handle_get_metadata_item_uri_type(
1180 handle: *const heif_image_handle,
1181 metadata_id: heif_item_id,
1182 ) -> *const libc::c_char;
1183}
1184unsafe extern "C" {
1185 #[doc = " Add EXIF metadata to an image."]
1186 pub fn heif_context_add_exif_metadata(
1187 arg1: *mut heif_context,
1188 image_handle: *const heif_image_handle,
1189 data: *const libc::c_void,
1190 size: libc::c_int,
1191 ) -> heif_error;
1192}
1193unsafe extern "C" {
1194 #[doc = " Add XMP metadata to an image."]
1195 pub fn heif_context_add_XMP_metadata(
1196 arg1: *mut heif_context,
1197 image_handle: *const heif_image_handle,
1198 data: *const libc::c_void,
1199 size: libc::c_int,
1200 ) -> heif_error;
1201}
1202unsafe extern "C" {
1203 #[doc = " New version of heif_context_add_XMP_metadata() with data compression (experimental)."]
1204 pub fn heif_context_add_XMP_metadata2(
1205 arg1: *mut heif_context,
1206 image_handle: *const heif_image_handle,
1207 data: *const libc::c_void,
1208 size: libc::c_int,
1209 compression: heif_metadata_compression,
1210 ) -> heif_error;
1211}
1212unsafe extern "C" {
1213 #[doc = " Add generic, proprietary metadata to an image. You have to specify an 'item_type' that will\n identify your metadata. 'content_type' can be an additional type, or it can be NULL.\n For example, this function can be used to add IPTC metadata (IIM stream, not XMP) to an image.\n Although not standard, we propose to store IPTC data with item type=\"iptc\", content_type=NULL."]
1214 pub fn heif_context_add_generic_metadata(
1215 ctx: *mut heif_context,
1216 image_handle: *const heif_image_handle,
1217 data: *const libc::c_void,
1218 size: libc::c_int,
1219 item_type: *const libc::c_char,
1220 content_type: *const libc::c_char,
1221 ) -> heif_error;
1222}
1223unsafe extern "C" {
1224 #[doc = " Add generic metadata with item_type \"uri \". Items with this type do not have a content_type, but\n an item_uri_type and they have no content_encoding (they are always stored uncompressed)."]
1225 pub fn heif_context_add_generic_uri_metadata(
1226 ctx: *mut heif_context,
1227 image_handle: *const heif_image_handle,
1228 data: *const libc::c_void,
1229 size: libc::c_int,
1230 item_uri_type: *const libc::c_char,
1231 out_item_id: *mut heif_item_id,
1232 ) -> heif_error;
1233}
1234#[repr(C)]
1235#[derive(Debug)]
1236pub struct heif_encoder {
1237 _unused: [u8; 0],
1238}
1239unsafe extern "C" {
1240 #[doc = " ------------------------- depth images -------------------------"]
1241 pub fn heif_image_handle_has_depth_image(arg1: *const heif_image_handle) -> libc::c_int;
1242}
1243unsafe extern "C" {
1244 pub fn heif_image_handle_get_number_of_depth_images(
1245 handle: *const heif_image_handle,
1246 ) -> libc::c_int;
1247}
1248unsafe extern "C" {
1249 pub fn heif_image_handle_get_list_of_depth_image_IDs(
1250 handle: *const heif_image_handle,
1251 ids: *mut heif_item_id,
1252 count: libc::c_int,
1253 ) -> libc::c_int;
1254}
1255unsafe extern "C" {
1256 pub fn heif_image_handle_get_depth_image_handle(
1257 handle: *const heif_image_handle,
1258 depth_image_id: heif_item_id,
1259 out_depth_handle: *mut *mut heif_image_handle,
1260 ) -> heif_error;
1261}
1262pub const heif_depth_representation_type_heif_depth_representation_type_uniform_inverse_Z:
1263 heif_depth_representation_type = 0;
1264pub const heif_depth_representation_type_heif_depth_representation_type_uniform_disparity:
1265 heif_depth_representation_type = 1;
1266pub const heif_depth_representation_type_heif_depth_representation_type_uniform_Z:
1267 heif_depth_representation_type = 2;
1268pub const heif_depth_representation_type_heif_depth_representation_type_nonuniform_disparity:
1269 heif_depth_representation_type = 3;
1270pub type heif_depth_representation_type = libc::c_uint;
1271#[repr(C)]
1272#[derive(Debug)]
1273pub struct heif_depth_representation_info {
1274 pub version: u8,
1275 #[doc = " version 1 fields"]
1276 pub has_z_near: u8,
1277 pub has_z_far: u8,
1278 pub has_d_min: u8,
1279 pub has_d_max: u8,
1280 pub z_near: f64,
1281 pub z_far: f64,
1282 pub d_min: f64,
1283 pub d_max: f64,
1284 pub depth_representation_type: heif_depth_representation_type,
1285 pub disparity_reference_view: u32,
1286 pub depth_nonlinear_representation_model_size: u32,
1287 pub depth_nonlinear_representation_model: *mut u8,
1288}
1289unsafe extern "C" {
1290 pub fn heif_depth_representation_info_free(info: *const heif_depth_representation_info);
1291}
1292unsafe extern "C" {
1293 #[doc = " Returns true when there is depth_representation_info available\n Note 1: depth_image_id is currently unused because we support only one depth channel per image, but\n you should still provide the correct ID for future compatibility.\n Note 2: Because of an API bug before v1.11.0, the function also works when 'handle' is the handle of the depth image.\n However, you should pass the handle of the main image. Please adapt your code if needed."]
1294 pub fn heif_image_handle_get_depth_image_representation_info(
1295 handle: *const heif_image_handle,
1296 depth_image_id: heif_item_id,
1297 out: *mut *const heif_depth_representation_info,
1298 ) -> libc::c_int;
1299}
1300unsafe extern "C" {
1301 #[doc = " List the number of thumbnails assigned to this image handle. Usually 0 or 1."]
1302 pub fn heif_image_handle_get_number_of_thumbnails(
1303 handle: *const heif_image_handle,
1304 ) -> libc::c_int;
1305}
1306unsafe extern "C" {
1307 pub fn heif_image_handle_get_list_of_thumbnail_IDs(
1308 handle: *const heif_image_handle,
1309 ids: *mut heif_item_id,
1310 count: libc::c_int,
1311 ) -> libc::c_int;
1312}
1313unsafe extern "C" {
1314 #[doc = " Get the image handle of a thumbnail image."]
1315 pub fn heif_image_handle_get_thumbnail(
1316 main_image_handle: *const heif_image_handle,
1317 thumbnail_id: heif_item_id,
1318 out_thumbnail_handle: *mut *mut heif_image_handle,
1319 ) -> heif_error;
1320}
1321unsafe extern "C" {
1322 #[doc = " Encode the 'image' as a scaled down thumbnail image.\n The image is scaled down to fit into a square area of width 'bbox_size'.\n If the input image is already so small that it fits into this bounding box, no thumbnail\n image is encoded and NULL is returned in 'out_thumb_image_handle'.\n No error is returned in this case.\n The encoded thumbnail is automatically assigned to the 'master_image_handle'. Hence, you\n do not have to call heif_context_assign_thumbnail()."]
1323 pub fn heif_context_encode_thumbnail(
1324 arg1: *mut heif_context,
1325 image: *const heif_image,
1326 master_image_handle: *const heif_image_handle,
1327 encoder: *mut heif_encoder,
1328 options: *const heif_encoding_options,
1329 bbox_size: libc::c_int,
1330 out_thumb_image_handle: *mut *mut heif_image_handle,
1331 ) -> heif_error;
1332}
1333unsafe extern "C" {
1334 #[doc = " Assign 'thumbnail_image' as the thumbnail image of 'master_image'."]
1335 pub fn heif_context_assign_thumbnail(
1336 arg1: *mut heif_context,
1337 master_image: *const heif_image_handle,
1338 thumbnail_image: *const heif_image_handle,
1339 ) -> heif_error;
1340}
1341unsafe extern "C" {
1342 #[doc = " List the number of auxiliary images assigned to this image handle."]
1343 pub fn heif_image_handle_get_number_of_auxiliary_images(
1344 handle: *const heif_image_handle,
1345 aux_filter: libc::c_int,
1346 ) -> libc::c_int;
1347}
1348unsafe extern "C" {
1349 pub fn heif_image_handle_get_list_of_auxiliary_image_IDs(
1350 handle: *const heif_image_handle,
1351 aux_filter: libc::c_int,
1352 ids: *mut heif_item_id,
1353 count: libc::c_int,
1354 ) -> libc::c_int;
1355}
1356unsafe extern "C" {
1357 #[doc = " You are responsible to deallocate the returned buffer with heif_image_handle_release_auxiliary_type()."]
1358 pub fn heif_image_handle_get_auxiliary_type(
1359 handle: *const heif_image_handle,
1360 out_type: *mut *const libc::c_char,
1361 ) -> heif_error;
1362}
1363unsafe extern "C" {
1364 pub fn heif_image_handle_release_auxiliary_type(
1365 handle: *const heif_image_handle,
1366 out_type: *mut *const libc::c_char,
1367 );
1368}
1369unsafe extern "C" {
1370 #[doc = " Get the image handle of an auxiliary image."]
1371 pub fn heif_image_handle_get_auxiliary_image_handle(
1372 main_image_handle: *const heif_image_handle,
1373 auxiliary_id: heif_item_id,
1374 out_auxiliary_handle: *mut *mut heif_image_handle,
1375 ) -> heif_error;
1376}
1377unsafe extern "C" {
1378 #[doc = " DEPRECATED (because typo in function name). Use heif_image_handle_release_auxiliary_type() instead."]
1379 pub fn heif_image_handle_free_auxiliary_types(
1380 handle: *const heif_image_handle,
1381 out_type: *mut *const libc::c_char,
1382 );
1383}
1384#[doc = " ------------------------- entity groups ------------------------"]
1385pub type heif_entity_group_id = u32;
1386#[repr(C)]
1387#[derive(Debug)]
1388pub struct heif_entity_group {
1389 pub entity_group_id: heif_entity_group_id,
1390 #[doc = " this is a FourCC constant"]
1391 pub entity_group_type: u32,
1392 pub entities: *mut heif_item_id,
1393 pub num_entities: u32,
1394}
1395unsafe extern "C" {
1396 #[doc = " Use 0 for `type_filter` or `item_filter` to disable the filter.\n Returns an array of heif_entity_group structs with *out_num_groups entries."]
1397 pub fn heif_context_get_entity_groups(
1398 arg1: *const heif_context,
1399 type_filter: u32,
1400 item_filter: heif_item_id,
1401 out_num_groups: *mut libc::c_int,
1402 ) -> *mut heif_entity_group;
1403}
1404unsafe extern "C" {
1405 #[doc = " Release an array of entity groups returned by heif_context_get_entity_groups()."]
1406 pub fn heif_entity_groups_release(arg1: *mut heif_entity_group, num_groups: libc::c_int);
1407}
1408#[doc = " If you set a limit to 0, the limit is disabled."]
1409#[repr(C)]
1410#[derive(Debug, Copy, Clone)]
1411pub struct heif_security_limits {
1412 pub version: u8,
1413 #[doc = " Limit on the maximum image size to avoid allocating too much memory.\n For example, setting this to 32768^2 pixels = 1 Gigapixels results\n in 1.5 GB memory need for YUV-4:2:0 or 4 GB for RGB32."]
1414 pub max_image_size_pixels: u64,
1415 pub max_number_of_tiles: u64,
1416 #[doc = " Also used for polarization pattern (splz) size limit."]
1417 pub max_bayer_pattern_pixels: u32,
1418 pub max_items: u32,
1419 pub max_color_profile_size: u32,
1420 pub max_memory_block_size: u64,
1421 pub max_components: u32,
1422 pub max_iloc_extents_per_item: u32,
1423 pub max_size_entity_group: u32,
1424 #[doc = " for all boxes that are not covered by other limits"]
1425 pub max_children_per_box: u32,
1426 #[doc = " --- version 2 (v1.20.0)"]
1427 pub max_total_memory: u64,
1428 pub max_sample_description_box_entries: u32,
1429 pub max_sample_group_description_box_entries: u32,
1430 #[doc = " --- version 3 (v1.21.0)"]
1431 pub max_sequence_frames: u32,
1432 pub max_number_of_file_brands: u32,
1433 #[doc = " --- version 4 (v1.22.0)"]
1434 pub max_bad_pixels: u32,
1435 #[doc = " Upper bound (in bytes) on the pixel_size field of an uncompressed (ISO 23001-17)\n uncC box. Caps the byte stride between adjacent pixels and prevents pathological\n padding values from blowing up tile-size arithmetic."]
1436 pub max_iso23001_17_pixel_size_bytes: u32,
1437 #[doc = " Internal: when libheif derives a limits struct from another one (e.g. to\n tighten the maximum image size for a specific decode), this points back to\n the registered context whose total-memory budget the allocation should be\n accounted against. nullptr means \"this is a root context\" (the registered\n one). User code should leave this as nullptr; the field is set internally."]
1438 pub parent: *const heif_security_limits,
1439}
1440unsafe extern "C" {
1441 #[doc = " The global security limits are the default for new heif_contexts.\n These global limits cannot be changed, but you can override the limits for a specific heif_context."]
1442 pub fn heif_get_global_security_limits() -> *const heif_security_limits;
1443}
1444unsafe extern "C" {
1445 #[doc = " Returns a set of fully disabled security limits. Use with care and only after user confirmation."]
1446 pub fn heif_get_disabled_security_limits() -> *const heif_security_limits;
1447}
1448unsafe extern "C" {
1449 #[doc = " Returns the security limits for a heif_context.\n By default, the limits are set to the global limits, but you can change them in the returned object."]
1450 pub fn heif_context_get_security_limits(arg1: *const heif_context)
1451 -> *mut heif_security_limits;
1452}
1453unsafe extern "C" {
1454 #[doc = " Overwrites the security limits of a heif_context.\n This is a convenience function to easily copy limits."]
1455 pub fn heif_context_set_security_limits(
1456 arg1: *mut heif_context,
1457 arg2: *const heif_security_limits,
1458 ) -> heif_error;
1459}
1460unsafe extern "C" {
1461 #[doc = " Set the maximum image size security limit. This function will set the maximum image area (number of pixels)\n to maximum_width ^ 2. Alternatively to using this function, you can also set the maximum image area\n in the security limits structure returned by heif_context_get_security_limits()."]
1462 pub fn heif_context_set_maximum_image_size_limit(
1463 ctx: *mut heif_context,
1464 maximum_width: libc::c_int,
1465 );
1466}
1467#[doc = " Unspecified / undefined compression format.\n\n This is used to mean \"no match\" or \"any decoder\" for some parts of the\n API. It does not indicate a specific compression format."]
1468pub const heif_compression_format_heif_compression_undefined: heif_compression_format = 0;
1469#[doc = " HEVC compression, used for HEIC images.\n\n This is equivalent to H.265."]
1470pub const heif_compression_format_heif_compression_HEVC: heif_compression_format = 1;
1471#[doc = " AVC compression. (Currently unused in libheif.)\n\n The compression is defined in ISO/IEC 14496-10. This is equivalent to H.264.\n\n The encapsulation is defined in ISO/IEC 23008-12:2022 Annex E."]
1472pub const heif_compression_format_heif_compression_AVC: heif_compression_format = 2;
1473#[doc = " JPEG compression.\n\n The compression format is defined in ISO/IEC 10918-1. The encapsulation\n of JPEG is specified in ISO/IEC 23008-12:2022 Annex H."]
1474pub const heif_compression_format_heif_compression_JPEG: heif_compression_format = 3;
1475#[doc = " AV1 compression, used for AVIF images.\n\n The compression format is provided at https://aomediacodec.github.io/av1-spec/\n\n The encapsulation is defined in https://aomediacodec.github.io/av1-avif/"]
1476pub const heif_compression_format_heif_compression_AV1: heif_compression_format = 4;
1477#[doc = " VVC compression.\n\n The compression format is defined in ISO/IEC 23090-3. This is equivalent to H.266.\n\n The encapsulation is defined in ISO/IEC 23008-12:2022 Annex L."]
1478pub const heif_compression_format_heif_compression_VVC: heif_compression_format = 5;
1479#[doc = " EVC compression. (Currently unused in libheif.)\n\n The compression format is defined in ISO/IEC 23094-1.\n\n The encapsulation is defined in ISO/IEC 23008-12:2022 Annex M."]
1480pub const heif_compression_format_heif_compression_EVC: heif_compression_format = 6;
1481#[doc = " JPEG 2000 compression.\n\n The encapsulation of JPEG 2000 is specified in ISO/IEC 15444-16:2021.\n The core encoding is defined in ISO/IEC 15444-1, or ITU-T T.800."]
1482pub const heif_compression_format_heif_compression_JPEG2000: heif_compression_format = 7;
1483#[doc = " Uncompressed encoding.\n\n This is defined in ISO/IEC 23001-17:2024."]
1484pub const heif_compression_format_heif_compression_uncompressed: heif_compression_format = 8;
1485#[doc = " Mask image encoding.\n\n See ISO/IEC 23008-12:2022 Section 6.10.2"]
1486pub const heif_compression_format_heif_compression_mask: heif_compression_format = 9;
1487#[doc = " High Throughput JPEG 2000 (HT-J2K) compression.\n\n The encapsulation of HT-J2K is specified in ISO/IEC 15444-16:2021.\n The core encoding is defined in ISO/IEC 15444-15, or ITU-T T.814."]
1488pub const heif_compression_format_heif_compression_HTJ2K: heif_compression_format = 10;
1489#[doc = " libheif known compression formats."]
1490pub type heif_compression_format = libc::c_uint;
1491unsafe extern "C" {
1492 #[doc = " Allocate a new context for reading HEIF files.\n Has to be freed again with heif_context_free()."]
1493 pub fn heif_context_alloc() -> *mut heif_context;
1494}
1495unsafe extern "C" {
1496 #[doc = " Free a previously allocated HEIF context. You should not free a context twice."]
1497 pub fn heif_context_free(arg1: *mut heif_context);
1498}
1499#[repr(C)]
1500#[derive(Debug)]
1501pub struct heif_reading_options {
1502 _unused: [u8; 0],
1503}
1504#[doc = " requested size has been reached, we can read until this point"]
1505pub const heif_reader_grow_status_heif_reader_grow_status_size_reached: heif_reader_grow_status = 0;
1506#[doc = " size has not been reached yet, but it may still grow further (deprecated)"]
1507pub const heif_reader_grow_status_heif_reader_grow_status_timeout: heif_reader_grow_status = 1;
1508#[doc = " size has not been reached and never will. The file has grown to its full size"]
1509pub const heif_reader_grow_status_heif_reader_grow_status_size_beyond_eof: heif_reader_grow_status =
1510 2;
1511#[doc = " an error has occurred"]
1512pub const heif_reader_grow_status_heif_reader_grow_status_error: heif_reader_grow_status = 3;
1513pub type heif_reader_grow_status = libc::c_uint;
1514#[repr(C)]
1515#[derive(Debug)]
1516pub struct heif_reader_range_request_result {
1517 #[doc = " should not return 'heif_reader_grow_status_timeout'"]
1518 pub status: heif_reader_grow_status,
1519 #[doc = " Indicates up to what position the file has been read.\n If we cannot read the whole file range (status == 'heif_reader_grow_status_size_beyond_eof'), this is the actual end position.\n On the other hand, it may be that the reader was reading more data than requested. In that case, it should indicate the full size here\n and libheif may decide to make use of the additional data (e.g. for filling 'tili' offset tables)."]
1520 pub range_end: u64,
1521 #[doc = " a reader specific error code"]
1522 pub reader_error_code: libc::c_int,
1523 #[doc = " libheif will call heif_reader.release_error_msg on this if it is not NULL"]
1524 pub reader_error_msg: *const libc::c_char,
1525}
1526#[repr(C)]
1527#[derive(Debug, Copy, Clone)]
1528pub struct heif_reader {
1529 #[doc = " API version supported by this reader"]
1530 pub reader_api_version: libc::c_int,
1531 #[doc = " --- version 1 functions ---"]
1532 pub get_position:
1533 ::std::option::Option<unsafe extern "C" fn(userdata: *mut libc::c_void) -> i64>,
1534 #[doc = " The functions read(), and seek() return 0 on success.\n Generally, libheif will make sure that we do not read past the file size."]
1535 pub read: ::std::option::Option<
1536 unsafe extern "C" fn(
1537 data: *mut libc::c_void,
1538 size: usize,
1539 userdata: *mut libc::c_void,
1540 ) -> libc::c_int,
1541 >,
1542 pub seek: ::std::option::Option<
1543 unsafe extern "C" fn(position: i64, userdata: *mut libc::c_void) -> libc::c_int,
1544 >,
1545 #[doc = " When calling this function, libheif wants to make sure that it can read the file\n up to 'target_size'. This is useful when the file is currently downloaded and may\n grow with time. You may, for example, extract the image sizes even before the actual\n compressed image data has been completely downloaded.\n\n Even if your input files will not grow, you will have to implement at least\n detection whether the target_size is above the (fixed) file length\n (in this case, return 'size_beyond_eof')."]
1546 pub wait_for_file_size: ::std::option::Option<
1547 unsafe extern "C" fn(
1548 target_size: i64,
1549 userdata: *mut libc::c_void,
1550 ) -> heif_reader_grow_status,
1551 >,
1552 #[doc = " If this function is defined, libheif will often request a file range before accessing it.\n The purpose of this function is that libheif will usually read very small chunks of data with the\n read() callback above. However, it is inefficient to request such a small chunk of data over a network\n and the network delay will significantly increase the decoding time.\n Thus, libheif will call request_range() with a larger block of data that should be preloaded and the\n subsequent read() calls will work within the requested ranges.\n\n Note: `end_pos` is one byte after the last position to be read.\n You should return\n - 'heif_reader_grow_status_size_reached' if the requested range is available, or\n - 'heif_reader_grow_status_size_beyond_eof' if the requested range exceeds the file size\n (the valid part of the range has been read)."]
1553 pub request_range: ::std::option::Option<
1554 unsafe extern "C" fn(
1555 start_pos: u64,
1556 end_pos: u64,
1557 userdata: *mut libc::c_void,
1558 ) -> heif_reader_range_request_result,
1559 >,
1560 #[doc = " libheif might issue hints when it assumes that a file range might be needed in the future.\n This may happen, for example, when your are doing selective tile accesses and libheif proposes\n to preload offset pointer tables.\n Another difference to request_file_range() is that this call should be non-blocking.\n If you preload any data, do this in a background thread."]
1561 pub preload_range_hint: ::std::option::Option<
1562 unsafe extern "C" fn(start_pos: u64, end_pos: u64, userdata: *mut libc::c_void),
1563 >,
1564 #[doc = " If libheif does not need access to a file range anymore, it may call this function to\n give a hint to the reader that it may release the range from a cache.\n If you do not maintain a file cache that wants to reduce its size dynamically, you do not\n need to implement this function."]
1565 pub release_file_range: ::std::option::Option<
1566 unsafe extern "C" fn(start_pos: u64, end_pos: u64, userdata: *mut libc::c_void),
1567 >,
1568 #[doc = " Release an error message that was returned by heif_reader in an earlier call.\n If this function is NULL, the error message string will not be released.\n This is a viable option if you are only returning static strings."]
1569 pub release_error_msg: ::std::option::Option<unsafe extern "C" fn(msg: *const libc::c_char)>,
1570}
1571unsafe extern "C" {
1572 #[doc = " Read a HEIF file from a named disk file.\n The heif_reading_options should currently be set to NULL."]
1573 pub fn heif_context_read_from_file(
1574 arg1: *mut heif_context,
1575 filename: *const libc::c_char,
1576 arg2: *const heif_reading_options,
1577 ) -> heif_error;
1578}
1579unsafe extern "C" {
1580 #[doc = " Read a HEIF file stored completely in memory.\n The heif_reading_options should currently be set to NULL.\n DEPRECATED: use heif_context_read_from_memory_without_copy() instead."]
1581 pub fn heif_context_read_from_memory(
1582 arg1: *mut heif_context,
1583 mem: *const libc::c_void,
1584 size: usize,
1585 arg2: *const heif_reading_options,
1586 ) -> heif_error;
1587}
1588unsafe extern "C" {
1589 #[doc = " Same as heif_context_read_from_memory() except that the provided memory is not copied.\n That means, you will have to keep the memory area alive as long as you use the heif_context."]
1590 pub fn heif_context_read_from_memory_without_copy(
1591 arg1: *mut heif_context,
1592 mem: *const libc::c_void,
1593 size: usize,
1594 arg2: *const heif_reading_options,
1595 ) -> heif_error;
1596}
1597unsafe extern "C" {
1598 pub fn heif_context_read_from_reader(
1599 arg1: *mut heif_context,
1600 reader: *const heif_reader,
1601 userdata: *mut libc::c_void,
1602 arg2: *const heif_reading_options,
1603 ) -> heif_error;
1604}
1605unsafe extern "C" {
1606 #[doc = " Number of top-level images in the HEIF file. This does not include the thumbnails or the\n tile images that are composed to an image grid. You can get access to the thumbnails via\n the main image handle."]
1607 pub fn heif_context_get_number_of_top_level_images(ctx: *mut heif_context) -> libc::c_int;
1608}
1609unsafe extern "C" {
1610 pub fn heif_context_is_top_level_image_ID(
1611 ctx: *mut heif_context,
1612 id: heif_item_id,
1613 ) -> libc::c_int;
1614}
1615unsafe extern "C" {
1616 #[doc = " Fills in image IDs into the user-supplied int-array 'ID_array', preallocated with 'count' entries.\n Function returns the total number of IDs filled into the array."]
1617 pub fn heif_context_get_list_of_top_level_image_IDs(
1618 ctx: *mut heif_context,
1619 ID_array: *mut heif_item_id,
1620 count: libc::c_int,
1621 ) -> libc::c_int;
1622}
1623unsafe extern "C" {
1624 pub fn heif_context_get_primary_image_ID(
1625 ctx: *mut heif_context,
1626 id: *mut heif_item_id,
1627 ) -> heif_error;
1628}
1629unsafe extern "C" {
1630 #[doc = " Get a handle to the primary image of the HEIF file.\n This is the image that should be displayed primarily when there are several images in the file."]
1631 pub fn heif_context_get_primary_image_handle(
1632 ctx: *mut heif_context,
1633 arg1: *mut *mut heif_image_handle,
1634 ) -> heif_error;
1635}
1636unsafe extern "C" {
1637 #[doc = " Get the image handle for a known image ID."]
1638 pub fn heif_context_get_image_handle(
1639 ctx: *mut heif_context,
1640 id: heif_item_id,
1641 arg1: *mut *mut heif_image_handle,
1642 ) -> heif_error;
1643}
1644unsafe extern "C" {
1645 #[doc = " Print information about the boxes of a HEIF file to file descriptor.\n This is for debugging and informational purposes only. You should not rely on\n the output having a specific format. At best, you should not use this at all."]
1646 pub fn heif_context_debug_dump_boxes_to_file(ctx: *mut heif_context, fd: libc::c_int);
1647}
1648unsafe extern "C" {
1649 #[doc = " Enable writing in the compact 'mini' box format (ISO/IEC 23008-12 DAmd2).\n When enabled, the output file will use a single 'mini' box instead of the standard\n meta+mdat box structure, if the file content is compatible with the mini format.\n If the content cannot be represented as a mini box, the standard format is used as fallback.\n Note: the mini box format is defined by a draft amendment to ISO/IEC 23008-12\n and may have reduced interoperability with other readers.\n Default: disabled."]
1650 pub fn heif_context_set_write_mini_format(arg1: *mut heif_context, enable: libc::c_int);
1651}
1652unsafe extern "C" {
1653 #[doc = " ====================================================================================================\n Write the heif_context to a HEIF file"]
1654 pub fn heif_context_write_to_file(
1655 arg1: *mut heif_context,
1656 filename: *const libc::c_char,
1657 ) -> heif_error;
1658}
1659#[repr(C)]
1660#[derive(Debug, Copy, Clone)]
1661pub struct heif_writer {
1662 #[doc = " API version supported by this writer"]
1663 pub writer_api_version: libc::c_int,
1664 #[doc = " TODO: why do we need this parameter?"]
1665 pub write: ::std::option::Option<
1666 unsafe extern "C" fn(
1667 ctx: *mut heif_context,
1668 data: *const libc::c_void,
1669 size: usize,
1670 userdata: *mut libc::c_void,
1671 ) -> heif_error,
1672 >,
1673}
1674unsafe extern "C" {
1675 pub fn heif_context_write(
1676 arg1: *mut heif_context,
1677 writer: *mut heif_writer,
1678 userdata: *mut libc::c_void,
1679 ) -> heif_error;
1680}
1681#[repr(C)]
1682#[derive(Debug, Copy, Clone)]
1683pub struct heif_unci_image_parameters {
1684 _unused: [u8; 0],
1685}
1686#[repr(C)]
1687#[derive(Debug)]
1688pub struct heif_encoder_descriptor {
1689 _unused: [u8; 0],
1690}
1691#[repr(C)]
1692#[derive(Debug)]
1693pub struct heif_encoder_parameter {
1694 _unused: [u8; 0],
1695}
1696unsafe extern "C" {
1697 #[doc = " Quick check whether there is an enoder available for the given format.\n Note that the encoder may be limited to a certain subset of features (e.g. only 8 bit, only lossy).\n You will have to query the specific capabilities further."]
1698 pub fn heif_have_encoder_for_format(format: heif_compression_format) -> libc::c_int;
1699}
1700unsafe extern "C" {
1701 #[doc = " Get a list of available encoders. You can filter the encoders by compression format and name.\n Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.\n The returned list of encoders is sorted by their priority (which is a plugin property).\n The number of encoders is returned, which are not more than 'count' if (out_encoders != nullptr).\n By setting out_encoders==nullptr, you can query the number of encoders, 'count' is ignored.\n Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder()."]
1702 pub fn heif_get_encoder_descriptors(
1703 format_filter: heif_compression_format,
1704 name_filter: *const libc::c_char,
1705 out_encoders: *mut *const heif_encoder_descriptor,
1706 count: libc::c_int,
1707 ) -> libc::c_int;
1708}
1709unsafe extern "C" {
1710 #[doc = " Return a long, descriptive name of the encoder (including version information)."]
1711 pub fn heif_encoder_descriptor_get_name(
1712 arg1: *const heif_encoder_descriptor,
1713 ) -> *const libc::c_char;
1714}
1715unsafe extern "C" {
1716 #[doc = " Return a short, symbolic name for identifying the encoder.\n This name should stay constant over different encoder versions."]
1717 pub fn heif_encoder_descriptor_get_id_name(
1718 arg1: *const heif_encoder_descriptor,
1719 ) -> *const libc::c_char;
1720}
1721unsafe extern "C" {
1722 pub fn heif_encoder_descriptor_get_compression_format(
1723 arg1: *const heif_encoder_descriptor,
1724 ) -> heif_compression_format;
1725}
1726unsafe extern "C" {
1727 pub fn heif_encoder_descriptor_supports_lossy_compression(
1728 arg1: *const heif_encoder_descriptor,
1729 ) -> libc::c_int;
1730}
1731unsafe extern "C" {
1732 pub fn heif_encoder_descriptor_supports_lossless_compression(
1733 arg1: *const heif_encoder_descriptor,
1734 ) -> libc::c_int;
1735}
1736unsafe extern "C" {
1737 #[doc = " Get an encoder instance that can be used to actually encode images from a descriptor."]
1738 pub fn heif_context_get_encoder(
1739 context: *mut heif_context,
1740 arg1: *const heif_encoder_descriptor,
1741 out_encoder: *mut *mut heif_encoder,
1742 ) -> heif_error;
1743}
1744unsafe extern "C" {
1745 #[doc = " Get an encoder for the given compression format. If there are several encoder plugins\n for this format, the encoder with the highest plugin priority will be returned."]
1746 pub fn heif_context_get_encoder_for_format(
1747 context: *mut heif_context,
1748 format: heif_compression_format,
1749 arg1: *mut *mut heif_encoder,
1750 ) -> heif_error;
1751}
1752unsafe extern "C" {
1753 #[doc = " Release the encoder object after use."]
1754 pub fn heif_encoder_release(arg1: *mut heif_encoder);
1755}
1756unsafe extern "C" {
1757 #[doc = " Get the encoder name from the encoder itself."]
1758 pub fn heif_encoder_get_name(arg1: *const heif_encoder) -> *const libc::c_char;
1759}
1760unsafe extern "C" {
1761 #[doc = " Set a 'quality' factor (0-100). How this is mapped to actual encoding parameters is\n encoder dependent."]
1762 pub fn heif_encoder_set_lossy_quality(
1763 arg1: *mut heif_encoder,
1764 quality: libc::c_int,
1765 ) -> heif_error;
1766}
1767unsafe extern "C" {
1768 pub fn heif_encoder_set_lossless(arg1: *mut heif_encoder, enable: libc::c_int) -> heif_error;
1769}
1770unsafe extern "C" {
1771 #[doc = " level should be between 0 (= none) to 4 (= full)"]
1772 pub fn heif_encoder_set_logging_level(
1773 arg1: *mut heif_encoder,
1774 level: libc::c_int,
1775 ) -> heif_error;
1776}
1777unsafe extern "C" {
1778 #[doc = " Get a generic list of encoder parameters.\n Each encoder may define its own, additional set of parameters.\n You do not have to free the returned list."]
1779 pub fn heif_encoder_list_parameters(
1780 arg1: *mut heif_encoder,
1781 ) -> *const *const heif_encoder_parameter;
1782}
1783unsafe extern "C" {
1784 #[doc = " Return the parameter name."]
1785 pub fn heif_encoder_parameter_get_name(
1786 arg1: *const heif_encoder_parameter,
1787 ) -> *const libc::c_char;
1788}
1789pub const heif_encoder_parameter_type_heif_encoder_parameter_type_integer:
1790 heif_encoder_parameter_type = 1;
1791pub const heif_encoder_parameter_type_heif_encoder_parameter_type_boolean:
1792 heif_encoder_parameter_type = 2;
1793pub const heif_encoder_parameter_type_heif_encoder_parameter_type_string:
1794 heif_encoder_parameter_type = 3;
1795pub type heif_encoder_parameter_type = libc::c_uint;
1796unsafe extern "C" {
1797 #[doc = " Return the parameter type."]
1798 pub fn heif_encoder_parameter_get_type(
1799 arg1: *const heif_encoder_parameter,
1800 ) -> heif_encoder_parameter_type;
1801}
1802unsafe extern "C" {
1803 #[doc = " DEPRECATED. Use heif_encoder_parameter_get_valid_integer_values() instead."]
1804 pub fn heif_encoder_parameter_get_valid_integer_range(
1805 arg1: *const heif_encoder_parameter,
1806 have_minimum_maximum: *mut libc::c_int,
1807 minimum: *mut libc::c_int,
1808 maximum: *mut libc::c_int,
1809 ) -> heif_error;
1810}
1811unsafe extern "C" {
1812 #[doc = " If integer is limited by a range, have_minimum and/or have_maximum will be != 0 and *minimum, *maximum is set.\n If integer is limited by a fixed set of values, *num_valid_values will be >0 and *out_integer_array is set."]
1813 pub fn heif_encoder_parameter_get_valid_integer_values(
1814 arg1: *const heif_encoder_parameter,
1815 have_minimum: *mut libc::c_int,
1816 have_maximum: *mut libc::c_int,
1817 minimum: *mut libc::c_int,
1818 maximum: *mut libc::c_int,
1819 num_valid_values: *mut libc::c_int,
1820 out_integer_array: *mut *const libc::c_int,
1821 ) -> heif_error;
1822}
1823unsafe extern "C" {
1824 pub fn heif_encoder_parameter_get_valid_string_values(
1825 arg1: *const heif_encoder_parameter,
1826 out_stringarray: *mut *const *const libc::c_char,
1827 ) -> heif_error;
1828}
1829unsafe extern "C" {
1830 pub fn heif_encoder_set_parameter_integer(
1831 arg1: *mut heif_encoder,
1832 parameter_name: *const libc::c_char,
1833 value: libc::c_int,
1834 ) -> heif_error;
1835}
1836unsafe extern "C" {
1837 pub fn heif_encoder_get_parameter_integer(
1838 arg1: *mut heif_encoder,
1839 parameter_name: *const libc::c_char,
1840 value: *mut libc::c_int,
1841 ) -> heif_error;
1842}
1843unsafe extern "C" {
1844 pub fn heif_encoder_parameter_integer_valid_range(
1845 arg1: *mut heif_encoder,
1846 parameter_name: *const libc::c_char,
1847 have_minimum_maximum: *mut libc::c_int,
1848 minimum: *mut libc::c_int,
1849 maximum: *mut libc::c_int,
1850 ) -> heif_error;
1851}
1852unsafe extern "C" {
1853 pub fn heif_encoder_set_parameter_boolean(
1854 arg1: *mut heif_encoder,
1855 parameter_name: *const libc::c_char,
1856 value: libc::c_int,
1857 ) -> heif_error;
1858}
1859unsafe extern "C" {
1860 pub fn heif_encoder_get_parameter_boolean(
1861 arg1: *mut heif_encoder,
1862 parameter_name: *const libc::c_char,
1863 value: *mut libc::c_int,
1864 ) -> heif_error;
1865}
1866unsafe extern "C" {
1867 pub fn heif_encoder_set_parameter_string(
1868 arg1: *mut heif_encoder,
1869 parameter_name: *const libc::c_char,
1870 value: *const libc::c_char,
1871 ) -> heif_error;
1872}
1873unsafe extern "C" {
1874 pub fn heif_encoder_get_parameter_string(
1875 arg1: *mut heif_encoder,
1876 parameter_name: *const libc::c_char,
1877 value: *mut libc::c_char,
1878 value_size: libc::c_int,
1879 ) -> heif_error;
1880}
1881unsafe extern "C" {
1882 #[doc = " returns a NULL-terminated list of valid strings or NULL if all values are allowed"]
1883 pub fn heif_encoder_parameter_string_valid_values(
1884 arg1: *mut heif_encoder,
1885 parameter_name: *const libc::c_char,
1886 out_stringarray: *mut *const *const libc::c_char,
1887 ) -> heif_error;
1888}
1889unsafe extern "C" {
1890 pub fn heif_encoder_parameter_integer_valid_values(
1891 arg1: *mut heif_encoder,
1892 parameter_name: *const libc::c_char,
1893 have_minimum: *mut libc::c_int,
1894 have_maximum: *mut libc::c_int,
1895 minimum: *mut libc::c_int,
1896 maximum: *mut libc::c_int,
1897 num_valid_values: *mut libc::c_int,
1898 out_integer_array: *mut *const libc::c_int,
1899 ) -> heif_error;
1900}
1901unsafe extern "C" {
1902 #[doc = " Set a parameter of any type to the string value.\n Integer values are parsed from the string.\n Boolean values can be \"true\"/\"false\"/\"1\"/\"0\"\n\n x265 encoder specific note:\n When using the x265 encoder, you may pass any of its parameters by\n prefixing the parameter name with 'x265:'. Hence, to set the 'ctu' parameter,\n you will have to set 'x265:ctu' in libheif.\n Note that there is no checking for valid parameters when using the prefix."]
1903 pub fn heif_encoder_set_parameter(
1904 arg1: *mut heif_encoder,
1905 parameter_name: *const libc::c_char,
1906 value: *const libc::c_char,
1907 ) -> heif_error;
1908}
1909unsafe extern "C" {
1910 #[doc = " Get the current value of a parameter of any type as a human readable string.\n The returned string is compatible with heif_encoder_set_parameter()."]
1911 pub fn heif_encoder_get_parameter(
1912 arg1: *mut heif_encoder,
1913 parameter_name: *const libc::c_char,
1914 value_ptr: *mut libc::c_char,
1915 value_size: libc::c_int,
1916 ) -> heif_error;
1917}
1918unsafe extern "C" {
1919 #[doc = " Query whether a specific parameter has a default value."]
1920 pub fn heif_encoder_has_default(
1921 arg1: *mut heif_encoder,
1922 parameter_name: *const libc::c_char,
1923 ) -> libc::c_int;
1924}
1925pub const heif_orientation_heif_orientation_normal: heif_orientation = 1;
1926pub const heif_orientation_heif_orientation_flip_horizontally: heif_orientation = 2;
1927pub const heif_orientation_heif_orientation_rotate_180: heif_orientation = 3;
1928pub const heif_orientation_heif_orientation_flip_vertically: heif_orientation = 4;
1929pub const heif_orientation_heif_orientation_rotate_90_cw_then_flip_horizontally: heif_orientation =
1930 5;
1931pub const heif_orientation_heif_orientation_rotate_90_cw: heif_orientation = 6;
1932pub const heif_orientation_heif_orientation_rotate_90_cw_then_flip_vertically: heif_orientation = 7;
1933pub const heif_orientation_heif_orientation_rotate_270_cw: heif_orientation = 8;
1934#[doc = " The orientation values are defined equal to the EXIF Orientation tag."]
1935pub type heif_orientation = libc::c_uint;
1936unsafe extern "C" {
1937 pub fn heif_orientation_concat(
1938 first: heif_orientation,
1939 second: heif_orientation,
1940 ) -> heif_orientation;
1941}
1942#[repr(C)]
1943#[derive(Debug)]
1944pub struct heif_encoding_options {
1945 pub version: u8,
1946 #[doc = " default: true"]
1947 pub save_alpha_channel: u8,
1948 #[doc = " DEPRECATED. This option is not required anymore. Its value will be ignored."]
1949 pub macOS_compatibility_workaround: u8,
1950 #[doc = " default: false"]
1951 pub save_two_colr_boxes_when_ICC_and_nclx_available: u8,
1952 #[doc = " Set this to the NCLX parameters to be used in the output image or set to NULL\n when the same parameters as in the input image should be used."]
1953 pub output_nclx_profile: *mut heif_color_profile_nclx,
1954 pub macOS_compatibility_workaround_no_nclx_profile: u8,
1955 #[doc = " libheif will generate irot/imir boxes to match these orientations"]
1956 pub image_orientation: heif_orientation,
1957 #[doc = " version 6 options"]
1958 pub color_conversion_options: heif_color_conversion_options,
1959 #[doc = " Set this to true to use compressed form of uncC where possible."]
1960 pub prefer_uncC_short_form: u8,
1961 #[doc = " Optional 'unci'-specific encoding parameters (compression method, and future fields\n such as interleave type and padding).\n\n Default: nullptr"]
1962 pub unci_parameters: *const heif_unci_image_parameters,
1963}
1964unsafe extern "C" {
1965 pub fn heif_encoding_options_alloc() -> *mut heif_encoding_options;
1966}
1967unsafe extern "C" {
1968 pub fn heif_encoding_options_copy(
1969 dst: *mut heif_encoding_options,
1970 src: *const heif_encoding_options,
1971 );
1972}
1973unsafe extern "C" {
1974 pub fn heif_encoding_options_free(arg1: *mut heif_encoding_options);
1975}
1976unsafe extern "C" {
1977 #[doc = " Compress the input image.\n Returns a handle to the coded image in 'out_image_handle' unless out_image_handle = NULL.\n 'options' should be NULL for now.\n The first image added to the context is also automatically set the primary image, but\n you can change the primary image later with heif_context_set_primary_image()."]
1978 pub fn heif_context_encode_image(
1979 arg1: *mut heif_context,
1980 image: *const heif_image,
1981 encoder: *mut heif_encoder,
1982 options: *const heif_encoding_options,
1983 out_image_handle: *mut *mut heif_image_handle,
1984 ) -> heif_error;
1985}
1986unsafe extern "C" {
1987 #[doc = " offsets[] should either be NULL (all offsets==0) or an array of size 2*nImages with x;y offset pairs.\n If background_rgba is NULL, the background is transparent."]
1988 pub fn heif_context_add_overlay_image(
1989 ctx: *mut heif_context,
1990 image_width: u32,
1991 image_height: u32,
1992 nImages: u16,
1993 image_ids: *const heif_item_id,
1994 offsets: *mut i32,
1995 background_rgba: *const [u16; 4usize],
1996 out_iovl_image_handle: *mut *mut heif_image_handle,
1997 ) -> heif_error;
1998}
1999unsafe extern "C" {
2000 pub fn heif_context_set_primary_image(
2001 arg1: *mut heif_context,
2002 image_handle: *mut heif_image_handle,
2003 ) -> heif_error;
2004}
2005unsafe extern "C" {
2006 #[doc = " Set the major brand of the file.\n If this function is not called, the major brand is determined automatically from\n the image or sequence content."]
2007 pub fn heif_context_set_major_brand(ctx: *mut heif_context, major_brand: heif_brand2);
2008}
2009unsafe extern "C" {
2010 #[doc = " Add a compatible brand that is now added automatically by libheif when encoding images (e.g. some application brands like 'geo1')."]
2011 pub fn heif_context_add_compatible_brand(ctx: *mut heif_context, compatible_brand: heif_brand2);
2012}
2013unsafe extern "C" {
2014 #[doc = " Enable the unified ID namespace ('unif' brand).\n\n When enabled, item IDs, track IDs, and entity group IDs share a single\n global counter so no ID value is reused across categories. The 'unif'\n compatible brand is automatically added to the output file.\n\n @param ctx the encoding context\n @param flag non-zero to enable, zero to disable"]
2015 pub fn heif_context_set_unif(ctx: *mut heif_context, flag: libc::c_int);
2016}
2017unsafe extern "C" {
2018 #[doc = " DEPRECATED, typo in function name"]
2019 pub fn heif_encoder_descriptor_supportes_lossy_compression(
2020 arg1: *const heif_encoder_descriptor,
2021 ) -> libc::c_int;
2022}
2023unsafe extern "C" {
2024 #[doc = " DEPRECATED, typo in function name"]
2025 pub fn heif_encoder_descriptor_supportes_lossless_compression(
2026 arg1: *const heif_encoder_descriptor,
2027 ) -> libc::c_int;
2028}
2029unsafe extern "C" {
2030 #[doc = " DEPRECATED: use heif_get_encoder_descriptors() instead.\n Get a list of available encoders. You can filter the encoders by compression format and name.\n Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.\n The returned list of encoders is sorted by their priority (which is a plugin property).\n The number of encoders is returned, which are not more than 'count' if (out_encoders != nullptr).\n By setting out_encoders==nullptr, you can query the number of encoders, 'count' is ignored.\n Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder()."]
2031 pub fn heif_context_get_encoder_descriptors(
2032 arg1: *mut heif_context,
2033 format_filter: heif_compression_format,
2034 name_filter: *const libc::c_char,
2035 out_encoders: *mut *const heif_encoder_descriptor,
2036 count: libc::c_int,
2037 ) -> libc::c_int;
2038}
2039unsafe extern "C" {
2040 #[doc = " If the maximum threads number is set to 0, the image tiles are decoded in the main thread.\n This is different from setting it to 1, which will generate a single background thread to decode the tiles.\n Note that this setting only affects libheif itself. The codecs itself may still use multi-threaded decoding.\n You can use it, for example, in cases where you are decoding several images in parallel anyway you thus want\n to minimize parallelism in each decoder."]
2041 pub fn heif_context_set_max_decoding_threads(ctx: *mut heif_context, max_threads: libc::c_int);
2042}
2043unsafe extern "C" {
2044 #[doc = " Returns the current maximum number of background threads used for parallel tile decoding.\n This reflects either the library default or the value last passed to\n heif_context_set_max_decoding_threads().\n If 'ctx' is NULL, the library default is returned."]
2045 pub fn heif_context_get_max_decoding_threads(ctx: *const heif_context) -> libc::c_int;
2046}
2047unsafe extern "C" {
2048 #[doc = " Quick check whether there is a decoder available for the given format.\n Note that the decoder still may not be able to decode all variants of that format.\n You will have to query that further (todo) or just try to decode and check the returned error."]
2049 pub fn heif_have_decoder_for_format(format: heif_compression_format) -> libc::c_int;
2050}
2051pub const heif_progress_step_heif_progress_step_total: heif_progress_step = 0;
2052pub const heif_progress_step_heif_progress_step_load_tile: heif_progress_step = 1;
2053pub type heif_progress_step = libc::c_uint;
2054#[repr(C)]
2055#[derive(Debug)]
2056pub struct heif_decoding_options {
2057 pub version: u8,
2058 #[doc = " Ignore geometric transformations like cropping, rotation, mirroring.\n Default: false (do not ignore)."]
2059 pub ignore_transformations: u8,
2060 #[doc = " Any of the progress functions may be called from background threads."]
2061 pub start_progress: ::std::option::Option<
2062 unsafe extern "C" fn(
2063 step: heif_progress_step,
2064 max_progress: libc::c_int,
2065 progress_user_data: *mut libc::c_void,
2066 ),
2067 >,
2068 pub on_progress: ::std::option::Option<
2069 unsafe extern "C" fn(
2070 step: heif_progress_step,
2071 progress: libc::c_int,
2072 progress_user_data: *mut libc::c_void,
2073 ),
2074 >,
2075 pub end_progress: ::std::option::Option<
2076 unsafe extern "C" fn(step: heif_progress_step, progress_user_data: *mut libc::c_void),
2077 >,
2078 pub progress_user_data: *mut libc::c_void,
2079 #[doc = " version 2 options"]
2080 pub convert_hdr_to_8bit: u8,
2081 #[doc = " When enabled, an error is returned for invalid input. Otherwise, it will try its best and\n add decoding warnings to the decoded heif_image. Default is non-strict."]
2082 pub strict_decoding: u8,
2083 #[doc = " name_id of the decoder to use for the decoding.\n If set to NULL (default), the highest priority decoder is chosen.\n The priority is defined in the plugin."]
2084 pub decoder_id: *const libc::c_char,
2085 #[doc = " version 5 options"]
2086 pub color_conversion_options: heif_color_conversion_options,
2087 #[doc = " version 6 options"]
2088 pub cancel_decoding: ::std::option::Option<
2089 unsafe extern "C" fn(progress_user_data: *mut libc::c_void) -> libc::c_int,
2090 >,
2091 #[doc = " When set to NULL, default options will be used"]
2092 pub color_conversion_options_ext: *mut heif_color_conversion_options_ext,
2093 #[doc = " bool"]
2094 pub ignore_sequence_editlist: libc::c_int,
2095 #[doc = " Requested NCLX color profile of the decoded output image. If the input\n image's NCLX differs, libheif will color-convert the pixels accordingly\n (e.g. YCbCr matrix, primaries, range) so the result matches what is\n requested here.\n\n When set to NULL, the behavior depends on the flag\n output_image_nclx_profile_passthrough below: by default NULL means\n \"convert to sRGB\"; with the passthrough flag enabled, NULL means\n \"keep the input image's NCLX\"."]
2096 pub output_image_nclx_profile: *mut heif_color_profile_nclx,
2097 #[doc = " 0 = let libheif decide (TODO, currently ignored)"]
2098 pub num_library_threads: libc::c_int,
2099 #[doc = " 0 = use decoder default"]
2100 pub num_codec_threads: libc::c_int,
2101 #[doc = " If enabled, libheif will attempt to work around known broken-input quirks\n (e.g. Sony HIF files where the NCLX `colr` box disagrees with the HEVC VUI\n on the YCbCr range flag). Default: false (strict spec-conformant behavior)."]
2102 pub autocorrect_broken_input: u8,
2103 #[doc = " Controls the meaning of output_image_nclx_profile == NULL.\n\n When false (default), a NULL output_image_nclx_profile means \"convert the\n decoded image to sRGB\" (BT.709 primaries, sRGB transfer, BT.601 matrix,\n full-range). For HDR inputs (e.g. BT.2100 PQ) this silently discards the\n original color volume.\n\n When true, a NULL output_image_nclx_profile means \"keep the input image's\n NCLX\". The decoded image carries the input file's primaries / transfer /\n matrix / range, and no extra color-space conversion is performed solely\n because the output NCLX was unspecified. If a YCbCr<->RGB colorspace\n conversion fires for another reason, the input NCLX is used to drive that\n conversion (so the result is tagged consistently with the source).\n\n Although this flag is off by default to preserve historical behavior, new\n code that wants to preserve HDR through decode should generally enable it.\n Setting output_image_nclx_profile to a non-NULL value overrides this flag."]
2104 pub output_image_nclx_profile_passthrough: u8,
2105}
2106unsafe extern "C" {
2107 #[doc = " Allocate decoding options and fill with default values.\n Note: you should always get the decoding options through this function since the\n option structure may grow in size in future versions."]
2108 pub fn heif_decoding_options_alloc() -> *mut heif_decoding_options;
2109}
2110unsafe extern "C" {
2111 pub fn heif_decoding_options_copy(
2112 dst: *mut heif_decoding_options,
2113 src: *const heif_decoding_options,
2114 );
2115}
2116unsafe extern "C" {
2117 pub fn heif_decoding_options_free(arg1: *mut heif_decoding_options);
2118}
2119#[repr(C)]
2120#[derive(Debug)]
2121pub struct heif_decoder_descriptor {
2122 _unused: [u8; 0],
2123}
2124unsafe extern "C" {
2125 #[doc = " Get a list of available decoders. You can filter the encoders by compression format.\n Use format_filter==heif_compression_undefined to get all available decoders.\n The returned list of decoders is sorted by their priority (which is a plugin property).\n The number of decoders is returned, which are not more than 'count' if (out_decoders != nullptr).\n By setting out_decoders==nullptr, you can query the number of decoders, 'count' is ignored."]
2126 pub fn heif_get_decoder_descriptors(
2127 format_filter: heif_compression_format,
2128 out_decoders: *mut *const heif_decoder_descriptor,
2129 count: libc::c_int,
2130 ) -> libc::c_int;
2131}
2132unsafe extern "C" {
2133 #[doc = " Return a long, descriptive name of the decoder (including version information)."]
2134 pub fn heif_decoder_descriptor_get_name(
2135 arg1: *const heif_decoder_descriptor,
2136 ) -> *const libc::c_char;
2137}
2138unsafe extern "C" {
2139 #[doc = " Return a short, symbolic name for identifying the decoder.\n This name should stay constant over different decoder versions.\n Note: the returned ID may be NULL for old plugins that don't support this yet."]
2140 pub fn heif_decoder_descriptor_get_id_name(
2141 arg1: *const heif_decoder_descriptor,
2142 ) -> *const libc::c_char;
2143}
2144unsafe extern "C" {
2145 #[doc = " Decode an heif_image_handle into the actual pixel image and also carry out\n all geometric transformations specified in the HEIF file (rotation, cropping, mirroring).\n\n If colorspace or chroma is set to heif_colorspace_undefined or heif_chroma_undefined,\n respectively, the original colorspace is taken.\n Decoding options may be NULL. If you want to supply options, always use\n heif_decoding_options_alloc() to get the structure."]
2146 pub fn heif_decode_image(
2147 in_handle: *const heif_image_handle,
2148 out_img: *mut *mut heif_image,
2149 colorspace: heif_colorspace,
2150 chroma: heif_chroma,
2151 options: *const heif_decoding_options,
2152 ) -> heif_error;
2153}
2154unsafe extern "C" {
2155 #[doc = " Release image handle."]
2156 pub fn heif_image_handle_release(arg1: *const heif_image_handle);
2157}
2158unsafe extern "C" {
2159 #[doc = " Check whether the given image_handle is the primary image of the file."]
2160 pub fn heif_image_handle_is_primary_image(handle: *const heif_image_handle) -> libc::c_int;
2161}
2162unsafe extern "C" {
2163 pub fn heif_image_handle_get_item_id(handle: *const heif_image_handle) -> heif_item_id;
2164}
2165unsafe extern "C" {
2166 #[doc = " Get the image width.\n\n If 'handle' is invalid (NULL) or if the image size exceeds the range of `int`, 0 is returned."]
2167 pub fn heif_image_handle_get_width(handle: *const heif_image_handle) -> libc::c_int;
2168}
2169unsafe extern "C" {
2170 #[doc = " Get the image height.\n\n If 'handle' is invalid (NULL) or if the image size exceeds the range of `int`, 0 is returned."]
2171 pub fn heif_image_handle_get_height(handle: *const heif_image_handle) -> libc::c_int;
2172}
2173unsafe extern "C" {
2174 pub fn heif_image_handle_has_alpha_channel(arg1: *const heif_image_handle) -> libc::c_int;
2175}
2176unsafe extern "C" {
2177 pub fn heif_image_handle_is_premultiplied_alpha(arg1: *const heif_image_handle) -> libc::c_int;
2178}
2179unsafe extern "C" {
2180 #[doc = " Returns -1 on error, e.g. if this information is not present in the image.\n Only defined for images coded in the YCbCr or monochrome colorspace."]
2181 pub fn heif_image_handle_get_luma_bits_per_pixel(arg1: *const heif_image_handle)
2182 -> libc::c_int;
2183}
2184unsafe extern "C" {
2185 #[doc = " Returns -1 on error, e.g. if this information is not present in the image.\n Only defined for images coded in the YCbCr colorspace."]
2186 pub fn heif_image_handle_get_chroma_bits_per_pixel(
2187 arg1: *const heif_image_handle,
2188 ) -> libc::c_int;
2189}
2190unsafe extern "C" {
2191 #[doc = " Return the colorspace that libheif proposes to use for decoding.\n Usually, these will be either YCbCr or Monochrome, but it may also propose RGB for images\n encoded with matrix_coefficients=0 or for images coded natively in RGB.\n It may also return *_undefined if the file misses relevant information to determine this without decoding.\n These are only proposed values that avoid colorspace conversions as much as possible.\n You can still request the output in your preferred colorspace, but this may involve an internal conversion."]
2192 pub fn heif_image_handle_get_preferred_decoding_colorspace(
2193 image_handle: *const heif_image_handle,
2194 out_colorspace: *mut heif_colorspace,
2195 out_chroma: *mut heif_chroma,
2196 ) -> heif_error;
2197}
2198unsafe extern "C" {
2199 #[doc = " Get the image width from the 'ispe' box. This is the original image size without\n any transformations applied to it. Do not use this unless you know exactly what\n you are doing."]
2200 pub fn heif_image_handle_get_ispe_width(handle: *const heif_image_handle) -> libc::c_int;
2201}
2202unsafe extern "C" {
2203 pub fn heif_image_handle_get_ispe_height(handle: *const heif_image_handle) -> libc::c_int;
2204}
2205unsafe extern "C" {
2206 #[doc = " Returns whether the image has 'pixel aspect ratio information' information. If 0 is returned, the output is filled with the 1:1 default."]
2207 pub fn heif_image_handle_get_pixel_aspect_ratio(
2208 arg1: *const heif_image_handle,
2209 aspect_h: *mut u32,
2210 aspect_v: *mut u32,
2211 ) -> libc::c_int;
2212}
2213unsafe extern "C" {
2214 #[doc = " This gets the context associated with the image handle.\n Note that you have to release the returned context with heif_context_free() in any case.\n\n This means: when you have several image-handles that originate from the same file and you get the\n context of each of them, the returned pointer may be different even though it refers to the same\n logical context. You have to call heif_context_free() on all those context pointers.\n After you freed a context pointer, you can still use the context through a different pointer that you\n might have acquired from elsewhere."]
2215 pub fn heif_image_handle_get_context(handle: *const heif_image_handle) -> *mut heif_context;
2216}
2217unsafe extern "C" {
2218 pub fn heif_image_handle_get_gimi_content_id(
2219 handle: *const heif_image_handle,
2220 ) -> *const libc::c_char;
2221}
2222unsafe extern "C" {
2223 pub fn heif_image_handle_set_gimi_content_id(
2224 handle: *mut heif_image_handle,
2225 content_id: *const libc::c_char,
2226 );
2227}
2228unsafe extern "C" {
2229 #[doc = " Returns the number of components in the cmpd box, or 0 if no cmpd property exists."]
2230 pub fn heif_image_handle_get_number_of_cmpd_components(arg1: *const heif_image_handle) -> u32;
2231}
2232unsafe extern "C" {
2233 #[doc = " Returns the component_type for the given cmpd component index.\n Returns 0 if out of range or no cmpd property."]
2234 pub fn heif_image_handle_get_cmpd_component_type(
2235 arg1: *const heif_image_handle,
2236 component_idx: u32,
2237 ) -> u16;
2238}
2239unsafe extern "C" {
2240 #[doc = " Returns the component_type_uri for the given cmpd component index (component_type >= 0x8000).\n Returns NULL if the component does not have a URI.\n The returned string must be freed with heif_string_release()."]
2241 pub fn heif_image_handle_get_cmpd_component_type_uri(
2242 arg1: *const heif_image_handle,
2243 component_idx: u32,
2244 ) -> *const libc::c_char;
2245}
2246unsafe extern "C" {
2247 #[doc = " Returns non-zero (count of content IDs) if an ItemComponentContentIDProperty is set, 0 otherwise."]
2248 pub fn heif_image_handle_has_gimi_component_content_ids(
2249 arg1: *const heif_image_handle,
2250 ) -> libc::c_int;
2251}
2252unsafe extern "C" {
2253 #[doc = " Returns the GIMI component content ID for the given component index.\n Returns NULL if no ItemComponentContentIDProperty is set or index is out of range.\n The returned string must be freed with heif_string_release()."]
2254 pub fn heif_image_handle_get_gimi_component_content_id(
2255 arg1: *const heif_image_handle,
2256 component_idx: u32,
2257 ) -> *const libc::c_char;
2258}
2259unsafe extern "C" {
2260 #[doc = " Set a GIMI component content ID for a single component.\n If an ItemComponentContentIDProperty does not yet exist, one will be created.\n The content IDs array is resized as needed (new entries default to empty)."]
2261 pub fn heif_image_handle_set_gimi_component_content_id(
2262 arg1: *mut heif_image_handle,
2263 component_idx: u32,
2264 content_id: *const libc::c_char,
2265 );
2266}
2267#[repr(C)]
2268#[derive(Debug, Copy, Clone)]
2269pub struct heif_image_tiling {
2270 pub version: libc::c_int,
2271 #[doc = " --- version 1"]
2272 pub num_columns: u32,
2273 pub num_rows: u32,
2274 pub tile_width: u32,
2275 pub tile_height: u32,
2276 pub image_width: u32,
2277 pub image_height: u32,
2278 #[doc = " Position of the top left tile.\n Usually, this is (0;0), but if a tiled image is rotated or cropped, it may be that the top left tile should be placed at a negative position.\n The offsets define this negative shift."]
2279 pub top_offset: u32,
2280 pub left_offset: u32,
2281 #[doc = " 0 for normal images, 1 for volumetric (3D), ..."]
2282 pub number_of_extra_dimensions: u8,
2283 #[doc = " size of extra dimensions (first 8 dimensions)"]
2284 pub extra_dimension_size: [u32; 8usize],
2285}
2286unsafe extern "C" {
2287 #[doc = " If 'process_image_transformations' is true, this returns modified sizes.\n If it is false, the top_offset and left_offset will always be (0;0)."]
2288 pub fn heif_image_handle_get_image_tiling(
2289 handle: *const heif_image_handle,
2290 process_image_transformations: libc::c_int,
2291 out_tiling: *mut heif_image_tiling,
2292 ) -> heif_error;
2293}
2294unsafe extern "C" {
2295 #[doc = " For grid images, return the image item ID of a specific grid tile.\n If 'process_image_transformations' is true, the tile positions are given in the transformed image coordinate system and\n are internally mapped to the original image tile positions."]
2296 pub fn heif_image_handle_get_grid_image_tile_id(
2297 handle: *const heif_image_handle,
2298 process_image_transformations: libc::c_int,
2299 tile_x: u32,
2300 tile_y: u32,
2301 out_tile_item_id: *mut heif_item_id,
2302 ) -> heif_error;
2303}
2304unsafe extern "C" {
2305 #[doc = " The tile position is given in tile indices, not in pixel coordinates.\n If the image transformations are processed (option->ignore_image_transformations==false), the tile position\n is given in the transformed coordinates."]
2306 pub fn heif_image_handle_decode_image_tile(
2307 in_handle: *const heif_image_handle,
2308 out_img: *mut *mut heif_image,
2309 colorspace: heif_colorspace,
2310 chroma: heif_chroma,
2311 options: *const heif_decoding_options,
2312 tile_x: u32,
2313 tile_y: u32,
2314 ) -> heif_error;
2315}
2316unsafe extern "C" {
2317 #[doc = " @brief Encodes an array of images into a grid.\n\n @param ctx The file context\n @param tiles User allocated array of images that will form the grid.\n @param rows The number of rows in the grid.\n @param columns The number of columns in the grid.\n @param encoder Defines the encoder to use. See heif_context_get_encoder_for_format()\n @param input_options Optional, may be nullptr.\n @param out_image_handle Returns a handle to the grid. The caller is responsible for freeing it.\n @return Returns an error if ctx, tiles, or encoder is nullptr. If rows or columns is 0."]
2318 pub fn heif_context_encode_grid(
2319 ctx: *mut heif_context,
2320 tiles: *mut *mut heif_image,
2321 rows: u16,
2322 columns: u16,
2323 encoder: *mut heif_encoder,
2324 input_options: *const heif_encoding_options,
2325 out_image_handle: *mut *mut heif_image_handle,
2326 ) -> heif_error;
2327}
2328unsafe extern "C" {
2329 pub fn heif_context_add_grid_image(
2330 ctx: *mut heif_context,
2331 image_width: u32,
2332 image_height: u32,
2333 tile_columns: u32,
2334 tile_rows: u32,
2335 encoding_options: *const heif_encoding_options,
2336 out_grid_image_handle: *mut *mut heif_image_handle,
2337 ) -> heif_error;
2338}
2339unsafe extern "C" {
2340 pub fn heif_context_add_image_tile(
2341 ctx: *mut heif_context,
2342 tiled_image: *mut heif_image_handle,
2343 tile_x: u32,
2344 tile_y: u32,
2345 image: *const heif_image,
2346 encoder: *mut heif_encoder,
2347 ) -> heif_error;
2348}
2349pub const heif_component_datatype_heif_component_datatype_unsigned_integer:
2350 heif_component_datatype = 0;
2351pub const heif_component_datatype_heif_component_datatype_floating_point: heif_component_datatype =
2352 1;
2353pub const heif_component_datatype_heif_component_datatype_complex_number: heif_component_datatype =
2354 2;
2355pub const heif_component_datatype_heif_component_datatype_signed_integer: heif_component_datatype =
2356 3;
2357pub const heif_component_datatype_heif_component_datatype_undefined: heif_component_datatype = 255;
2358#[doc = " --- pixel datatype support\n\n The numeric values are aligned with the ISO/IEC 23001-17 Table 2\n component_format byte (used by the uncC box of the uncompressed codec).\n This is an internal convenience and should not be relied upon."]
2359pub type heif_component_datatype = libc::c_uint;
2360#[repr(C)]
2361#[derive(Debug, Copy, Clone)]
2362pub struct heif_complex32 {
2363 pub real: f32,
2364 pub imaginary: f32,
2365}
2366#[repr(C)]
2367#[derive(Debug, Copy, Clone)]
2368pub struct heif_complex64 {
2369 pub real: f64,
2370 pub imaginary: f64,
2371}
2372pub const heif_cmpd_component_type_heif_cmpd_component_type_monochrome: heif_cmpd_component_type =
2373 0;
2374pub const heif_cmpd_component_type_heif_cmpd_component_type_Y: heif_cmpd_component_type = 1;
2375pub const heif_cmpd_component_type_heif_cmpd_component_type_Cb: heif_cmpd_component_type = 2;
2376pub const heif_cmpd_component_type_heif_cmpd_component_type_Cr: heif_cmpd_component_type = 3;
2377pub const heif_cmpd_component_type_heif_cmpd_component_type_red: heif_cmpd_component_type = 4;
2378pub const heif_cmpd_component_type_heif_cmpd_component_type_green: heif_cmpd_component_type = 5;
2379pub const heif_cmpd_component_type_heif_cmpd_component_type_blue: heif_cmpd_component_type = 6;
2380pub const heif_cmpd_component_type_heif_cmpd_component_type_alpha: heif_cmpd_component_type = 7;
2381pub const heif_cmpd_component_type_heif_cmpd_component_type_depth: heif_cmpd_component_type = 8;
2382pub const heif_cmpd_component_type_heif_cmpd_component_type_disparity: heif_cmpd_component_type = 9;
2383pub const heif_cmpd_component_type_heif_cmpd_component_type_palette: heif_cmpd_component_type = 10;
2384pub const heif_cmpd_component_type_heif_cmpd_component_type_filter_array: heif_cmpd_component_type =
2385 11;
2386pub const heif_cmpd_component_type_heif_cmpd_component_type_padded: heif_cmpd_component_type = 12;
2387pub const heif_cmpd_component_type_heif_cmpd_component_type_cyan: heif_cmpd_component_type = 13;
2388pub const heif_cmpd_component_type_heif_cmpd_component_type_magenta: heif_cmpd_component_type = 14;
2389pub const heif_cmpd_component_type_heif_cmpd_component_type_yellow: heif_cmpd_component_type = 15;
2390pub const heif_cmpd_component_type_heif_cmpd_component_type_key_black: heif_cmpd_component_type =
2391 16;
2392#[doc = " --- component types (ISO/IEC 23001-17 Table 1, used in the cmpd box)"]
2393pub type heif_cmpd_component_type = libc::c_uint;
2394unsafe extern "C" {
2395 #[doc = " Returns the number of components that have pixel data (planes) in this image."]
2396 pub fn heif_image_get_number_of_used_components(arg1: *const heif_image) -> u32;
2397}
2398unsafe extern "C" {
2399 #[doc = " Fills `out_component_ids` with the valid component IDs.\n The caller must allocate an array of at least heif_image_get_number_of_used_components() elements."]
2400 pub fn heif_image_get_used_component_ids(arg1: *const heif_image, out_component_ids: *mut u32);
2401}
2402unsafe extern "C" {
2403 pub fn heif_image_get_component_channel(
2404 arg1: *const heif_image,
2405 component_id: u32,
2406 ) -> heif_channel;
2407}
2408unsafe extern "C" {
2409 pub fn heif_image_get_component_width(arg1: *const heif_image, component_id: u32) -> u32;
2410}
2411unsafe extern "C" {
2412 pub fn heif_image_get_component_height(arg1: *const heif_image, component_id: u32) -> u32;
2413}
2414unsafe extern "C" {
2415 pub fn heif_image_get_component_bits_per_pixel(
2416 arg1: *const heif_image,
2417 component_id: u32,
2418 ) -> libc::c_int;
2419}
2420unsafe extern "C" {
2421 pub fn heif_image_get_component_type(arg1: *const heif_image, component_id: u32) -> u16;
2422}
2423unsafe extern "C" {
2424 #[doc = " Returns the datatype (unsigned/signed integer, floating point, or complex\n number) of the given component."]
2425 pub fn heif_image_get_component_datatype(
2426 arg1: *const heif_image,
2427 component_id: u32,
2428 ) -> heif_component_datatype;
2429}
2430unsafe extern "C" {
2431 #[doc = " --- ID-based component access via heif_image_handle (before decoding)\n\n These let the caller introspect a multi-component image's components without\n decoding any tile. They return 0 / -1 / heif_component_datatype_undefined for\n images that do not expose a component model or for unknown component IDs.\n\n The component IDs returned here match the IDs that\n heif_image_get_used_component_ids() will report after the same image is\n decoded, so the same numerical id can be used to address a component on\n either side of the API."]
2432 pub fn heif_image_handle_get_number_of_components(arg1: *const heif_image_handle) -> u32;
2433}
2434unsafe extern "C" {
2435 #[doc = " Fills `out_component_ids` with the valid component IDs.\n The caller must allocate an array of at least\n heif_image_handle_get_number_of_components() elements."]
2436 pub fn heif_image_handle_get_used_component_ids(
2437 arg1: *const heif_image_handle,
2438 out_component_ids: *mut u32,
2439 );
2440}
2441unsafe extern "C" {
2442 pub fn heif_image_handle_get_component_type(
2443 arg1: *const heif_image_handle,
2444 component_id: u32,
2445 ) -> u16;
2446}
2447unsafe extern "C" {
2448 pub fn heif_image_handle_get_component_bits_per_pixel(
2449 arg1: *const heif_image_handle,
2450 component_id: u32,
2451 ) -> libc::c_int;
2452}
2453unsafe extern "C" {
2454 pub fn heif_image_handle_get_component_datatype(
2455 arg1: *const heif_image_handle,
2456 component_id: u32,
2457 ) -> heif_component_datatype;
2458}
2459unsafe extern "C" {
2460 #[doc = " --- adding components to a heif_image (encoder path)"]
2461 pub fn heif_image_add_component(
2462 image: *mut heif_image,
2463 width: libc::c_int,
2464 height: libc::c_int,
2465 component_type: u16,
2466 datatype: heif_component_datatype,
2467 bit_depth: libc::c_int,
2468 out_component_id: *mut u32,
2469 ) -> heif_error;
2470}
2471unsafe extern "C" {
2472 #[doc = " --- untyped uint8 component data getters: stride is in BYTES per row."]
2473 pub fn heif_image_get_component_readonly(
2474 arg1: *const heif_image,
2475 component_id: u32,
2476 out_stride: *mut usize,
2477 ) -> *const u8;
2478}
2479unsafe extern "C" {
2480 pub fn heif_image_get_component(
2481 arg1: *mut heif_image,
2482 component_id: u32,
2483 out_stride: *mut usize,
2484 ) -> *mut u8;
2485}
2486unsafe extern "C" {
2487 #[doc = " --- typed component data getters: `out_row_elements` is the number of T\n elements per row, not bytes. Index with `data[y * row_elements + x]` (no\n casts, no sizeof). libheif allocates rows with element-aligned padding, so\n this count is always exact for the named type T."]
2488 pub fn heif_image_get_component_uint16_readonly(
2489 arg1: *const heif_image,
2490 component_id: u32,
2491 out_row_elements: *mut usize,
2492 ) -> *const u16;
2493}
2494unsafe extern "C" {
2495 pub fn heif_image_get_component_uint16(
2496 arg1: *mut heif_image,
2497 component_id: u32,
2498 out_row_elements: *mut usize,
2499 ) -> *mut u16;
2500}
2501unsafe extern "C" {
2502 pub fn heif_image_get_component_uint32_readonly(
2503 arg1: *const heif_image,
2504 component_id: u32,
2505 out_row_elements: *mut usize,
2506 ) -> *const u32;
2507}
2508unsafe extern "C" {
2509 pub fn heif_image_get_component_uint32(
2510 arg1: *mut heif_image,
2511 component_id: u32,
2512 out_row_elements: *mut usize,
2513 ) -> *mut u32;
2514}
2515unsafe extern "C" {
2516 pub fn heif_image_get_component_uint64_readonly(
2517 arg1: *const heif_image,
2518 component_id: u32,
2519 out_row_elements: *mut usize,
2520 ) -> *const u64;
2521}
2522unsafe extern "C" {
2523 pub fn heif_image_get_component_uint64(
2524 arg1: *mut heif_image,
2525 component_id: u32,
2526 out_row_elements: *mut usize,
2527 ) -> *mut u64;
2528}
2529unsafe extern "C" {
2530 pub fn heif_image_get_component_int8_readonly(
2531 arg1: *const heif_image,
2532 component_id: u32,
2533 out_row_elements: *mut usize,
2534 ) -> *const i8;
2535}
2536unsafe extern "C" {
2537 pub fn heif_image_get_component_int8(
2538 arg1: *mut heif_image,
2539 component_id: u32,
2540 out_row_elements: *mut usize,
2541 ) -> *mut i8;
2542}
2543unsafe extern "C" {
2544 pub fn heif_image_get_component_int16_readonly(
2545 arg1: *const heif_image,
2546 component_id: u32,
2547 out_row_elements: *mut usize,
2548 ) -> *const i16;
2549}
2550unsafe extern "C" {
2551 pub fn heif_image_get_component_int16(
2552 arg1: *mut heif_image,
2553 component_id: u32,
2554 out_row_elements: *mut usize,
2555 ) -> *mut i16;
2556}
2557unsafe extern "C" {
2558 pub fn heif_image_get_component_int32_readonly(
2559 arg1: *const heif_image,
2560 component_id: u32,
2561 out_row_elements: *mut usize,
2562 ) -> *const i32;
2563}
2564unsafe extern "C" {
2565 pub fn heif_image_get_component_int32(
2566 arg1: *mut heif_image,
2567 component_id: u32,
2568 out_row_elements: *mut usize,
2569 ) -> *mut i32;
2570}
2571unsafe extern "C" {
2572 pub fn heif_image_get_component_int64_readonly(
2573 arg1: *const heif_image,
2574 component_id: u32,
2575 out_row_elements: *mut usize,
2576 ) -> *const i64;
2577}
2578unsafe extern "C" {
2579 pub fn heif_image_get_component_int64(
2580 arg1: *mut heif_image,
2581 component_id: u32,
2582 out_row_elements: *mut usize,
2583 ) -> *mut i64;
2584}
2585unsafe extern "C" {
2586 pub fn heif_image_get_component_float32_readonly(
2587 arg1: *const heif_image,
2588 component_id: u32,
2589 out_row_elements: *mut usize,
2590 ) -> *const f32;
2591}
2592unsafe extern "C" {
2593 pub fn heif_image_get_component_float32(
2594 arg1: *mut heif_image,
2595 component_id: u32,
2596 out_row_elements: *mut usize,
2597 ) -> *mut f32;
2598}
2599unsafe extern "C" {
2600 pub fn heif_image_get_component_float64_readonly(
2601 arg1: *const heif_image,
2602 component_id: u32,
2603 out_row_elements: *mut usize,
2604 ) -> *const f64;
2605}
2606unsafe extern "C" {
2607 pub fn heif_image_get_component_float64(
2608 arg1: *mut heif_image,
2609 component_id: u32,
2610 out_row_elements: *mut usize,
2611 ) -> *mut f64;
2612}
2613unsafe extern "C" {
2614 pub fn heif_image_get_component_complex32_readonly(
2615 arg1: *const heif_image,
2616 component_id: u32,
2617 out_row_elements: *mut usize,
2618 ) -> *const heif_complex32;
2619}
2620unsafe extern "C" {
2621 pub fn heif_image_get_component_complex32(
2622 arg1: *mut heif_image,
2623 component_id: u32,
2624 out_row_elements: *mut usize,
2625 ) -> *mut heif_complex32;
2626}
2627unsafe extern "C" {
2628 pub fn heif_image_get_component_complex64_readonly(
2629 arg1: *const heif_image,
2630 component_id: u32,
2631 out_row_elements: *mut usize,
2632 ) -> *const heif_complex64;
2633}
2634unsafe extern "C" {
2635 pub fn heif_image_get_component_complex64(
2636 arg1: *mut heif_image,
2637 component_id: u32,
2638 out_row_elements: *mut usize,
2639 ) -> *mut heif_complex64;
2640}
2641unsafe extern "C" {
2642 #[doc = " Set a GIMI component content ID for the component with the given\n component_id (as minted by heif_image_add_component / returned via the\n component access API). Pass an empty string to clear a previously set id.\n Returns an error if no component with this id exists on the image.\n The collected ids are written into an ItemComponentContentIDProperty box\n during encoding."]
2643 pub fn heif_image_set_gimi_component_content_id(
2644 arg1: *mut heif_image,
2645 component_id: u32,
2646 content_id: *const libc::c_char,
2647 ) -> heif_error;
2648}
2649#[doc = " Equirectangular projection."]
2650pub const heif_omaf_image_projection_heif_omaf_image_projection_equirectangular:
2651 heif_omaf_image_projection = 0;
2652#[doc = " Cube map."]
2653pub const heif_omaf_image_projection_heif_omaf_image_projection_cube_map:
2654 heif_omaf_image_projection = 1;
2655#[doc = " Flat projection. Also returned by the get-projection accessors when no\n projection information is present on the image, so callers can use\n `result == heif_omaf_image_projection_flat` to test for \"no prfr box\".\n 0xFF lies outside the prfr value range reserved by ISO 23090-2:2023\n Table 10, so it cannot collide with a value read from a file."]
2656pub const heif_omaf_image_projection_heif_omaf_image_projection_flat: heif_omaf_image_projection =
2657 255;
2658#[doc = " OMAF Image projection.\n\n The image projection for most images is flat - it is projected as intended to be shown on\n a flat screen or print. For immersive or omnidirectional media (e.g. VR headsets, or\n equivalent), there are alternatives such as an equirectangular projection or cubemap projection.\n\n See ISO/IEC 23090-2 \"Omnidirectional media format\" for more information."]
2659pub type heif_omaf_image_projection = libc::c_uint;
2660unsafe extern "C" {
2661 #[doc = " To test whether projection information is present, compare the getter's\n result against heif_omaf_image_projection_flat."]
2662 pub fn heif_image_handle_get_omaf_image_projection(
2663 handle: *const heif_image_handle,
2664 ) -> heif_omaf_image_projection;
2665}
2666unsafe extern "C" {
2667 pub fn heif_image_handle_set_omaf_image_projection(
2668 handle: *mut heif_image_handle,
2669 image_projection: heif_omaf_image_projection,
2670 );
2671}
2672unsafe extern "C" {
2673 #[doc = " Variants operating on a heif_image (a decoded or about-to-be-encoded pixel\n image). Setting the projection on a heif_image before encoding causes the\n resulting image item to carry the corresponding prfr property."]
2674 pub fn heif_image_get_omaf_image_projection(
2675 image: *const heif_image,
2676 ) -> heif_omaf_image_projection;
2677}
2678unsafe extern "C" {
2679 pub fn heif_image_set_omaf_image_projection(
2680 image: *mut heif_image,
2681 image_projection: heif_omaf_image_projection,
2682 );
2683}
2684#[doc = " heif_item_property_unknown = -1,"]
2685pub const heif_item_property_type_heif_item_property_type_invalid: heif_item_property_type = 0;
2686#[doc = " heif_item_property_unknown = -1,"]
2687pub const heif_item_property_type_heif_item_property_type_user_description:
2688 heif_item_property_type = 1969513843;
2689#[doc = " heif_item_property_unknown = -1,"]
2690pub const heif_item_property_type_heif_item_property_type_transform_mirror:
2691 heif_item_property_type = 1768778098;
2692#[doc = " heif_item_property_unknown = -1,"]
2693pub const heif_item_property_type_heif_item_property_type_transform_rotation:
2694 heif_item_property_type = 1769107316;
2695#[doc = " heif_item_property_unknown = -1,"]
2696pub const heif_item_property_type_heif_item_property_type_transform_crop: heif_item_property_type =
2697 1668047216;
2698#[doc = " heif_item_property_unknown = -1,"]
2699pub const heif_item_property_type_heif_item_property_type_image_size: heif_item_property_type =
2700 1769173093;
2701#[doc = " heif_item_property_unknown = -1,"]
2702pub const heif_item_property_type_heif_item_property_type_uuid: heif_item_property_type =
2703 1970628964;
2704#[doc = " heif_item_property_unknown = -1,"]
2705pub const heif_item_property_type_heif_item_property_type_tai_clock_info: heif_item_property_type =
2706 1952541027;
2707#[doc = " heif_item_property_unknown = -1,"]
2708pub const heif_item_property_type_heif_item_property_type_tai_timestamp: heif_item_property_type =
2709 1769234793;
2710#[doc = " heif_item_property_unknown = -1,"]
2711pub const heif_item_property_type_heif_item_property_type_extended_language:
2712 heif_item_property_type = 1701604967;
2713#[doc = " ------------------------- item properties -------------------------"]
2714pub type heif_item_property_type = libc::c_uint;
2715unsafe extern "C" {
2716 #[doc = " Get the heif_property_id for a heif_item_id.\n You may specify which property 'type' you want to receive.\n If you specify 'heif_item_property_type_invalid', all properties associated to that item are returned.\n The number of properties is returned, which are not more than 'count' if (out_list != nullptr).\n By setting out_list==nullptr, you can query the number of properties, 'count' is ignored."]
2717 pub fn heif_item_get_properties_of_type(
2718 context: *const heif_context,
2719 id: heif_item_id,
2720 type_: heif_item_property_type,
2721 out_list: *mut heif_property_id,
2722 count: libc::c_int,
2723 ) -> libc::c_int;
2724}
2725unsafe extern "C" {
2726 #[doc = " Returns all transformative properties in the correct order.\n This includes \"irot\", \"imir\", \"clap\".\n The number of properties is returned, which are not more than 'count' if (out_list != nullptr).\n By setting out_list==nullptr, you can query the number of properties, 'count' is ignored."]
2727 pub fn heif_item_get_transformation_properties(
2728 context: *const heif_context,
2729 id: heif_item_id,
2730 out_list: *mut heif_property_id,
2731 count: libc::c_int,
2732 ) -> libc::c_int;
2733}
2734unsafe extern "C" {
2735 pub fn heif_item_get_property_type(
2736 context: *const heif_context,
2737 id: heif_item_id,
2738 property_id: heif_property_id,
2739 ) -> heif_item_property_type;
2740}
2741#[doc = " The strings are managed by libheif. They will be deleted in heif_property_user_description_release()."]
2742#[repr(C)]
2743#[derive(Debug)]
2744pub struct heif_property_user_description {
2745 pub version: libc::c_int,
2746 #[doc = " version 1"]
2747 pub lang: *const libc::c_char,
2748 pub name: *const libc::c_char,
2749 pub description: *const libc::c_char,
2750 pub tags: *const libc::c_char,
2751}
2752unsafe extern "C" {
2753 #[doc = " Get the \"udes\" user description property content.\n Undefined strings are returned as empty strings."]
2754 pub fn heif_item_get_property_user_description(
2755 context: *const heif_context,
2756 itemId: heif_item_id,
2757 propertyId: heif_property_id,
2758 out: *mut *mut heif_property_user_description,
2759 ) -> heif_error;
2760}
2761unsafe extern "C" {
2762 #[doc = " Add a \"udes\" user description property to the item.\n If any string pointers are NULL, an empty string will be used instead."]
2763 pub fn heif_item_add_property_user_description(
2764 context: *const heif_context,
2765 itemId: heif_item_id,
2766 description: *const heif_property_user_description,
2767 out_propertyId: *mut heif_property_id,
2768 ) -> heif_error;
2769}
2770unsafe extern "C" {
2771 #[doc = " Release all strings and the object itself.\n Only call for objects that you received from heif_item_get_property_user_description()."]
2772 pub fn heif_property_user_description_release(arg1: *mut heif_property_user_description);
2773}
2774pub const heif_transform_mirror_direction_heif_transform_mirror_direction_invalid:
2775 heif_transform_mirror_direction = -1;
2776#[doc = " flip image vertically"]
2777pub const heif_transform_mirror_direction_heif_transform_mirror_direction_vertical:
2778 heif_transform_mirror_direction = 0;
2779#[doc = " flip image horizontally"]
2780pub const heif_transform_mirror_direction_heif_transform_mirror_direction_horizontal:
2781 heif_transform_mirror_direction = 1;
2782pub type heif_transform_mirror_direction = libc::c_int;
2783unsafe extern "C" {
2784 #[doc = " Will return 'heif_transform_mirror_direction_invalid' in case of error.\n If 'propertyId==0', it returns the first imir property found."]
2785 pub fn heif_item_get_property_transform_mirror(
2786 context: *const heif_context,
2787 itemId: heif_item_id,
2788 propertyId: heif_property_id,
2789 ) -> heif_transform_mirror_direction;
2790}
2791unsafe extern "C" {
2792 #[doc = " Returns only 0, 90, 180, or 270 angle values.\n Returns -1 in case of error (but it will only return an error in case of wrong usage).\n If 'propertyId==0', it returns the first irot property found."]
2793 pub fn heif_item_get_property_transform_rotation_ccw(
2794 context: *const heif_context,
2795 itemId: heif_item_id,
2796 propertyId: heif_property_id,
2797 ) -> libc::c_int;
2798}
2799unsafe extern "C" {
2800 #[doc = " Returns the number of pixels that should be removed from the four edges.\n Because of the way this data is stored, you have to pass the image size at the moment of the crop operation\n to compute the cropped border sizes.\n If 'propertyId==0', it returns the first clap property found."]
2801 pub fn heif_item_get_property_transform_crop_borders(
2802 context: *const heif_context,
2803 itemId: heif_item_id,
2804 propertyId: heif_property_id,
2805 image_width: libc::c_int,
2806 image_height: libc::c_int,
2807 left: *mut libc::c_int,
2808 top: *mut libc::c_int,
2809 right: *mut libc::c_int,
2810 bottom: *mut libc::c_int,
2811 );
2812}
2813unsafe extern "C" {
2814 #[doc = " @param context The heif_context for the file\n @param itemId The image item id to which this property belongs.\n @param fourcc_type The short four-cc type of the property to add.\n @param uuid_type If fourcc_type=='uuid', this should point to a 16-byte UUID type. It is ignored otherwise and can be NULL.\n @param data Data to insert for this property (including a full-box header, if required for this box).\n @param size Length of data in bytes.\n @param is_essential Whether this property is essential (boolean).\n @param out_propertyId Outputs the id of the inserted property. Can be NULL."]
2815 pub fn heif_item_add_raw_property(
2816 context: *const heif_context,
2817 itemId: heif_item_id,
2818 fourcc_type: u32,
2819 uuid_type: *const u8,
2820 data: *const u8,
2821 size: usize,
2822 is_essential: libc::c_int,
2823 out_propertyId: *mut heif_property_id,
2824 ) -> heif_error;
2825}
2826unsafe extern "C" {
2827 pub fn heif_item_get_property_raw_size(
2828 context: *const heif_context,
2829 itemId: heif_item_id,
2830 propertyId: heif_property_id,
2831 out_size: *mut usize,
2832 ) -> heif_error;
2833}
2834unsafe extern "C" {
2835 #[doc = " @param out_data User-supplied array to write the property data to. The required size of the output array is given by heif_item_get_property_raw_size()."]
2836 pub fn heif_item_get_property_raw_data(
2837 context: *const heif_context,
2838 itemId: heif_item_id,
2839 propertyId: heif_property_id,
2840 out_data: *mut u8,
2841 ) -> heif_error;
2842}
2843unsafe extern "C" {
2844 #[doc = " Get the extended type for an extended \"uuid\" box.\n\n This provides the UUID for the extended box.\n\n This method should only be called on properties of type `heif_item_property_type_uuid`.\n\n @param context the heif_context containing the HEIF file\n @param itemId the image item id to which this property belongs.\n @param propertyId the property index (1-based) to get the extended type for\n @param out_extended_type output of the call, must be a pointer to at least 16-bytes.\n @return heif_error_success or an error indicating the failure"]
2845 pub fn heif_item_get_property_uuid_type(
2846 context: *const heif_context,
2847 itemId: heif_item_id,
2848 propertyId: heif_property_id,
2849 out_extended_type: *mut [u8; 16usize],
2850 ) -> heif_error;
2851}
2852#[doc = " --- Bayer / filter array pattern (cpat box)"]
2853#[repr(C)]
2854#[derive(Debug, Copy, Clone)]
2855pub struct heif_bayer_pattern_pixel {
2856 pub component_id: u32,
2857 pub component_gain: f32,
2858}
2859unsafe extern "C" {
2860 #[doc = " Set a Bayer / filter array pattern on an image.\n The pattern is a 2D array of component indices with dimensions pattern_width x pattern_height.\n The number of entries in patternPixels must be pattern_width * pattern_height.\n The component_index values are indices into the cmpd component definition table.\n On the encoder path, these indices are generated by heif_image_add_component() and the\n encoder adds reference components to cmpd for pattern entries that don't have image planes.\n On the decoder path, they come directly from the cpat box."]
2861 pub fn heif_image_set_bayer_pattern(
2862 arg1: *mut heif_image,
2863 bayer_component_id: u32,
2864 pattern_width: u16,
2865 pattern_height: u16,
2866 patternPixels: *const heif_bayer_pattern_pixel,
2867 ) -> heif_error;
2868}
2869unsafe extern "C" {
2870 #[doc = " Add a reference-only component to the image's component description table for use as\n a Bayer pattern entry. The component is registered (its component_type appears in the\n cmpd box) but carries no pixel plane of its own — the actual pixel data lives in the\n single combined Bayer component (added with heif_image_add_component()).\n\n Use this for the per-cell colors that the Bayer pattern references (e.g. red, green,\n blue) when those colors have no standalone plane. Pass the returned component_id in\n heif_bayer_pattern_pixel::component_id of the patternPixels array given to\n heif_image_set_bayer_pattern().\n\n component_type: one of heif_cmpd_component_type_* (e.g. _red, _green, _blue).\n out_component_id: receives the minted component id. Must not be NULL."]
2871 pub fn heif_image_add_bayer_component(
2872 arg1: *mut heif_image,
2873 component_type: u16,
2874 out_component_id: *mut u32,
2875 ) -> heif_error;
2876}
2877unsafe extern "C" {
2878 #[doc = " Returns whether the image has a Bayer / filter array pattern.\n If the image has a pattern, out_pattern_width and out_pattern_height are set.\n Either output pointer may be NULL if the caller does not need that value."]
2879 pub fn heif_image_get_bayer_pattern_size(
2880 arg1: *const heif_image,
2881 bayer_component_id: u32,
2882 out_pattern_width: *mut u16,
2883 out_pattern_height: *mut u16,
2884 ) -> libc::c_int;
2885}
2886unsafe extern "C" {
2887 #[doc = " Get the Bayer / filter array pattern pixels.\n The caller must provide an array large enough for pattern_width * pattern_height entries\n (use heif_image_get_bayer_pattern_size() to query the dimensions first).\n Returns heif_error_Ok on success, or an error if no pattern is set."]
2888 pub fn heif_image_get_bayer_pattern(
2889 arg1: *const heif_image,
2890 bayer_component_id: u32,
2891 out_patternPixels: *mut heif_bayer_pattern_pixel,
2892 ) -> heif_error;
2893}
2894unsafe extern "C" {
2895 #[doc = " Returns a float with the 0xFFFFFFFF bit pattern (NaN) representing \"no polarization filter\"."]
2896 pub fn heif_polarization_angle_no_filter() -> f32;
2897}
2898unsafe extern "C" {
2899 #[doc = " Returns non-zero if the given angle has the \"no filter\" bit pattern (0xFFFFFFFF)."]
2900 pub fn heif_polarization_angle_is_no_filter(angle: f32) -> libc::c_int;
2901}
2902unsafe extern "C" {
2903 #[doc = " Add a polarization pattern to an image.\n component_indices: array of component indices this pattern applies to (may be NULL if num_component_indices == 0,\n meaning the pattern applies to all components).\n polarization_angles: array of pattern_width * pattern_height float values.\n Each is an angle in degrees [0.0, 360.0), or heif_polarization_angle_no_filter() for \"no filter\".\n Multiple patterns can be added (one per distinct component group)."]
2904 pub fn heif_image_add_polarization_pattern(
2905 arg1: *mut heif_image,
2906 num_component_indices: u32,
2907 component_indices: *const u32,
2908 pattern_width: u16,
2909 pattern_height: u16,
2910 polarization_angles: *const f32,
2911 ) -> heif_error;
2912}
2913unsafe extern "C" {
2914 #[doc = " Returns the number of polarization patterns on this image (0 if none)."]
2915 pub fn heif_image_get_number_of_polarization_patterns(arg1: *const heif_image) -> libc::c_int;
2916}
2917unsafe extern "C" {
2918 #[doc = " Get the sizes/dimensions of a polarization pattern (to allocate arrays for the data query)."]
2919 pub fn heif_image_get_polarization_pattern_info(
2920 arg1: *const heif_image,
2921 pattern_index: libc::c_int,
2922 out_num_component_indices: *mut u32,
2923 out_pattern_width: *mut u16,
2924 out_pattern_height: *mut u16,
2925 ) -> heif_error;
2926}
2927unsafe extern "C" {
2928 #[doc = " Get the actual data of a polarization pattern.\n Caller must provide pre-allocated arrays:\n out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)\n out_polarization_angles: pattern_width * pattern_height entries"]
2929 pub fn heif_image_get_polarization_pattern_data(
2930 arg1: *const heif_image,
2931 pattern_index: libc::c_int,
2932 out_component_indices: *mut u32,
2933 out_polarization_angles: *mut f32,
2934 ) -> heif_error;
2935}
2936unsafe extern "C" {
2937 #[doc = " Find the polarization pattern index that applies to a given component index.\n Returns the pattern index (>= 0), or -1 if no pattern matches.\n A pattern with an empty component list (component_count == 0) matches all components."]
2938 pub fn heif_image_get_polarization_pattern_index_for_component(
2939 arg1: *const heif_image,
2940 component_index: u32,
2941 ) -> libc::c_int;
2942}
2943#[doc = " --- Sensor bad pixels map (ISO 23001-17, Section 6.1.7)"]
2944#[repr(C)]
2945#[derive(Debug, Copy, Clone)]
2946pub struct heif_bad_pixel {
2947 pub row: u32,
2948 pub column: u32,
2949}
2950unsafe extern "C" {
2951 #[doc = " Add a sensor bad pixels map to an image.\n component_indices: array of component indices this map applies to (may be NULL if num_component_indices == 0,\n meaning the map applies to all components).\n Multiple maps can be added (one per distinct component group with different defects)."]
2952 pub fn heif_image_add_sensor_bad_pixels_map(
2953 arg1: *mut heif_image,
2954 num_component_indices: u32,
2955 component_indices: *const u32,
2956 correction_applied: libc::c_int,
2957 num_bad_rows: u32,
2958 bad_rows: *const u32,
2959 num_bad_columns: u32,
2960 bad_columns: *const u32,
2961 num_bad_pixels: u32,
2962 bad_pixels: *const heif_bad_pixel,
2963 ) -> heif_error;
2964}
2965unsafe extern "C" {
2966 #[doc = " Returns the number of sensor bad pixels maps on this image (0 if none)."]
2967 pub fn heif_image_get_number_of_sensor_bad_pixels_maps(arg1: *const heif_image) -> libc::c_int;
2968}
2969unsafe extern "C" {
2970 #[doc = " Get the sizes of a sensor bad pixels map (to allocate arrays for the data query)."]
2971 pub fn heif_image_get_sensor_bad_pixels_map_info(
2972 arg1: *const heif_image,
2973 map_index: libc::c_int,
2974 out_num_component_indices: *mut u32,
2975 out_correction_applied: *mut libc::c_int,
2976 out_num_bad_rows: *mut u32,
2977 out_num_bad_columns: *mut u32,
2978 out_num_bad_pixels: *mut u32,
2979 ) -> heif_error;
2980}
2981unsafe extern "C" {
2982 #[doc = " Get the actual data of a sensor bad pixels map.\n Caller must provide pre-allocated arrays:\n out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)\n out_bad_rows: num_bad_rows entries (may be NULL if num_bad_rows == 0)\n out_bad_columns: num_bad_columns entries (may be NULL if num_bad_columns == 0)\n out_bad_pixels: num_bad_pixels entries (may be NULL if num_bad_pixels == 0)"]
2983 pub fn heif_image_get_sensor_bad_pixels_map_data(
2984 arg1: *const heif_image,
2985 map_index: libc::c_int,
2986 out_component_indices: *mut u32,
2987 out_bad_rows: *mut u32,
2988 out_bad_columns: *mut u32,
2989 out_bad_pixels: *mut heif_bad_pixel,
2990 ) -> heif_error;
2991}
2992unsafe extern "C" {
2993 #[doc = " Add a sensor non-uniformity correction table to an image.\n component_indices: array of component indices this NUC applies to (may be NULL if num_component_indices == 0,\n meaning it applies to all components).\n nuc_gains and nuc_offsets: arrays of image_width * image_height float values.\n Correction equation: y = nuc_gain * x + nuc_offset.\n Multiple NUC tables can be added (one per distinct component group)."]
2994 pub fn heif_image_add_sensor_nuc(
2995 arg1: *mut heif_image,
2996 num_component_indices: u32,
2997 component_indices: *const u32,
2998 nuc_is_applied: libc::c_int,
2999 image_width: u32,
3000 image_height: u32,
3001 nuc_gains: *const f32,
3002 nuc_offsets: *const f32,
3003 ) -> heif_error;
3004}
3005unsafe extern "C" {
3006 #[doc = " Returns the number of sensor NUC tables on this image (0 if none)."]
3007 pub fn heif_image_get_number_of_sensor_nucs(arg1: *const heif_image) -> libc::c_int;
3008}
3009unsafe extern "C" {
3010 #[doc = " Get the sizes of a sensor NUC table (to allocate arrays for the data query)."]
3011 pub fn heif_image_get_sensor_nuc_info(
3012 arg1: *const heif_image,
3013 nuc_index: libc::c_int,
3014 out_num_component_indices: *mut u32,
3015 out_nuc_is_applied: *mut libc::c_int,
3016 out_image_width: *mut u32,
3017 out_image_height: *mut u32,
3018 ) -> heif_error;
3019}
3020unsafe extern "C" {
3021 #[doc = " Get the actual data of a sensor NUC table.\n Caller must provide pre-allocated arrays:\n out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)\n out_nuc_gains: image_width * image_height entries\n out_nuc_offsets: image_width * image_height entries"]
3022 pub fn heif_image_get_sensor_nuc_data(
3023 arg1: *const heif_image,
3024 nuc_index: libc::c_int,
3025 out_component_indices: *mut u32,
3026 out_nuc_gains: *mut f32,
3027 out_nuc_offsets: *mut f32,
3028 ) -> heif_error;
3029}
3030#[doc = " values 0-5 according to ISO 23091-2 / ITU-T H.273"]
3031pub const heif_chroma420_sample_location_heif_chroma420_sample_location_00_05:
3032 heif_chroma420_sample_location = 0;
3033#[doc = " values 0-5 according to ISO 23091-2 / ITU-T H.273"]
3034pub const heif_chroma420_sample_location_heif_chroma420_sample_location_05_05:
3035 heif_chroma420_sample_location = 1;
3036#[doc = " values 0-5 according to ISO 23091-2 / ITU-T H.273"]
3037pub const heif_chroma420_sample_location_heif_chroma420_sample_location_00_00:
3038 heif_chroma420_sample_location = 2;
3039#[doc = " values 0-5 according to ISO 23091-2 / ITU-T H.273"]
3040pub const heif_chroma420_sample_location_heif_chroma420_sample_location_05_00:
3041 heif_chroma420_sample_location = 3;
3042#[doc = " values 0-5 according to ISO 23091-2 / ITU-T H.273"]
3043pub const heif_chroma420_sample_location_heif_chroma420_sample_location_00_10:
3044 heif_chroma420_sample_location = 4;
3045#[doc = " values 0-5 according to ISO 23091-2 / ITU-T H.273"]
3046pub const heif_chroma420_sample_location_heif_chroma420_sample_location_05_10:
3047 heif_chroma420_sample_location = 5;
3048#[doc = " value 6 according to ISO 23001-17"]
3049pub const heif_chroma420_sample_location_heif_chroma420_sample_location_00_00_01_00:
3050 heif_chroma420_sample_location = 6;
3051#[doc = " --- Chroma sample location (ISO 23091-2 / ITU-T H.273 + ISO 23001-17, Section 6.1.4) [cloc box]"]
3052pub type heif_chroma420_sample_location = libc::c_uint;
3053unsafe extern "C" {
3054 #[doc = " Set the chroma sample location on an image.\n chroma_location must be in the range 0-6 (see heif_chroma420_sample_location)."]
3055 pub fn heif_image_set_chroma_location(arg1: *mut heif_image, chroma_location: u8)
3056 -> heif_error;
3057}
3058unsafe extern "C" {
3059 #[doc = " Returns non-zero if the image has a chroma sample location set."]
3060 pub fn heif_image_has_chroma_location(arg1: *const heif_image) -> libc::c_int;
3061}
3062unsafe extern "C" {
3063 #[doc = " Returns the chroma sample location (0-6), or 0 if none is set."]
3064 pub fn heif_image_get_chroma_location(arg1: *const heif_image) -> u8;
3065}
3066#[doc = " ------------------------- intrinsic and extrinsic matrices -------------------------"]
3067#[repr(C)]
3068#[derive(Debug, Copy, Clone)]
3069pub struct heif_camera_intrinsic_matrix {
3070 pub focal_length_x: f64,
3071 pub focal_length_y: f64,
3072 pub principal_point_x: f64,
3073 pub principal_point_y: f64,
3074 pub skew: f64,
3075}
3076unsafe extern "C" {
3077 pub fn heif_image_handle_has_camera_intrinsic_matrix(
3078 handle: *const heif_image_handle,
3079 ) -> libc::c_int;
3080}
3081unsafe extern "C" {
3082 pub fn heif_image_handle_get_camera_intrinsic_matrix(
3083 handle: *const heif_image_handle,
3084 out_matrix: *mut heif_camera_intrinsic_matrix,
3085 ) -> heif_error;
3086}
3087#[repr(C)]
3088#[derive(Debug)]
3089pub struct heif_camera_extrinsic_matrix {
3090 _unused: [u8; 0],
3091}
3092unsafe extern "C" {
3093 pub fn heif_image_handle_has_camera_extrinsic_matrix(
3094 handle: *const heif_image_handle,
3095 ) -> libc::c_int;
3096}
3097unsafe extern "C" {
3098 pub fn heif_image_handle_get_camera_extrinsic_matrix(
3099 handle: *const heif_image_handle,
3100 out_matrix: *mut *mut heif_camera_extrinsic_matrix,
3101 ) -> heif_error;
3102}
3103unsafe extern "C" {
3104 pub fn heif_camera_extrinsic_matrix_release(arg1: *mut heif_camera_extrinsic_matrix);
3105}
3106unsafe extern "C" {
3107 pub fn heif_camera_extrinsic_matrix_get_rotation_matrix(
3108 arg1: *const heif_camera_extrinsic_matrix,
3109 out_matrix_row_major: *mut f64,
3110 ) -> heif_error;
3111}
3112#[repr(C)]
3113#[derive(Debug)]
3114pub struct heif_region_item {
3115 _unused: [u8; 0],
3116}
3117#[doc = " Point geometry.\n\n The region is represented by a single point."]
3118pub const heif_region_type_heif_region_type_point: heif_region_type = 0;
3119#[doc = " Rectangle geometry.\n\n The region is represented by a top left position, and a size defined\n by a width and height. All of the interior points and the edge are\n part of the region."]
3120pub const heif_region_type_heif_region_type_rectangle: heif_region_type = 1;
3121#[doc = " Ellipse geometry.\n\n The region is represented by a centre point, and radii in the X and\n Y directions. All of the interior points and the edge are part of the\n region."]
3122pub const heif_region_type_heif_region_type_ellipse: heif_region_type = 2;
3123#[doc = " Polygon geometry.\n\n The region is represented by a sequence of points, which is considered\n implicitly closed. All of the interior points and the edge are part\n of the region."]
3124pub const heif_region_type_heif_region_type_polygon: heif_region_type = 3;
3125#[doc = " Reference mask.\n\n The region geometry is described by the pixels in another image item,\n which has a item reference of type `mask` from the region item to the\n image item containing the mask.\n\n The image item containing the mask is one of:\n\n - a mask item (see ISO/IEC 23008-12:2022 Section 6.10.2), or a derived\n image from a mask item\n\n - an image item in monochrome format (4:0:0 chroma)\n\n - an image item in colour format with luma and chroma planes (e.g. 4:2:0)\n\n If the pixel value is equal to the minimum sample value (e.g. 0 for unsigned\n integer), the pixel is not part of the region. If the pixel value is equal\n to the maximum sample value (e.g. 255 for 8 bit unsigned integer), the pixel\n is part of the region. If the pixel value is between the minimum sample value\n and maximum sample value, the pixel value represents an (application defined)\n probability that the pixel is part of the region, where higher pixel values\n correspond to higher probability values."]
3126pub const heif_region_type_heif_region_type_referenced_mask: heif_region_type = 4;
3127#[doc = " Inline mask.\n\n The region geometry is described by a sequence of bits stored in inline\n in the region, one bit per pixel. If the bit value is `1`, the pixel is\n part of the region. If the bit value is `0`, the pixel is not part of the\n region."]
3128pub const heif_region_type_heif_region_type_inline_mask: heif_region_type = 5;
3129#[doc = " Polyline geometry.\n\n The region is represented by a sequence of points, which are not\n considered to form a closed surface. Only the edge is part of the region."]
3130pub const heif_region_type_heif_region_type_polyline: heif_region_type = 6;
3131#[doc = " Region type.\n\n Each region item will contain zero or more regions, which may have different geometry or\n mask representations."]
3132pub type heif_region_type = libc::c_uint;
3133#[repr(C)]
3134#[derive(Debug)]
3135pub struct heif_region {
3136 _unused: [u8; 0],
3137}
3138unsafe extern "C" {
3139 #[doc = " Get the number of region items that are attached to an image.\n\n @param image_handle the image handle for the image to query.\n @return the number of region items, which can be zero."]
3140 pub fn heif_image_handle_get_number_of_region_items(
3141 image_handle: *const heif_image_handle,
3142 ) -> libc::c_int;
3143}
3144unsafe extern "C" {
3145 #[doc = " Get the region item identifiers for the region items attached to an image.\n\n Possible usage (in C++):\n @code\n int numRegionItems = heif_image_handle_get_number_of_region_items(handle);\n if (numRegionItems > 0) {\n std::vector<heif_item_id> region_item_ids(numRegionItems);\n heif_image_handle_get_list_of_region_item_ids(handle, region_item_ids.data(), numRegionItems);\n // use region item ids\n }\n @endcode\n\n @param image_handle the image handle for the parent image to query\n @param region_item_ids_array array to put the item identifiers into\n @param max_count the maximum number of region identifiers\n @return the number of region item identifiers that were returned."]
3146 pub fn heif_image_handle_get_list_of_region_item_ids(
3147 image_handle: *const heif_image_handle,
3148 region_item_ids_array: *mut heif_item_id,
3149 max_count: libc::c_int,
3150 ) -> libc::c_int;
3151}
3152unsafe extern "C" {
3153 #[doc = " Get the region item.\n\n Caller is responsible for release of the output heif_region_item with heif_region_item_release().\n\n @param context the context to get the region item from, usually from a file operation\n @param region_item_id the identifier for the region item\n @param out pointer to pointer to the resulting region item\n @return heif_error_ok on success, or an error value indicating the problem"]
3154 pub fn heif_context_get_region_item(
3155 context: *const heif_context,
3156 region_item_id: heif_item_id,
3157 out: *mut *mut heif_region_item,
3158 ) -> heif_error;
3159}
3160unsafe extern "C" {
3161 #[doc = " Get the item identifier for a region item.\n\n @param region_item the region item to query\n @return the region item identifier (or 0 if the region_item is null)"]
3162 pub fn heif_region_item_get_id(region_item: *mut heif_region_item) -> heif_item_id;
3163}
3164unsafe extern "C" {
3165 #[doc = " Release a region item.\n\n This should be called on items from heif_context_get_region_item().\n\n @param region_item the item to release."]
3166 pub fn heif_region_item_release(region_item: *mut heif_region_item);
3167}
3168unsafe extern "C" {
3169 #[doc = " Get the reference size for a region item.\n\n The reference size specifies the coordinate space used for the region items.\n When the reference size does not match the image size, the regions need to be\n scaled to correspond.\n\n @param out_width the return value for the reference width (before any transformation)\n @param out_height the return value for the reference height (before any transformation)"]
3170 pub fn heif_region_item_get_reference_size(
3171 arg1: *mut heif_region_item,
3172 out_width: *mut u32,
3173 out_height: *mut u32,
3174 );
3175}
3176unsafe extern "C" {
3177 #[doc = " Get the number of regions within a region item.\n\n @param region_item the region item to query.\n @return the number of regions"]
3178 pub fn heif_region_item_get_number_of_regions(
3179 region_item: *const heif_region_item,
3180 ) -> libc::c_int;
3181}
3182unsafe extern "C" {
3183 #[doc = " Get the regions that are part of a region item.\n\n Caller is responsible for releasing the returned `heif_region` objects, using heif_region_release()\n on each region, or heif_region_release_many() on the returned array.\n\n Possible usage (in C++):\n @code\n int num_regions = heif_image_handle_get_number_of_regions(region_item);\n if (num_regions > 0) {\n std::vector<heif_region*> regions(num_regions);\n int n = heif_region_item_get_list_of_regions(region_item, regions.data(), (int)regions.size());\n // use regions\n heif_region_release_many(regions.data(), n);\n }\n @endcode\n\n @param region_item the region_item to query\n @param out_regions_array array to put the region pointers into\n @param max_count the maximum number of regions, which needs to correspond to the size of the out_regions_array\n @return the number of regions that were returned."]
3184 pub fn heif_region_item_get_list_of_regions(
3185 region_item: *const heif_region_item,
3186 out_regions_array: *mut *mut heif_region,
3187 max_count: libc::c_int,
3188 ) -> libc::c_int;
3189}
3190unsafe extern "C" {
3191 #[doc = " Release a region.\n\n This should be called on regions from heif_region_item_get_list_of_regions().\n\n @param region the region to release.\n\n \\sa heif_region_release_many() to release the whole list"]
3192 pub fn heif_region_release(region: *const heif_region);
3193}
3194unsafe extern "C" {
3195 #[doc = " Release a list of regions.\n\n This should be called on the list of regions from heif_region_item_get_list_of_regions().\n\n @param regions_array the regions to release.\n @param num_items the number of items in the array\n\n \\sa heif_region_release() to release a single region"]
3196 pub fn heif_region_release_many(
3197 regions_array: *const *const heif_region,
3198 num_items: libc::c_int,
3199 );
3200}
3201unsafe extern "C" {
3202 #[doc = " Get the region type for a specified region.\n\n @param region the region to query\n @return the corresponding region type as an enumeration value"]
3203 pub fn heif_region_get_type(region: *const heif_region) -> heif_region_type;
3204}
3205unsafe extern "C" {
3206 #[doc = " Get the values for a point region.\n\n This returns the coordinates in the reference coordinate space (from the parent region item).\n\n @param region the region to query, which must be of type #heif_region_type_point.\n @param out_x the X coordinate, where 0 is the left-most column.\n @param out_y the Y coordinate, where 0 is the top-most row.\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_point_transformed() for a version in pixels after all transformative properties have been applied."]
3207 pub fn heif_region_get_point(
3208 region: *const heif_region,
3209 out_x: *mut i32,
3210 out_y: *mut i32,
3211 ) -> heif_error;
3212}
3213unsafe extern "C" {
3214 #[doc = " Get the transformed values for a point region.\n\n This returns the coordinates in pixels after all transformative properties have been applied.\n\n @param region the region to query, which must be of type #heif_region_type_point.\n @param image_id the identifier for the image to transform / scale the region to\n @param out_x the X coordinate, where 0 is the left-most column.\n @param out_y the Y coordinate, where 0 is the top-most row.\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_point() for a version that returns the values in the reference coordinate space."]
3215 pub fn heif_region_get_point_transformed(
3216 region: *const heif_region,
3217 image_id: heif_item_id,
3218 out_x: *mut f64,
3219 out_y: *mut f64,
3220 ) -> heif_error;
3221}
3222unsafe extern "C" {
3223 #[doc = " Get the values for a rectangle region.\n\n This returns the values in the reference coordinate space (from the parent region item).\n The rectangle is represented by a top left corner position, and a size defined\n by a width and height. All of the interior points and the edge are\n part of the region.\n\n @param region the region to query, which must be of type #heif_region_type_rectangle.\n @param out_x the X coordinate for the top left corner, where 0 is the left-most column.\n @param out_y the Y coordinate for the top left corner, where 0 is the top-most row.\n @param out_width the width of the rectangle\n @param out_height the height of the rectangle\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_rectangle_transformed() for a version in pixels after all transformative properties have been applied."]
3224 pub fn heif_region_get_rectangle(
3225 region: *const heif_region,
3226 out_x: *mut i32,
3227 out_y: *mut i32,
3228 out_width: *mut u32,
3229 out_height: *mut u32,
3230 ) -> heif_error;
3231}
3232unsafe extern "C" {
3233 #[doc = " Get the transformed values for a rectangle region.\n\n This returns the coordinates in pixels after all transformative properties have been applied.\n The rectangle is represented by a top left corner position, and a size defined\n by a width and height. All of the interior points and the edge are\n part of the region.\n\n @param region the region to query, which must be of type #heif_region_type_rectangle.\n @param image_id the identifier for the image to transform / scale the region to\n @param out_x the X coordinate for the top left corner, where 0 is the left-most column.\n @param out_y the Y coordinate for the top left corner, where 0 is the top-most row.\n @param out_width the width of the rectangle\n @param out_height the height of the rectangle\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_rectangle() for a version that returns the values in the reference coordinate space."]
3234 pub fn heif_region_get_rectangle_transformed(
3235 region: *const heif_region,
3236 image_id: heif_item_id,
3237 out_x: *mut f64,
3238 out_y: *mut f64,
3239 out_width: *mut f64,
3240 out_height: *mut f64,
3241 ) -> heif_error;
3242}
3243unsafe extern "C" {
3244 #[doc = " Get the values for an ellipse region.\n\n This returns the values in the reference coordinate space (from the parent region item).\n The ellipse is represented by a centre position, and a size defined\n by radii in the X and Y directions. All of the interior points and the edge are\n part of the region.\n\n @param region the region to query, which must be of type #heif_region_type_ellipse.\n @param out_x the X coordinate for the centre point, where 0 is the left-most column.\n @param out_y the Y coordinate for the centre point, where 0 is the top-most row.\n @param out_radius_x the radius value in the X direction.\n @param out_radius_y the radius value in the Y direction\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_ellipse_transformed() for a version in pixels after all transformative properties have been applied."]
3245 pub fn heif_region_get_ellipse(
3246 region: *const heif_region,
3247 out_x: *mut i32,
3248 out_y: *mut i32,
3249 out_radius_x: *mut u32,
3250 out_radius_y: *mut u32,
3251 ) -> heif_error;
3252}
3253unsafe extern "C" {
3254 #[doc = " Get the transformed values for an ellipse region.\n\n This returns the coordinates in pixels after all transformative properties have been applied.\n The ellipse is represented by a centre position, and a size defined\n by radii in the X and Y directions. All of the interior points and the edge are\n part of the region.\n\n @param region the region to query, which must be of type #heif_region_type_ellipse.\n @param image_id the identifier for the image to transform / scale the region to\n @param out_x the X coordinate for the centre point, where 0 is the left-most column.\n @param out_y the Y coordinate for the centre point, where 0 is the top-most row.\n @param out_radius_x the radius value in the X direction.\n @param out_radius_y the radius value in the Y direction\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_ellipse() for a version that returns the values in the reference coordinate space."]
3255 pub fn heif_region_get_ellipse_transformed(
3256 region: *const heif_region,
3257 image_id: heif_item_id,
3258 out_x: *mut f64,
3259 out_y: *mut f64,
3260 out_radius_x: *mut f64,
3261 out_radius_y: *mut f64,
3262 ) -> heif_error;
3263}
3264unsafe extern "C" {
3265 #[doc = " Get the number of points in a polygon.\n\n @param region the region to query, which must be of type #heif_region_type_polygon\n @return the number of points, or -1 on error."]
3266 pub fn heif_region_get_polygon_num_points(region: *const heif_region) -> libc::c_int;
3267}
3268unsafe extern "C" {
3269 #[doc = " Get the points in a polygon region.\n\n This returns the values in the reference coordinate space (from the parent region item).\n\n A polygon is a sequence of points that form a closed shape. The first point does\n not need to be repeated as the last point. All of the interior points and the edge are\n part of the region.\n The points are returned as pairs of X,Y coordinates, in the order X<sub>1</sub>,\n Y<sub>1</sub>, X<sub>2</sub>, Y<sub>2</sub>, ..., X<sub>n</sub>, Y<sub>n</sub>.\n\n @param region the region to query, which must be of type #heif_region_type_polygon\n @param out_pts_array the array to return the points in, which must have twice as many entries as there are points\n in the polygon.\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_polygon_points_transformed() for a version in pixels after all transformative properties have been applied."]
3270 pub fn heif_region_get_polygon_points(
3271 region: *const heif_region,
3272 out_pts_array: *mut i32,
3273 ) -> heif_error;
3274}
3275unsafe extern "C" {
3276 #[doc = " Get the transformed points in a polygon region.\n\n This returns the coordinates in pixels after all transformative properties have been applied.\n\n A polygon is a sequence of points that form a closed shape. The first point does\n not need to be repeated as the last point. All of the interior points and the edge are\n part of the region.\n The points are returned as pairs of X,Y coordinates, in the order X<sub>1</sub>,\n Y<sub>1</sub>, X<sub>2</sub>, Y<sub>2</sub>, ..., X<sub>n</sub>, Y<sub>n</sub>.\n\n @param region the region to query, which must be of type #heif_region_type_polygon\n @param image_id the identifier for the image to transform / scale the region to\n @param out_pts_array the array to return the points in, which must have twice as many entries as there are points\n in the polygon.\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_polygon_points() for a version that returns the values in the reference coordinate space."]
3277 pub fn heif_region_get_polygon_points_transformed(
3278 region: *const heif_region,
3279 image_id: heif_item_id,
3280 out_pts_array: *mut f64,
3281 ) -> heif_error;
3282}
3283unsafe extern "C" {
3284 #[doc = " Get the number of points in a polyline.\n\n @param region the region to query, which must be of type #heif_region_type_polyline\n @return the number of points, or -1 on error."]
3285 pub fn heif_region_get_polyline_num_points(region: *const heif_region) -> libc::c_int;
3286}
3287unsafe extern "C" {
3288 #[doc = " Get the points in a polyline region.\n\n This returns the values in the reference coordinate space (from the parent region item).\n\n A polyline is a sequence of points that does not form a closed shape. Even if the\n polyline is closed, the only points that are part of the region are those that\n intersect (even minimally) a one-pixel line drawn along the polyline.\n The points are provided as pairs of X,Y coordinates, in the order X<sub>1</sub>,\n Y<sub>1</sub>, X<sub>2</sub>, Y<sub>2</sub>, ..., X<sub>n</sub>, Y<sub>n</sub>.\n\n Possible usage (in C++):\n @code\n int num_polyline_points = heif_region_get_polyline_num_points(region);\n if (num_polyline_points > 0) {\n std::vector<int32_t> polyline(num_polyline_points * 2);\n heif_region_get_polyline_points(region, polyline.data());\n // do something with points ...\n }\n @endcode\n\n @param region the region to query, which must be of type #heif_region_type_polyline\n @param out_pts_array the array to return the points in, which must have twice as many entries as there are points\n in the polyline.\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_polyline_points_transformed() for a version in pixels after all transformative properties have been applied."]
3289 pub fn heif_region_get_polyline_points(
3290 region: *const heif_region,
3291 out_pts_array: *mut i32,
3292 ) -> heif_error;
3293}
3294unsafe extern "C" {
3295 #[doc = " Get the transformed points in a polyline region.\n\n This returns the coordinates in pixels after all transformative properties have been applied.\n\n A polyline is a sequence of points that does not form a closed shape. Even if the\n polyline is closed, the only points that are part of the region are those that\n intersect (even minimally) a one-pixel line drawn along the polyline.\n The points are provided as pairs of X,Y coordinates, in the order X<sub>1</sub>,\n Y<sub>1</sub>, X<sub>2</sub>, Y<sub>2</sub>, ..., X<sub>n</sub>, Y<sub>n</sub>.\n\n @param region the region to query, which must be of type #heif_region_type_polyline\n @param image_id the identifier for the image to transform / scale the region to\n @param out_pts_array the array to return the points in, which must have twice as many entries as there are points\n in the polyline.\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\sa heif_region_get_polyline_points() for a version that returns the values in the reference coordinate space."]
3296 pub fn heif_region_get_polyline_points_transformed(
3297 region: *const heif_region,
3298 image_id: heif_item_id,
3299 out_pts_array: *mut f64,
3300 ) -> heif_error;
3301}
3302unsafe extern "C" {
3303 #[doc = " Get a referenced item mask region.\n\n This returns the values in the reference coordinate space (from the parent region item).\n The mask location is represented by a top left corner position, and a size defined\n by a width and height. The value of each sample in that mask identifies whether the\n corresponding pixel is part of the region.\n\n The mask is provided as an image in another item. The image item containing the mask\n is one of:\n\n - a mask item (see ISO/IEC 23008-12:2022 Section 6.10.2), or a derived\n image from a mask item\n\n - an image item in monochrome format (4:0:0 chroma)\n\n - an image item in colour format with luma and chroma planes (e.g. 4:2:0)\n\n If the pixel value is equal to the minimum sample value (e.g. 0 for unsigned\n integer), the pixel is not part of the region. If the pixel value is equal\n to the maximum sample value (e.g. 255 for 8 bit unsigned integer), the pixel\n is part of the region. If the pixel value is between the minimum sample value\n and maximum sample value, the pixel value represents an (application defined)\n probability that the pixel is part of the region, where higher pixel values\n correspond to higher probability values.\n\n @param region the region to query, which must be of type #heif_region_type_referenced_mask.\n @param out_x the X coordinate for the top left corner, where 0 is the left-most column.\n @param out_y the Y coordinate for the top left corner, where 0 is the top-most row.\n @param out_width the width of the mask region\n @param out_height the height of the mask region\n @param out_mask_item_id the item identifier for the image that provides the mask.\n @return heif_error_ok on success, or an error value indicating the problem on failure"]
3304 pub fn heif_region_get_referenced_mask_ID(
3305 region: *const heif_region,
3306 out_x: *mut i32,
3307 out_y: *mut i32,
3308 out_width: *mut u32,
3309 out_height: *mut u32,
3310 out_mask_item_id: *mut heif_item_id,
3311 ) -> heif_error;
3312}
3313unsafe extern "C" {
3314 #[doc = " Get the length of the data in an inline mask region.\n\n @param region the region to query, which must be of type #heif_region_type_inline_mask.\n @return the number of bytes in the mask data, or 0 on error."]
3315 pub fn heif_region_get_inline_mask_data_len(region: *const heif_region) -> usize;
3316}
3317unsafe extern "C" {
3318 #[doc = " Get data for an inline mask region.\n\n This returns the values in the reference coordinate space (from the parent region item).\n The mask location is represented by a top left corner position, and a size defined\n by a width and height.\n\n The mask is held as inline data on the region, one bit per pixel, most significant\n bit first pixel, no padding. If the bit value is `1`, the corresponding pixel is\n part of the region. If the bit value is `0`, the corresponding pixel is not part of the\n region.\n\n Possible usage (in C++):\n @code\n long unsigned int data_len = heif_region_get_inline_mask_data_len(region);\n int32_t x, y;\n uint32_t width, height;\n std::vector<uint8_t> mask_data(data_len);\n err = heif_region_get_inline_mask(region, &x, &y, &width, &height, mask_data.data());\n @endcode\n\n @param region the region to query, which must be of type #heif_region_type_inline_mask.\n @param out_x the X coordinate for the top left corner, where 0 is the left-most column.\n @param out_y the Y coordinate for the top left corner, where 0 is the top-most row.\n @param out_width the width of the mask region\n @param out_height the height of the mask region\n @param out_mask_data the location to return the mask data\n @return heif_error_ok on success, or an error value indicating the problem on failure"]
3319 pub fn heif_region_get_inline_mask_data(
3320 region: *const heif_region,
3321 out_x: *mut i32,
3322 out_y: *mut i32,
3323 out_width: *mut u32,
3324 out_height: *mut u32,
3325 out_mask_data: *mut u8,
3326 ) -> heif_error;
3327}
3328unsafe extern "C" {
3329 #[doc = " Get a mask region image.\n\n This returns the values in the reference coordinate space (from the parent region item).\n The mask location is represented by a top left corner position, and a size defined\n by a width and height.\n\n This function works when the passed region is either a heif_region_type_referenced_mask or\n a heif_region_type_inline_mask.\n The returned image is a monochrome image where each pixel represents the (scaled) probability\n of the pixel being part of the mask.\n\n If the region type is an inline mask, which always holds a binary mask, this function\n converts the binary inline mask to an 8-bit monochrome image with the values '0' and '255'.\n The pixel value is set to `255` where the pixel is part of the region, and `0` where the\n pixel is not part of the region.\n\n @param region the region to query, which must be of type #heif_region_type_inline_mask.\n @param out_x the X coordinate for the top left corner, where 0 is the left-most column.\n @param out_y the Y coordinate for the top left corner, where 0 is the top-most row.\n @param out_width the width of the mask region\n @param out_height the height of the mask region\n @param out_mask_image the returned mask image\n @return heif_error_ok on success, or an error value indicating the problem on failure\n\n \\note the caller is responsible for releasing the mask image"]
3330 pub fn heif_region_get_mask_image(
3331 region: *const heif_region,
3332 out_x: *mut i32,
3333 out_y: *mut i32,
3334 out_width: *mut u32,
3335 out_height: *mut u32,
3336 out_mask_image: *mut *mut heif_image,
3337 ) -> heif_error;
3338}
3339unsafe extern "C" {
3340 #[doc = " Add a region item to an image.\n\n The region item is a collection of regions (point, polyline, polygon, rectangle, ellipse or mask)\n along with a reference size (width and height) that forms the coordinate basis for the regions.\n\n The concept is to add the region item, then add one or more regions to the region item.\n\n @param image_handle the image to attach the region item to.\n @param reference_width the width of the reference size.\n @param reference_height the height of the reference size.\n @param out_region_item the resulting region item\n @return heif_error_ok on success, or an error indicating the problem on failure"]
3341 pub fn heif_image_handle_add_region_item(
3342 image_handle: *mut heif_image_handle,
3343 reference_width: u32,
3344 reference_height: u32,
3345 out_region_item: *mut *mut heif_region_item,
3346 ) -> heif_error;
3347}
3348unsafe extern "C" {
3349 #[doc = " Add a point region to the region item.\n\n @param region_item the region item that holds this point region\n @param x the x value for the point location\n @param y the y value for the point location\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error indicating the problem on failure\n\n @note The `out_region` parameter is optional, and can be set to `NULL` if not needed."]
3350 pub fn heif_region_item_add_region_point(
3351 region_item: *mut heif_region_item,
3352 x: i32,
3353 y: i32,
3354 out_region: *mut *mut heif_region,
3355 ) -> heif_error;
3356}
3357unsafe extern "C" {
3358 #[doc = " Add a rectangle region to the region item.\n\n @param region_item the region item that holds this rectangle region\n @param x the x value for the top-left corner of this rectangle region\n @param y the y value for the top-left corner of this rectangle region\n @param width the width of this rectangle region\n @param height the height of this rectangle region\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error indicating the problem on failure\n\n @note The `out_region` parameter is optional, and can be set to `NULL` if not needed."]
3359 pub fn heif_region_item_add_region_rectangle(
3360 region_item: *mut heif_region_item,
3361 x: i32,
3362 y: i32,
3363 width: u32,
3364 height: u32,
3365 out_region: *mut *mut heif_region,
3366 ) -> heif_error;
3367}
3368unsafe extern "C" {
3369 #[doc = " Add a ellipse region to the region item.\n\n @param region_item the region item that holds this ellipse region\n @param x the x value for the centre of this ellipse region\n @param y the y value for the centre of this ellipse region\n @param radius_x the radius of the ellipse in the X (horizontal) direction\n @param radius_y the radius of the ellipse in the Y (vertical) direction\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error indicating the problem on failure\n\n @note The `out_region` parameter is optional, and can be set to `NULL` if not needed."]
3370 pub fn heif_region_item_add_region_ellipse(
3371 region_item: *mut heif_region_item,
3372 x: i32,
3373 y: i32,
3374 radius_x: u32,
3375 radius_y: u32,
3376 out_region: *mut *mut heif_region,
3377 ) -> heif_error;
3378}
3379unsafe extern "C" {
3380 #[doc = " Add a polygon region to the region item.\n\n A polygon is a sequence of points that form a closed shape. The first point does\n not need to be repeated as the last point.\n The points are provided as pairs of X,Y coordinates, in the order X<sub>1</sub>,\n Y<sub>1</sub>, X<sub>2</sub>, Y<sub>2</sub>, ..., X<sub>n</sub>, Y<sub>n</sub>.\n\n @param region_item the region item that holds this polygon region\n @param pts_array the array of points in X,Y order (see above)\n @param nPoints the number of points\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error indicating the problem on failure\n\n @note `nPoints` is the number of points, not the number of elements in the array\n @note The `out_region` parameter is optional, and can be set to `NULL` if not needed."]
3381 pub fn heif_region_item_add_region_polygon(
3382 region_item: *mut heif_region_item,
3383 pts_array: *const i32,
3384 nPoints: libc::c_int,
3385 out_region: *mut *mut heif_region,
3386 ) -> heif_error;
3387}
3388unsafe extern "C" {
3389 #[doc = " Add a polyline region to the region item.\n\n A polyline is a sequence of points that does not form a closed shape. Even if the\n polyline is closed, the only points that are part of the region are those that\n intersect (even minimally) a one-pixel line drawn along the polyline.\n The points are provided as pairs of X,Y coordinates, in the order X<sub>1</sub>,\n Y<sub>1</sub>, X<sub>2</sub>, Y<sub>2</sub>, ..., X<sub>n</sub>, Y<sub>n</sub>.\n\n @param region_item the region item that holds this polyline region\n @param pts_array the array of points in X,Y order (see above)\n @param nPoints the number of points\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error indicating the problem on failure\n\n @note `nPoints` is the number of points, not the number of elements in the array\n @note The `out_region` parameter is optional, and can be set to `NULL` if not needed."]
3390 pub fn heif_region_item_add_region_polyline(
3391 region_item: *mut heif_region_item,
3392 pts_array: *const i32,
3393 nPoints: libc::c_int,
3394 out_region: *mut *mut heif_region,
3395 ) -> heif_error;
3396}
3397unsafe extern "C" {
3398 #[doc = " Add a referenced mask region to the region item.\n\n The region geometry is described by the pixels in another image item,\n which has a item reference of type `mask` from the region item to the\n image item containing the mask.\n\n The image item containing the mask is one of:\n\n - a mask item (see ISO/IEC 23008-12:2022 Section 6.10.2), or a derived\n image from a mask item\n\n - an image item in monochrome format (4:0:0 chroma)\n\n - an image item in colour format with luma and chroma planes (e.g. 4:2:0)\n\n If the pixel value is equal to the minimum sample value (e.g. 0 for unsigned\n integer), the pixel is not part of the region. If the pixel value is equal\n to the maximum sample value (e.g. 255 for 8 bit unsigned integer), the pixel\n is part of the region. If the pixel value is between the minimum sample value\n and maximum sample value, the pixel value represents an (application defined)\n probability that the pixel is part of the region, where higher pixel values\n correspond to higher probability values.\n\n @param region_item the region item that holds this mask region\n @param x the x value for the top-left corner of this mask region\n @param y the y value for the top-left corner of this mask region\n @param width the width of this mask region\n @param height the height of this mask region\n @param mask_item_id the item identifier for the mask that is referenced\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error indicating the problem on failure\n\n @note The `out_region` parameter is optional, and can be set to `NULL` if not needed."]
3399 pub fn heif_region_item_add_region_referenced_mask(
3400 region_item: *mut heif_region_item,
3401 x: i32,
3402 y: i32,
3403 width: u32,
3404 height: u32,
3405 mask_item_id: heif_item_id,
3406 out_region: *mut *mut heif_region,
3407 ) -> heif_error;
3408}
3409unsafe extern "C" {
3410 #[doc = " Add an inline mask region to the region item.\n\n The region geometry is described by a top left corner position, and a size defined\n by a width and height.\n\n The mask is held as inline data on the region, one bit per pixel, most significant\n bit first pixel, no padding. If the bit value is `1`, the corresponding pixel is\n part of the region. If the bit value is `0`, the corresponding pixel is not part of the\n region.\n\n @param region_item the region item that holds this mask region\n @param x the x value for the top-left corner of this mask region\n @param y the y value for the top-left corner of this mask region\n @param width the width of this mask region\n @param height the height of this mask region\n @param mask_data the location to return the mask data\n @param mask_data_len the length of the mask data, in bytes\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error value indicating the problem on failure"]
3411 pub fn heif_region_item_add_region_inline_mask_data(
3412 region_item: *mut heif_region_item,
3413 x: i32,
3414 y: i32,
3415 width: u32,
3416 height: u32,
3417 mask_data: *const u8,
3418 mask_data_len: usize,
3419 out_region: *mut *mut heif_region,
3420 ) -> heif_error;
3421}
3422unsafe extern "C" {
3423 #[doc = " Add an inline mask region image to the region item.\n\n The region geometry is described by a top left corner position, and a size defined\n by a width and height.\n\n The mask data is held as inline data on the region, one bit per pixel. The provided\n image is converted to inline data, where any pixel with a value >= 0x80 becomes part of the\n mask region. If the image width is less that the specified width, it is expanded\n to match the width of the region (zero fill on the right). If the image height is\n less than the specified height, it is expanded to match the height of the region\n (zero fill on the bottom). If the image width or height is greater than the\n width or height (correspondingly) of the region, the image is cropped.\n\n @param region_item the region item that holds this mask region\n @param x the x value for the top-left corner of this mask region\n @param y the y value for the top-left corner of this mask region\n @param width the width of this mask region\n @param height the height of this mask region\n @param image the image to convert to an inline mask\n @param out_region pointer to pointer to the returned region (optional, see below)\n @return heif_error_ok on success, or an error value indicating the problem on failure"]
3424 pub fn heif_region_item_add_region_inline_mask(
3425 region_item: *mut heif_region_item,
3426 x: i32,
3427 y: i32,
3428 width: u32,
3429 height: u32,
3430 image: *mut heif_image,
3431 out_region: *mut *mut heif_region,
3432 ) -> heif_error;
3433}
3434unsafe extern "C" {
3435 #[doc = " Gets the number of items.\n\n This is not the same as the number of images, since there can be other types of items,\n such as metadata.\n\n @param ctx the file context\n @return the number of items"]
3436 pub fn heif_context_get_number_of_items(ctx: *const heif_context) -> libc::c_int;
3437}
3438unsafe extern "C" {
3439 #[doc = " Get the item identifiers.\n\n Fills in the item IDs into the user-supplied array {@code ID_array}, preallocated with {@code count} entries.\n\n @param ctx the file context\n @param ID_array the output array.\n @param count the number of items allocated within {@code ID_array}.\n @return the total number of IDs filled into the array, which may be less than {@code count}."]
3440 pub fn heif_context_get_list_of_item_IDs(
3441 ctx: *const heif_context,
3442 ID_array: *mut heif_item_id,
3443 count: libc::c_int,
3444 ) -> libc::c_int;
3445}
3446unsafe extern "C" {
3447 #[doc = " Gets the item type.\n\n Usually, this is a four character code (e.g. `mime` or `uri `), but it can theoretically be\n any 4-byte number. Thus, the type is returned as an integer. You can use #heif_fourcc to map\n between the two representations.\n\n @param ctx the file context\n @param item_id the item identifier for the item\n @return the item type"]
3448 pub fn heif_item_get_item_type(ctx: *const heif_context, item_id: heif_item_id) -> u32;
3449}
3450unsafe extern "C" {
3451 pub fn heif_item_is_item_hidden(ctx: *const heif_context, item_id: heif_item_id)
3452 -> libc::c_int;
3453}
3454unsafe extern "C" {
3455 #[doc = " Gets the MIME content_type for an item.\n\n Only valid if the item type is `mime`.\n If the item does not exist, or if it is not a `mime` item, NULL is returned.\n\n @param ctx the file context\n @param item_id the item identifier for the item\n @return the item content_type"]
3456 pub fn heif_item_get_mime_item_content_type(
3457 ctx: *const heif_context,
3458 item_id: heif_item_id,
3459 ) -> *const libc::c_char;
3460}
3461unsafe extern "C" {
3462 #[doc = " Gets the content_encoding for a MIME item.\n\n Only valid if the item type is `mime`.\n If the item does not exist, or if it is not a `mime` item, NULL is returned.\n\n If the item is not encoded, the returned value will be an empty string (not null).\n\n @param ctx the file context\n @param item_id the item identifier for the item\n @return the item content_type"]
3463 pub fn heif_item_get_mime_item_content_encoding(
3464 ctx: *const heif_context,
3465 item_id: heif_item_id,
3466 ) -> *const libc::c_char;
3467}
3468unsafe extern "C" {
3469 #[doc = " Gets the item_uri_type for an item.\n\n Only valid if the item type is `uri `.\n If the item does not exist, or if it is not a `uri ` item, NULL is returned.\n\n @param ctx the file context\n @param item_id the item identifier for the item\n @return the item item_uri_type"]
3470 pub fn heif_item_get_uri_item_uri_type(
3471 ctx: *const heif_context,
3472 item_id: heif_item_id,
3473 ) -> *const libc::c_char;
3474}
3475unsafe extern "C" {
3476 pub fn heif_item_get_item_name(
3477 ctx: *const heif_context,
3478 item_id: heif_item_id,
3479 ) -> *const libc::c_char;
3480}
3481unsafe extern "C" {
3482 pub fn heif_item_set_item_name(
3483 ctx: *mut heif_context,
3484 item: heif_item_id,
3485 item_name: *const libc::c_char,
3486 ) -> heif_error;
3487}
3488unsafe extern "C" {
3489 #[doc = " Gets the raw metadata, as stored in the HEIF file.\n\n Data in a \"mime\" item with \"content_encoding\" can be compressed.\n When `out_compression_format` is NULL, the decompressed data will be returned.\n Otherwise, the compressed data is returned and `out_compression_format` will be filled with the\n compression format.\n If the compression method is not supported, an error will be returned.\n\n It is valid to set `out_data` to NULL. In that case, only the `out_data_size` is filled.\n Note that it is inefficient to use `out_data=NULL` just to get the size of compressed data.\n In general, this should be avoided.\n\n If there is no data assigned to the item or there is an error, `out_data_size` is set to zero.\n\n @param ctx the file context\n @param item_id the item identifier for the item\n @param out_compression_format how the data is compressed. If the pointer is NULL, the decompressed data will be returned.\n @param out_data the corresponding raw metadata\n @param out_data_size the size of the metadata in bytes\n @return whether the call succeeded, or there was an error"]
3490 pub fn heif_item_get_item_data(
3491 ctx: *const heif_context,
3492 item_id: heif_item_id,
3493 out_compression_format: *mut heif_metadata_compression,
3494 out_data: *mut *mut u8,
3495 out_data_size: *mut usize,
3496 ) -> heif_error;
3497}
3498unsafe extern "C" {
3499 #[doc = " Free the item data.\n\n This is used to free memory associated with the data returned by\n {@link heif_item_get_item_data} in 'out_data' and set the pointer to NULL.\n\n @param ctx the file context\n @param item_data the data to free"]
3500 pub fn heif_release_item_data(ctx: *const heif_context, item_data: *mut *mut u8);
3501}
3502unsafe extern "C" {
3503 #[doc = " Get the extended language associated with the item.\n The item is usually a text item.\n\n @param context the heif file context containg the item.\n @param itemId the identifier for the item\n @param out_language output parameter with the item's language. Free with heif_string_release().\n @return heif_error_ok on success, or an error value indicating the problem"]
3504 pub fn heif_item_get_property_extended_language(
3505 context: *const heif_context,
3506 itemId: heif_item_id,
3507 out_language: *mut *mut libc::c_char,
3508 ) -> heif_error;
3509}
3510unsafe extern "C" {
3511 pub fn heif_item_set_property_extended_language(
3512 context: *mut heif_context,
3513 item_id: heif_item_id,
3514 language: *const libc::c_char,
3515 out_optional_propertyId: *mut heif_property_id,
3516 ) -> heif_error;
3517}
3518unsafe extern "C" {
3519 #[doc = " Get the item ids that reference the given item.\n\n @param ctx the file context.\n @param from_item_id the item identifier for the item.\n @param index the index of the reference to get.\n @param out_reference_type_4cc The 4cc of the reference. (e.g dimg, thmb, cdsc, or auxl)\n @param out_references_to the item references. Use {@link heif_release_item_references} to free the memory.\n @return the number of items that reference the given item. Returns 0 if the index exceeds the number of references."]
3520 pub fn heif_context_get_item_references(
3521 ctx: *const heif_context,
3522 from_item_id: heif_item_id,
3523 index: libc::c_int,
3524 out_reference_type_4cc: *mut u32,
3525 out_references_to: *mut *mut heif_item_id,
3526 ) -> usize;
3527}
3528unsafe extern "C" {
3529 pub fn heif_release_item_references(
3530 ctx: *const heif_context,
3531 references: *mut *mut heif_item_id,
3532 );
3533}
3534unsafe extern "C" {
3535 pub fn heif_context_add_item_reference(
3536 ctx: *mut heif_context,
3537 reference_type: u32,
3538 from_item: heif_item_id,
3539 to_item: heif_item_id,
3540 ) -> heif_error;
3541}
3542unsafe extern "C" {
3543 pub fn heif_context_add_item_references(
3544 ctx: *mut heif_context,
3545 reference_type: u32,
3546 from_item: heif_item_id,
3547 to_item: *const heif_item_id,
3548 num_to_items: libc::c_int,
3549 ) -> heif_error;
3550}
3551unsafe extern "C" {
3552 #[doc = " ------------------------- adding new items -------------------------"]
3553 pub fn heif_context_add_item(
3554 ctx: *mut heif_context,
3555 item_type: *const libc::c_char,
3556 data: *const libc::c_void,
3557 size: libc::c_int,
3558 out_item_id: *mut heif_item_id,
3559 ) -> heif_error;
3560}
3561unsafe extern "C" {
3562 pub fn heif_context_add_mime_item(
3563 ctx: *mut heif_context,
3564 content_type: *const libc::c_char,
3565 content_encoding: heif_metadata_compression,
3566 data: *const libc::c_void,
3567 size: libc::c_int,
3568 out_item_id: *mut heif_item_id,
3569 ) -> heif_error;
3570}
3571unsafe extern "C" {
3572 pub fn heif_context_add_precompressed_mime_item(
3573 ctx: *mut heif_context,
3574 content_type: *const libc::c_char,
3575 content_encoding: *const libc::c_char,
3576 data: *const libc::c_void,
3577 size: libc::c_int,
3578 out_item_id: *mut heif_item_id,
3579 ) -> heif_error;
3580}
3581unsafe extern "C" {
3582 pub fn heif_context_add_uri_item(
3583 ctx: *mut heif_context,
3584 item_uri_type: *const libc::c_char,
3585 data: *const libc::c_void,
3586 size: libc::c_int,
3587 out_item_id: *mut heif_item_id,
3588 ) -> heif_error;
3589}
3590unsafe extern "C" {
3591 #[doc = " Check whether there is an image sequence in the HEIF file.\n\n @return A boolean whether there is an image sequence in the HEIF file."]
3592 pub fn heif_context_has_sequence(arg1: *const heif_context) -> libc::c_int;
3593}
3594unsafe extern "C" {
3595 #[doc = " Get the timescale (clock ticks per second) for timing values in the sequence.\n\n @note Each track may have its independent timescale.\n\n @return Clock ticks per second. Returns 0 if there is no sequence in the file."]
3596 pub fn heif_context_get_sequence_timescale(arg1: *const heif_context) -> u32;
3597}
3598unsafe extern "C" {
3599 #[doc = " Get the total duration of the sequence in timescale clock ticks.\n Use `heif_context_get_sequence_timescale()` to get the clock ticks per second.\n\n @return Sequence duration in clock ticks. Returns 0 if there is no sequence in the file."]
3600 pub fn heif_context_get_sequence_duration(arg1: *const heif_context) -> u64;
3601}
3602#[repr(C)]
3603#[derive(Debug)]
3604pub struct heif_track {
3605 _unused: [u8; 0],
3606}
3607unsafe extern "C" {
3608 #[doc = " Free a `heif_track` object received from libheif.\n Passing NULL is ok."]
3609 pub fn heif_track_release(arg1: *mut heif_track);
3610}
3611unsafe extern "C" {
3612 #[doc = " Get the number of tracks in the HEIF file.\n\n @return Number of tracks or 0 if there is no sequence in the HEIF file."]
3613 pub fn heif_context_number_of_sequence_tracks(arg1: *const heif_context) -> libc::c_int;
3614}
3615unsafe extern "C" {
3616 #[doc = " Returns the IDs for each of the tracks stored in the HEIF file.\n\n The caller MUST allocate `out_track_id_array` with exactly\n heif_context_number_of_sequence_tracks() entries. The function writes\n that many IDs unconditionally. Passing a smaller array results in a\n buffer overflow (undefined behavior); there is no capacity parameter\n and no truncation."]
3617 pub fn heif_context_get_track_ids(
3618 ctx: *const heif_context,
3619 out_track_id_array: *mut [u32; 0usize],
3620 );
3621}
3622unsafe extern "C" {
3623 #[doc = " Get the ID of the passed track.\n The track ID will never be 0."]
3624 pub fn heif_track_get_id(track: *const heif_track) -> u32;
3625}
3626unsafe extern "C" {
3627 #[doc = " Get the heif_track object for the given track ID.\n If you pass `id=0`, the first visual track will be returned.\n If there is no track with the given ID or if 0 is passed and there is no visual track, NULL will be returned.\n\n @note Tracks never have a zero ID. This is why we can use this as a special value to find the first visual track.\n\n @param id Track id or 0 for the first visual track.\n @return heif_track object. You must free this after use.\n/\n// Use id=0 for the first visual track."]
3628 pub fn heif_context_get_track(arg1: *const heif_context, id: u32) -> *mut heif_track;
3629}
3630pub type heif_track_type = u32;
3631pub const heif_track_type_4cc_heif_track_type_video: heif_track_type_4cc = 1986618469;
3632pub const heif_track_type_4cc_heif_track_type_image_sequence: heif_track_type_4cc = 1885954932;
3633pub const heif_track_type_4cc_heif_track_type_auxiliary: heif_track_type_4cc = 1635088502;
3634pub const heif_track_type_4cc_heif_track_type_metadata: heif_track_type_4cc = 1835365473;
3635pub type heif_track_type_4cc = libc::c_uint;
3636unsafe extern "C" {
3637 #[doc = " Get the four-cc track handler type.\n Typical codes are \"vide\" for video sequences, \"pict\" for image sequences, \"meta\" for metadata tracks.\n These are defined in heif_track_type_4cc, but files may also contain other types.\n\n @return four-cc handler type"]
3638 pub fn heif_track_get_track_handler_type(arg1: *const heif_track) -> heif_track_type;
3639}
3640pub const heif_auxiliary_track_info_type_heif_auxiliary_track_info_type_unknown:
3641 heif_auxiliary_track_info_type = 0;
3642pub const heif_auxiliary_track_info_type_heif_auxiliary_track_info_type_alpha:
3643 heif_auxiliary_track_info_type = 1;
3644pub type heif_auxiliary_track_info_type = libc::c_uint;
3645unsafe extern "C" {
3646 pub fn heif_track_get_auxiliary_info_type(
3647 arg1: *const heif_track,
3648 ) -> heif_auxiliary_track_info_type;
3649}
3650unsafe extern "C" {
3651 pub fn heif_track_get_auxiliary_info_type_urn(arg1: *const heif_track) -> *const libc::c_char;
3652}
3653unsafe extern "C" {
3654 pub fn heif_track_has_alpha_channel(arg1: *const heif_track) -> libc::c_int;
3655}
3656unsafe extern "C" {
3657 #[doc = " Get the timescale (clock ticks per second) for this track.\n Note that this can be different from the timescale used at sequence level.\n\n @return clock ticks per second"]
3658 pub fn heif_track_get_timescale(arg1: *const heif_track) -> u32;
3659}
3660unsafe extern "C" {
3661 #[doc = " How many times the media segment should be played according to the track's edit list.\n\n Returns:\n - 0 if an edit list box is present but follows a pattern libheif does not interpret\n as a loop count. Callers should fall back to a single playback in that case.\n - 1 when no edit list is present. The media plays exactly once.\n - `heif_sequence_track_number_of_repetitions_infinite` (= UINT32_MAX) when the file\n signals indefinite playback (mvhd duration is the all-1s sentinel together with an\n editlist in repeat mode), or when the repetition count does not fit in uint32_t.\n - Otherwise the number of times the media segment is played.\n\n The reported value is informational; it does not change how\n `heif_track_decode_next_image()` walks samples. By default, that function applies\n the edit list and (for repeated playback) returns samples for every requested\n repetition; iterating until end-of-sequence on an infinite-loop file therefore\n never terminates.\n\n Clients that want to handle repetition themselves (e.g. to honor an \"infinite\"\n value with their own looping policy or to enforce an application-level cap) should\n set `heif_decoding_options::ignore_sequence_editlist` when calling\n `heif_track_decode_next_image()`. With that flag set, libheif plays the media\n timeline exactly once. Use the value returned by this function to decide how often\n to replay the track at the application level."]
3662 pub fn heif_track_get_number_of_repetitions(arg1: *const heif_track) -> u32;
3663}
3664unsafe extern "C" {
3665 #[doc = " Get the image resolution of the track.\n If the passed track is no visual track, an error is returned."]
3666 pub fn heif_track_get_image_resolution(
3667 arg1: *const heif_track,
3668 out_width: *mut u16,
3669 out_height: *mut u16,
3670 ) -> heif_error;
3671}
3672unsafe extern "C" {
3673 #[doc = " Decode the next image in the passed sequence track.\n If there is no more image in the sequence, `heif_error_End_of_sequence` is returned.\n The parameters `colorspace`, `chroma` and `options` are similar to heif_decode_image().\n If you want to let libheif decide the output colorspace and chroma, set these parameters\n to heif_colorspace_undefined / heif_chroma_undefined. Usually, libheif will return the\n image in the input colorspace, but it may also modify it for example when it has to rotate the image.\n If you want to get the image in a specific colorspace/chroma format, you can specify this\n and libheif will convert the image to match this format."]
3674 pub fn heif_track_decode_next_image(
3675 track: *mut heif_track,
3676 out_img: *mut *mut heif_image,
3677 colorspace: heif_colorspace,
3678 chroma: heif_chroma,
3679 options: *const heif_decoding_options,
3680 ) -> heif_error;
3681}
3682unsafe extern "C" {
3683 #[doc = " Get the image display duration in clock ticks of this track.\n Make sure to use the timescale of the track and not the timescale of the total sequence."]
3684 pub fn heif_image_get_duration(arg1: *const heif_image) -> u32;
3685}
3686unsafe extern "C" {
3687 #[doc = " Get the \"sample entry type\" of the first sample sample cluster in the track.\n In the case of metadata tracks, this will usually be \"urim\" for \"URI Meta Sample Entry\".\n The exact URI can then be obtained with 'heif_track_get_urim_sample_entry_uri_of_first_cluster'."]
3688 pub fn heif_track_get_sample_entry_type_of_first_cluster(arg1: *const heif_track) -> u32;
3689}
3690unsafe extern "C" {
3691 #[doc = " Get the URI of the first sample cluster in an 'urim' track.\n Only call this for tracks with 'urim' sample entry types. It will return an error otherwise.\n\n @param out_uri A string with the URI will be returned. Free this string with `heif_string_release()`."]
3692 pub fn heif_track_get_urim_sample_entry_uri_of_first_cluster(
3693 arg1: *const heif_track,
3694 out_uri: *mut *const libc::c_char,
3695 ) -> heif_error;
3696}
3697#[repr(C)]
3698#[derive(Debug)]
3699pub struct heif_raw_sequence_sample {
3700 _unused: [u8; 0],
3701}
3702unsafe extern "C" {
3703 #[doc = " Get the next raw sample from the (metadata) sequence track.\n You have to free the returned sample with heif_raw_sequence_sample_release()."]
3704 pub fn heif_track_get_next_raw_sequence_sample(
3705 arg1: *mut heif_track,
3706 out_sample: *mut *mut heif_raw_sequence_sample,
3707 ) -> heif_error;
3708}
3709unsafe extern "C" {
3710 #[doc = " Release a heif_raw_sequence_sample object.\n You may pass NULL."]
3711 pub fn heif_raw_sequence_sample_release(arg1: *mut heif_raw_sequence_sample);
3712}
3713unsafe extern "C" {
3714 #[doc = " Get a pointer to the data of the (metadata) sample.\n The data pointer stays valid until the heif_raw_sequence_sample object is released.\n\n @param out_array_size Size of the returned array (may be NULL)."]
3715 pub fn heif_raw_sequence_sample_get_data(
3716 arg1: *const heif_raw_sequence_sample,
3717 out_array_size: *mut usize,
3718 ) -> *const u8;
3719}
3720unsafe extern "C" {
3721 #[doc = " Return the size of the raw data contained in the sample.\n This is the same as returned through the 'out_array_size' parameter of 'heif_raw_sequence_sample_get_data()'."]
3722 pub fn heif_raw_sequence_sample_get_data_size(arg1: *const heif_raw_sequence_sample) -> usize;
3723}
3724unsafe extern "C" {
3725 #[doc = " Get the sample duration in clock ticks of this track.\n Make sure to use the timescale of the track and not the timescale of the total sequence."]
3726 pub fn heif_raw_sequence_sample_get_duration(arg1: *const heif_raw_sequence_sample) -> u32;
3727}
3728unsafe extern "C" {
3729 #[doc = " Set an independent global timescale for the sequence.\n If no timescale is set with this function, the timescale of the first track will be used."]
3730 pub fn heif_context_set_sequence_timescale(arg1: *mut heif_context, timescale: u32);
3731}
3732unsafe extern "C" {
3733 #[doc = " Number of times the sequence should be played in total (default = 1).\n Can be set to heif_sequence_maximum_number_of_repetitions."]
3734 pub fn heif_context_set_number_of_sequence_repetitions(
3735 arg1: *mut heif_context,
3736 number_of_repetitions: u32,
3737 );
3738}
3739pub const heif_sample_aux_info_presence_heif_sample_aux_info_presence_none:
3740 heif_sample_aux_info_presence = 0;
3741pub const heif_sample_aux_info_presence_heif_sample_aux_info_presence_optional:
3742 heif_sample_aux_info_presence = 1;
3743pub const heif_sample_aux_info_presence_heif_sample_aux_info_presence_mandatory:
3744 heif_sample_aux_info_presence = 2;
3745#[doc = " Specifies whether a 'sample auxiliary info' is stored with the samples.\n The difference between `heif_sample_aux_info_presence_optional` and `heif_sample_aux_info_presence_mandatory`\n is that `heif_sample_aux_info_presence_mandatory` will throw an error if the data is missing when writing a sample."]
3746pub type heif_sample_aux_info_presence = libc::c_uint;
3747#[repr(C)]
3748#[derive(Debug)]
3749pub struct heif_track_options {
3750 _unused: [u8; 0],
3751}
3752unsafe extern "C" {
3753 #[doc = " Allocate track options object that is required to set options for a new track.\n When you create a new track, you can also pass a NULL heif_track_options pointer, in which case the default options are used."]
3754 pub fn heif_track_options_alloc() -> *mut heif_track_options;
3755}
3756unsafe extern "C" {
3757 pub fn heif_track_options_release(arg1: *mut heif_track_options);
3758}
3759unsafe extern "C" {
3760 #[doc = " Set the track specific timescale. This is the number of clock ticks per second.\n The default is 90,000 Hz.\n @param timescale"]
3761 pub fn heif_track_options_set_timescale(arg1: *mut heif_track_options, timescale: u32);
3762}
3763unsafe extern "C" {
3764 #[doc = " Set whether the aux-info data should be stored interleaved with the sequence samples.\n Default is: false.\n\n If 'true', the aux_info data blocks will be interleaved with the compressed image.\n This has the advantage that the aux_info is localized near the image data.\n\n If 'false', all aux_info will be written as one block after the compressed image data.\n This has the advantage that no aux_info offsets have to be written.\n\n Note: currently ignored. Interleaved writing is disabled."]
3765 pub fn heif_track_options_set_interleaved_sample_aux_infos(
3766 arg1: *mut heif_track_options,
3767 interleaved_flag: libc::c_int,
3768 );
3769}
3770unsafe extern "C" {
3771 pub fn heif_track_options_enable_sample_tai_timestamps(
3772 arg1: *mut heif_track_options,
3773 arg2: *const heif_tai_clock_info,
3774 arg3: heif_sample_aux_info_presence,
3775 ) -> heif_error;
3776}
3777unsafe extern "C" {
3778 pub fn heif_track_options_enable_sample_gimi_content_ids(
3779 arg1: *mut heif_track_options,
3780 arg2: heif_sample_aux_info_presence,
3781 );
3782}
3783unsafe extern "C" {
3784 #[doc = " Set the GIMI format track ID string. If NULL is passed, no track ID is saved.\n @param track_id"]
3785 pub fn heif_track_options_set_gimi_track_id(
3786 arg1: *mut heif_track_options,
3787 track_id: *const libc::c_char,
3788 );
3789}
3790#[doc = " Only independently decodable keyframes."]
3791pub const heif_sequence_gop_structure_heif_sequence_gop_structure_intra_only:
3792 heif_sequence_gop_structure = 0;
3793#[doc = " No frame reordering, usually an IPPPP structure."]
3794pub const heif_sequence_gop_structure_heif_sequence_gop_structure_lowdelay:
3795 heif_sequence_gop_structure = 1;
3796#[doc = " All frame types are allowed, including frame reordering, to achieve\n the best compression ratio."]
3797pub const heif_sequence_gop_structure_heif_sequence_gop_structure_unrestricted:
3798 heif_sequence_gop_structure = 2;
3799#[doc = " --- writing visual tracks"]
3800pub type heif_sequence_gop_structure = libc::c_uint;
3801pub const heif_sequence_content_kind_heif_sequence_content_kind_auto: heif_sequence_content_kind =
3802 0;
3803pub const heif_sequence_content_kind_heif_sequence_content_kind_image_sequence:
3804 heif_sequence_content_kind = 1;
3805pub const heif_sequence_content_kind_heif_sequence_content_kind_video: heif_sequence_content_kind =
3806 2;
3807#[doc = " Describes the intent of the encoded sequence content. Encoder plugins may\n use this to choose different default tunings (e.g. perceptual quality vs.\n rate-distortion) for slide-show-style image sequences vs. video.\n\n Pass `_auto` to let libheif pick a value. Today libheif derives the kind\n from the track's handler type (`pict` -> image_sequence, `vide` -> video);\n in the future it may use additional input signals (e.g. frame rate or\n frame-to-frame similarity). Plugins never see `_auto`: libheif resolves it\n to a concrete kind before passing the options to the encoder plugin."]
3808pub type heif_sequence_content_kind = libc::c_uint;
3809#[repr(C)]
3810#[derive(Debug)]
3811pub struct heif_sequence_encoding_options {
3812 pub version: u8,
3813 #[doc = " Set this to the NCLX parameters to be used in the output images or set to NULL\n when the same parameters as in the input images should be used."]
3814 pub output_nclx_profile: *const heif_color_profile_nclx,
3815 pub color_conversion_options: heif_color_conversion_options,
3816 #[doc = " version 2 options"]
3817 pub gop_structure: heif_sequence_gop_structure,
3818 #[doc = " 0 - undefined"]
3819 pub keyframe_distance_min: libc::c_int,
3820 #[doc = " 0 - undefined"]
3821 pub keyframe_distance_max: libc::c_int,
3822 pub save_alpha_channel: libc::c_int,
3823 #[doc = " Intent of the encoded content. Encoder plugins may use this to choose\n different tunings for slide-show-style image sequences vs. video.\n Set to `_auto` (the default) to let libheif pick. libheif resolves the\n value to a concrete kind before passing the options to the encoder\n plugin, so plugins never see `_auto`."]
3824 pub content_kind: heif_sequence_content_kind,
3825}
3826unsafe extern "C" {
3827 pub fn heif_sequence_encoding_options_alloc() -> *mut heif_sequence_encoding_options;
3828}
3829unsafe extern "C" {
3830 #[doc = " Copy fields from `src` into `dst`, respecting both structs' version numbers.\n Only fields present in `min(dst->version, src->version)` are copied, so this\n is safe when libheif and the caller were built against different header\n versions of `heif_sequence_encoding_options`. Pass NULL `src` to leave `dst`\n unchanged."]
3831 pub fn heif_sequence_encoding_options_copy(
3832 dst: *mut heif_sequence_encoding_options,
3833 src: *const heif_sequence_encoding_options,
3834 );
3835}
3836unsafe extern "C" {
3837 pub fn heif_sequence_encoding_options_release(arg1: *mut heif_sequence_encoding_options);
3838}
3839unsafe extern "C" {
3840 #[doc = " Add a visual track to the sequence.\n The track ID is assigned automatically.\n\n @param width Image resolution width\n @param height Image resolution height\n @param track_type Has to be heif_track_type_video or heif_track_type_image_sequence\n @param track_options Optional track creation options. If NULL, default options will be used.\n @param encoding_options Options for sequence encoding. If NULL, default options will be used.\n @param out_track Output parameter to receive the track object for the just created track.\n @return"]
3841 pub fn heif_context_add_visual_sequence_track(
3842 arg1: *mut heif_context,
3843 width: u16,
3844 height: u16,
3845 track_type: heif_track_type,
3846 track_options: *const heif_track_options,
3847 encoding_options: *const heif_sequence_encoding_options,
3848 out_track: *mut *mut heif_track,
3849 ) -> heif_error;
3850}
3851unsafe extern "C" {
3852 #[doc = " Set the image display duration in the track's timescale units."]
3853 pub fn heif_image_set_duration(arg1: *mut heif_image, duration: u32);
3854}
3855unsafe extern "C" {
3856 #[doc = " Encode the image into a visual track.\n If the passed track is no visual track, an error will be returned.\n\n @param image The input image to append to the sequence.\n @param encoder The encoder used for encoding the image.\n @param sequence_encoding_options Options for sequence encoding. If NULL, default options will be used."]
3857 pub fn heif_track_encode_sequence_image(
3858 arg1: *mut heif_track,
3859 image: *const heif_image,
3860 encoder: *mut heif_encoder,
3861 sequence_encoding_options: *const heif_sequence_encoding_options,
3862 ) -> heif_error;
3863}
3864unsafe extern "C" {
3865 #[doc = " When all sequence frames have been sent, you can to call this function to let the\n library know that no more frames will follow. This is strongly recommended, but optional\n for backwards compatibility.\n If you do not end the sequence explicitly with this function, it will be closed\n automatically when the HEIF file is written. Using this function has the advantage\n that you can free the {@link heif_encoder} afterwards (with {@link heif_encoder_release}).\n If you do not use call function, you have to keep the {@link heif_encoder} alive\n until the HEIF file is written."]
3866 pub fn heif_track_encode_end_of_sequence(
3867 arg1: *mut heif_track,
3868 encoder: *mut heif_encoder,
3869 ) -> heif_error;
3870}
3871unsafe extern "C" {
3872 #[doc = " Add a metadata track.\n The track is created as a 'urim' \"URI Meta Sample Entry\".\n The track content type is specified by the 'uri' parameter.\n\n @param uri Track content type.\n @param options Optional track creation options. If NULL, default options will be used.\n @param out_track Returns the created track object. If this is not NULL, you have to\n free the returned track with {@link heif_track_release}."]
3873 pub fn heif_context_add_uri_metadata_sequence_track(
3874 arg1: *mut heif_context,
3875 uri: *const libc::c_char,
3876 options: *const heif_track_options,
3877 out_track: *mut *mut heif_track,
3878 ) -> heif_error;
3879}
3880unsafe extern "C" {
3881 #[doc = " Allocate a new heif_raw_sequence_sample object.\n Free with heif_raw_sequence_sample_release()."]
3882 pub fn heif_raw_sequence_sample_alloc() -> *mut heif_raw_sequence_sample;
3883}
3884unsafe extern "C" {
3885 #[doc = " Set the raw sequence sample data."]
3886 pub fn heif_raw_sequence_sample_set_data(
3887 arg1: *mut heif_raw_sequence_sample,
3888 data: *const u8,
3889 size: usize,
3890 ) -> heif_error;
3891}
3892unsafe extern "C" {
3893 #[doc = " Set the sample duration in track timescale units."]
3894 pub fn heif_raw_sequence_sample_set_duration(
3895 arg1: *mut heif_raw_sequence_sample,
3896 duration: u32,
3897 );
3898}
3899unsafe extern "C" {
3900 #[doc = " Add a raw sequence sample (usually a metadata sample) to the (metadata) track."]
3901 pub fn heif_track_add_raw_sequence_sample(
3902 arg1: *mut heif_track,
3903 arg2: *const heif_raw_sequence_sample,
3904 ) -> heif_error;
3905}
3906#[doc = " Contains the type of sample auxiliary data assigned to the track samples."]
3907#[repr(C)]
3908#[derive(Debug, Copy, Clone)]
3909pub struct heif_sample_aux_info_type {
3910 pub type_: u32,
3911 pub parameter: u32,
3912}
3913unsafe extern "C" {
3914 #[doc = " Returns how many different types of sample auxiliary data units are assigned to this track's samples."]
3915 pub fn heif_track_get_number_of_sample_aux_infos(arg1: *const heif_track) -> libc::c_int;
3916}
3917unsafe extern "C" {
3918 #[doc = " Get get the list of sample auxiliary data types used in the track.\n The passed array has to have heif_track_get_number_of_sample_aux_infos() entries."]
3919 pub fn heif_track_get_sample_aux_info_types(
3920 arg1: *const heif_track,
3921 out_types: *mut [heif_sample_aux_info_type; 0usize],
3922 );
3923}
3924unsafe extern "C" {
3925 #[doc = " Get the GIMI content ID for the track (as a whole).\n If there is no content ID, nullptr is returned.\n\n @return The returned string has to be released with `heif_string_release()`."]
3926 pub fn heif_track_get_gimi_track_content_id(arg1: *const heif_track) -> *const libc::c_char;
3927}
3928unsafe extern "C" {
3929 #[doc = " Get the GIMI content ID stored in the image sample.\n If there is no content ID, NULL is returned.\n @return"]
3930 pub fn heif_image_get_gimi_sample_content_id(arg1: *const heif_image) -> *const libc::c_char;
3931}
3932unsafe extern "C" {
3933 #[doc = " Get the GIMI content ID stored in the metadata sample.\n If there is no content ID, NULL is returned.\n @return"]
3934 pub fn heif_raw_sequence_sample_get_gimi_sample_content_id(
3935 arg1: *const heif_raw_sequence_sample,
3936 ) -> *const libc::c_char;
3937}
3938unsafe extern "C" {
3939 #[doc = " Set the GIMI content ID for an image sample. It will be stored as SAI.\n When passing NULL, a previously set ID will be removed."]
3940 pub fn heif_image_set_gimi_sample_content_id(
3941 arg1: *mut heif_image,
3942 contentID: *const libc::c_char,
3943 );
3944}
3945unsafe extern "C" {
3946 #[doc = " Set the GIMI content ID for a (metadata) sample. It will be stored as SAI.\n When passing NULL, a previously set ID will be removed."]
3947 pub fn heif_raw_sequence_sample_set_gimi_sample_content_id(
3948 arg1: *mut heif_raw_sequence_sample,
3949 contentID: *const libc::c_char,
3950 );
3951}
3952unsafe extern "C" {
3953 #[doc = " Returns whether the raw (metadata) sample has a TAI timestamp attached to it (stored as SAI).\n\n @return boolean flag whether a TAI exists for this sample."]
3954 pub fn heif_raw_sequence_sample_has_tai_timestamp(
3955 arg1: *const heif_raw_sequence_sample,
3956 ) -> libc::c_int;
3957}
3958unsafe extern "C" {
3959 #[doc = " Get the TAI timestamp of the (metadata) sample.\n If there is no timestamp assigned to it, NULL will be returned.\n\n @note You should NOT free the returned timestamp with 'heif_tai_timestamp_packet_release()'.\n The returned struct stays valid until the heif_raw_sequence_sample is released."]
3960 pub fn heif_raw_sequence_sample_get_tai_timestamp(
3961 arg1: *const heif_raw_sequence_sample,
3962 ) -> *const heif_tai_timestamp_packet;
3963}
3964unsafe extern "C" {
3965 #[doc = " Set the TAI timestamp for a raw sequence sample.\n The timestamp will be copied, you can release it after calling this function."]
3966 pub fn heif_raw_sequence_sample_set_tai_timestamp(
3967 sample: *mut heif_raw_sequence_sample,
3968 timestamp: *const heif_tai_timestamp_packet,
3969 );
3970}
3971unsafe extern "C" {
3972 #[doc = " Returns the TAI clock info of the track.\n If there is no TAI clock info, NULL is returned.\n You should NOT free the returned heif_tai_clock_info.\n The structure stays valid until the heif_track object is released."]
3973 pub fn heif_track_get_tai_clock_info_of_first_cluster(
3974 arg1: *mut heif_track,
3975 ) -> *const heif_tai_clock_info;
3976}
3977#[doc = " track_description"]
3978pub const heif_track_reference_type_heif_track_reference_type_description:
3979 heif_track_reference_type = 1667527523;
3980#[doc = " thumbnails"]
3981pub const heif_track_reference_type_heif_track_reference_type_thumbnails:
3982 heif_track_reference_type = 1953000802;
3983#[doc = " auxiliary data (e.g. depth maps or alpha channel)"]
3984pub const heif_track_reference_type_heif_track_reference_type_auxiliary: heif_track_reference_type =
3985 1635088492;
3986#[doc = " --- track references"]
3987pub type heif_track_reference_type = libc::c_uint;
3988unsafe extern "C" {
3989 #[doc = " Add a reference between tracks.\n 'reference_type' can be one of the four-cc codes listed in heif_track_reference_type or any other type."]
3990 pub fn heif_track_add_reference_to_track(
3991 arg1: *mut heif_track,
3992 reference_type: u32,
3993 to_track: *const heif_track,
3994 );
3995}
3996unsafe extern "C" {
3997 #[doc = " Return the number of different reference types used in this track's tref box."]
3998 pub fn heif_track_get_number_of_track_reference_types(arg1: *const heif_track) -> usize;
3999}
4000unsafe extern "C" {
4001 #[doc = " List the reference types used in this track.\n\n The caller MUST allocate `out_reference_types` with exactly\n heif_track_get_number_of_track_reference_types() entries. The function\n writes that many values unconditionally. Passing a smaller array\n results in a buffer overflow (undefined behavior); there is no\n capacity parameter and no truncation."]
4002 pub fn heif_track_get_track_reference_types(
4003 arg1: *const heif_track,
4004 out_reference_types: *mut [u32; 0usize],
4005 );
4006}
4007unsafe extern "C" {
4008 #[doc = " Get the number of references of the passed type."]
4009 pub fn heif_track_get_number_of_track_reference_of_type(
4010 arg1: *const heif_track,
4011 reference_type: u32,
4012 ) -> usize;
4013}
4014unsafe extern "C" {
4015 #[doc = " List the track ids this track points to with the passed reference type.\n The passed array must have heif_track_get_number_of_track_reference_of_type() entries."]
4016 pub fn heif_track_get_references_from_track(
4017 arg1: *const heif_track,
4018 reference_type: u32,
4019 out_to_track_id: *mut [u32; 0usize],
4020 ) -> usize;
4021}
4022unsafe extern "C" {
4023 #[doc = " Find tracks that are referring to the current track through the passed reference_type.\n The found track IDs will be filled into the passed array, but no more than `array_size` entries will be filled.\n\n @return number of tracks found. If this is equal to 'array_size', you should ask again with a larger array size to be sure you got all tracks."]
4024 pub fn heif_track_find_referring_tracks(
4025 arg1: *const heif_track,
4026 reference_type: u32,
4027 out_track_id: *mut [u32; 0usize],
4028 array_size: usize,
4029 ) -> usize;
4030}
4031#[repr(C)]
4032#[derive(Debug, Copy, Clone)]
4033pub struct heif_tai_clock_info {
4034 pub version: u8,
4035 #[doc = " Standard deviation for timestamp generation process.\n May be `heif_tai_clock_info_time_uncertainty_unknown` if unknown."]
4036 pub time_uncertainty: u64,
4037 #[doc = " Receptor clock resolution in nanoseconds."]
4038 pub clock_resolution: u32,
4039 #[doc = " Clock drift rate in picoseconds/second when synchronization is stopped.\n Maybe `heif_tai_clock_info_clock_drift_rate_unknown` if unknown."]
4040 pub clock_drift_rate: i32,
4041 #[doc = " Whether clock is synchronized to an atomic source,\n see the clock_type defines below."]
4042 pub clock_type: u8,
4043}
4044unsafe extern "C" {
4045 #[doc = " Allocate a new heif_tai_clock_info object and initialize with default values."]
4046 pub fn heif_tai_clock_info_alloc() -> *mut heif_tai_clock_info;
4047}
4048unsafe extern "C" {
4049 #[doc = " Copies the source object into the destination object.\n Only the fields that are present in both objects are copied.\n The version property has to be set in both structs."]
4050 pub fn heif_tai_clock_info_copy(dst: *mut heif_tai_clock_info, src: *const heif_tai_clock_info);
4051}
4052unsafe extern "C" {
4053 pub fn heif_tai_clock_info_release(clock_info: *mut heif_tai_clock_info);
4054}
4055#[repr(C)]
4056#[derive(Debug, Copy, Clone)]
4057pub struct heif_tai_timestamp_packet {
4058 pub version: u8,
4059 #[doc = " number of nanoseconds since TAI epoch (1958-01-01T00:00:00.0)"]
4060 pub tai_timestamp: u64,
4061 #[doc = " bool"]
4062 pub synchronization_state: u8,
4063 #[doc = " bool"]
4064 pub timestamp_generation_failure: u8,
4065 #[doc = " bool"]
4066 pub timestamp_is_modified: u8,
4067}
4068unsafe extern "C" {
4069 #[doc = " Allocate a new heif_tai_timestamp_packet object and initialize with default values."]
4070 pub fn heif_tai_timestamp_packet_alloc() -> *mut heif_tai_timestamp_packet;
4071}
4072unsafe extern "C" {
4073 #[doc = " Copies the source object into the destination object.\n Only the fields that are present in both objects are copied.\n The version property has to be set in both structs."]
4074 pub fn heif_tai_timestamp_packet_copy(
4075 dst: *mut heif_tai_timestamp_packet,
4076 src: *const heif_tai_timestamp_packet,
4077 );
4078}
4079unsafe extern "C" {
4080 pub fn heif_tai_timestamp_packet_release(arg1: *mut heif_tai_timestamp_packet);
4081}
4082unsafe extern "C" {
4083 #[doc = " Creates a new clock info property if it doesn't exist yet.\n You can only add one tai_clock_info to an image.\n\n @param clock_info The TAI clock info to set for the item. This object will be copied.\n @param out_optional_propertyId Output parameter for the property ID of the tai_clock_info.\n This parameter may be NULL if the info is not required."]
4084 pub fn heif_item_set_property_tai_clock_info(
4085 ctx: *mut heif_context,
4086 itemId: heif_item_id,
4087 clock_info: *const heif_tai_clock_info,
4088 out_optional_propertyId: *mut heif_property_id,
4089 ) -> heif_error;
4090}
4091unsafe extern "C" {
4092 #[doc = " Get the heif_tai_clock_info attached to the item.\n This function allocates a new heif_tai_clock_info and returns it through out_clock.\n\n @param out_clock This parameter must not be nullptr. The object returned through this parameter must\n be released with heif_tai_clock_info_release().\n If no tai_clock_info property exists for the item, out_clock is set to NULL and\n no error is returned."]
4093 pub fn heif_item_get_property_tai_clock_info(
4094 ctx: *const heif_context,
4095 itemId: heif_item_id,
4096 out_clock: *mut *mut heif_tai_clock_info,
4097 ) -> heif_error;
4098}
4099unsafe extern "C" {
4100 #[doc = " Creates a new TAI timestamp property if it doesn't exist yet.\n You can only add one tai_timestamp to an image.\n\n @param timestamp The TAI timestamp to set for the item. This object will be copied.\n @param out_optional_propertyId Output parameter for the property ID of the TAI timestamp.\n This parameter may be NULL if the info is not required."]
4101 pub fn heif_item_set_property_tai_timestamp(
4102 ctx: *mut heif_context,
4103 itemId: heif_item_id,
4104 timestamp: *const heif_tai_timestamp_packet,
4105 out_optional_propertyId: *mut heif_property_id,
4106 ) -> heif_error;
4107}
4108unsafe extern "C" {
4109 #[doc = " Get the heif_tai_timestamp_packet attached to the item.\n This function allocates a new heif_tai_timestamp_packet and returns it through out_timestamp.\n\n @param out_timestamp This parameter must not be NULL. The object returned through this parameter must\n be released with heif_tai_timestamp_packet_release().\n If no tai_timestamp_packet property exists for the item, *out_timestamp is set to NULL and\n no error is returned."]
4110 pub fn heif_item_get_property_tai_timestamp(
4111 ctx: *const heif_context,
4112 itemId: heif_item_id,
4113 out_timestamp: *mut *mut heif_tai_timestamp_packet,
4114 ) -> heif_error;
4115}
4116unsafe extern "C" {
4117 #[doc = " Attach a TAI timestamp to the image.\n The main use of this function is for image sequences, but it can also be used for still images.\n If used for still images, note that you also have to set the heif_tai_clock_info to the image item\n through heif_item_set_property_tai_clock_info().\n\n @param timestamp The TAI timestamp to set to the image. This object will be copied."]
4118 pub fn heif_image_set_tai_timestamp(
4119 img: *mut heif_image,
4120 timestamp: *const heif_tai_timestamp_packet,
4121 ) -> heif_error;
4122}
4123unsafe extern "C" {
4124 #[doc = " Get the heif_tai_timestamp_packet attached to the image.\n The main use of this function is for image sequences, but it can also be used for still images.\n This function allocates a new heif_tai_timestamp_packet and returns it through out_timestamp.\n\n @param out_timestamp This parameter must not be NULL. The object returned through this parameter must\n be released with heif_tai_timestamp_packet_release().\n If no tai_timestamp_packet property exists for the image, *out_timestamp is set to NULL and\n no error is returned."]
4125 pub fn heif_image_get_tai_timestamp(
4126 img: *const heif_image,
4127 out_timestamp: *mut *mut heif_tai_timestamp_packet,
4128 ) -> heif_error;
4129}
4130#[repr(C)]
4131#[derive(Debug, Copy, Clone)]
4132pub struct heif_text_item {
4133 _unused: [u8; 0],
4134}
4135unsafe extern "C" {
4136 #[doc = " Get the number of text items that are attached to an image.\n\n @param image_handle the image handle for the image to query.\n @return the number of text items, which can be zero."]
4137 pub fn heif_image_handle_get_number_of_text_items(
4138 image_handle: *const heif_image_handle,
4139 ) -> libc::c_int;
4140}
4141unsafe extern "C" {
4142 #[doc = " Get the text item identifiers for the text items attached to an image.\n\n Possible usage (in C++):\n @code\n int numTextItems = heif_image_handle_get_number_of_text_items(handle);\n if (numTextItems > 0) {\n std::vector<heif_item_id> text_item_ids(numTextItems);\n heif_image_handle_get_list_of_text_item_ids(handle, text_item_ids.data(), numTextItems);\n // use text item ids\n }\n @endcode\n\n @param image_handle the image handle for the parent image to query\n @param text_item_ids_array array to put the item identifiers into\n @param max_count the maximum number of text identifiers\n @return the number of text item identifiers that were returned."]
4143 pub fn heif_image_handle_get_list_of_text_item_ids(
4144 image_handle: *const heif_image_handle,
4145 text_item_ids_array: *mut heif_item_id,
4146 max_count: libc::c_int,
4147 ) -> libc::c_int;
4148}
4149unsafe extern "C" {
4150 #[doc = " Get the text item.\n\n Caller is responsible for release of the output heif_text_item with heif_text_item_release().\n\n @param context the context to get the text item from, usually from a file operation\n @param text_item_id the identifier for the text item\n @param out pointer to pointer to the resulting text item\n @return heif_error_ok on success, or an error value indicating the problem"]
4151 pub fn heif_context_get_text_item(
4152 context: *const heif_context,
4153 text_item_id: heif_item_id,
4154 out: *mut *mut heif_text_item,
4155 ) -> heif_error;
4156}
4157unsafe extern "C" {
4158 #[doc = " Get the item identifier for a text item.\n\n @param text_item the text item to query\n @return the text item identifier (or 0 if the text_item is null)"]
4159 pub fn heif_text_item_get_id(text_item: *mut heif_text_item) -> heif_item_id;
4160}
4161unsafe extern "C" {
4162 #[doc = " Get the item content for a text item.\n\n This is the payload text, in the format given by the associated content_type.\n\n @param text_item the text item to query\n @return the text item content (or null if the text_item is null). The returned string shall be released\n with heif_string_release()."]
4163 pub fn heif_text_item_get_content(text_item: *mut heif_text_item) -> *const libc::c_char;
4164}
4165unsafe extern "C" {
4166 #[doc = " This function is similar to heif_item_get_property_extended_language(), but\n takes a `heif_text_item` as parameter.\n\n @param text_item The text item for which we are requesting the language.\n @param out_language Output parameter for the text language. Free with heif_string_release().\n @return"]
4167 pub fn heif_text_item_get_property_extended_language(
4168 text_item: *const heif_text_item,
4169 out_language: *mut *mut libc::c_char,
4170 ) -> heif_error;
4171}
4172unsafe extern "C" {
4173 #[doc = " Add a text item to an image."]
4174 pub fn heif_image_handle_add_text_item(
4175 image_handle: *mut heif_image_handle,
4176 content_type: *const libc::c_char,
4177 text: *const libc::c_char,
4178 out_text_item: *mut *mut heif_text_item,
4179 ) -> heif_error;
4180}
4181unsafe extern "C" {
4182 #[doc = " Release a text item.\n\n This should be called on items from heif_context_add_text_item().\n\n @param text_item the item to release."]
4183 pub fn heif_text_item_release(text_item: *mut heif_text_item);
4184}
4185unsafe extern "C" {
4186 #[doc = " Set the extended language property to the text item.\n\n This adds an RFC 5346 (IETF BCP 47) extended language tag, such as \"en-AU\".\n\n @param text_item the text item to query\n @param language the language to set\n @param out_optional_propertyId Output parameter for the property ID of the language property.\n This parameter may be NULL if the info is not required.\n @return heif_error_ok on success, or an error value indicating the problem"]
4187 pub fn heif_text_item_set_extended_language(
4188 text_item: *mut heif_text_item,
4189 language: *const libc::c_char,
4190 out_optional_propertyId: *mut heif_property_id,
4191 ) -> heif_error;
4192}