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 = " 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."]
136pub const heif_suberror_code_heif_suberror_Security_limit_exceeded: heif_suberror_code = 1000;
137#[doc = " There was an error from the underlying compression / decompression library.\n One possibility is lack of resources (e.g. memory)."]
138pub const heif_suberror_code_heif_suberror_Compression_initialisation_error: heif_suberror_code =
139 1001;
140#[doc = " also used for Invalid_input"]
141pub const heif_suberror_code_heif_suberror_Nonexisting_item_referenced: heif_suberror_code = 2000;
142#[doc = " An API argument was given a NULL pointer, which is not allowed for that function."]
143pub const heif_suberror_code_heif_suberror_Null_pointer_argument: heif_suberror_code = 2001;
144#[doc = " Image channel referenced that does not exist in the image"]
145pub const heif_suberror_code_heif_suberror_Nonexisting_image_channel_referenced:
146 heif_suberror_code = 2002;
147#[doc = " The version of the passed plugin is not supported."]
148pub const heif_suberror_code_heif_suberror_Unsupported_plugin_version: heif_suberror_code = 2003;
149#[doc = " The version of the passed writer is not supported."]
150pub const heif_suberror_code_heif_suberror_Unsupported_writer_version: heif_suberror_code = 2004;
151#[doc = " The given (encoder) parameter name does not exist."]
152pub const heif_suberror_code_heif_suberror_Unsupported_parameter: heif_suberror_code = 2005;
153#[doc = " The value for the given parameter is not in the valid range."]
154pub const heif_suberror_code_heif_suberror_Invalid_parameter_value: heif_suberror_code = 2006;
155#[doc = " Error in property specification"]
156pub const heif_suberror_code_heif_suberror_Invalid_property: heif_suberror_code = 2007;
157#[doc = " Image reference cycle found in iref"]
158pub const heif_suberror_code_heif_suberror_Item_reference_cycle: heif_suberror_code = 2008;
159#[doc = " Image was coded with an unsupported compression method."]
160pub const heif_suberror_code_heif_suberror_Unsupported_codec: heif_suberror_code = 3000;
161#[doc = " Image is specified in an unknown way, e.g. as tiled grid image (which is supported)"]
162pub const heif_suberror_code_heif_suberror_Unsupported_image_type: heif_suberror_code = 3001;
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_data_version: heif_suberror_code = 3002;
165#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
166pub const heif_suberror_code_heif_suberror_Unsupported_color_conversion: heif_suberror_code = 3003;
167#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
168pub const heif_suberror_code_heif_suberror_Unsupported_item_construction_method:
169 heif_suberror_code = 3004;
170#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
171pub const heif_suberror_code_heif_suberror_Unsupported_header_compression_method:
172 heif_suberror_code = 3005;
173#[doc = " Generically compressed data used an unsupported compression method"]
174pub const heif_suberror_code_heif_suberror_Unsupported_generic_compression_method:
175 heif_suberror_code = 3006;
176#[doc = " Generically compressed data used an unsupported compression method"]
177pub const heif_suberror_code_heif_suberror_Unsupported_essential_property: heif_suberror_code =
178 3007;
179#[doc = " Generically compressed data used an unsupported compression method"]
180pub const heif_suberror_code_heif_suberror_Unsupported_track_type: heif_suberror_code = 3008;
181#[doc = " --- Encoder_plugin_error ---"]
182pub const heif_suberror_code_heif_suberror_Unsupported_bit_depth: heif_suberror_code = 4000;
183#[doc = " --- Encoding_error ---"]
184pub const heif_suberror_code_heif_suberror_Cannot_write_output_data: heif_suberror_code = 5000;
185#[doc = " --- Encoding_error ---"]
186pub const heif_suberror_code_heif_suberror_Encoder_initialization: heif_suberror_code = 5001;
187#[doc = " --- Encoding_error ---"]
188pub const heif_suberror_code_heif_suberror_Encoder_encoding: heif_suberror_code = 5002;
189#[doc = " --- Encoding_error ---"]
190pub const heif_suberror_code_heif_suberror_Encoder_cleanup: heif_suberror_code = 5003;
191#[doc = " --- Encoding_error ---"]
192pub const heif_suberror_code_heif_suberror_Too_many_regions: heif_suberror_code = 5004;
193#[doc = " a specific plugin file cannot be loaded"]
194pub const heif_suberror_code_heif_suberror_Plugin_loading_error: heif_suberror_code = 6000;
195#[doc = " trying to remove a plugin that is not loaded"]
196pub const heif_suberror_code_heif_suberror_Plugin_is_not_loaded: heif_suberror_code = 6001;
197#[doc = " error while scanning the directory for plugins"]
198pub const heif_suberror_code_heif_suberror_Cannot_read_plugin_directory: heif_suberror_code = 6002;
199#[doc = " no decoder found for that compression format"]
200pub const heif_suberror_code_heif_suberror_No_matching_decoder_installed: heif_suberror_code = 6003;
201pub type heif_suberror_code = libc::c_uint;
202#[repr(C)]
203#[derive(Debug, Copy, Clone)]
204pub struct heif_error {
205 #[doc = " main error category"]
206 pub code: heif_error_code,
207 #[doc = " more detailed error code"]
208 pub subcode: heif_suberror_code,
209 #[doc = " textual error message (is always defined, you do not have to check for NULL)"]
210 pub message: *const libc::c_char,
211}
212unsafe extern "C" {
213 #[doc = " Version string of linked libheif library."]
214 pub fn heif_get_version() -> *const libc::c_char;
215}
216unsafe extern "C" {
217 #[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"]
218 pub fn heif_get_version_number() -> u32;
219}
220unsafe extern "C" {
221 #[doc = " Numeric part \"HH\" from above. Returned as a decimal number."]
222 pub fn heif_get_version_number_major() -> libc::c_int;
223}
224unsafe extern "C" {
225 #[doc = " Numeric part \"MM\" from above. Returned as a decimal number."]
226 pub fn heif_get_version_number_minor() -> libc::c_int;
227}
228unsafe extern "C" {
229 #[doc = " Numeric part \"LL\" from above. Returned as a decimal number."]
230 pub fn heif_get_version_number_maintenance() -> libc::c_int;
231}
232#[repr(C)]
233#[derive(Debug)]
234pub struct heif_context {
235 _unused: [u8; 0],
236}
237#[repr(C)]
238#[derive(Debug)]
239pub struct heif_image_handle {
240 _unused: [u8; 0],
241}
242pub type heif_item_id = u32;
243pub type heif_property_id = u32;
244unsafe extern "C" {
245 #[doc = " Free a string returned by libheif in various API functions.\n You may pass NULL."]
246 pub fn heif_string_release(arg1: *const libc::c_char);
247}
248#[doc = " ========================= library initialization ======================"]
249#[repr(C)]
250#[derive(Debug, Copy, Clone)]
251pub struct heif_init_params {
252 pub version: libc::c_int,
253}
254unsafe extern "C" {
255 #[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."]
256 pub fn heif_init(arg1: *mut heif_init_params) -> heif_error;
257}
258unsafe extern "C" {
259 #[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()"]
260 pub fn heif_deinit();
261}
262pub const heif_plugin_type_heif_plugin_type_encoder: heif_plugin_type = 0;
263pub const heif_plugin_type_heif_plugin_type_decoder: heif_plugin_type = 1;
264#[doc = " --- Plugins are currently only supported on Unix platforms."]
265pub type heif_plugin_type = libc::c_uint;
266#[repr(C)]
267#[derive(Debug)]
268pub struct heif_plugin_info {
269 #[doc = " version of this info struct"]
270 pub version: libc::c_int,
271 pub type_: heif_plugin_type,
272 pub plugin: *const libc::c_void,
273 #[doc = " for internal use only"]
274 pub internal_handle: *mut libc::c_void,
275}
276unsafe extern "C" {
277 pub fn heif_load_plugin(
278 filename: *const libc::c_char,
279 out_plugin: *mut *const heif_plugin_info,
280 ) -> heif_error;
281}
282unsafe extern "C" {
283 pub fn heif_load_plugins(
284 directory: *const libc::c_char,
285 out_plugins: *mut *const heif_plugin_info,
286 out_nPluginsLoaded: *mut libc::c_int,
287 output_array_size: libc::c_int,
288 ) -> heif_error;
289}
290unsafe extern "C" {
291 pub fn heif_unload_plugin(plugin: *const heif_plugin_info) -> heif_error;
292}
293unsafe extern "C" {
294 #[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)."]
295 pub fn heif_get_plugin_directories() -> *const *const libc::c_char;
296}
297unsafe extern "C" {
298 pub fn heif_free_plugin_directories(arg1: *const *const libc::c_char);
299}
300#[repr(C)]
301#[derive(Debug)]
302pub struct heif_decoder_plugin {
303 _unused: [u8; 0],
304}
305#[repr(C)]
306#[derive(Debug)]
307pub struct heif_encoder_plugin {
308 _unused: [u8; 0],
309}
310unsafe extern "C" {
311 pub fn heif_register_decoder_plugin(arg1: *const heif_decoder_plugin) -> heif_error;
312}
313unsafe extern "C" {
314 pub fn heif_register_encoder_plugin(arg1: *const heif_encoder_plugin) -> heif_error;
315}
316unsafe extern "C" {
317 #[doc = " DEPRECATED. Use heif_register_decoder_plugin(const struct heif_decoder_plugin*) instead."]
318 pub fn heif_register_decoder(
319 heif: *mut heif_context,
320 arg1: *const heif_decoder_plugin,
321 ) -> heif_error;
322}
323pub const heif_chroma_heif_chroma_undefined: heif_chroma = 99;
324pub const heif_chroma_heif_chroma_monochrome: heif_chroma = 0;
325pub const heif_chroma_heif_chroma_420: heif_chroma = 1;
326pub const heif_chroma_heif_chroma_422: heif_chroma = 2;
327pub const heif_chroma_heif_chroma_444: heif_chroma = 3;
328pub const heif_chroma_heif_chroma_interleaved_RGB: heif_chroma = 10;
329pub const heif_chroma_heif_chroma_interleaved_RGBA: heif_chroma = 11;
330#[doc = " HDR, big endian."]
331pub const heif_chroma_heif_chroma_interleaved_RRGGBB_BE: heif_chroma = 12;
332#[doc = " HDR, big endian."]
333pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_BE: heif_chroma = 13;
334#[doc = " HDR, little endian."]
335pub const heif_chroma_heif_chroma_interleaved_RRGGBB_LE: heif_chroma = 14;
336#[doc = " HDR, little endian."]
337pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_LE: heif_chroma = 15;
338pub type heif_chroma = libc::c_uint;
339pub const heif_colorspace_heif_colorspace_undefined: heif_colorspace = 99;
340#[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"]
341pub const heif_colorspace_heif_colorspace_YCbCr: heif_colorspace = 0;
342#[doc = " heif_colorspace_RGB should be used with one of these heif_chroma values:\n * heif_chroma_444 (for planar RGB)\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"]
343pub const heif_colorspace_heif_colorspace_RGB: heif_colorspace = 1;
344#[doc = " heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome"]
345pub const heif_colorspace_heif_colorspace_monochrome: heif_colorspace = 2;
346#[doc = " Indicates that this image has no visual channels."]
347pub const heif_colorspace_heif_colorspace_nonvisual: heif_colorspace = 3;
348pub type heif_colorspace = libc::c_uint;
349pub const heif_channel_heif_channel_Y: heif_channel = 0;
350pub const heif_channel_heif_channel_Cb: heif_channel = 1;
351pub const heif_channel_heif_channel_Cr: heif_channel = 2;
352pub const heif_channel_heif_channel_R: heif_channel = 3;
353pub const heif_channel_heif_channel_G: heif_channel = 4;
354pub const heif_channel_heif_channel_B: heif_channel = 5;
355pub const heif_channel_heif_channel_Alpha: heif_channel = 6;
356pub const heif_channel_heif_channel_interleaved: heif_channel = 10;
357pub const heif_channel_heif_channel_filter_array: heif_channel = 11;
358pub const heif_channel_heif_channel_depth: heif_channel = 12;
359pub const heif_channel_heif_channel_disparity: heif_channel = 13;
360pub type heif_channel = libc::c_uint;
361#[repr(C)]
362#[derive(Debug)]
363pub struct heif_image {
364 _unused: [u8; 0],
365}
366unsafe extern "C" {
367 #[doc = " Get the colorspace format of the image."]
368 pub fn heif_image_get_colorspace(arg1: *const heif_image) -> heif_colorspace;
369}
370unsafe extern "C" {
371 #[doc = " Get the chroma format of the image."]
372 pub fn heif_image_get_chroma_format(arg1: *const heif_image) -> heif_chroma;
373}
374unsafe extern "C" {
375 #[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"]
376 pub fn heif_image_get_width(img: *const heif_image, channel: heif_channel) -> libc::c_int;
377}
378unsafe extern "C" {
379 #[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"]
380 pub fn heif_image_get_height(img: *const heif_image, channel: heif_channel) -> libc::c_int;
381}
382unsafe extern "C" {
383 #[doc = " Get the width of the main channel.\n\n This is the Y channel in YCbCr or mono, or any in RGB.\n\n @param img the image to get the primary width for\n @return the width in pixels"]
384 pub fn heif_image_get_primary_width(img: *const heif_image) -> libc::c_int;
385}
386unsafe extern "C" {
387 #[doc = " Get the height of the main channel.\n\n This is the Y channel in YCbCr or mono, or any in RGB.\n\n @param img the image to get the primary height for\n @return the height in pixels"]
388 pub fn heif_image_get_primary_height(img: *const heif_image) -> libc::c_int;
389}
390unsafe extern "C" {
391 pub fn heif_image_crop(
392 img: *mut heif_image,
393 left: libc::c_int,
394 right: libc::c_int,
395 top: libc::c_int,
396 bottom: libc::c_int,
397 ) -> heif_error;
398}
399unsafe extern "C" {
400 pub fn heif_image_extract_area(
401 arg1: *const heif_image,
402 x0: u32,
403 y0: u32,
404 w: u32,
405 h: u32,
406 limits: *const heif_security_limits,
407 out_image: *mut *mut heif_image,
408 ) -> heif_error;
409}
410unsafe extern "C" {
411 #[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."]
412 pub fn heif_image_get_bits_per_pixel(
413 arg1: *const heif_image,
414 channel: heif_channel,
415 ) -> libc::c_int;
416}
417unsafe extern "C" {
418 #[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)."]
419 pub fn heif_image_get_bits_per_pixel_range(
420 arg1: *const heif_image,
421 channel: heif_channel,
422 ) -> libc::c_int;
423}
424unsafe extern "C" {
425 pub fn heif_image_has_channel(arg1: *const heif_image, channel: heif_channel) -> libc::c_int;
426}
427unsafe extern "C" {
428 #[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."]
429 pub fn heif_image_get_plane_readonly(
430 arg1: *const heif_image,
431 channel: heif_channel,
432 out_stride: *mut libc::c_int,
433 ) -> *const u8;
434}
435unsafe extern "C" {
436 #[doc = " Deprecated, use the safer version heif_image_get_plane2() instead."]
437 pub fn heif_image_get_plane(
438 arg1: *mut heif_image,
439 channel: heif_channel,
440 out_stride: *mut libc::c_int,
441 ) -> *mut u8;
442}
443unsafe extern "C" {
444 #[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."]
445 pub fn heif_image_get_plane_readonly2(
446 arg1: *const heif_image,
447 channel: heif_channel,
448 out_stride: *mut usize,
449 ) -> *const u8;
450}
451unsafe extern "C" {
452 pub fn heif_image_get_plane2(
453 arg1: *mut heif_image,
454 channel: heif_channel,
455 out_stride: *mut usize,
456 ) -> *mut u8;
457}
458#[repr(C)]
459#[derive(Debug)]
460pub struct heif_scaling_options {
461 _unused: [u8; 0],
462}
463unsafe extern "C" {
464 #[doc = " Currently, heif_scaling_options is not defined yet. Pass a NULL pointer."]
465 pub fn heif_image_scale_image(
466 input: *const heif_image,
467 output: *mut *mut heif_image,
468 width: libc::c_int,
469 height: libc::c_int,
470 options: *const heif_scaling_options,
471 ) -> heif_error;
472}
473unsafe extern "C" {
474 #[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."]
475 pub fn heif_image_extend_to_size_fill_with_zero(
476 image: *mut heif_image,
477 width: u32,
478 height: u32,
479 ) -> heif_error;
480}
481unsafe extern "C" {
482 #[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'."]
483 pub fn heif_image_get_decoding_warnings(
484 image: *mut heif_image,
485 first_warning_idx: libc::c_int,
486 out_warnings: *mut heif_error,
487 max_output_buffer_entries: libc::c_int,
488 ) -> libc::c_int;
489}
490unsafe extern "C" {
491 #[doc = " This function is only for decoder plugin implementors."]
492 pub fn heif_image_add_decoding_warning(image: *mut heif_image, err: heif_error);
493}
494unsafe extern "C" {
495 #[doc = " Release heif_image."]
496 pub fn heif_image_release(arg1: *const heif_image);
497}
498unsafe extern "C" {
499 pub fn heif_image_get_pixel_aspect_ratio(
500 arg1: *const heif_image,
501 aspect_h: *mut u32,
502 aspect_v: *mut u32,
503 );
504}
505unsafe extern "C" {
506 pub fn heif_image_set_pixel_aspect_ratio(arg1: *mut heif_image, aspect_h: u32, aspect_v: u32);
507}
508unsafe extern "C" {
509 pub fn heif_image_handle_set_pixel_aspect_ratio(
510 arg1: *mut heif_image_handle,
511 aspect_h: u32,
512 aspect_v: u32,
513 );
514}
515unsafe extern "C" {
516 #[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"]
517 pub fn heif_image_create(
518 width: libc::c_int,
519 height: libc::c_int,
520 colorspace: heif_colorspace,
521 chroma: heif_chroma,
522 out_image: *mut *mut heif_image,
523 ) -> heif_error;
524}
525unsafe extern "C" {
526 #[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."]
527 pub fn heif_image_add_plane(
528 image: *mut heif_image,
529 channel: heif_channel,
530 width: libc::c_int,
531 height: libc::c_int,
532 bit_depth: libc::c_int,
533 ) -> heif_error;
534}
535unsafe extern "C" {
536 #[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."]
537 pub fn heif_image_add_plane_safe(
538 image: *mut heif_image,
539 channel: heif_channel,
540 width: libc::c_int,
541 height: libc::c_int,
542 bit_depth: libc::c_int,
543 limits: *const heif_security_limits,
544 ) -> heif_error;
545}
546unsafe extern "C" {
547 #[doc = " Signal that the image is premultiplied by the alpha pixel values."]
548 pub fn heif_image_set_premultiplied_alpha(
549 image: *mut heif_image,
550 is_premultiplied_alpha: libc::c_int,
551 );
552}
553unsafe extern "C" {
554 pub fn heif_image_is_premultiplied_alpha(image: *mut heif_image) -> libc::c_int;
555}
556unsafe extern "C" {
557 #[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."]
558 pub fn heif_image_extend_padding_to_size(
559 image: *mut heif_image,
560 min_physical_width: libc::c_int,
561 min_physical_height: libc::c_int,
562 ) -> heif_error;
563}
564pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_nearest_neighbor:
565 heif_chroma_downsampling_algorithm = 1;
566pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_average:
567 heif_chroma_downsampling_algorithm = 2;
568#[doc = " Combine with 'heif_chroma_upsampling_bilinear' for best quality.\n Makes edges look sharper when using YUV 420 with bilinear chroma upsampling."]
569pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_sharp_yuv:
570 heif_chroma_downsampling_algorithm = 3;
571pub type heif_chroma_downsampling_algorithm = libc::c_uint;
572pub const heif_chroma_upsampling_algorithm_heif_chroma_upsampling_nearest_neighbor:
573 heif_chroma_upsampling_algorithm = 1;
574pub const heif_chroma_upsampling_algorithm_heif_chroma_upsampling_bilinear:
575 heif_chroma_upsampling_algorithm = 2;
576pub type heif_chroma_upsampling_algorithm = libc::c_uint;
577#[repr(C)]
578#[derive(Debug, Copy, Clone)]
579pub struct heif_color_conversion_options {
580 #[doc = " 'version' must be 1."]
581 pub version: u8,
582 #[doc = " --- version 1 options"]
583 pub preferred_chroma_downsampling_algorithm: heif_chroma_downsampling_algorithm,
584 pub preferred_chroma_upsampling_algorithm: heif_chroma_upsampling_algorithm,
585 #[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."]
586 pub only_use_preferred_chroma_algorithm: u8,
587}
588pub const heif_alpha_composition_mode_heif_alpha_composition_mode_none:
589 heif_alpha_composition_mode = 0;
590pub const heif_alpha_composition_mode_heif_alpha_composition_mode_solid_color:
591 heif_alpha_composition_mode = 1;
592pub const heif_alpha_composition_mode_heif_alpha_composition_mode_checkerboard:
593 heif_alpha_composition_mode = 2;
594pub type heif_alpha_composition_mode = libc::c_uint;
595#[repr(C)]
596#[derive(Debug, Copy, Clone)]
597pub struct heif_color_conversion_options_ext {
598 pub version: u8,
599 #[doc = " --- version 1 options"]
600 pub alpha_composition_mode: heif_alpha_composition_mode,
601 #[doc = " color values should be specified in the range [0, 65535]"]
602 pub background_red: u16,
603 #[doc = " color values should be specified in the range [0, 65535]"]
604 pub background_green: u16,
605 #[doc = " color values should be specified in the range [0, 65535]"]
606 pub background_blue: u16,
607 pub secondary_background_red: u16,
608 pub secondary_background_green: u16,
609 pub secondary_background_blue: u16,
610 pub checkerboard_square_size: u16,
611}
612unsafe extern "C" {
613 #[doc = " Assumes that it is a version=1 struct."]
614 pub fn heif_color_conversion_options_set_defaults(arg1: *mut heif_color_conversion_options);
615}
616unsafe extern "C" {
617 pub fn heif_color_conversion_options_ext_alloc() -> *mut heif_color_conversion_options_ext;
618}
619unsafe extern "C" {
620 pub fn heif_color_conversion_options_ext_copy(
621 dst: *mut heif_color_conversion_options_ext,
622 src: *const heif_color_conversion_options_ext,
623 );
624}
625unsafe extern "C" {
626 pub fn heif_color_conversion_options_ext_free(arg1: *mut heif_color_conversion_options_ext);
627}
628pub const heif_color_profile_type_heif_color_profile_type_not_present: heif_color_profile_type = 0;
629pub const heif_color_profile_type_heif_color_profile_type_nclx: heif_color_profile_type =
630 1852009592;
631pub const heif_color_profile_type_heif_color_profile_type_rICC: heif_color_profile_type =
632 1917403971;
633pub const heif_color_profile_type_heif_color_profile_type_prof: heif_color_profile_type =
634 1886547814;
635#[doc = " ------------------------- color profiles -------------------------"]
636pub type heif_color_profile_type = libc::c_uint;
637unsafe extern "C" {
638 #[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."]
639 pub fn heif_image_handle_get_color_profile_type(
640 handle: *const heif_image_handle,
641 ) -> heif_color_profile_type;
642}
643unsafe extern "C" {
644 pub fn heif_image_handle_get_raw_color_profile_size(handle: *const heif_image_handle) -> usize;
645}
646unsafe extern "C" {
647 #[doc = " Returns 'heif_error_Color_profile_does_not_exist' when there is no ICC profile."]
648 pub fn heif_image_handle_get_raw_color_profile(
649 handle: *const heif_image_handle,
650 out_data: *mut libc::c_void,
651 ) -> heif_error;
652}
653#[doc = " g=0.3;0.6, b=0.15;0.06, r=0.64;0.33, w=0.3127,0.3290"]
654pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_709_5: heif_color_primaries = 1;
655pub const heif_color_primaries_heif_color_primaries_unspecified: heif_color_primaries = 2;
656pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_470_6_System_M: heif_color_primaries =
657 4;
658pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_470_6_System_B_G:
659 heif_color_primaries = 5;
660pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_601_6: heif_color_primaries = 6;
661pub const heif_color_primaries_heif_color_primaries_SMPTE_240M: heif_color_primaries = 7;
662pub const heif_color_primaries_heif_color_primaries_generic_film: heif_color_primaries = 8;
663pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_2020_2_and_2100_0:
664 heif_color_primaries = 9;
665pub const heif_color_primaries_heif_color_primaries_SMPTE_ST_428_1: heif_color_primaries = 10;
666pub const heif_color_primaries_heif_color_primaries_SMPTE_RP_431_2: heif_color_primaries = 11;
667pub const heif_color_primaries_heif_color_primaries_SMPTE_EG_432_1: heif_color_primaries = 12;
668pub const heif_color_primaries_heif_color_primaries_EBU_Tech_3213_E: heif_color_primaries = 22;
669pub type heif_color_primaries = libc::c_uint;
670pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_709_5:
671 heif_transfer_characteristics = 1;
672pub const heif_transfer_characteristics_heif_transfer_characteristic_unspecified:
673 heif_transfer_characteristics = 2;
674pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_470_6_System_M:
675 heif_transfer_characteristics = 4;
676pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_470_6_System_B_G:
677 heif_transfer_characteristics = 5;
678pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_601_6:
679 heif_transfer_characteristics = 6;
680pub const heif_transfer_characteristics_heif_transfer_characteristic_SMPTE_240M:
681 heif_transfer_characteristics = 7;
682pub const heif_transfer_characteristics_heif_transfer_characteristic_linear:
683 heif_transfer_characteristics = 8;
684pub const heif_transfer_characteristics_heif_transfer_characteristic_logarithmic_100:
685 heif_transfer_characteristics = 9;
686pub const heif_transfer_characteristics_heif_transfer_characteristic_logarithmic_100_sqrt10:
687 heif_transfer_characteristics = 10;
688pub const heif_transfer_characteristics_heif_transfer_characteristic_IEC_61966_2_4:
689 heif_transfer_characteristics = 11;
690pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_1361:
691 heif_transfer_characteristics = 12;
692pub const heif_transfer_characteristics_heif_transfer_characteristic_IEC_61966_2_1:
693 heif_transfer_characteristics = 13;
694pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2020_2_10bit:
695 heif_transfer_characteristics = 14;
696pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2020_2_12bit:
697 heif_transfer_characteristics = 15;
698pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2100_0_PQ:
699 heif_transfer_characteristics = 16;
700pub const heif_transfer_characteristics_heif_transfer_characteristic_SMPTE_ST_428_1:
701 heif_transfer_characteristics = 17;
702pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2100_0_HLG:
703 heif_transfer_characteristics = 18;
704pub type heif_transfer_characteristics = libc::c_uint;
705pub const heif_matrix_coefficients_heif_matrix_coefficients_RGB_GBR: heif_matrix_coefficients = 0;
706#[doc = " TODO: or 709-6 according to h.273"]
707pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_709_5:
708 heif_matrix_coefficients = 1;
709pub const heif_matrix_coefficients_heif_matrix_coefficients_unspecified: heif_matrix_coefficients =
710 2;
711pub const heif_matrix_coefficients_heif_matrix_coefficients_US_FCC_T47: heif_matrix_coefficients =
712 4;
713pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G:
714 heif_matrix_coefficients = 5;
715#[doc = " TODO: or 601-7 according to h.273"]
716pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_601_6:
717 heif_matrix_coefficients = 6;
718pub const heif_matrix_coefficients_heif_matrix_coefficients_SMPTE_240M: heif_matrix_coefficients =
719 7;
720pub const heif_matrix_coefficients_heif_matrix_coefficients_YCgCo: heif_matrix_coefficients = 8;
721pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance : heif_matrix_coefficients = 9 ;
722pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_2020_2_constant_luminance:
723 heif_matrix_coefficients = 10;
724pub const heif_matrix_coefficients_heif_matrix_coefficients_SMPTE_ST_2085:
725 heif_matrix_coefficients = 11;
726pub const heif_matrix_coefficients_heif_matrix_coefficients_chromaticity_derived_non_constant_luminance : heif_matrix_coefficients = 12 ;
727pub const heif_matrix_coefficients_heif_matrix_coefficients_chromaticity_derived_constant_luminance : heif_matrix_coefficients = 13 ;
728pub const heif_matrix_coefficients_heif_matrix_coefficients_ICtCp: heif_matrix_coefficients = 14;
729pub type heif_matrix_coefficients = libc::c_uint;
730#[repr(C)]
731#[derive(Debug, Copy, Clone)]
732pub struct heif_color_profile_nclx {
733 #[doc = " === version 1 fields"]
734 pub version: u8,
735 pub color_primaries: heif_color_primaries,
736 pub transfer_characteristics: heif_transfer_characteristics,
737 pub matrix_coefficients: heif_matrix_coefficients,
738 pub full_range_flag: u8,
739 #[doc = " --- decoded values (not used when saving nclx)"]
740 pub color_primary_red_x: f32,
741 #[doc = " --- decoded values (not used when saving nclx)"]
742 pub color_primary_red_y: f32,
743 pub color_primary_green_x: f32,
744 pub color_primary_green_y: f32,
745 pub color_primary_blue_x: f32,
746 pub color_primary_blue_y: f32,
747 pub color_primary_white_x: f32,
748 pub color_primary_white_y: f32,
749}
750unsafe extern "C" {
751 pub fn heif_nclx_color_profile_set_color_primaries(
752 nclx: *mut heif_color_profile_nclx,
753 cp: u16,
754 ) -> heif_error;
755}
756unsafe extern "C" {
757 pub fn heif_nclx_color_profile_set_transfer_characteristics(
758 nclx: *mut heif_color_profile_nclx,
759 transfer_characteristics: u16,
760 ) -> heif_error;
761}
762unsafe extern "C" {
763 pub fn heif_nclx_color_profile_set_matrix_coefficients(
764 nclx: *mut heif_color_profile_nclx,
765 matrix_coefficients: u16,
766 ) -> heif_error;
767}
768unsafe extern "C" {
769 #[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."]
770 pub fn heif_image_handle_get_nclx_color_profile(
771 handle: *const heif_image_handle,
772 out_data: *mut *mut heif_color_profile_nclx,
773 ) -> heif_error;
774}
775unsafe extern "C" {
776 #[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."]
777 pub fn heif_nclx_color_profile_alloc() -> *mut heif_color_profile_nclx;
778}
779unsafe extern "C" {
780 pub fn heif_nclx_color_profile_free(nclx_profile: *mut heif_color_profile_nclx);
781}
782unsafe extern "C" {
783 #[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."]
784 pub fn heif_image_get_color_profile_type(image: *const heif_image) -> heif_color_profile_type;
785}
786unsafe extern "C" {
787 #[doc = " Returns the size of the ICC profile if one is assigned to the image. Otherwise, it returns 0."]
788 pub fn heif_image_get_raw_color_profile_size(image: *const heif_image) -> usize;
789}
790unsafe extern "C" {
791 #[doc = " Returns the ICC profile if one is assigned to the image. Otherwise, it returns an error."]
792 pub fn heif_image_get_raw_color_profile(
793 image: *const heif_image,
794 out_data: *mut libc::c_void,
795 ) -> heif_error;
796}
797unsafe extern "C" {
798 pub fn heif_image_get_nclx_color_profile(
799 image: *const heif_image,
800 out_data: *mut *mut heif_color_profile_nclx,
801 ) -> heif_error;
802}
803unsafe extern "C" {
804 #[doc = " The color profile is not attached to the image handle because we might need it\n for color space transform and encoding."]
805 pub fn heif_image_set_raw_color_profile(
806 image: *mut heif_image,
807 profile_type_fourcc_string: *const libc::c_char,
808 profile_data: *const libc::c_void,
809 profile_size: usize,
810 ) -> heif_error;
811}
812unsafe extern "C" {
813 pub fn heif_image_set_nclx_color_profile(
814 image: *mut heif_image,
815 color_profile: *const heif_color_profile_nclx,
816 ) -> heif_error;
817}
818#[doc = " Note: a value of 0 for any of these values indicates that the value is undefined.\n The unit of these values is Candelas per square meter."]
819#[repr(C)]
820#[derive(Debug, Copy, Clone)]
821pub struct heif_content_light_level {
822 pub max_content_light_level: u16,
823 pub max_pic_average_light_level: u16,
824}
825unsafe extern "C" {
826 pub fn heif_image_has_content_light_level(arg1: *const heif_image) -> libc::c_int;
827}
828unsafe extern "C" {
829 pub fn heif_image_get_content_light_level(
830 arg1: *const heif_image,
831 out: *mut heif_content_light_level,
832 );
833}
834unsafe extern "C" {
835 #[doc = " Returns whether the image has 'content light level' information. If 0 is returned, the output is not filled."]
836 pub fn heif_image_handle_get_content_light_level(
837 arg1: *const heif_image_handle,
838 out: *mut heif_content_light_level,
839 ) -> libc::c_int;
840}
841unsafe extern "C" {
842 pub fn heif_image_set_content_light_level(
843 arg1: *const heif_image,
844 in_: *const heif_content_light_level,
845 );
846}
847unsafe extern "C" {
848 pub fn heif_image_handle_set_content_light_level(
849 arg1: *const heif_image_handle,
850 in_: *const heif_content_light_level,
851 );
852}
853#[doc = " Note: color coordinates are defined according to the CIE 1931 definition of x as specified in ISO 11664-1 (see also ISO 11664-3 and CIE 15)."]
854#[repr(C)]
855#[derive(Debug, Copy, Clone)]
856pub struct heif_mastering_display_colour_volume {
857 pub display_primaries_x: [u16; 3usize],
858 pub display_primaries_y: [u16; 3usize],
859 pub white_point_x: u16,
860 pub white_point_y: u16,
861 pub max_display_mastering_luminance: u32,
862 pub min_display_mastering_luminance: u32,
863}
864#[doc = " The units for max_display_mastering_luminance and min_display_mastering_luminance is Candelas per square meter."]
865#[repr(C)]
866#[derive(Debug, Copy, Clone)]
867pub struct heif_decoded_mastering_display_colour_volume {
868 pub display_primaries_x: [f32; 3usize],
869 pub display_primaries_y: [f32; 3usize],
870 pub white_point_x: f32,
871 pub white_point_y: f32,
872 pub max_display_mastering_luminance: f64,
873 pub min_display_mastering_luminance: f64,
874}
875#[repr(C)]
876#[derive(Debug, Copy, Clone)]
877pub struct heif_ambient_viewing_environment {
878 pub ambient_illumination: u32,
879 pub ambient_light_x: u16,
880 pub ambient_light_y: u16,
881}
882unsafe extern "C" {
883 pub fn heif_image_has_mastering_display_colour_volume(arg1: *const heif_image) -> libc::c_int;
884}
885unsafe extern "C" {
886 pub fn heif_image_get_mastering_display_colour_volume(
887 arg1: *const heif_image,
888 out: *mut heif_mastering_display_colour_volume,
889 );
890}
891unsafe extern "C" {
892 #[doc = " Returns whether the image has 'mastering display colour volume' information. If 0 is returned, the output is not filled."]
893 pub fn heif_image_handle_get_mastering_display_colour_volume(
894 arg1: *const heif_image_handle,
895 out: *mut heif_mastering_display_colour_volume,
896 ) -> libc::c_int;
897}
898unsafe extern "C" {
899 pub fn heif_image_set_mastering_display_colour_volume(
900 arg1: *const heif_image,
901 in_: *const heif_mastering_display_colour_volume,
902 );
903}
904unsafe extern "C" {
905 pub fn heif_image_handle_set_mastering_display_colour_volume(
906 arg1: *const heif_image_handle,
907 in_: *const heif_mastering_display_colour_volume,
908 );
909}
910unsafe extern "C" {
911 #[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)."]
912 pub fn heif_mastering_display_colour_volume_decode(
913 in_: *const heif_mastering_display_colour_volume,
914 out: *mut heif_decoded_mastering_display_colour_volume,
915 ) -> heif_error;
916}
917pub type heif_brand2 = u32;
918unsafe extern "C" {
919 #[doc = " input data should be at least 12 bytes"]
920 pub fn heif_read_main_brand(data: *const u8, len: libc::c_int) -> heif_brand2;
921}
922unsafe extern "C" {
923 #[doc = " input data should be at least 16 bytes"]
924 pub fn heif_read_minor_version_brand(data: *const u8, len: libc::c_int) -> heif_brand2;
925}
926unsafe extern "C" {
927 #[doc = " 'brand_fourcc' must be 4 character long, but need not be 0-terminated"]
928 pub fn heif_fourcc_to_brand(brand_fourcc: *const libc::c_char) -> heif_brand2;
929}
930unsafe extern "C" {
931 #[doc = " the output buffer must be at least 4 bytes long"]
932 pub fn heif_brand_to_fourcc(brand: heif_brand2, out_fourcc: *mut libc::c_char);
933}
934unsafe extern "C" {
935 #[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"]
936 pub fn heif_has_compatible_brand(
937 data: *const u8,
938 len: libc::c_int,
939 brand_fourcc: *const libc::c_char,
940 ) -> libc::c_int;
941}
942unsafe extern "C" {
943 #[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."]
944 pub fn heif_list_compatible_brands(
945 data: *const u8,
946 len: libc::c_int,
947 out_brands: *mut *mut heif_brand2,
948 out_size: *mut libc::c_int,
949 ) -> heif_error;
950}
951unsafe extern "C" {
952 pub fn heif_free_list_of_compatible_brands(brands_list: *mut heif_brand2);
953}
954unsafe extern "C" {
955 #[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."]
956 pub fn heif_get_file_mime_type(data: *const u8, len: libc::c_int) -> *const libc::c_char;
957}
958pub const heif_filetype_result_heif_filetype_no: heif_filetype_result = 0;
959#[doc = " it is heif and can be read by libheif"]
960pub const heif_filetype_result_heif_filetype_yes_supported: heif_filetype_result = 1;
961#[doc = " it is heif, but cannot be read by libheif"]
962pub const heif_filetype_result_heif_filetype_yes_unsupported: heif_filetype_result = 2;
963#[doc = " not sure whether it is an heif, try detection with more input data"]
964pub const heif_filetype_result_heif_filetype_maybe: heif_filetype_result = 3;
965#[doc = " ========================= file type check ======================"]
966pub type heif_filetype_result = libc::c_uint;
967unsafe extern "C" {
968 #[doc = " input data should be at least 12 bytes"]
969 pub fn heif_check_filetype(data: *const u8, len: libc::c_int) -> heif_filetype_result;
970}
971unsafe extern "C" {
972 #[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."]
973 pub fn heif_has_compatible_filetype(data: *const u8, len: libc::c_int) -> heif_error;
974}
975unsafe extern "C" {
976 pub fn heif_check_jpeg_filetype(data: *const u8, len: libc::c_int) -> libc::c_int;
977}
978pub const heif_brand_heif_unknown_brand: heif_brand = 0;
979#[doc = " HEIF image with h265"]
980pub const heif_brand_heif_heic: heif_brand = 1;
981#[doc = " 10bit images, or anything that uses h265 with range extension"]
982pub const heif_brand_heif_heix: heif_brand = 2;
983#[doc = " brands for image sequences"]
984pub const heif_brand_heif_hevc: heif_brand = 3;
985#[doc = " brands for image sequences"]
986pub const heif_brand_heif_hevx: heif_brand = 4;
987#[doc = " multiview"]
988pub const heif_brand_heif_heim: heif_brand = 5;
989#[doc = " scalable"]
990pub const heif_brand_heif_heis: heif_brand = 6;
991#[doc = " multiview sequence"]
992pub const heif_brand_heif_hevm: heif_brand = 7;
993#[doc = " scalable sequence"]
994pub const heif_brand_heif_hevs: heif_brand = 8;
995#[doc = " image, any coding algorithm"]
996pub const heif_brand_heif_mif1: heif_brand = 9;
997#[doc = " sequence, any coding algorithm"]
998pub const heif_brand_heif_msf1: heif_brand = 10;
999#[doc = " HEIF image with AV1"]
1000pub const heif_brand_heif_avif: heif_brand = 11;
1001pub const heif_brand_heif_avis: heif_brand = 12;
1002#[doc = " VVC image"]
1003pub const heif_brand_heif_vvic: heif_brand = 13;
1004#[doc = " VVC sequence"]
1005pub const heif_brand_heif_vvis: heif_brand = 14;
1006#[doc = " EVC image"]
1007pub const heif_brand_heif_evbi: heif_brand = 15;
1008#[doc = " EVC sequence"]
1009pub const heif_brand_heif_evbs: heif_brand = 16;
1010#[doc = " JPEG2000 image"]
1011pub const heif_brand_heif_j2ki: heif_brand = 17;
1012#[doc = " JPEG2000 image sequence"]
1013pub const heif_brand_heif_j2is: heif_brand = 18;
1014#[doc = " DEPRECATED, use heif_brand2 and the heif_brand2_* constants instead"]
1015pub type heif_brand = libc::c_uint;
1016unsafe extern "C" {
1017 #[doc = " input data should be at least 12 bytes\n DEPRECATED, use heif_read_main_brand() instead"]
1018 pub fn heif_main_brand(data: *const u8, len: libc::c_int) -> heif_brand;
1019}
1020pub const heif_metadata_compression_heif_metadata_compression_off: heif_metadata_compression = 0;
1021pub const heif_metadata_compression_heif_metadata_compression_auto: heif_metadata_compression = 1;
1022#[doc = " only used when reading unknown method from input file"]
1023pub const heif_metadata_compression_heif_metadata_compression_unknown: heif_metadata_compression =
1024 2;
1025pub const heif_metadata_compression_heif_metadata_compression_deflate: heif_metadata_compression =
1026 3;
1027#[doc = " do not use for header data"]
1028pub const heif_metadata_compression_heif_metadata_compression_zlib: heif_metadata_compression = 4;
1029pub const heif_metadata_compression_heif_metadata_compression_brotli: heif_metadata_compression = 5;
1030pub type heif_metadata_compression = libc::c_uint;
1031unsafe extern "C" {
1032 pub fn heif_metadata_compression_method_supported(
1033 method: heif_metadata_compression,
1034 ) -> libc::c_int;
1035}
1036unsafe extern "C" {
1037 #[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."]
1038 pub fn heif_image_handle_get_number_of_metadata_blocks(
1039 handle: *const heif_image_handle,
1040 type_filter: *const libc::c_char,
1041 ) -> libc::c_int;
1042}
1043unsafe extern "C" {
1044 #[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."]
1045 pub fn heif_image_handle_get_list_of_metadata_block_IDs(
1046 handle: *const heif_image_handle,
1047 type_filter: *const libc::c_char,
1048 ids: *mut heif_item_id,
1049 count: libc::c_int,
1050 ) -> libc::c_int;
1051}
1052unsafe extern "C" {
1053 #[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."]
1054 pub fn heif_image_handle_get_metadata_type(
1055 handle: *const heif_image_handle,
1056 metadata_id: heif_item_id,
1057 ) -> *const libc::c_char;
1058}
1059unsafe extern "C" {
1060 #[doc = " For EXIF, the content type is empty.\n For XMP, the content type is \"application/rdf+xml\"."]
1061 pub fn heif_image_handle_get_metadata_content_type(
1062 handle: *const heif_image_handle,
1063 metadata_id: heif_item_id,
1064 ) -> *const libc::c_char;
1065}
1066unsafe extern "C" {
1067 #[doc = " Get the size of the raw metadata, as stored in the HEIF file."]
1068 pub fn heif_image_handle_get_metadata_size(
1069 handle: *const heif_image_handle,
1070 metadata_id: heif_item_id,
1071 ) -> usize;
1072}
1073unsafe extern "C" {
1074 #[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."]
1075 pub fn heif_image_handle_get_metadata(
1076 handle: *const heif_image_handle,
1077 metadata_id: heif_item_id,
1078 out_data: *mut libc::c_void,
1079 ) -> heif_error;
1080}
1081unsafe extern "C" {
1082 #[doc = " Only valid for item type == \"uri \", an absolute URI"]
1083 pub fn heif_image_handle_get_metadata_item_uri_type(
1084 handle: *const heif_image_handle,
1085 metadata_id: heif_item_id,
1086 ) -> *const libc::c_char;
1087}
1088unsafe extern "C" {
1089 #[doc = " Add EXIF metadata to an image."]
1090 pub fn heif_context_add_exif_metadata(
1091 arg1: *mut heif_context,
1092 image_handle: *const heif_image_handle,
1093 data: *const libc::c_void,
1094 size: libc::c_int,
1095 ) -> heif_error;
1096}
1097unsafe extern "C" {
1098 #[doc = " Add XMP metadata to an image."]
1099 pub fn heif_context_add_XMP_metadata(
1100 arg1: *mut heif_context,
1101 image_handle: *const heif_image_handle,
1102 data: *const libc::c_void,
1103 size: libc::c_int,
1104 ) -> heif_error;
1105}
1106unsafe extern "C" {
1107 #[doc = " New version of heif_context_add_XMP_metadata() with data compression (experimental)."]
1108 pub fn heif_context_add_XMP_metadata2(
1109 arg1: *mut heif_context,
1110 image_handle: *const heif_image_handle,
1111 data: *const libc::c_void,
1112 size: libc::c_int,
1113 compression: heif_metadata_compression,
1114 ) -> heif_error;
1115}
1116unsafe extern "C" {
1117 #[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."]
1118 pub fn heif_context_add_generic_metadata(
1119 ctx: *mut heif_context,
1120 image_handle: *const heif_image_handle,
1121 data: *const libc::c_void,
1122 size: libc::c_int,
1123 item_type: *const libc::c_char,
1124 content_type: *const libc::c_char,
1125 ) -> heif_error;
1126}
1127unsafe extern "C" {
1128 #[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)."]
1129 pub fn heif_context_add_generic_uri_metadata(
1130 ctx: *mut heif_context,
1131 image_handle: *const heif_image_handle,
1132 data: *const libc::c_void,
1133 size: libc::c_int,
1134 item_uri_type: *const libc::c_char,
1135 out_item_id: *mut heif_item_id,
1136 ) -> heif_error;
1137}
1138#[repr(C)]
1139#[derive(Debug)]
1140pub struct heif_encoder {
1141 _unused: [u8; 0],
1142}
1143unsafe extern "C" {
1144 #[doc = " ------------------------- depth images -------------------------"]
1145 pub fn heif_image_handle_has_depth_image(arg1: *const heif_image_handle) -> libc::c_int;
1146}
1147unsafe extern "C" {
1148 pub fn heif_image_handle_get_number_of_depth_images(
1149 handle: *const heif_image_handle,
1150 ) -> libc::c_int;
1151}
1152unsafe extern "C" {
1153 pub fn heif_image_handle_get_list_of_depth_image_IDs(
1154 handle: *const heif_image_handle,
1155 ids: *mut heif_item_id,
1156 count: libc::c_int,
1157 ) -> libc::c_int;
1158}
1159unsafe extern "C" {
1160 pub fn heif_image_handle_get_depth_image_handle(
1161 handle: *const heif_image_handle,
1162 depth_image_id: heif_item_id,
1163 out_depth_handle: *mut *mut heif_image_handle,
1164 ) -> heif_error;
1165}
1166pub const heif_depth_representation_type_heif_depth_representation_type_uniform_inverse_Z:
1167 heif_depth_representation_type = 0;
1168pub const heif_depth_representation_type_heif_depth_representation_type_uniform_disparity:
1169 heif_depth_representation_type = 1;
1170pub const heif_depth_representation_type_heif_depth_representation_type_uniform_Z:
1171 heif_depth_representation_type = 2;
1172pub const heif_depth_representation_type_heif_depth_representation_type_nonuniform_disparity:
1173 heif_depth_representation_type = 3;
1174pub type heif_depth_representation_type = libc::c_uint;
1175#[repr(C)]
1176#[derive(Debug)]
1177pub struct heif_depth_representation_info {
1178 pub version: u8,
1179 #[doc = " version 1 fields"]
1180 pub has_z_near: u8,
1181 pub has_z_far: u8,
1182 pub has_d_min: u8,
1183 pub has_d_max: u8,
1184 pub z_near: f64,
1185 pub z_far: f64,
1186 pub d_min: f64,
1187 pub d_max: f64,
1188 pub depth_representation_type: heif_depth_representation_type,
1189 pub disparity_reference_view: u32,
1190 pub depth_nonlinear_representation_model_size: u32,
1191 pub depth_nonlinear_representation_model: *mut u8,
1192}
1193unsafe extern "C" {
1194 pub fn heif_depth_representation_info_free(info: *const heif_depth_representation_info);
1195}
1196unsafe extern "C" {
1197 #[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."]
1198 pub fn heif_image_handle_get_depth_image_representation_info(
1199 handle: *const heif_image_handle,
1200 depth_image_id: heif_item_id,
1201 out: *mut *const heif_depth_representation_info,
1202 ) -> libc::c_int;
1203}
1204unsafe extern "C" {
1205 #[doc = " List the number of thumbnails assigned to this image handle. Usually 0 or 1."]
1206 pub fn heif_image_handle_get_number_of_thumbnails(
1207 handle: *const heif_image_handle,
1208 ) -> libc::c_int;
1209}
1210unsafe extern "C" {
1211 pub fn heif_image_handle_get_list_of_thumbnail_IDs(
1212 handle: *const heif_image_handle,
1213 ids: *mut heif_item_id,
1214 count: libc::c_int,
1215 ) -> libc::c_int;
1216}
1217unsafe extern "C" {
1218 #[doc = " Get the image handle of a thumbnail image."]
1219 pub fn heif_image_handle_get_thumbnail(
1220 main_image_handle: *const heif_image_handle,
1221 thumbnail_id: heif_item_id,
1222 out_thumbnail_handle: *mut *mut heif_image_handle,
1223 ) -> heif_error;
1224}
1225unsafe extern "C" {
1226 #[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()."]
1227 pub fn heif_context_encode_thumbnail(
1228 arg1: *mut heif_context,
1229 image: *const heif_image,
1230 master_image_handle: *const heif_image_handle,
1231 encoder: *mut heif_encoder,
1232 options: *const heif_encoding_options,
1233 bbox_size: libc::c_int,
1234 out_thumb_image_handle: *mut *mut heif_image_handle,
1235 ) -> heif_error;
1236}
1237unsafe extern "C" {
1238 #[doc = " Assign 'thumbnail_image' as the thumbnail image of 'master_image'."]
1239 pub fn heif_context_assign_thumbnail(
1240 arg1: *mut heif_context,
1241 master_image: *const heif_image_handle,
1242 thumbnail_image: *const heif_image_handle,
1243 ) -> heif_error;
1244}
1245unsafe extern "C" {
1246 #[doc = " List the number of auxiliary images assigned to this image handle."]
1247 pub fn heif_image_handle_get_number_of_auxiliary_images(
1248 handle: *const heif_image_handle,
1249 aux_filter: libc::c_int,
1250 ) -> libc::c_int;
1251}
1252unsafe extern "C" {
1253 pub fn heif_image_handle_get_list_of_auxiliary_image_IDs(
1254 handle: *const heif_image_handle,
1255 aux_filter: libc::c_int,
1256 ids: *mut heif_item_id,
1257 count: libc::c_int,
1258 ) -> libc::c_int;
1259}
1260unsafe extern "C" {
1261 #[doc = " You are responsible to deallocate the returned buffer with heif_image_handle_release_auxiliary_type()."]
1262 pub fn heif_image_handle_get_auxiliary_type(
1263 handle: *const heif_image_handle,
1264 out_type: *mut *const libc::c_char,
1265 ) -> heif_error;
1266}
1267unsafe extern "C" {
1268 pub fn heif_image_handle_release_auxiliary_type(
1269 handle: *const heif_image_handle,
1270 out_type: *mut *const libc::c_char,
1271 );
1272}
1273unsafe extern "C" {
1274 #[doc = " Get the image handle of an auxiliary image."]
1275 pub fn heif_image_handle_get_auxiliary_image_handle(
1276 main_image_handle: *const heif_image_handle,
1277 auxiliary_id: heif_item_id,
1278 out_auxiliary_handle: *mut *mut heif_image_handle,
1279 ) -> heif_error;
1280}
1281unsafe extern "C" {
1282 #[doc = " DEPRECATED (because typo in function name). Use heif_image_handle_release_auxiliary_type() instead."]
1283 pub fn heif_image_handle_free_auxiliary_types(
1284 handle: *const heif_image_handle,
1285 out_type: *mut *const libc::c_char,
1286 );
1287}
1288#[doc = " ------------------------- entity groups ------------------------"]
1289pub type heif_entity_group_id = u32;
1290#[repr(C)]
1291#[derive(Debug)]
1292pub struct heif_entity_group {
1293 pub entity_group_id: heif_entity_group_id,
1294 #[doc = " this is a FourCC constant"]
1295 pub entity_group_type: u32,
1296 pub entities: *mut heif_item_id,
1297 pub num_entities: u32,
1298}
1299unsafe extern "C" {
1300 #[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."]
1301 pub fn heif_context_get_entity_groups(
1302 arg1: *const heif_context,
1303 type_filter: u32,
1304 item_filter: heif_item_id,
1305 out_num_groups: *mut libc::c_int,
1306 ) -> *mut heif_entity_group;
1307}
1308unsafe extern "C" {
1309 #[doc = " Release an array of entity groups returned by heif_context_get_entity_groups()."]
1310 pub fn heif_entity_groups_release(arg1: *mut heif_entity_group, num_groups: libc::c_int);
1311}
1312#[doc = " If you set a limit to 0, the limit is disabled."]
1313#[repr(C)]
1314#[derive(Debug, Copy, Clone)]
1315pub struct heif_security_limits {
1316 pub version: u8,
1317 #[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."]
1318 pub max_image_size_pixels: u64,
1319 pub max_number_of_tiles: u64,
1320 pub max_bayer_pattern_pixels: u32,
1321 pub max_items: u32,
1322 pub max_color_profile_size: u32,
1323 pub max_memory_block_size: u64,
1324 pub max_components: u32,
1325 pub max_iloc_extents_per_item: u32,
1326 pub max_size_entity_group: u32,
1327 #[doc = " for all boxes that are not covered by other limits"]
1328 pub max_children_per_box: u32,
1329 #[doc = " --- version 2"]
1330 pub max_total_memory: u64,
1331 pub max_sample_description_box_entries: u32,
1332 pub max_sample_group_description_box_entries: u32,
1333 #[doc = " --- version 3"]
1334 pub max_sequence_frames: u32,
1335 pub max_number_of_file_brands: u32,
1336}
1337unsafe extern "C" {
1338 #[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."]
1339 pub fn heif_get_global_security_limits() -> *const heif_security_limits;
1340}
1341unsafe extern "C" {
1342 #[doc = " Returns a set of fully disabled security limits. Use with care and only after user confirmation."]
1343 pub fn heif_get_disabled_security_limits() -> *const heif_security_limits;
1344}
1345unsafe extern "C" {
1346 #[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."]
1347 pub fn heif_context_get_security_limits(arg1: *const heif_context)
1348 -> *mut heif_security_limits;
1349}
1350unsafe extern "C" {
1351 #[doc = " Overwrites the security limits of a heif_context.\n This is a convenience function to easily copy limits."]
1352 pub fn heif_context_set_security_limits(
1353 arg1: *mut heif_context,
1354 arg2: *const heif_security_limits,
1355 ) -> heif_error;
1356}
1357unsafe extern "C" {
1358 #[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()."]
1359 pub fn heif_context_set_maximum_image_size_limit(
1360 ctx: *mut heif_context,
1361 maximum_width: libc::c_int,
1362 );
1363}
1364#[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."]
1365pub const heif_compression_format_heif_compression_undefined: heif_compression_format = 0;
1366#[doc = " HEVC compression, used for HEIC images.\n\n This is equivalent to H.265."]
1367pub const heif_compression_format_heif_compression_HEVC: heif_compression_format = 1;
1368#[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."]
1369pub const heif_compression_format_heif_compression_AVC: heif_compression_format = 2;
1370#[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."]
1371pub const heif_compression_format_heif_compression_JPEG: heif_compression_format = 3;
1372#[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/"]
1373pub const heif_compression_format_heif_compression_AV1: heif_compression_format = 4;
1374#[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."]
1375pub const heif_compression_format_heif_compression_VVC: heif_compression_format = 5;
1376#[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."]
1377pub const heif_compression_format_heif_compression_EVC: heif_compression_format = 6;
1378#[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."]
1379pub const heif_compression_format_heif_compression_JPEG2000: heif_compression_format = 7;
1380#[doc = " Uncompressed encoding.\n\n This is defined in ISO/IEC 23001-17:2024."]
1381pub const heif_compression_format_heif_compression_uncompressed: heif_compression_format = 8;
1382#[doc = " Mask image encoding.\n\n See ISO/IEC 23008-12:2022 Section 6.10.2"]
1383pub const heif_compression_format_heif_compression_mask: heif_compression_format = 9;
1384#[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."]
1385pub const heif_compression_format_heif_compression_HTJ2K: heif_compression_format = 10;
1386#[doc = " libheif known compression formats."]
1387pub type heif_compression_format = libc::c_uint;
1388unsafe extern "C" {
1389 #[doc = " Allocate a new context for reading HEIF files.\n Has to be freed again with heif_context_free()."]
1390 pub fn heif_context_alloc() -> *mut heif_context;
1391}
1392unsafe extern "C" {
1393 #[doc = " Free a previously allocated HEIF context. You should not free a context twice."]
1394 pub fn heif_context_free(arg1: *mut heif_context);
1395}
1396#[repr(C)]
1397#[derive(Debug)]
1398pub struct heif_reading_options {
1399 _unused: [u8; 0],
1400}
1401#[doc = " requested size has been reached, we can read until this point"]
1402pub const heif_reader_grow_status_heif_reader_grow_status_size_reached: heif_reader_grow_status = 0;
1403#[doc = " size has not been reached yet, but it may still grow further (deprecated)"]
1404pub const heif_reader_grow_status_heif_reader_grow_status_timeout: heif_reader_grow_status = 1;
1405#[doc = " size has not been reached and never will. The file has grown to its full size"]
1406pub const heif_reader_grow_status_heif_reader_grow_status_size_beyond_eof: heif_reader_grow_status =
1407 2;
1408#[doc = " an error has occurred"]
1409pub const heif_reader_grow_status_heif_reader_grow_status_error: heif_reader_grow_status = 3;
1410pub type heif_reader_grow_status = libc::c_uint;
1411#[repr(C)]
1412#[derive(Debug)]
1413pub struct heif_reader_range_request_result {
1414 #[doc = " should not return 'heif_reader_grow_status_timeout'"]
1415 pub status: heif_reader_grow_status,
1416 #[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)."]
1417 pub range_end: u64,
1418 #[doc = " a reader specific error code"]
1419 pub reader_error_code: libc::c_int,
1420 #[doc = " libheif will call heif_reader.release_error_msg on this if it is not NULL"]
1421 pub reader_error_msg: *const libc::c_char,
1422}
1423#[repr(C)]
1424#[derive(Debug, Copy, Clone)]
1425pub struct heif_reader {
1426 #[doc = " API version supported by this reader"]
1427 pub reader_api_version: libc::c_int,
1428 #[doc = " --- version 1 functions ---"]
1429 pub get_position:
1430 ::std::option::Option<unsafe extern "C" fn(userdata: *mut libc::c_void) -> i64>,
1431 #[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."]
1432 pub read: ::std::option::Option<
1433 unsafe extern "C" fn(
1434 data: *mut libc::c_void,
1435 size: usize,
1436 userdata: *mut libc::c_void,
1437 ) -> libc::c_int,
1438 >,
1439 pub seek: ::std::option::Option<
1440 unsafe extern "C" fn(position: i64, userdata: *mut libc::c_void) -> libc::c_int,
1441 >,
1442 #[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')."]
1443 pub wait_for_file_size: ::std::option::Option<
1444 unsafe extern "C" fn(
1445 target_size: i64,
1446 userdata: *mut libc::c_void,
1447 ) -> heif_reader_grow_status,
1448 >,
1449 #[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)."]
1450 pub request_range: ::std::option::Option<
1451 unsafe extern "C" fn(
1452 start_pos: u64,
1453 end_pos: u64,
1454 userdata: *mut libc::c_void,
1455 ) -> heif_reader_range_request_result,
1456 >,
1457 #[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."]
1458 pub preload_range_hint: ::std::option::Option<
1459 unsafe extern "C" fn(start_pos: u64, end_pos: u64, userdata: *mut libc::c_void),
1460 >,
1461 #[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."]
1462 pub release_file_range: ::std::option::Option<
1463 unsafe extern "C" fn(start_pos: u64, end_pos: u64, userdata: *mut libc::c_void),
1464 >,
1465 #[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."]
1466 pub release_error_msg: ::std::option::Option<unsafe extern "C" fn(msg: *const libc::c_char)>,
1467}
1468unsafe extern "C" {
1469 #[doc = " Read a HEIF file from a named disk file.\n The heif_reading_options should currently be set to NULL."]
1470 pub fn heif_context_read_from_file(
1471 arg1: *mut heif_context,
1472 filename: *const libc::c_char,
1473 arg2: *const heif_reading_options,
1474 ) -> heif_error;
1475}
1476unsafe extern "C" {
1477 #[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."]
1478 pub fn heif_context_read_from_memory(
1479 arg1: *mut heif_context,
1480 mem: *const libc::c_void,
1481 size: usize,
1482 arg2: *const heif_reading_options,
1483 ) -> heif_error;
1484}
1485unsafe extern "C" {
1486 #[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."]
1487 pub fn heif_context_read_from_memory_without_copy(
1488 arg1: *mut heif_context,
1489 mem: *const libc::c_void,
1490 size: usize,
1491 arg2: *const heif_reading_options,
1492 ) -> heif_error;
1493}
1494unsafe extern "C" {
1495 pub fn heif_context_read_from_reader(
1496 arg1: *mut heif_context,
1497 reader: *const heif_reader,
1498 userdata: *mut libc::c_void,
1499 arg2: *const heif_reading_options,
1500 ) -> heif_error;
1501}
1502unsafe extern "C" {
1503 #[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."]
1504 pub fn heif_context_get_number_of_top_level_images(ctx: *mut heif_context) -> libc::c_int;
1505}
1506unsafe extern "C" {
1507 pub fn heif_context_is_top_level_image_ID(
1508 ctx: *mut heif_context,
1509 id: heif_item_id,
1510 ) -> libc::c_int;
1511}
1512unsafe extern "C" {
1513 #[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."]
1514 pub fn heif_context_get_list_of_top_level_image_IDs(
1515 ctx: *mut heif_context,
1516 ID_array: *mut heif_item_id,
1517 count: libc::c_int,
1518 ) -> libc::c_int;
1519}
1520unsafe extern "C" {
1521 pub fn heif_context_get_primary_image_ID(
1522 ctx: *mut heif_context,
1523 id: *mut heif_item_id,
1524 ) -> heif_error;
1525}
1526unsafe extern "C" {
1527 #[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."]
1528 pub fn heif_context_get_primary_image_handle(
1529 ctx: *mut heif_context,
1530 arg1: *mut *mut heif_image_handle,
1531 ) -> heif_error;
1532}
1533unsafe extern "C" {
1534 #[doc = " Get the image handle for a known image ID."]
1535 pub fn heif_context_get_image_handle(
1536 ctx: *mut heif_context,
1537 id: heif_item_id,
1538 arg1: *mut *mut heif_image_handle,
1539 ) -> heif_error;
1540}
1541unsafe extern "C" {
1542 #[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."]
1543 pub fn heif_context_debug_dump_boxes_to_file(ctx: *mut heif_context, fd: libc::c_int);
1544}
1545unsafe extern "C" {
1546 #[doc = " ====================================================================================================\n Write the heif_context to a HEIF file"]
1547 pub fn heif_context_write_to_file(
1548 arg1: *mut heif_context,
1549 filename: *const libc::c_char,
1550 ) -> heif_error;
1551}
1552#[repr(C)]
1553#[derive(Debug, Copy, Clone)]
1554pub struct heif_writer {
1555 #[doc = " API version supported by this writer"]
1556 pub writer_api_version: libc::c_int,
1557 #[doc = " TODO: why do we need this parameter?"]
1558 pub write: ::std::option::Option<
1559 unsafe extern "C" fn(
1560 ctx: *mut heif_context,
1561 data: *const libc::c_void,
1562 size: usize,
1563 userdata: *mut libc::c_void,
1564 ) -> heif_error,
1565 >,
1566}
1567unsafe extern "C" {
1568 pub fn heif_context_write(
1569 arg1: *mut heif_context,
1570 writer: *mut heif_writer,
1571 userdata: *mut libc::c_void,
1572 ) -> heif_error;
1573}
1574#[repr(C)]
1575#[derive(Debug)]
1576pub struct heif_encoder_descriptor {
1577 _unused: [u8; 0],
1578}
1579#[repr(C)]
1580#[derive(Debug)]
1581pub struct heif_encoder_parameter {
1582 _unused: [u8; 0],
1583}
1584unsafe extern "C" {
1585 #[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."]
1586 pub fn heif_have_encoder_for_format(format: heif_compression_format) -> libc::c_int;
1587}
1588unsafe extern "C" {
1589 #[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()."]
1590 pub fn heif_get_encoder_descriptors(
1591 format_filter: heif_compression_format,
1592 name_filter: *const libc::c_char,
1593 out_encoders: *mut *const heif_encoder_descriptor,
1594 count: libc::c_int,
1595 ) -> libc::c_int;
1596}
1597unsafe extern "C" {
1598 #[doc = " Return a long, descriptive name of the encoder (including version information)."]
1599 pub fn heif_encoder_descriptor_get_name(
1600 arg1: *const heif_encoder_descriptor,
1601 ) -> *const libc::c_char;
1602}
1603unsafe extern "C" {
1604 #[doc = " Return a short, symbolic name for identifying the encoder.\n This name should stay constant over different encoder versions."]
1605 pub fn heif_encoder_descriptor_get_id_name(
1606 arg1: *const heif_encoder_descriptor,
1607 ) -> *const libc::c_char;
1608}
1609unsafe extern "C" {
1610 pub fn heif_encoder_descriptor_get_compression_format(
1611 arg1: *const heif_encoder_descriptor,
1612 ) -> heif_compression_format;
1613}
1614unsafe extern "C" {
1615 pub fn heif_encoder_descriptor_supports_lossy_compression(
1616 arg1: *const heif_encoder_descriptor,
1617 ) -> libc::c_int;
1618}
1619unsafe extern "C" {
1620 pub fn heif_encoder_descriptor_supports_lossless_compression(
1621 arg1: *const heif_encoder_descriptor,
1622 ) -> libc::c_int;
1623}
1624unsafe extern "C" {
1625 #[doc = " Get an encoder instance that can be used to actually encode images from a descriptor."]
1626 pub fn heif_context_get_encoder(
1627 context: *mut heif_context,
1628 arg1: *const heif_encoder_descriptor,
1629 out_encoder: *mut *mut heif_encoder,
1630 ) -> heif_error;
1631}
1632unsafe extern "C" {
1633 #[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."]
1634 pub fn heif_context_get_encoder_for_format(
1635 context: *mut heif_context,
1636 format: heif_compression_format,
1637 arg1: *mut *mut heif_encoder,
1638 ) -> heif_error;
1639}
1640unsafe extern "C" {
1641 #[doc = " Release the encoder object after use."]
1642 pub fn heif_encoder_release(arg1: *mut heif_encoder);
1643}
1644unsafe extern "C" {
1645 #[doc = " Get the encoder name from the encoder itself."]
1646 pub fn heif_encoder_get_name(arg1: *const heif_encoder) -> *const libc::c_char;
1647}
1648unsafe extern "C" {
1649 #[doc = " Set a 'quality' factor (0-100). How this is mapped to actual encoding parameters is\n encoder dependent."]
1650 pub fn heif_encoder_set_lossy_quality(
1651 arg1: *mut heif_encoder,
1652 quality: libc::c_int,
1653 ) -> heif_error;
1654}
1655unsafe extern "C" {
1656 pub fn heif_encoder_set_lossless(arg1: *mut heif_encoder, enable: libc::c_int) -> heif_error;
1657}
1658unsafe extern "C" {
1659 #[doc = " level should be between 0 (= none) to 4 (= full)"]
1660 pub fn heif_encoder_set_logging_level(
1661 arg1: *mut heif_encoder,
1662 level: libc::c_int,
1663 ) -> heif_error;
1664}
1665unsafe extern "C" {
1666 #[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."]
1667 pub fn heif_encoder_list_parameters(
1668 arg1: *mut heif_encoder,
1669 ) -> *const *const heif_encoder_parameter;
1670}
1671unsafe extern "C" {
1672 #[doc = " Return the parameter name."]
1673 pub fn heif_encoder_parameter_get_name(
1674 arg1: *const heif_encoder_parameter,
1675 ) -> *const libc::c_char;
1676}
1677pub const heif_encoder_parameter_type_heif_encoder_parameter_type_integer:
1678 heif_encoder_parameter_type = 1;
1679pub const heif_encoder_parameter_type_heif_encoder_parameter_type_boolean:
1680 heif_encoder_parameter_type = 2;
1681pub const heif_encoder_parameter_type_heif_encoder_parameter_type_string:
1682 heif_encoder_parameter_type = 3;
1683pub type heif_encoder_parameter_type = libc::c_uint;
1684unsafe extern "C" {
1685 #[doc = " Return the parameter type."]
1686 pub fn heif_encoder_parameter_get_type(
1687 arg1: *const heif_encoder_parameter,
1688 ) -> heif_encoder_parameter_type;
1689}
1690unsafe extern "C" {
1691 #[doc = " DEPRECATED. Use heif_encoder_parameter_get_valid_integer_values() instead."]
1692 pub fn heif_encoder_parameter_get_valid_integer_range(
1693 arg1: *const heif_encoder_parameter,
1694 have_minimum_maximum: *mut libc::c_int,
1695 minimum: *mut libc::c_int,
1696 maximum: *mut libc::c_int,
1697 ) -> heif_error;
1698}
1699unsafe extern "C" {
1700 #[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."]
1701 pub fn heif_encoder_parameter_get_valid_integer_values(
1702 arg1: *const heif_encoder_parameter,
1703 have_minimum: *mut libc::c_int,
1704 have_maximum: *mut libc::c_int,
1705 minimum: *mut libc::c_int,
1706 maximum: *mut libc::c_int,
1707 num_valid_values: *mut libc::c_int,
1708 out_integer_array: *mut *const libc::c_int,
1709 ) -> heif_error;
1710}
1711unsafe extern "C" {
1712 pub fn heif_encoder_parameter_get_valid_string_values(
1713 arg1: *const heif_encoder_parameter,
1714 out_stringarray: *mut *const *const libc::c_char,
1715 ) -> heif_error;
1716}
1717unsafe extern "C" {
1718 pub fn heif_encoder_set_parameter_integer(
1719 arg1: *mut heif_encoder,
1720 parameter_name: *const libc::c_char,
1721 value: libc::c_int,
1722 ) -> heif_error;
1723}
1724unsafe extern "C" {
1725 pub fn heif_encoder_get_parameter_integer(
1726 arg1: *mut heif_encoder,
1727 parameter_name: *const libc::c_char,
1728 value: *mut libc::c_int,
1729 ) -> heif_error;
1730}
1731unsafe extern "C" {
1732 pub fn heif_encoder_parameter_integer_valid_range(
1733 arg1: *mut heif_encoder,
1734 parameter_name: *const libc::c_char,
1735 have_minimum_maximum: *mut libc::c_int,
1736 minimum: *mut libc::c_int,
1737 maximum: *mut libc::c_int,
1738 ) -> heif_error;
1739}
1740unsafe extern "C" {
1741 pub fn heif_encoder_set_parameter_boolean(
1742 arg1: *mut heif_encoder,
1743 parameter_name: *const libc::c_char,
1744 value: libc::c_int,
1745 ) -> heif_error;
1746}
1747unsafe extern "C" {
1748 pub fn heif_encoder_get_parameter_boolean(
1749 arg1: *mut heif_encoder,
1750 parameter_name: *const libc::c_char,
1751 value: *mut libc::c_int,
1752 ) -> heif_error;
1753}
1754unsafe extern "C" {
1755 pub fn heif_encoder_set_parameter_string(
1756 arg1: *mut heif_encoder,
1757 parameter_name: *const libc::c_char,
1758 value: *const libc::c_char,
1759 ) -> heif_error;
1760}
1761unsafe extern "C" {
1762 pub fn heif_encoder_get_parameter_string(
1763 arg1: *mut heif_encoder,
1764 parameter_name: *const libc::c_char,
1765 value: *mut libc::c_char,
1766 value_size: libc::c_int,
1767 ) -> heif_error;
1768}
1769unsafe extern "C" {
1770 #[doc = " returns a NULL-terminated list of valid strings or NULL if all values are allowed"]
1771 pub fn heif_encoder_parameter_string_valid_values(
1772 arg1: *mut heif_encoder,
1773 parameter_name: *const libc::c_char,
1774 out_stringarray: *mut *const *const libc::c_char,
1775 ) -> heif_error;
1776}
1777unsafe extern "C" {
1778 pub fn heif_encoder_parameter_integer_valid_values(
1779 arg1: *mut heif_encoder,
1780 parameter_name: *const libc::c_char,
1781 have_minimum: *mut libc::c_int,
1782 have_maximum: *mut libc::c_int,
1783 minimum: *mut libc::c_int,
1784 maximum: *mut libc::c_int,
1785 num_valid_values: *mut libc::c_int,
1786 out_integer_array: *mut *const libc::c_int,
1787 ) -> heif_error;
1788}
1789unsafe extern "C" {
1790 #[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."]
1791 pub fn heif_encoder_set_parameter(
1792 arg1: *mut heif_encoder,
1793 parameter_name: *const libc::c_char,
1794 value: *const libc::c_char,
1795 ) -> heif_error;
1796}
1797unsafe extern "C" {
1798 #[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()."]
1799 pub fn heif_encoder_get_parameter(
1800 arg1: *mut heif_encoder,
1801 parameter_name: *const libc::c_char,
1802 value_ptr: *mut libc::c_char,
1803 value_size: libc::c_int,
1804 ) -> heif_error;
1805}
1806unsafe extern "C" {
1807 #[doc = " Query whether a specific parameter has a default value."]
1808 pub fn heif_encoder_has_default(
1809 arg1: *mut heif_encoder,
1810 parameter_name: *const libc::c_char,
1811 ) -> libc::c_int;
1812}
1813pub const heif_orientation_heif_orientation_normal: heif_orientation = 1;
1814pub const heif_orientation_heif_orientation_flip_horizontally: heif_orientation = 2;
1815pub const heif_orientation_heif_orientation_rotate_180: heif_orientation = 3;
1816pub const heif_orientation_heif_orientation_flip_vertically: heif_orientation = 4;
1817pub const heif_orientation_heif_orientation_rotate_90_cw_then_flip_horizontally: heif_orientation =
1818 5;
1819pub const heif_orientation_heif_orientation_rotate_90_cw: heif_orientation = 6;
1820pub const heif_orientation_heif_orientation_rotate_90_cw_then_flip_vertically: heif_orientation = 7;
1821pub const heif_orientation_heif_orientation_rotate_270_cw: heif_orientation = 8;
1822#[doc = " The orientation values are defined equal to the EXIF Orientation tag."]
1823pub type heif_orientation = libc::c_uint;
1824#[repr(C)]
1825#[derive(Debug)]
1826pub struct heif_encoding_options {
1827 pub version: u8,
1828 #[doc = " default: true"]
1829 pub save_alpha_channel: u8,
1830 #[doc = " DEPRECATED. This option is not required anymore. Its value will be ignored."]
1831 pub macOS_compatibility_workaround: u8,
1832 #[doc = " default: false"]
1833 pub save_two_colr_boxes_when_ICC_and_nclx_available: u8,
1834 #[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."]
1835 pub output_nclx_profile: *mut heif_color_profile_nclx,
1836 pub macOS_compatibility_workaround_no_nclx_profile: u8,
1837 #[doc = " libheif will generate irot/imir boxes to match these orientations"]
1838 pub image_orientation: heif_orientation,
1839 #[doc = " version 6 options"]
1840 pub color_conversion_options: heif_color_conversion_options,
1841 #[doc = " Set this to true to use compressed form of uncC where possible."]
1842 pub prefer_uncC_short_form: u8,
1843}
1844unsafe extern "C" {
1845 pub fn heif_encoding_options_alloc() -> *mut heif_encoding_options;
1846}
1847unsafe extern "C" {
1848 pub fn heif_encoding_options_copy(
1849 dst: *mut heif_encoding_options,
1850 src: *const heif_encoding_options,
1851 );
1852}
1853unsafe extern "C" {
1854 pub fn heif_encoding_options_free(arg1: *mut heif_encoding_options);
1855}
1856unsafe extern "C" {
1857 #[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()."]
1858 pub fn heif_context_encode_image(
1859 arg1: *mut heif_context,
1860 image: *const heif_image,
1861 encoder: *mut heif_encoder,
1862 options: *const heif_encoding_options,
1863 out_image_handle: *mut *mut heif_image_handle,
1864 ) -> heif_error;
1865}
1866unsafe extern "C" {
1867 #[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."]
1868 pub fn heif_context_add_overlay_image(
1869 ctx: *mut heif_context,
1870 image_width: u32,
1871 image_height: u32,
1872 nImages: u16,
1873 image_ids: *const heif_item_id,
1874 offsets: *mut i32,
1875 background_rgba: *const [u16; 4usize],
1876 out_iovl_image_handle: *mut *mut heif_image_handle,
1877 ) -> heif_error;
1878}
1879unsafe extern "C" {
1880 pub fn heif_context_set_primary_image(
1881 arg1: *mut heif_context,
1882 image_handle: *mut heif_image_handle,
1883 ) -> heif_error;
1884}
1885unsafe extern "C" {
1886 #[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."]
1887 pub fn heif_context_set_major_brand(ctx: *mut heif_context, major_brand: heif_brand2);
1888}
1889unsafe extern "C" {
1890 #[doc = " Add a compatible brand that is now added automatically by libheif when encoding images (e.g. some application brands like 'geo1')."]
1891 pub fn heif_context_add_compatible_brand(ctx: *mut heif_context, compatible_brand: heif_brand2);
1892}
1893unsafe extern "C" {
1894 #[doc = " DEPRECATED, typo in function name"]
1895 pub fn heif_encoder_descriptor_supportes_lossy_compression(
1896 arg1: *const heif_encoder_descriptor,
1897 ) -> libc::c_int;
1898}
1899unsafe extern "C" {
1900 #[doc = " DEPRECATED, typo in function name"]
1901 pub fn heif_encoder_descriptor_supportes_lossless_compression(
1902 arg1: *const heif_encoder_descriptor,
1903 ) -> libc::c_int;
1904}
1905unsafe extern "C" {
1906 #[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()."]
1907 pub fn heif_context_get_encoder_descriptors(
1908 arg1: *mut heif_context,
1909 format_filter: heif_compression_format,
1910 name_filter: *const libc::c_char,
1911 out_encoders: *mut *const heif_encoder_descriptor,
1912 count: libc::c_int,
1913 ) -> libc::c_int;
1914}
1915unsafe extern "C" {
1916 #[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."]
1917 pub fn heif_context_set_max_decoding_threads(ctx: *mut heif_context, max_threads: libc::c_int);
1918}
1919unsafe extern "C" {
1920 #[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."]
1921 pub fn heif_have_decoder_for_format(format: heif_compression_format) -> libc::c_int;
1922}
1923pub const heif_progress_step_heif_progress_step_total: heif_progress_step = 0;
1924pub const heif_progress_step_heif_progress_step_load_tile: heif_progress_step = 1;
1925pub type heif_progress_step = libc::c_uint;
1926#[repr(C)]
1927#[derive(Debug)]
1928pub struct heif_decoding_options {
1929 pub version: u8,
1930 #[doc = " Ignore geometric transformations like cropping, rotation, mirroring.\n Default: false (do not ignore)."]
1932 pub ignore_transformations: u8,
1933 #[doc = " Any of the progress functions may be called from background threads."]
1934 pub start_progress: ::std::option::Option<
1935 unsafe extern "C" fn(
1936 step: heif_progress_step,
1937 max_progress: libc::c_int,
1938 progress_user_data: *mut libc::c_void,
1939 ),
1940 >,
1941 pub on_progress: ::std::option::Option<
1942 unsafe extern "C" fn(
1943 step: heif_progress_step,
1944 progress: libc::c_int,
1945 progress_user_data: *mut libc::c_void,
1946 ),
1947 >,
1948 pub end_progress: ::std::option::Option<
1949 unsafe extern "C" fn(step: heif_progress_step, progress_user_data: *mut libc::c_void),
1950 >,
1951 pub progress_user_data: *mut libc::c_void,
1952 pub convert_hdr_to_8bit: u8,
1954 #[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."]
1956 pub strict_decoding: u8,
1957 #[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."]
1959 pub decoder_id: *const libc::c_char,
1960 pub color_conversion_options: heif_color_conversion_options,
1962 pub cancel_decoding: ::std::option::Option<
1964 unsafe extern "C" fn(progress_user_data: *mut libc::c_void) -> libc::c_int,
1965 >,
1966 #[doc = " When set to NULL, default options will be used"]
1968 pub color_conversion_options_ext: *mut heif_color_conversion_options_ext,
1969 pub ignore_sequence_editlist: libc::c_int,
1974 pub output_image_nclx_profile: *mut heif_color_profile_nclx,
1975 #[doc = " 0 = let libheif decide (TODO, currently ignored)"]
1976 pub num_library_threads: libc::c_int,
1977 #[doc = " 0 = use decoder default"]
1978 pub num_codec_threads: libc::c_int,
1979}
1980unsafe extern "C" {
1981 #[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."]
1982 pub fn heif_decoding_options_alloc() -> *mut heif_decoding_options;
1983}
1984unsafe extern "C" {
1985 pub fn heif_decoding_options_copy(
1986 dst: *mut heif_decoding_options,
1987 src: *const heif_decoding_options,
1988 );
1989}
1990unsafe extern "C" {
1991 pub fn heif_decoding_options_free(arg1: *mut heif_decoding_options);
1992}
1993#[repr(C)]
1994#[derive(Debug)]
1995pub struct heif_decoder_descriptor {
1996 _unused: [u8; 0],
1997}
1998unsafe extern "C" {
1999 #[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."]
2000 pub fn heif_get_decoder_descriptors(
2001 format_filter: heif_compression_format,
2002 out_decoders: *mut *const heif_decoder_descriptor,
2003 count: libc::c_int,
2004 ) -> libc::c_int;
2005}
2006unsafe extern "C" {
2007 #[doc = " Return a long, descriptive name of the decoder (including version information)."]
2008 pub fn heif_decoder_descriptor_get_name(
2009 arg1: *const heif_decoder_descriptor,
2010 ) -> *const libc::c_char;
2011}
2012unsafe extern "C" {
2013 #[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."]
2014 pub fn heif_decoder_descriptor_get_id_name(
2015 arg1: *const heif_decoder_descriptor,
2016 ) -> *const libc::c_char;
2017}
2018unsafe extern "C" {
2019 #[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."]
2020 pub fn heif_decode_image(
2021 in_handle: *const heif_image_handle,
2022 out_img: *mut *mut heif_image,
2023 colorspace: heif_colorspace,
2024 chroma: heif_chroma,
2025 options: *const heif_decoding_options,
2026 ) -> heif_error;
2027}
2028unsafe extern "C" {
2029 #[doc = " Release image handle."]
2030 pub fn heif_image_handle_release(arg1: *const heif_image_handle);
2031}
2032unsafe extern "C" {
2033 #[doc = " Check whether the given image_handle is the primary image of the file."]
2034 pub fn heif_image_handle_is_primary_image(handle: *const heif_image_handle) -> libc::c_int;
2035}
2036unsafe extern "C" {
2037 pub fn heif_image_handle_get_item_id(handle: *const heif_image_handle) -> heif_item_id;
2038}
2039unsafe extern "C" {
2040 #[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."]
2041 pub fn heif_image_handle_get_width(handle: *const heif_image_handle) -> libc::c_int;
2042}
2043unsafe extern "C" {
2044 #[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."]
2045 pub fn heif_image_handle_get_height(handle: *const heif_image_handle) -> libc::c_int;
2046}
2047unsafe extern "C" {
2048 pub fn heif_image_handle_has_alpha_channel(arg1: *const heif_image_handle) -> libc::c_int;
2049}
2050unsafe extern "C" {
2051 pub fn heif_image_handle_is_premultiplied_alpha(arg1: *const heif_image_handle) -> libc::c_int;
2052}
2053unsafe extern "C" {
2054 #[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."]
2055 pub fn heif_image_handle_get_luma_bits_per_pixel(arg1: *const heif_image_handle)
2056 -> libc::c_int;
2057}
2058unsafe extern "C" {
2059 #[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."]
2060 pub fn heif_image_handle_get_chroma_bits_per_pixel(
2061 arg1: *const heif_image_handle,
2062 ) -> libc::c_int;
2063}
2064unsafe extern "C" {
2065 #[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."]
2066 pub fn heif_image_handle_get_preferred_decoding_colorspace(
2067 image_handle: *const heif_image_handle,
2068 out_colorspace: *mut heif_colorspace,
2069 out_chroma: *mut heif_chroma,
2070 ) -> heif_error;
2071}
2072unsafe extern "C" {
2073 #[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."]
2074 pub fn heif_image_handle_get_ispe_width(handle: *const heif_image_handle) -> libc::c_int;
2075}
2076unsafe extern "C" {
2077 pub fn heif_image_handle_get_ispe_height(handle: *const heif_image_handle) -> libc::c_int;
2078}
2079unsafe extern "C" {
2080 #[doc = " Returns whether the image has 'pixel aspect ratio information' information. If 0 is returned, the output is filled with the 1:1 default."]
2081 pub fn heif_image_handle_get_pixel_aspect_ratio(
2082 arg1: *const heif_image_handle,
2083 aspect_h: *mut u32,
2084 aspect_v: *mut u32,
2085 ) -> libc::c_int;
2086}
2087unsafe extern "C" {
2088 #[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."]
2089 pub fn heif_image_handle_get_context(handle: *const heif_image_handle) -> *mut heif_context;
2090}
2091unsafe extern "C" {
2092 pub fn heif_image_handle_get_gimi_content_id(
2093 handle: *const heif_image_handle,
2094 ) -> *const libc::c_char;
2095}
2096#[repr(C)]
2097#[derive(Debug, Copy, Clone)]
2098pub struct heif_image_tiling {
2099 pub version: libc::c_int,
2100 #[doc = " --- version 1"]
2101 pub num_columns: u32,
2102 pub num_rows: u32,
2103 pub tile_width: u32,
2104 pub tile_height: u32,
2105 pub image_width: u32,
2106 pub image_height: u32,
2107 #[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."]
2108 pub top_offset: u32,
2109 pub left_offset: u32,
2110 #[doc = " 0 for normal images, 1 for volumetric (3D), ..."]
2111 pub number_of_extra_dimensions: u8,
2112 #[doc = " size of extra dimensions (first 8 dimensions)"]
2113 pub extra_dimension_size: [u32; 8usize],
2114}
2115unsafe extern "C" {
2116 #[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)."]
2117 pub fn heif_image_handle_get_image_tiling(
2118 handle: *const heif_image_handle,
2119 process_image_transformations: libc::c_int,
2120 out_tiling: *mut heif_image_tiling,
2121 ) -> heif_error;
2122}
2123unsafe extern "C" {
2124 #[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."]
2125 pub fn heif_image_handle_get_grid_image_tile_id(
2126 handle: *const heif_image_handle,
2127 process_image_transformations: libc::c_int,
2128 tile_x: u32,
2129 tile_y: u32,
2130 out_tile_item_id: *mut heif_item_id,
2131 ) -> heif_error;
2132}
2133unsafe extern "C" {
2134 #[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."]
2135 pub fn heif_image_handle_decode_image_tile(
2136 in_handle: *const heif_image_handle,
2137 out_img: *mut *mut heif_image,
2138 colorspace: heif_colorspace,
2139 chroma: heif_chroma,
2140 options: *const heif_decoding_options,
2141 tile_x: u32,
2142 tile_y: u32,
2143 ) -> heif_error;
2144}
2145unsafe extern "C" {
2146 #[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."]
2147 pub fn heif_context_encode_grid(
2148 ctx: *mut heif_context,
2149 tiles: *mut *mut heif_image,
2150 rows: u16,
2151 columns: u16,
2152 encoder: *mut heif_encoder,
2153 input_options: *const heif_encoding_options,
2154 out_image_handle: *mut *mut heif_image_handle,
2155 ) -> heif_error;
2156}
2157unsafe extern "C" {
2158 pub fn heif_context_add_grid_image(
2159 ctx: *mut heif_context,
2160 image_width: u32,
2161 image_height: u32,
2162 tile_columns: u32,
2163 tile_rows: u32,
2164 encoding_options: *const heif_encoding_options,
2165 out_grid_image_handle: *mut *mut heif_image_handle,
2166 ) -> heif_error;
2167}
2168unsafe extern "C" {
2169 pub fn heif_context_add_image_tile(
2170 ctx: *mut heif_context,
2171 tiled_image: *mut heif_image_handle,
2172 tile_x: u32,
2173 tile_y: u32,
2174 image: *const heif_image,
2175 encoder: *mut heif_encoder,
2176 ) -> heif_error;
2177}
2178#[doc = " heif_item_property_unknown = -1,"]
2179pub const heif_item_property_type_heif_item_property_type_invalid: heif_item_property_type = 0;
2180#[doc = " heif_item_property_unknown = -1,"]
2181pub const heif_item_property_type_heif_item_property_type_user_description:
2182 heif_item_property_type = 1969513843;
2183#[doc = " heif_item_property_unknown = -1,"]
2184pub const heif_item_property_type_heif_item_property_type_transform_mirror:
2185 heif_item_property_type = 1768778098;
2186#[doc = " heif_item_property_unknown = -1,"]
2187pub const heif_item_property_type_heif_item_property_type_transform_rotation:
2188 heif_item_property_type = 1769107316;
2189#[doc = " heif_item_property_unknown = -1,"]
2190pub const heif_item_property_type_heif_item_property_type_transform_crop: heif_item_property_type =
2191 1668047216;
2192#[doc = " heif_item_property_unknown = -1,"]
2193pub const heif_item_property_type_heif_item_property_type_image_size: heif_item_property_type =
2194 1769173093;
2195#[doc = " heif_item_property_unknown = -1,"]
2196pub const heif_item_property_type_heif_item_property_type_uuid: heif_item_property_type =
2197 1970628964;
2198#[doc = " heif_item_property_unknown = -1,"]
2199pub const heif_item_property_type_heif_item_property_type_tai_clock_info: heif_item_property_type =
2200 1952541027;
2201#[doc = " heif_item_property_unknown = -1,"]
2202pub const heif_item_property_type_heif_item_property_type_tai_timestamp: heif_item_property_type =
2203 1769234793;
2204#[doc = " heif_item_property_unknown = -1,"]
2205pub const heif_item_property_type_heif_item_property_type_extended_language:
2206 heif_item_property_type = 1701604967;
2207#[doc = " ------------------------- item properties -------------------------"]
2208pub type heif_item_property_type = libc::c_uint;
2209unsafe extern "C" {
2210 #[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."]
2211 pub fn heif_item_get_properties_of_type(
2212 context: *const heif_context,
2213 id: heif_item_id,
2214 type_: heif_item_property_type,
2215 out_list: *mut heif_property_id,
2216 count: libc::c_int,
2217 ) -> libc::c_int;
2218}
2219unsafe extern "C" {
2220 #[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."]
2221 pub fn heif_item_get_transformation_properties(
2222 context: *const heif_context,
2223 id: heif_item_id,
2224 out_list: *mut heif_property_id,
2225 count: libc::c_int,
2226 ) -> libc::c_int;
2227}
2228unsafe extern "C" {
2229 pub fn heif_item_get_property_type(
2230 context: *const heif_context,
2231 id: heif_item_id,
2232 property_id: heif_property_id,
2233 ) -> heif_item_property_type;
2234}
2235#[doc = " The strings are managed by libheif. They will be deleted in heif_property_user_description_release()."]
2236#[repr(C)]
2237#[derive(Debug)]
2238pub struct heif_property_user_description {
2239 pub version: libc::c_int,
2240 #[doc = " version 1"]
2241 pub lang: *const libc::c_char,
2242 pub name: *const libc::c_char,
2243 pub description: *const libc::c_char,
2244 pub tags: *const libc::c_char,
2245}
2246unsafe extern "C" {
2247 #[doc = " Get the \"udes\" user description property content.\n Undefined strings are returned as empty strings."]
2248 pub fn heif_item_get_property_user_description(
2249 context: *const heif_context,
2250 itemId: heif_item_id,
2251 propertyId: heif_property_id,
2252 out: *mut *mut heif_property_user_description,
2253 ) -> heif_error;
2254}
2255unsafe extern "C" {
2256 #[doc = " Add a \"udes\" user description property to the item.\n If any string pointers are NULL, an empty string will be used instead."]
2257 pub fn heif_item_add_property_user_description(
2258 context: *const heif_context,
2259 itemId: heif_item_id,
2260 description: *const heif_property_user_description,
2261 out_propertyId: *mut heif_property_id,
2262 ) -> heif_error;
2263}
2264unsafe extern "C" {
2265 #[doc = " Release all strings and the object itself.\n Only call for objects that you received from heif_item_get_property_user_description()."]
2266 pub fn heif_property_user_description_release(arg1: *mut heif_property_user_description);
2267}
2268pub const heif_transform_mirror_direction_heif_transform_mirror_direction_invalid:
2269 heif_transform_mirror_direction = -1;
2270#[doc = " flip image vertically"]
2271pub const heif_transform_mirror_direction_heif_transform_mirror_direction_vertical:
2272 heif_transform_mirror_direction = 0;
2273#[doc = " flip image horizontally"]
2274pub const heif_transform_mirror_direction_heif_transform_mirror_direction_horizontal:
2275 heif_transform_mirror_direction = 1;
2276pub type heif_transform_mirror_direction = libc::c_int;
2277unsafe extern "C" {
2278 #[doc = " Will return 'heif_transform_mirror_direction_invalid' in case of error.\n If 'propertyId==0', it returns the first imir property found."]
2279 pub fn heif_item_get_property_transform_mirror(
2280 context: *const heif_context,
2281 itemId: heif_item_id,
2282 propertyId: heif_property_id,
2283 ) -> heif_transform_mirror_direction;
2284}
2285unsafe extern "C" {
2286 #[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."]
2287 pub fn heif_item_get_property_transform_rotation_ccw(
2288 context: *const heif_context,
2289 itemId: heif_item_id,
2290 propertyId: heif_property_id,
2291 ) -> libc::c_int;
2292}
2293unsafe extern "C" {
2294 #[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."]
2295 pub fn heif_item_get_property_transform_crop_borders(
2296 context: *const heif_context,
2297 itemId: heif_item_id,
2298 propertyId: heif_property_id,
2299 image_width: libc::c_int,
2300 image_height: libc::c_int,
2301 left: *mut libc::c_int,
2302 top: *mut libc::c_int,
2303 right: *mut libc::c_int,
2304 bottom: *mut libc::c_int,
2305 );
2306}
2307unsafe extern "C" {
2308 #[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."]
2309 pub fn heif_item_add_raw_property(
2310 context: *const heif_context,
2311 itemId: heif_item_id,
2312 fourcc_type: u32,
2313 uuid_type: *const u8,
2314 data: *const u8,
2315 size: usize,
2316 is_essential: libc::c_int,
2317 out_propertyId: *mut heif_property_id,
2318 ) -> heif_error;
2319}
2320unsafe extern "C" {
2321 pub fn heif_item_get_property_raw_size(
2322 context: *const heif_context,
2323 itemId: heif_item_id,
2324 propertyId: heif_property_id,
2325 out_size: *mut usize,
2326 ) -> heif_error;
2327}
2328unsafe extern "C" {
2329 #[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()."]
2330 pub fn heif_item_get_property_raw_data(
2331 context: *const heif_context,
2332 itemId: heif_item_id,
2333 propertyId: heif_property_id,
2334 out_data: *mut u8,
2335 ) -> heif_error;
2336}
2337unsafe extern "C" {
2338 #[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"]
2339 pub fn heif_item_get_property_uuid_type(
2340 context: *const heif_context,
2341 itemId: heif_item_id,
2342 propertyId: heif_property_id,
2343 out_extended_type: *mut [u8; 16usize],
2344 ) -> heif_error;
2345}
2346#[doc = " ------------------------- intrinsic and extrinsic matrices -------------------------"]
2347#[repr(C)]
2348#[derive(Debug, Copy, Clone)]
2349pub struct heif_camera_intrinsic_matrix {
2350 pub focal_length_x: f64,
2351 pub focal_length_y: f64,
2352 pub principal_point_x: f64,
2353 pub principal_point_y: f64,
2354 pub skew: f64,
2355}
2356unsafe extern "C" {
2357 pub fn heif_image_handle_has_camera_intrinsic_matrix(
2358 handle: *const heif_image_handle,
2359 ) -> libc::c_int;
2360}
2361unsafe extern "C" {
2362 pub fn heif_image_handle_get_camera_intrinsic_matrix(
2363 handle: *const heif_image_handle,
2364 out_matrix: *mut heif_camera_intrinsic_matrix,
2365 ) -> heif_error;
2366}
2367#[repr(C)]
2368#[derive(Debug)]
2369pub struct heif_camera_extrinsic_matrix {
2370 _unused: [u8; 0],
2371}
2372unsafe extern "C" {
2373 pub fn heif_image_handle_has_camera_extrinsic_matrix(
2374 handle: *const heif_image_handle,
2375 ) -> libc::c_int;
2376}
2377unsafe extern "C" {
2378 pub fn heif_image_handle_get_camera_extrinsic_matrix(
2379 handle: *const heif_image_handle,
2380 out_matrix: *mut *mut heif_camera_extrinsic_matrix,
2381 ) -> heif_error;
2382}
2383unsafe extern "C" {
2384 pub fn heif_camera_extrinsic_matrix_release(arg1: *mut heif_camera_extrinsic_matrix);
2385}
2386unsafe extern "C" {
2387 pub fn heif_camera_extrinsic_matrix_get_rotation_matrix(
2388 arg1: *const heif_camera_extrinsic_matrix,
2389 out_matrix_row_major: *mut f64,
2390 ) -> heif_error;
2391}
2392#[repr(C)]
2393#[derive(Debug)]
2394pub struct heif_region_item {
2395 _unused: [u8; 0],
2396}
2397#[doc = " Point geometry.\n\n The region is represented by a single point."]
2398pub const heif_region_type_heif_region_type_point: heif_region_type = 0;
2399#[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."]
2400pub const heif_region_type_heif_region_type_rectangle: heif_region_type = 1;
2401#[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."]
2402pub const heif_region_type_heif_region_type_ellipse: heif_region_type = 2;
2403#[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."]
2404pub const heif_region_type_heif_region_type_polygon: heif_region_type = 3;
2405#[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."]
2406pub const heif_region_type_heif_region_type_referenced_mask: heif_region_type = 4;
2407#[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."]
2408pub const heif_region_type_heif_region_type_inline_mask: heif_region_type = 5;
2409#[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."]
2410pub const heif_region_type_heif_region_type_polyline: heif_region_type = 6;
2411#[doc = " Region type.\n\n Each region item will contain zero or more regions, which may have different geometry or\n mask representations."]
2412pub type heif_region_type = libc::c_uint;
2413#[repr(C)]
2414#[derive(Debug)]
2415pub struct heif_region {
2416 _unused: [u8; 0],
2417}
2418unsafe extern "C" {
2419 #[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."]
2420 pub fn heif_image_handle_get_number_of_region_items(
2421 image_handle: *const heif_image_handle,
2422 ) -> libc::c_int;
2423}
2424unsafe extern "C" {
2425 #[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."]
2426 pub fn heif_image_handle_get_list_of_region_item_ids(
2427 image_handle: *const heif_image_handle,
2428 region_item_ids_array: *mut heif_item_id,
2429 max_count: libc::c_int,
2430 ) -> libc::c_int;
2431}
2432unsafe extern "C" {
2433 #[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"]
2434 pub fn heif_context_get_region_item(
2435 context: *const heif_context,
2436 region_item_id: heif_item_id,
2437 out: *mut *mut heif_region_item,
2438 ) -> heif_error;
2439}
2440unsafe extern "C" {
2441 #[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)"]
2442 pub fn heif_region_item_get_id(region_item: *mut heif_region_item) -> heif_item_id;
2443}
2444unsafe extern "C" {
2445 #[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."]
2446 pub fn heif_region_item_release(region_item: *mut heif_region_item);
2447}
2448unsafe extern "C" {
2449 #[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)"]
2450 pub fn heif_region_item_get_reference_size(
2451 arg1: *mut heif_region_item,
2452 out_width: *mut u32,
2453 out_height: *mut u32,
2454 );
2455}
2456unsafe extern "C" {
2457 #[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"]
2458 pub fn heif_region_item_get_number_of_regions(
2459 region_item: *const heif_region_item,
2460 ) -> libc::c_int;
2461}
2462unsafe extern "C" {
2463 #[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."]
2464 pub fn heif_region_item_get_list_of_regions(
2465 region_item: *const heif_region_item,
2466 out_regions_array: *mut *mut heif_region,
2467 max_count: libc::c_int,
2468 ) -> libc::c_int;
2469}
2470unsafe extern "C" {
2471 #[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"]
2472 pub fn heif_region_release(region: *const heif_region);
2473}
2474unsafe extern "C" {
2475 #[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"]
2476 pub fn heif_region_release_many(
2477 regions_array: *const *const heif_region,
2478 num_items: libc::c_int,
2479 );
2480}
2481unsafe extern "C" {
2482 #[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"]
2483 pub fn heif_region_get_type(region: *const heif_region) -> heif_region_type;
2484}
2485unsafe extern "C" {
2486 #[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."]
2487 pub fn heif_region_get_point(
2488 region: *const heif_region,
2489 out_x: *mut i32,
2490 out_y: *mut i32,
2491 ) -> heif_error;
2492}
2493unsafe extern "C" {
2494 #[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."]
2495 pub fn heif_region_get_point_transformed(
2496 region: *const heif_region,
2497 image_id: heif_item_id,
2498 out_x: *mut f64,
2499 out_y: *mut f64,
2500 ) -> heif_error;
2501}
2502unsafe extern "C" {
2503 #[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."]
2504 pub fn heif_region_get_rectangle(
2505 region: *const heif_region,
2506 out_x: *mut i32,
2507 out_y: *mut i32,
2508 out_width: *mut u32,
2509 out_height: *mut u32,
2510 ) -> heif_error;
2511}
2512unsafe extern "C" {
2513 #[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."]
2514 pub fn heif_region_get_rectangle_transformed(
2515 region: *const heif_region,
2516 image_id: heif_item_id,
2517 out_x: *mut f64,
2518 out_y: *mut f64,
2519 out_width: *mut f64,
2520 out_height: *mut f64,
2521 ) -> heif_error;
2522}
2523unsafe extern "C" {
2524 #[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."]
2525 pub fn heif_region_get_ellipse(
2526 region: *const heif_region,
2527 out_x: *mut i32,
2528 out_y: *mut i32,
2529 out_radius_x: *mut u32,
2530 out_radius_y: *mut u32,
2531 ) -> heif_error;
2532}
2533unsafe extern "C" {
2534 #[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."]
2535 pub fn heif_region_get_ellipse_transformed(
2536 region: *const heif_region,
2537 image_id: heif_item_id,
2538 out_x: *mut f64,
2539 out_y: *mut f64,
2540 out_radius_x: *mut f64,
2541 out_radius_y: *mut f64,
2542 ) -> heif_error;
2543}
2544unsafe extern "C" {
2545 #[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."]
2546 pub fn heif_region_get_polygon_num_points(region: *const heif_region) -> libc::c_int;
2547}
2548unsafe extern "C" {
2549 #[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."]
2550 pub fn heif_region_get_polygon_points(
2551 region: *const heif_region,
2552 out_pts_array: *mut i32,
2553 ) -> heif_error;
2554}
2555unsafe extern "C" {
2556 #[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."]
2557 pub fn heif_region_get_polygon_points_transformed(
2558 region: *const heif_region,
2559 image_id: heif_item_id,
2560 out_pts_array: *mut f64,
2561 ) -> heif_error;
2562}
2563unsafe extern "C" {
2564 #[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."]
2565 pub fn heif_region_get_polyline_num_points(region: *const heif_region) -> libc::c_int;
2566}
2567unsafe extern "C" {
2568 #[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."]
2569 pub fn heif_region_get_polyline_points(
2570 region: *const heif_region,
2571 out_pts_array: *mut i32,
2572 ) -> heif_error;
2573}
2574unsafe extern "C" {
2575 #[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."]
2576 pub fn heif_region_get_polyline_points_transformed(
2577 region: *const heif_region,
2578 image_id: heif_item_id,
2579 out_pts_array: *mut f64,
2580 ) -> heif_error;
2581}
2582unsafe extern "C" {
2583 #[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"]
2584 pub fn heif_region_get_referenced_mask_ID(
2585 region: *const heif_region,
2586 out_x: *mut i32,
2587 out_y: *mut i32,
2588 out_width: *mut u32,
2589 out_height: *mut u32,
2590 out_mask_item_id: *mut heif_item_id,
2591 ) -> heif_error;
2592}
2593unsafe extern "C" {
2594 #[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."]
2595 pub fn heif_region_get_inline_mask_data_len(region: *const heif_region) -> usize;
2596}
2597unsafe extern "C" {
2598 #[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"]
2599 pub fn heif_region_get_inline_mask_data(
2600 region: *const heif_region,
2601 out_x: *mut i32,
2602 out_y: *mut i32,
2603 out_width: *mut u32,
2604 out_height: *mut u32,
2605 out_mask_data: *mut u8,
2606 ) -> heif_error;
2607}
2608unsafe extern "C" {
2609 #[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"]
2610 pub fn heif_region_get_mask_image(
2611 region: *const heif_region,
2612 out_x: *mut i32,
2613 out_y: *mut i32,
2614 out_width: *mut u32,
2615 out_height: *mut u32,
2616 out_mask_image: *mut *mut heif_image,
2617 ) -> heif_error;
2618}
2619unsafe extern "C" {
2620 #[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"]
2621 pub fn heif_image_handle_add_region_item(
2622 image_handle: *mut heif_image_handle,
2623 reference_width: u32,
2624 reference_height: u32,
2625 out_region_item: *mut *mut heif_region_item,
2626 ) -> heif_error;
2627}
2628unsafe extern "C" {
2629 #[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."]
2630 pub fn heif_region_item_add_region_point(
2631 region_item: *mut heif_region_item,
2632 x: i32,
2633 y: i32,
2634 out_region: *mut *mut heif_region,
2635 ) -> heif_error;
2636}
2637unsafe extern "C" {
2638 #[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."]
2639 pub fn heif_region_item_add_region_rectangle(
2640 region_item: *mut heif_region_item,
2641 x: i32,
2642 y: i32,
2643 width: u32,
2644 height: u32,
2645 out_region: *mut *mut heif_region,
2646 ) -> heif_error;
2647}
2648unsafe extern "C" {
2649 #[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."]
2650 pub fn heif_region_item_add_region_ellipse(
2651 region_item: *mut heif_region_item,
2652 x: i32,
2653 y: i32,
2654 radius_x: u32,
2655 radius_y: u32,
2656 out_region: *mut *mut heif_region,
2657 ) -> heif_error;
2658}
2659unsafe extern "C" {
2660 #[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."]
2661 pub fn heif_region_item_add_region_polygon(
2662 region_item: *mut heif_region_item,
2663 pts_array: *const i32,
2664 nPoints: libc::c_int,
2665 out_region: *mut *mut heif_region,
2666 ) -> heif_error;
2667}
2668unsafe extern "C" {
2669 #[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."]
2670 pub fn heif_region_item_add_region_polyline(
2671 region_item: *mut heif_region_item,
2672 pts_array: *const i32,
2673 nPoints: libc::c_int,
2674 out_region: *mut *mut heif_region,
2675 ) -> heif_error;
2676}
2677unsafe extern "C" {
2678 #[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."]
2679 pub fn heif_region_item_add_region_referenced_mask(
2680 region_item: *mut heif_region_item,
2681 x: i32,
2682 y: i32,
2683 width: u32,
2684 height: u32,
2685 mask_item_id: heif_item_id,
2686 out_region: *mut *mut heif_region,
2687 ) -> heif_error;
2688}
2689unsafe extern "C" {
2690 #[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"]
2691 pub fn heif_region_item_add_region_inline_mask_data(
2692 region_item: *mut heif_region_item,
2693 x: i32,
2694 y: i32,
2695 width: u32,
2696 height: u32,
2697 mask_data: *const u8,
2698 mask_data_len: usize,
2699 out_region: *mut *mut heif_region,
2700 ) -> heif_error;
2701}
2702unsafe extern "C" {
2703 #[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"]
2704 pub fn heif_region_item_add_region_inline_mask(
2705 region_item: *mut heif_region_item,
2706 x: i32,
2707 y: i32,
2708 width: u32,
2709 height: u32,
2710 image: *mut heif_image,
2711 out_region: *mut *mut heif_region,
2712 ) -> heif_error;
2713}
2714unsafe extern "C" {
2715 #[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"]
2716 pub fn heif_context_get_number_of_items(ctx: *const heif_context) -> libc::c_int;
2717}
2718unsafe extern "C" {
2719 #[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}."]
2720 pub fn heif_context_get_list_of_item_IDs(
2721 ctx: *const heif_context,
2722 ID_array: *mut heif_item_id,
2723 count: libc::c_int,
2724 ) -> libc::c_int;
2725}
2726unsafe extern "C" {
2727 #[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 {@link 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"]
2728 pub fn heif_item_get_item_type(ctx: *const heif_context, item_id: heif_item_id) -> u32;
2729}
2730unsafe extern "C" {
2731 pub fn heif_item_is_item_hidden(ctx: *const heif_context, item_id: heif_item_id)
2732 -> libc::c_int;
2733}
2734unsafe extern "C" {
2735 #[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"]
2736 pub fn heif_item_get_mime_item_content_type(
2737 ctx: *const heif_context,
2738 item_id: heif_item_id,
2739 ) -> *const libc::c_char;
2740}
2741unsafe extern "C" {
2742 #[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"]
2743 pub fn heif_item_get_mime_item_content_encoding(
2744 ctx: *const heif_context,
2745 item_id: heif_item_id,
2746 ) -> *const libc::c_char;
2747}
2748unsafe extern "C" {
2749 #[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"]
2750 pub fn heif_item_get_uri_item_uri_type(
2751 ctx: *const heif_context,
2752 item_id: heif_item_id,
2753 ) -> *const libc::c_char;
2754}
2755unsafe extern "C" {
2756 pub fn heif_item_get_item_name(
2757 ctx: *const heif_context,
2758 item_id: heif_item_id,
2759 ) -> *const libc::c_char;
2760}
2761unsafe extern "C" {
2762 pub fn heif_item_set_item_name(
2763 ctx: *mut heif_context,
2764 item: heif_item_id,
2765 item_name: *const libc::c_char,
2766 ) -> heif_error;
2767}
2768unsafe extern "C" {
2769 #[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"]
2770 pub fn heif_item_get_item_data(
2771 ctx: *const heif_context,
2772 item_id: heif_item_id,
2773 out_compression_format: *mut heif_metadata_compression,
2774 out_data: *mut *mut u8,
2775 out_data_size: *mut usize,
2776 ) -> heif_error;
2777}
2778unsafe extern "C" {
2779 #[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"]
2780 pub fn heif_release_item_data(ctx: *const heif_context, item_data: *mut *mut u8);
2781}
2782unsafe extern "C" {
2783 #[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"]
2784 pub fn heif_item_get_property_extended_language(
2785 context: *const heif_context,
2786 itemId: heif_item_id,
2787 out_language: *mut *mut libc::c_char,
2788 ) -> heif_error;
2789}
2790unsafe extern "C" {
2791 pub fn heif_item_set_property_extended_language(
2792 context: *mut heif_context,
2793 item_id: heif_item_id,
2794 language: *const libc::c_char,
2795 out_optional_propertyId: *mut heif_property_id,
2796 ) -> heif_error;
2797}
2798unsafe extern "C" {
2799 #[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."]
2800 pub fn heif_context_get_item_references(
2801 ctx: *const heif_context,
2802 from_item_id: heif_item_id,
2803 index: libc::c_int,
2804 out_reference_type_4cc: *mut u32,
2805 out_references_to: *mut *mut heif_item_id,
2806 ) -> usize;
2807}
2808unsafe extern "C" {
2809 pub fn heif_release_item_references(
2810 ctx: *const heif_context,
2811 references: *mut *mut heif_item_id,
2812 );
2813}
2814unsafe extern "C" {
2815 pub fn heif_context_add_item_reference(
2816 ctx: *mut heif_context,
2817 reference_type: u32,
2818 from_item: heif_item_id,
2819 to_item: heif_item_id,
2820 ) -> heif_error;
2821}
2822unsafe extern "C" {
2823 pub fn heif_context_add_item_references(
2824 ctx: *mut heif_context,
2825 reference_type: u32,
2826 from_item: heif_item_id,
2827 to_item: *const heif_item_id,
2828 num_to_items: libc::c_int,
2829 ) -> heif_error;
2830}
2831unsafe extern "C" {
2832 #[doc = " ------------------------- adding new items -------------------------"]
2833 pub fn heif_context_add_item(
2834 ctx: *mut heif_context,
2835 item_type: *const libc::c_char,
2836 data: *const libc::c_void,
2837 size: libc::c_int,
2838 out_item_id: *mut heif_item_id,
2839 ) -> heif_error;
2840}
2841unsafe extern "C" {
2842 pub fn heif_context_add_mime_item(
2843 ctx: *mut heif_context,
2844 content_type: *const libc::c_char,
2845 content_encoding: heif_metadata_compression,
2846 data: *const libc::c_void,
2847 size: libc::c_int,
2848 out_item_id: *mut heif_item_id,
2849 ) -> heif_error;
2850}
2851unsafe extern "C" {
2852 pub fn heif_context_add_precompressed_mime_item(
2853 ctx: *mut heif_context,
2854 content_type: *const libc::c_char,
2855 content_encoding: *const libc::c_char,
2856 data: *const libc::c_void,
2857 size: libc::c_int,
2858 out_item_id: *mut heif_item_id,
2859 ) -> heif_error;
2860}
2861unsafe extern "C" {
2862 pub fn heif_context_add_uri_item(
2863 ctx: *mut heif_context,
2864 item_uri_type: *const libc::c_char,
2865 data: *const libc::c_void,
2866 size: libc::c_int,
2867 out_item_id: *mut heif_item_id,
2868 ) -> heif_error;
2869}
2870unsafe extern "C" {
2871 #[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."]
2872 pub fn heif_context_has_sequence(arg1: *const heif_context) -> libc::c_int;
2873}
2874unsafe extern "C" {
2875 #[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."]
2876 pub fn heif_context_get_sequence_timescale(arg1: *const heif_context) -> u32;
2877}
2878unsafe extern "C" {
2879 #[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."]
2880 pub fn heif_context_get_sequence_duration(arg1: *const heif_context) -> u64;
2881}
2882#[repr(C)]
2883#[derive(Debug)]
2884pub struct heif_track {
2885 _unused: [u8; 0],
2886}
2887unsafe extern "C" {
2888 #[doc = " Free a `heif_track` object received from libheif.\n Passing NULL is ok."]
2889 pub fn heif_track_release(arg1: *mut heif_track);
2890}
2891unsafe extern "C" {
2892 #[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."]
2893 pub fn heif_context_number_of_sequence_tracks(arg1: *const heif_context) -> libc::c_int;
2894}
2895unsafe extern "C" {
2896 #[doc = " Returns the IDs for each of the tracks stored in the HEIF file.\n The output array must have heif_context_number_of_sequence_tracks() entries."]
2897 pub fn heif_context_get_track_ids(
2898 ctx: *const heif_context,
2899 out_track_id_array: *mut [u32; 0usize],
2900 );
2901}
2902unsafe extern "C" {
2903 #[doc = " Get the ID of the passed track.\n The track ID will never be 0."]
2904 pub fn heif_track_get_id(track: *const heif_track) -> u32;
2905}
2906unsafe extern "C" {
2907 #[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."]
2908 pub fn heif_context_get_track(arg1: *const heif_context, id: u32) -> *mut heif_track;
2909}
2910pub type heif_track_type = u32;
2911pub const heif_track_type_4cc_heif_track_type_video: heif_track_type_4cc = 1986618469;
2912pub const heif_track_type_4cc_heif_track_type_image_sequence: heif_track_type_4cc = 1885954932;
2913pub const heif_track_type_4cc_heif_track_type_auxiliary: heif_track_type_4cc = 1635088502;
2914pub const heif_track_type_4cc_heif_track_type_metadata: heif_track_type_4cc = 1835365473;
2915pub type heif_track_type_4cc = libc::c_uint;
2916unsafe extern "C" {
2917 #[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"]
2918 pub fn heif_track_get_track_handler_type(arg1: *const heif_track) -> heif_track_type;
2919}
2920pub const heif_auxiliary_track_info_type_heif_auxiliary_track_info_type_unknown:
2921 heif_auxiliary_track_info_type = 0;
2922pub const heif_auxiliary_track_info_type_heif_auxiliary_track_info_type_alpha:
2923 heif_auxiliary_track_info_type = 1;
2924pub type heif_auxiliary_track_info_type = libc::c_uint;
2925unsafe extern "C" {
2926 pub fn heif_track_get_auxiliary_info_type(
2927 arg1: *const heif_track,
2928 ) -> heif_auxiliary_track_info_type;
2929}
2930unsafe extern "C" {
2931 pub fn heif_track_get_auxiliary_info_type_urn(arg1: *const heif_track) -> *const libc::c_char;
2932}
2933unsafe extern "C" {
2934 pub fn heif_track_has_alpha_channel(arg1: *const heif_track) -> libc::c_int;
2935}
2936unsafe extern "C" {
2937 #[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"]
2938 pub fn heif_track_get_timescale(arg1: *const heif_track) -> u32;
2939}
2940unsafe extern "C" {
2941 #[doc = " Get the image resolution of the track.\n If the passed track is no visual track, an error is returned."]
2942 pub fn heif_track_get_image_resolution(
2943 arg1: *const heif_track,
2944 out_width: *mut u16,
2945 out_height: *mut u16,
2946 ) -> heif_error;
2947}
2948unsafe extern "C" {
2949 #[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."]
2950 pub fn heif_track_decode_next_image(
2951 track: *mut heif_track,
2952 out_img: *mut *mut heif_image,
2953 colorspace: heif_colorspace,
2954 chroma: heif_chroma,
2955 options: *const heif_decoding_options,
2956 ) -> heif_error;
2957}
2958unsafe extern "C" {
2959 #[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."]
2960 pub fn heif_image_get_duration(arg1: *const heif_image) -> u32;
2961}
2962unsafe extern "C" {
2963 #[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'."]
2964 pub fn heif_track_get_sample_entry_type_of_first_cluster(arg1: *const heif_track) -> u32;
2965}
2966unsafe extern "C" {
2967 #[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()`."]
2968 pub fn heif_track_get_urim_sample_entry_uri_of_first_cluster(
2969 arg1: *const heif_track,
2970 out_uri: *mut *const libc::c_char,
2971 ) -> heif_error;
2972}
2973#[repr(C)]
2974#[derive(Debug)]
2975pub struct heif_raw_sequence_sample {
2976 _unused: [u8; 0],
2977}
2978unsafe extern "C" {
2979 #[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()."]
2980 pub fn heif_track_get_next_raw_sequence_sample(
2981 arg1: *mut heif_track,
2982 out_sample: *mut *mut heif_raw_sequence_sample,
2983 ) -> heif_error;
2984}
2985unsafe extern "C" {
2986 #[doc = " Release a heif_raw_sequence_sample object.\n You may pass NULL."]
2987 pub fn heif_raw_sequence_sample_release(arg1: *mut heif_raw_sequence_sample);
2988}
2989unsafe extern "C" {
2990 #[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)."]
2991 pub fn heif_raw_sequence_sample_get_data(
2992 arg1: *const heif_raw_sequence_sample,
2993 out_array_size: *mut usize,
2994 ) -> *const u8;
2995}
2996unsafe extern "C" {
2997 #[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()'."]
2998 pub fn heif_raw_sequence_sample_get_data_size(arg1: *const heif_raw_sequence_sample) -> usize;
2999}
3000unsafe extern "C" {
3001 #[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."]
3002 pub fn heif_raw_sequence_sample_get_duration(arg1: *const heif_raw_sequence_sample) -> u32;
3003}
3004unsafe extern "C" {
3005 #[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."]
3006 pub fn heif_context_set_sequence_timescale(arg1: *mut heif_context, timescale: u32);
3007}
3008unsafe extern "C" {
3009 #[doc = " Number of times the sequence should be played in total (default = 1).\n Can be set to heif_sequence_maximum_number_of_repetitions."]
3010 pub fn heif_context_set_number_of_sequence_repetitions(
3011 arg1: *mut heif_context,
3012 number_of_repetitions: u32,
3013 );
3014}
3015pub const heif_sample_aux_info_presence_heif_sample_aux_info_presence_none:
3016 heif_sample_aux_info_presence = 0;
3017pub const heif_sample_aux_info_presence_heif_sample_aux_info_presence_optional:
3018 heif_sample_aux_info_presence = 1;
3019pub const heif_sample_aux_info_presence_heif_sample_aux_info_presence_mandatory:
3020 heif_sample_aux_info_presence = 2;
3021#[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."]
3022pub type heif_sample_aux_info_presence = libc::c_uint;
3023#[repr(C)]
3024#[derive(Debug)]
3025pub struct heif_track_options {
3026 _unused: [u8; 0],
3027}
3028unsafe extern "C" {
3029 #[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."]
3030 pub fn heif_track_options_alloc() -> *mut heif_track_options;
3031}
3032unsafe extern "C" {
3033 pub fn heif_track_options_release(arg1: *mut heif_track_options);
3034}
3035unsafe extern "C" {
3036 #[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"]
3037 pub fn heif_track_options_set_timescale(arg1: *mut heif_track_options, timescale: u32);
3038}
3039unsafe extern "C" {
3040 #[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."]
3041 pub fn heif_track_options_set_interleaved_sample_aux_infos(
3042 arg1: *mut heif_track_options,
3043 interleaved_flag: libc::c_int,
3044 );
3045}
3046unsafe extern "C" {
3047 pub fn heif_track_options_enable_sample_tai_timestamps(
3048 arg1: *mut heif_track_options,
3049 arg2: *const heif_tai_clock_info,
3050 arg3: heif_sample_aux_info_presence,
3051 ) -> heif_error;
3052}
3053unsafe extern "C" {
3054 pub fn heif_track_options_enable_sample_gimi_content_ids(
3055 arg1: *mut heif_track_options,
3056 arg2: heif_sample_aux_info_presence,
3057 );
3058}
3059unsafe extern "C" {
3060 #[doc = " Set the GIMI format track ID string. If NULL is passed, no track ID is saved.\n @param track_id"]
3061 pub fn heif_track_options_set_gimi_track_id(
3062 arg1: *mut heif_track_options,
3063 track_id: *const libc::c_char,
3064 );
3065}
3066#[doc = " Only independently decodable keyframes."]
3067pub const heif_sequence_gop_structure_heif_sequence_gop_structure_intra_only:
3068 heif_sequence_gop_structure = 0;
3069#[doc = " No frame reordering, usually an IPPPP structure."]
3070pub const heif_sequence_gop_structure_heif_sequence_gop_structure_lowdelay:
3071 heif_sequence_gop_structure = 1;
3072#[doc = " All frame types are allowed, including frame reordering, to achieve\n the best compression ratio."]
3073pub const heif_sequence_gop_structure_heif_sequence_gop_structure_unrestricted:
3074 heif_sequence_gop_structure = 2;
3075#[doc = " --- writing visual tracks"]
3076pub type heif_sequence_gop_structure = libc::c_uint;
3077#[repr(C)]
3078#[derive(Debug)]
3079pub struct heif_sequence_encoding_options {
3080 pub version: u8,
3081 #[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."]
3082 pub output_nclx_profile: *const heif_color_profile_nclx,
3083 pub color_conversion_options: heif_color_conversion_options,
3084 #[doc = " version 2 options"]
3085 pub gop_structure: heif_sequence_gop_structure,
3086 #[doc = " 0 - undefined"]
3087 pub keyframe_distance_min: libc::c_int,
3088 #[doc = " 0 - undefined"]
3089 pub keyframe_distance_max: libc::c_int,
3090 pub save_alpha_channel: libc::c_int,
3091}
3092unsafe extern "C" {
3093 pub fn heif_sequence_encoding_options_alloc() -> *mut heif_sequence_encoding_options;
3094}
3095unsafe extern "C" {
3096 pub fn heif_sequence_encoding_options_release(arg1: *mut heif_sequence_encoding_options);
3097}
3098unsafe extern "C" {
3099 #[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"]
3100 pub fn heif_context_add_visual_sequence_track(
3101 arg1: *mut heif_context,
3102 width: u16,
3103 height: u16,
3104 track_type: heif_track_type,
3105 track_options: *const heif_track_options,
3106 encoding_options: *const heif_sequence_encoding_options,
3107 out_track: *mut *mut heif_track,
3108 ) -> heif_error;
3109}
3110unsafe extern "C" {
3111 #[doc = " Set the image display duration in the track's timescale units."]
3112 pub fn heif_image_set_duration(arg1: *mut heif_image, duration: u32);
3113}
3114unsafe extern "C" {
3115 #[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."]
3116 pub fn heif_track_encode_sequence_image(
3117 arg1: *mut heif_track,
3118 image: *const heif_image,
3119 encoder: *mut heif_encoder,
3120 sequence_encoding_options: *const heif_sequence_encoding_options,
3121 ) -> heif_error;
3122}
3123unsafe extern "C" {
3124 #[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."]
3125 pub fn heif_track_encode_end_of_sequence(
3126 arg1: *mut heif_track,
3127 encoder: *mut heif_encoder,
3128 ) -> heif_error;
3129}
3130unsafe extern "C" {
3131 #[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}."]
3132 pub fn heif_context_add_uri_metadata_sequence_track(
3133 arg1: *mut heif_context,
3134 uri: *const libc::c_char,
3135 options: *const heif_track_options,
3136 out_track: *mut *mut heif_track,
3137 ) -> heif_error;
3138}
3139unsafe extern "C" {
3140 #[doc = " Allocate a new heif_raw_sequence_sample object.\n Free with heif_raw_sequence_sample_release()."]
3141 pub fn heif_raw_sequence_sample_alloc() -> *mut heif_raw_sequence_sample;
3142}
3143unsafe extern "C" {
3144 #[doc = " Set the raw sequence sample data."]
3145 pub fn heif_raw_sequence_sample_set_data(
3146 arg1: *mut heif_raw_sequence_sample,
3147 data: *const u8,
3148 size: usize,
3149 ) -> heif_error;
3150}
3151unsafe extern "C" {
3152 #[doc = " Set the sample duration in track timescale units."]
3153 pub fn heif_raw_sequence_sample_set_duration(
3154 arg1: *mut heif_raw_sequence_sample,
3155 duration: u32,
3156 );
3157}
3158unsafe extern "C" {
3159 #[doc = " Add a raw sequence sample (usually a metadata sample) to the (metadata) track."]
3160 pub fn heif_track_add_raw_sequence_sample(
3161 arg1: *mut heif_track,
3162 arg2: *const heif_raw_sequence_sample,
3163 ) -> heif_error;
3164}
3165#[doc = " Contains the type of sample auxiliary data assigned to the track samples."]
3166#[repr(C)]
3167#[derive(Debug, Copy, Clone)]
3168pub struct heif_sample_aux_info_type {
3169 pub type_: u32,
3170 pub parameter: u32,
3171}
3172unsafe extern "C" {
3173 #[doc = " Returns how many different types of sample auxiliary data units are assigned to this track's samples."]
3174 pub fn heif_track_get_number_of_sample_aux_infos(arg1: *const heif_track) -> libc::c_int;
3175}
3176unsafe extern "C" {
3177 #[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."]
3178 pub fn heif_track_get_sample_aux_info_types(
3179 arg1: *const heif_track,
3180 out_types: *mut [heif_sample_aux_info_type; 0usize],
3181 );
3182}
3183unsafe extern "C" {
3184 #[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()`."]
3185 pub fn heif_track_get_gimi_track_content_id(arg1: *const heif_track) -> *const libc::c_char;
3186}
3187unsafe extern "C" {
3188 #[doc = " Get the GIMI content ID stored in the image sample.\n If there is no content ID, NULL is returned.\n @return"]
3189 pub fn heif_image_get_gimi_sample_content_id(arg1: *const heif_image) -> *const libc::c_char;
3190}
3191unsafe extern "C" {
3192 #[doc = " Get the GIMI content ID stored in the metadata sample.\n If there is no content ID, NULL is returned.\n @return"]
3193 pub fn heif_raw_sequence_sample_get_gimi_sample_content_id(
3194 arg1: *const heif_raw_sequence_sample,
3195 ) -> *const libc::c_char;
3196}
3197unsafe extern "C" {
3198 #[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."]
3199 pub fn heif_image_set_gimi_sample_content_id(
3200 arg1: *mut heif_image,
3201 contentID: *const libc::c_char,
3202 );
3203}
3204unsafe extern "C" {
3205 #[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."]
3206 pub fn heif_raw_sequence_sample_set_gimi_sample_content_id(
3207 arg1: *mut heif_raw_sequence_sample,
3208 contentID: *const libc::c_char,
3209 );
3210}
3211unsafe extern "C" {
3212 #[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."]
3213 pub fn heif_raw_sequence_sample_has_tai_timestamp(
3214 arg1: *const heif_raw_sequence_sample,
3215 ) -> libc::c_int;
3216}
3217unsafe extern "C" {
3218 #[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."]
3219 pub fn heif_raw_sequence_sample_get_tai_timestamp(
3220 arg1: *const heif_raw_sequence_sample,
3221 ) -> *const heif_tai_timestamp_packet;
3222}
3223unsafe extern "C" {
3224 #[doc = " Set the TAI timestamp for a raw sequence sample.\n The timestamp will be copied, you can release it after calling this function."]
3225 pub fn heif_raw_sequence_sample_set_tai_timestamp(
3226 sample: *mut heif_raw_sequence_sample,
3227 timestamp: *const heif_tai_timestamp_packet,
3228 );
3229}
3230unsafe extern "C" {
3231 #[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."]
3232 pub fn heif_track_get_tai_clock_info_of_first_cluster(
3233 arg1: *mut heif_track,
3234 ) -> *const heif_tai_clock_info;
3235}
3236#[doc = " track_description"]
3237pub const heif_track_reference_type_heif_track_reference_type_description:
3238 heif_track_reference_type = 1667527523;
3239#[doc = " thumbnails"]
3240pub const heif_track_reference_type_heif_track_reference_type_thumbnails:
3241 heif_track_reference_type = 1953000802;
3242#[doc = " auxiliary data (e.g. depth maps or alpha channel)"]
3243pub const heif_track_reference_type_heif_track_reference_type_auxiliary: heif_track_reference_type =
3244 1635088492;
3245#[doc = " --- track references"]
3246pub type heif_track_reference_type = libc::c_uint;
3247unsafe extern "C" {
3248 #[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."]
3249 pub fn heif_track_add_reference_to_track(
3250 arg1: *mut heif_track,
3251 reference_type: u32,
3252 to_track: *const heif_track,
3253 );
3254}
3255unsafe extern "C" {
3256 #[doc = " Return the number of different reference types used in this track's tref box."]
3257 pub fn heif_track_get_number_of_track_reference_types(arg1: *const heif_track) -> usize;
3258}
3259unsafe extern "C" {
3260 #[doc = " List the reference types used in this track.\n The passed array must have heif_track_get_number_of_track_reference_types() entries."]
3261 pub fn heif_track_get_track_reference_types(
3262 arg1: *const heif_track,
3263 out_reference_types: *mut [u32; 0usize],
3264 );
3265}
3266unsafe extern "C" {
3267 #[doc = " Get the number of references of the passed type."]
3268 pub fn heif_track_get_number_of_track_reference_of_type(
3269 arg1: *const heif_track,
3270 reference_type: u32,
3271 ) -> usize;
3272}
3273unsafe extern "C" {
3274 #[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."]
3275 pub fn heif_track_get_references_from_track(
3276 arg1: *const heif_track,
3277 reference_type: u32,
3278 out_to_track_id: *mut [u32; 0usize],
3279 ) -> usize;
3280}
3281unsafe extern "C" {
3282 #[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."]
3283 pub fn heif_track_find_referring_tracks(
3284 arg1: *const heif_track,
3285 reference_type: u32,
3286 out_track_id: *mut [u32; 0usize],
3287 array_size: usize,
3288 ) -> usize;
3289}
3290#[repr(C)]
3291#[derive(Debug, Copy, Clone)]
3292pub struct heif_tai_clock_info {
3293 pub version: u8,
3294 #[doc = " Standard deviation for timestamp generation process.\n May be `heif_tai_clock_info_time_uncertainty_unknown` if unknown."]
3295 pub time_uncertainty: u64,
3296 #[doc = " Receptor clock resolution in nanoseconds."]
3297 pub clock_resolution: u32,
3298 #[doc = " Clock drift rate in picoseconds/second when synchronization is stopped.\n Maybe `heif_tai_clock_info_clock_drift_rate_unknown` if unknown."]
3299 pub clock_drift_rate: i32,
3300 #[doc = " Whether clock is synchronized to an atomic source,\n see the clock_type defines below."]
3301 pub clock_type: u8,
3302}
3303unsafe extern "C" {
3304 #[doc = " Allocate a new heif_tai_clock_info object and initialize with default values."]
3305 pub fn heif_tai_clock_info_alloc() -> *mut heif_tai_clock_info;
3306}
3307unsafe extern "C" {
3308 #[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."]
3309 pub fn heif_tai_clock_info_copy(dst: *mut heif_tai_clock_info, src: *const heif_tai_clock_info);
3310}
3311unsafe extern "C" {
3312 pub fn heif_tai_clock_info_release(clock_info: *mut heif_tai_clock_info);
3313}
3314#[repr(C)]
3315#[derive(Debug, Copy, Clone)]
3316pub struct heif_tai_timestamp_packet {
3317 pub version: u8,
3318 #[doc = " number of nanoseconds since TAI epoch (1958-01-01T00:00:00.0)"]
3319 pub tai_timestamp: u64,
3320 #[doc = " bool"]
3321 pub synchronization_state: u8,
3322 #[doc = " bool"]
3323 pub timestamp_generation_failure: u8,
3324 #[doc = " bool"]
3325 pub timestamp_is_modified: u8,
3326}
3327unsafe extern "C" {
3328 #[doc = " Allocate a new heif_tai_timestamp_packet object and initialize with default values."]
3329 pub fn heif_tai_timestamp_packet_alloc() -> *mut heif_tai_timestamp_packet;
3330}
3331unsafe extern "C" {
3332 #[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."]
3333 pub fn heif_tai_timestamp_packet_copy(
3334 dst: *mut heif_tai_timestamp_packet,
3335 src: *const heif_tai_timestamp_packet,
3336 );
3337}
3338unsafe extern "C" {
3339 pub fn heif_tai_timestamp_packet_release(arg1: *mut heif_tai_timestamp_packet);
3340}
3341unsafe extern "C" {
3342 #[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."]
3343 pub fn heif_item_set_property_tai_clock_info(
3344 ctx: *mut heif_context,
3345 itemId: heif_item_id,
3346 clock_info: *const heif_tai_clock_info,
3347 out_optional_propertyId: *mut heif_property_id,
3348 ) -> heif_error;
3349}
3350unsafe extern "C" {
3351 #[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."]
3352 pub fn heif_item_get_property_tai_clock_info(
3353 ctx: *const heif_context,
3354 itemId: heif_item_id,
3355 out_clock: *mut *mut heif_tai_clock_info,
3356 ) -> heif_error;
3357}
3358unsafe extern "C" {
3359 #[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."]
3360 pub fn heif_item_set_property_tai_timestamp(
3361 ctx: *mut heif_context,
3362 itemId: heif_item_id,
3363 timestamp: *const heif_tai_timestamp_packet,
3364 out_optional_propertyId: *mut heif_property_id,
3365 ) -> heif_error;
3366}
3367unsafe extern "C" {
3368 #[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."]
3369 pub fn heif_item_get_property_tai_timestamp(
3370 ctx: *const heif_context,
3371 itemId: heif_item_id,
3372 out_timestamp: *mut *mut heif_tai_timestamp_packet,
3373 ) -> heif_error;
3374}
3375unsafe extern "C" {
3376 #[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."]
3377 pub fn heif_image_set_tai_timestamp(
3378 img: *mut heif_image,
3379 timestamp: *const heif_tai_timestamp_packet,
3380 ) -> heif_error;
3381}
3382unsafe extern "C" {
3383 #[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."]
3384 pub fn heif_image_get_tai_timestamp(
3385 img: *const heif_image,
3386 out_timestamp: *mut *mut heif_tai_timestamp_packet,
3387 ) -> heif_error;
3388}