1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
/* automatically generated by rust-bindgen 0.69.1 */

extern "C" {
    #[doc = " Version string of linked libheif library."]
    pub fn heif_get_version() -> *const libc::c_char;
}
extern "C" {
    #[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"]
    pub fn heif_get_version_number() -> u32;
}
extern "C" {
    #[doc = " Numeric part \"HH\" from above. Returned as a decimal number."]
    pub fn heif_get_version_number_major() -> libc::c_int;
}
extern "C" {
    #[doc = " Numeric part \"MM\" from above. Returned as a decimal number."]
    pub fn heif_get_version_number_minor() -> libc::c_int;
}
extern "C" {
    #[doc = " Numeric part \"LL\" from above. Returned as a decimal number."]
    pub fn heif_get_version_number_maintenance() -> libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_image_handle {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_image {
    _unused: [u8; 0],
}
#[doc = " Everything ok, no error occurred."]
pub const heif_error_code_heif_error_Ok: heif_error_code = 0;
#[doc = " Input file does not exist."]
pub const heif_error_code_heif_error_Input_does_not_exist: heif_error_code = 1;
#[doc = " Error in input file. Corrupted or invalid content."]
pub const heif_error_code_heif_error_Invalid_input: heif_error_code = 2;
#[doc = " Input file type is not supported."]
pub const heif_error_code_heif_error_Unsupported_filetype: heif_error_code = 3;
#[doc = " Image requires an unsupported decoder feature."]
pub const heif_error_code_heif_error_Unsupported_feature: heif_error_code = 4;
#[doc = " Library API has been used in an invalid way."]
pub const heif_error_code_heif_error_Usage_error: heif_error_code = 5;
#[doc = " Could not allocate enough memory."]
pub const heif_error_code_heif_error_Memory_allocation_error: heif_error_code = 6;
#[doc = " The decoder plugin generated an error"]
pub const heif_error_code_heif_error_Decoder_plugin_error: heif_error_code = 7;
#[doc = " The encoder plugin generated an error"]
pub const heif_error_code_heif_error_Encoder_plugin_error: heif_error_code = 8;
#[doc = " Error during encoding or when writing to the output"]
pub const heif_error_code_heif_error_Encoding_error: heif_error_code = 9;
#[doc = " Application has asked for a color profile type that does not exist"]
pub const heif_error_code_heif_error_Color_profile_does_not_exist: heif_error_code = 10;
#[doc = " Error loading a dynamic plugin"]
pub const heif_error_code_heif_error_Plugin_loading_error: heif_error_code = 11;
pub type heif_error_code = libc::c_uint;
#[doc = " no further information available"]
pub const heif_suberror_code_heif_suberror_Unspecified: heif_suberror_code = 0;
#[doc = " End of data reached unexpectedly."]
pub const heif_suberror_code_heif_suberror_End_of_data: heif_suberror_code = 100;
#[doc = " Size of box (defined in header) is wrong"]
pub const heif_suberror_code_heif_suberror_Invalid_box_size: heif_suberror_code = 101;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_ftyp_box: heif_suberror_code = 102;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_idat_box: heif_suberror_code = 103;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_meta_box: heif_suberror_code = 104;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_hdlr_box: heif_suberror_code = 105;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_hvcC_box: heif_suberror_code = 106;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_pitm_box: heif_suberror_code = 107;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_ipco_box: heif_suberror_code = 108;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_ipma_box: heif_suberror_code = 109;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_iloc_box: heif_suberror_code = 110;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_iinf_box: heif_suberror_code = 111;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_iprp_box: heif_suberror_code = 112;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_iref_box: heif_suberror_code = 113;
#[doc = " Mandatory 'ftyp' box is missing"]
pub const heif_suberror_code_heif_suberror_No_pict_handler: heif_suberror_code = 114;
#[doc = " An item property referenced in the 'ipma' box is not existing in the 'ipco' container."]
pub const heif_suberror_code_heif_suberror_Ipma_box_references_nonexisting_property:
    heif_suberror_code = 115;
#[doc = " No properties have been assigned to an item."]
pub const heif_suberror_code_heif_suberror_No_properties_assigned_to_item: heif_suberror_code = 116;
#[doc = " Image has no (compressed) data"]
pub const heif_suberror_code_heif_suberror_No_item_data: heif_suberror_code = 117;
#[doc = " Invalid specification of image grid (tiled image)"]
pub const heif_suberror_code_heif_suberror_Invalid_grid_data: heif_suberror_code = 118;
#[doc = " Tile-images in a grid image are missing"]
pub const heif_suberror_code_heif_suberror_Missing_grid_images: heif_suberror_code = 119;
#[doc = " Tile-images in a grid image are missing"]
pub const heif_suberror_code_heif_suberror_Invalid_clean_aperture: heif_suberror_code = 120;
#[doc = " Invalid specification of overlay image"]
pub const heif_suberror_code_heif_suberror_Invalid_overlay_data: heif_suberror_code = 121;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Overlay_image_outside_of_canvas: heif_suberror_code =
    122;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Auxiliary_image_type_unspecified: heif_suberror_code =
    123;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_No_or_invalid_primary_item: heif_suberror_code = 124;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_No_infe_box: heif_suberror_code = 125;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Unknown_color_profile_type: heif_suberror_code = 126;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Wrong_tile_image_chroma_format: heif_suberror_code = 127;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Invalid_fractional_number: heif_suberror_code = 128;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Invalid_image_size: heif_suberror_code = 129;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Invalid_pixi_box: heif_suberror_code = 130;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_No_av1C_box: heif_suberror_code = 131;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Wrong_tile_image_pixel_depth: heif_suberror_code = 132;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Unknown_NCLX_color_primaries: heif_suberror_code = 133;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Unknown_NCLX_transfer_characteristics:
    heif_suberror_code = 134;
#[doc = " Overlay image completely outside of visible canvas area"]
pub const heif_suberror_code_heif_suberror_Unknown_NCLX_matrix_coefficients: heif_suberror_code =
    135;
#[doc = " Invalid specification of region item"]
pub const heif_suberror_code_heif_suberror_Invalid_region_data: heif_suberror_code = 136;
#[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."]
pub const heif_suberror_code_heif_suberror_Security_limit_exceeded: heif_suberror_code = 1000;
#[doc = " also used for Invalid_input"]
pub const heif_suberror_code_heif_suberror_Nonexisting_item_referenced: heif_suberror_code = 2000;
#[doc = " An API argument was given a NULL pointer, which is not allowed for that function."]
pub const heif_suberror_code_heif_suberror_Null_pointer_argument: heif_suberror_code = 2001;
#[doc = " Image channel referenced that does not exist in the image"]
pub const heif_suberror_code_heif_suberror_Nonexisting_image_channel_referenced:
    heif_suberror_code = 2002;
#[doc = " The version of the passed plugin is not supported."]
pub const heif_suberror_code_heif_suberror_Unsupported_plugin_version: heif_suberror_code = 2003;
#[doc = " The version of the passed writer is not supported."]
pub const heif_suberror_code_heif_suberror_Unsupported_writer_version: heif_suberror_code = 2004;
#[doc = " The given (encoder) parameter name does not exist."]
pub const heif_suberror_code_heif_suberror_Unsupported_parameter: heif_suberror_code = 2005;
#[doc = " The value for the given parameter is not in the valid range."]
pub const heif_suberror_code_heif_suberror_Invalid_parameter_value: heif_suberror_code = 2006;
#[doc = " Error in property specification"]
pub const heif_suberror_code_heif_suberror_Invalid_property: heif_suberror_code = 2007;
#[doc = " Image reference cycle found in iref"]
pub const heif_suberror_code_heif_suberror_Item_reference_cycle: heif_suberror_code = 2008;
#[doc = " Image was coded with an unsupported compression method."]
pub const heif_suberror_code_heif_suberror_Unsupported_codec: heif_suberror_code = 3000;
#[doc = " Image is specified in an unknown way, e.g. as tiled grid image (which is supported)"]
pub const heif_suberror_code_heif_suberror_Unsupported_image_type: heif_suberror_code = 3001;
#[doc = " Image is specified in an unknown way, e.g. as tiled grid image (which is supported)"]
pub const heif_suberror_code_heif_suberror_Unsupported_data_version: heif_suberror_code = 3002;
#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
pub const heif_suberror_code_heif_suberror_Unsupported_color_conversion: heif_suberror_code = 3003;
#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
pub const heif_suberror_code_heif_suberror_Unsupported_item_construction_method:
    heif_suberror_code = 3004;
#[doc = " The conversion of the source image to the requested chroma / colorspace is not supported."]
pub const heif_suberror_code_heif_suberror_Unsupported_header_compression_method:
    heif_suberror_code = 3005;
#[doc = " --- Encoder_plugin_error ---"]
pub const heif_suberror_code_heif_suberror_Unsupported_bit_depth: heif_suberror_code = 4000;
#[doc = " --- Encoding_error ---"]
pub const heif_suberror_code_heif_suberror_Cannot_write_output_data: heif_suberror_code = 5000;
#[doc = " --- Encoding_error ---"]
pub const heif_suberror_code_heif_suberror_Encoder_initialization: heif_suberror_code = 5001;
#[doc = " --- Encoding_error ---"]
pub const heif_suberror_code_heif_suberror_Encoder_encoding: heif_suberror_code = 5002;
#[doc = " --- Encoding_error ---"]
pub const heif_suberror_code_heif_suberror_Encoder_cleanup: heif_suberror_code = 5003;
#[doc = " --- Encoding_error ---"]
pub const heif_suberror_code_heif_suberror_Too_many_regions: heif_suberror_code = 5004;
#[doc = " a specific plugin file cannot be loaded"]
pub const heif_suberror_code_heif_suberror_Plugin_loading_error: heif_suberror_code = 6000;
#[doc = " trying to remove a plugin that is not loaded"]
pub const heif_suberror_code_heif_suberror_Plugin_is_not_loaded: heif_suberror_code = 6001;
#[doc = " error while scanning the directory for plugins"]
pub const heif_suberror_code_heif_suberror_Cannot_read_plugin_directory: heif_suberror_code = 6002;
pub type heif_suberror_code = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_error {
    #[doc = " main error category"]
    pub code: heif_error_code,
    #[doc = " more detailed error code"]
    pub subcode: heif_suberror_code,
    #[doc = " textual error message (is always defined, you do not have to check for NULL)"]
    pub message: *const libc::c_char,
}
#[test]
fn bindgen_test_layout_heif_error() {
    const UNINIT: ::std::mem::MaybeUninit<heif_error> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_error>(),
        16usize,
        concat!("Size of: ", stringify!(heif_error))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_error>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_error))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_error),
            "::",
            stringify!(code)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).subcode) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_error),
            "::",
            stringify!(subcode)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).message) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_error),
            "::",
            stringify!(message)
        )
    );
}
pub type heif_item_id = u32;
pub type heif_property_id = u32;
#[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."]
pub const heif_compression_format_heif_compression_undefined: heif_compression_format = 0;
#[doc = " HEVC compression, used for HEIC images.\n\n This is equivalent to H.265."]
pub const heif_compression_format_heif_compression_HEVC: heif_compression_format = 1;
#[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."]
pub const heif_compression_format_heif_compression_AVC: heif_compression_format = 2;
#[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."]
pub const heif_compression_format_heif_compression_JPEG: heif_compression_format = 3;
#[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/"]
pub const heif_compression_format_heif_compression_AV1: heif_compression_format = 4;
#[doc = " VVC compression. (Currently unused in libheif.)\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."]
pub const heif_compression_format_heif_compression_VVC: heif_compression_format = 5;
#[doc = " EVC compression. (Currently unused in libheif.)\n\n The compression format is defined in ISO/IEC 23094-1. This is equivalent to H.266.\n\n The encapsulation is defined in ISO/IEC 23008-12:2022 Annex M."]
pub const heif_compression_format_heif_compression_EVC: heif_compression_format = 6;
#[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."]
pub const heif_compression_format_heif_compression_JPEG2000: heif_compression_format = 7;
#[doc = " Uncompressed encoding.\n\n This is defined in ISO/IEC 23001-17:2023 (Final Draft International Standard)."]
pub const heif_compression_format_heif_compression_uncompressed: heif_compression_format = 8;
#[doc = " Mask image encoding.\n\n See ISO/IEC 23008-12:2022 Section 6.10.2"]
pub const heif_compression_format_heif_compression_mask: heif_compression_format = 9;
#[doc = " libheif known compression formats."]
pub type heif_compression_format = libc::c_uint;
pub const heif_chroma_heif_chroma_undefined: heif_chroma = 99;
pub const heif_chroma_heif_chroma_monochrome: heif_chroma = 0;
pub const heif_chroma_heif_chroma_420: heif_chroma = 1;
pub const heif_chroma_heif_chroma_422: heif_chroma = 2;
pub const heif_chroma_heif_chroma_444: heif_chroma = 3;
pub const heif_chroma_heif_chroma_interleaved_RGB: heif_chroma = 10;
pub const heif_chroma_heif_chroma_interleaved_RGBA: heif_chroma = 11;
#[doc = " HDR, big endian."]
pub const heif_chroma_heif_chroma_interleaved_RRGGBB_BE: heif_chroma = 12;
#[doc = " HDR, big endian."]
pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_BE: heif_chroma = 13;
#[doc = " HDR, little endian."]
pub const heif_chroma_heif_chroma_interleaved_RRGGBB_LE: heif_chroma = 14;
#[doc = " HDR, little endian."]
pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_LE: heif_chroma = 15;
pub type heif_chroma = libc::c_uint;
pub const heif_colorspace_heif_colorspace_undefined: heif_colorspace = 99;
#[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"]
pub const heif_colorspace_heif_colorspace_YCbCr: heif_colorspace = 0;
#[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"]
pub const heif_colorspace_heif_colorspace_RGB: heif_colorspace = 1;
#[doc = " heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome"]
pub const heif_colorspace_heif_colorspace_monochrome: heif_colorspace = 2;
pub type heif_colorspace = libc::c_uint;
pub const heif_channel_heif_channel_Y: heif_channel = 0;
pub const heif_channel_heif_channel_Cb: heif_channel = 1;
pub const heif_channel_heif_channel_Cr: heif_channel = 2;
pub const heif_channel_heif_channel_R: heif_channel = 3;
pub const heif_channel_heif_channel_G: heif_channel = 4;
pub const heif_channel_heif_channel_B: heif_channel = 5;
pub const heif_channel_heif_channel_Alpha: heif_channel = 6;
pub const heif_channel_heif_channel_interleaved: heif_channel = 10;
pub type heif_channel = libc::c_uint;
#[doc = " ========================= library initialization ======================"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_init_params {
    pub version: libc::c_int,
}
#[test]
fn bindgen_test_layout_heif_init_params() {
    const UNINIT: ::std::mem::MaybeUninit<heif_init_params> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_init_params>(),
        4usize,
        concat!("Size of: ", stringify!(heif_init_params))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_init_params>(),
        4usize,
        concat!("Alignment of ", stringify!(heif_init_params))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_init_params),
            "::",
            stringify!(version)
        )
    );
}
extern "C" {
    #[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."]
    pub fn heif_init(arg1: *mut heif_init_params) -> heif_error;
}
extern "C" {
    #[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 \\sa heif_init()"]
    pub fn heif_deinit();
}
pub const heif_plugin_type_heif_plugin_type_encoder: heif_plugin_type = 0;
pub const heif_plugin_type_heif_plugin_type_decoder: heif_plugin_type = 1;
#[doc = " --- Plugins are currently only supported on Unix platforms."]
pub type heif_plugin_type = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_plugin_info {
    #[doc = " version of this info struct"]
    pub version: libc::c_int,
    pub type_: heif_plugin_type,
    pub plugin: *const libc::c_void,
    #[doc = " for internal use only"]
    pub internal_handle: *mut libc::c_void,
}
#[test]
fn bindgen_test_layout_heif_plugin_info() {
    const UNINIT: ::std::mem::MaybeUninit<heif_plugin_info> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_plugin_info>(),
        24usize,
        concat!("Size of: ", stringify!(heif_plugin_info))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_plugin_info>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_plugin_info))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_plugin_info),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_plugin_info),
            "::",
            stringify!(type_)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).plugin) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_plugin_info),
            "::",
            stringify!(plugin)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).internal_handle) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_plugin_info),
            "::",
            stringify!(internal_handle)
        )
    );
}
extern "C" {
    pub fn heif_load_plugin(
        filename: *const libc::c_char,
        out_plugin: *mut *const heif_plugin_info,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_load_plugins(
        directory: *const libc::c_char,
        out_plugins: *mut *const heif_plugin_info,
        out_nPluginsLoaded: *mut libc::c_int,
        output_array_size: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_unload_plugin(plugin: *const heif_plugin_info) -> heif_error;
}
extern "C" {
    #[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)."]
    pub fn heif_get_plugin_directories() -> *const *const libc::c_char;
}
extern "C" {
    pub fn heif_free_plugin_directories(arg1: *const *const libc::c_char);
}
pub const heif_filetype_result_heif_filetype_no: heif_filetype_result = 0;
#[doc = " it is heif and can be read by libheif"]
pub const heif_filetype_result_heif_filetype_yes_supported: heif_filetype_result = 1;
#[doc = " it is heif, but cannot be read by libheif"]
pub const heif_filetype_result_heif_filetype_yes_unsupported: heif_filetype_result = 2;
#[doc = " not sure whether it is an heif, try detection with more input data"]
pub const heif_filetype_result_heif_filetype_maybe: heif_filetype_result = 3;
#[doc = " ========================= file type check ======================"]
pub type heif_filetype_result = libc::c_uint;
extern "C" {
    #[doc = " input data should be at least 12 bytes"]
    pub fn heif_check_filetype(data: *const u8, len: libc::c_int) -> heif_filetype_result;
}
extern "C" {
    pub fn heif_check_jpeg_filetype(data: *const u8, len: libc::c_int) -> libc::c_int;
}
pub const heif_brand_heif_unknown_brand: heif_brand = 0;
#[doc = " HEIF image with h265"]
pub const heif_brand_heif_heic: heif_brand = 1;
#[doc = " 10bit images, or anything that uses h265 with range extension"]
pub const heif_brand_heif_heix: heif_brand = 2;
#[doc = " brands for image sequences"]
pub const heif_brand_heif_hevc: heif_brand = 3;
#[doc = " brands for image sequences"]
pub const heif_brand_heif_hevx: heif_brand = 4;
#[doc = " multiview"]
pub const heif_brand_heif_heim: heif_brand = 5;
#[doc = " scalable"]
pub const heif_brand_heif_heis: heif_brand = 6;
#[doc = " multiview sequence"]
pub const heif_brand_heif_hevm: heif_brand = 7;
#[doc = " scalable sequence"]
pub const heif_brand_heif_hevs: heif_brand = 8;
#[doc = " image, any coding algorithm"]
pub const heif_brand_heif_mif1: heif_brand = 9;
#[doc = " sequence, any coding algorithm"]
pub const heif_brand_heif_msf1: heif_brand = 10;
#[doc = " HEIF image with AV1"]
pub const heif_brand_heif_avif: heif_brand = 11;
pub const heif_brand_heif_avis: heif_brand = 12;
#[doc = " VVC image"]
pub const heif_brand_heif_vvic: heif_brand = 13;
#[doc = " VVC sequence"]
pub const heif_brand_heif_vvis: heif_brand = 14;
#[doc = " EVC image"]
pub const heif_brand_heif_evbi: heif_brand = 15;
#[doc = " EVC sequence"]
pub const heif_brand_heif_evbs: heif_brand = 16;
#[doc = " JPEG2000 image"]
pub const heif_brand_heif_j2ki: heif_brand = 17;
#[doc = " JPEG2000 image sequence"]
pub const heif_brand_heif_j2is: heif_brand = 18;
#[doc = " DEPRECATED, use heif_brand2 and the heif_brand2_* constants below instead"]
pub type heif_brand = libc::c_uint;
extern "C" {
    #[doc = " input data should be at least 12 bytes\n DEPRECATED, use heif_read_main_brand() instead"]
    pub fn heif_main_brand(data: *const u8, len: libc::c_int) -> heif_brand;
}
pub type heif_brand2 = u32;
extern "C" {
    #[doc = " input data should be at least 12 bytes"]
    pub fn heif_read_main_brand(data: *const u8, len: libc::c_int) -> heif_brand2;
}
extern "C" {
    #[doc = " 'brand_fourcc' must be 4 character long, but need not be 0-terminated"]
    pub fn heif_fourcc_to_brand(brand_fourcc: *const libc::c_char) -> heif_brand2;
}
extern "C" {
    #[doc = " the output buffer must be at least 4 bytes long"]
    pub fn heif_brand_to_fourcc(brand: heif_brand2, out_fourcc: *mut libc::c_char);
}
extern "C" {
    #[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"]
    pub fn heif_has_compatible_brand(
        data: *const u8,
        len: libc::c_int,
        brand_fourcc: *const libc::c_char,
    ) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_list_compatible_brands(
        data: *const u8,
        len: libc::c_int,
        out_brands: *mut *mut heif_brand2,
        out_size: *mut libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_free_list_of_compatible_brands(brands_list: *mut heif_brand2);
}
extern "C" {
    #[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."]
    pub fn heif_get_file_mime_type(data: *const u8, len: libc::c_int) -> *const libc::c_char;
}
extern "C" {
    #[doc = " Allocate a new context for reading HEIF files.\n Has to be freed again with heif_context_free()."]
    pub fn heif_context_alloc() -> *mut heif_context;
}
extern "C" {
    #[doc = " Free a previously allocated HEIF context. You should not free a context twice."]
    pub fn heif_context_free(arg1: *mut heif_context);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_reading_options {
    _unused: [u8; 0],
}
#[doc = " requested size has been reached, we can read until this point"]
pub const heif_reader_grow_status_heif_reader_grow_status_size_reached: heif_reader_grow_status = 0;
#[doc = " size has not been reached yet, but it may still grow further"]
pub const heif_reader_grow_status_heif_reader_grow_status_timeout: heif_reader_grow_status = 1;
#[doc = " size has not been reached and never will. The file has grown to its full size"]
pub const heif_reader_grow_status_heif_reader_grow_status_size_beyond_eof: heif_reader_grow_status =
    2;
pub type heif_reader_grow_status = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_reader {
    #[doc = " API version supported by this reader"]
    pub reader_api_version: libc::c_int,
    #[doc = " --- version 1 functions ---"]
    pub get_position:
        ::std::option::Option<unsafe extern "C" fn(userdata: *mut libc::c_void) -> i64>,
    #[doc = " The functions read(), and seek() return heif_error_ok on success.\n Generally, libheif will make sure that we do not read past the file size."]
    pub read: ::std::option::Option<
        unsafe extern "C" fn(
            data: *mut libc::c_void,
            size: usize,
            userdata: *mut libc::c_void,
        ) -> libc::c_int,
    >,
    pub seek: ::std::option::Option<
        unsafe extern "C" fn(position: i64, userdata: *mut libc::c_void) -> libc::c_int,
    >,
    #[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')."]
    pub wait_for_file_size: ::std::option::Option<
        unsafe extern "C" fn(
            target_size: i64,
            userdata: *mut libc::c_void,
        ) -> heif_reader_grow_status,
    >,
}
#[test]
fn bindgen_test_layout_heif_reader() {
    const UNINIT: ::std::mem::MaybeUninit<heif_reader> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_reader>(),
        40usize,
        concat!("Size of: ", stringify!(heif_reader))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_reader>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_reader))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).reader_api_version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_reader),
            "::",
            stringify!(reader_api_version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).get_position) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_reader),
            "::",
            stringify!(get_position)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_reader),
            "::",
            stringify!(read)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).seek) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_reader),
            "::",
            stringify!(seek)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).wait_for_file_size) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_reader),
            "::",
            stringify!(wait_for_file_size)
        )
    );
}
extern "C" {
    #[doc = " Read a HEIF file from a named disk file.\n The heif_reading_options should currently be set to NULL."]
    pub fn heif_context_read_from_file(
        arg1: *mut heif_context,
        filename: *const libc::c_char,
        arg2: *const heif_reading_options,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_context_read_from_memory(
        arg1: *mut heif_context,
        mem: *const libc::c_void,
        size: usize,
        arg2: *const heif_reading_options,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_context_read_from_memory_without_copy(
        arg1: *mut heif_context,
        mem: *const libc::c_void,
        size: usize,
        arg2: *const heif_reading_options,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_context_read_from_reader(
        arg1: *mut heif_context,
        reader: *const heif_reader,
        userdata: *mut libc::c_void,
        arg2: *const heif_reading_options,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_context_get_number_of_top_level_images(ctx: *mut heif_context) -> libc::c_int;
}
extern "C" {
    pub fn heif_context_is_top_level_image_ID(
        ctx: *mut heif_context,
        id: heif_item_id,
    ) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_context_get_list_of_top_level_image_IDs(
        ctx: *mut heif_context,
        ID_array: *mut heif_item_id,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_context_get_primary_image_ID(
        ctx: *mut heif_context,
        id: *mut heif_item_id,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_context_get_primary_image_handle(
        ctx: *mut heif_context,
        arg1: *mut *mut heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Get the image handle for a known image ID."]
    pub fn heif_context_get_image_handle(
        ctx: *mut heif_context,
        id: heif_item_id,
        arg1: *mut *mut heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_context_debug_dump_boxes_to_file(ctx: *mut heif_context, fd: libc::c_int);
}
extern "C" {
    pub fn heif_context_set_maximum_image_size_limit(
        ctx: *mut heif_context,
        maximum_width: libc::c_int,
    );
}
extern "C" {
    #[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."]
    pub fn heif_context_set_max_decoding_threads(ctx: *mut heif_context, max_threads: libc::c_int);
}
extern "C" {
    #[doc = " Release image handle."]
    pub fn heif_image_handle_release(arg1: *const heif_image_handle);
}
extern "C" {
    #[doc = " Check whether the given image_handle is the primary image of the file."]
    pub fn heif_image_handle_is_primary_image(handle: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_item_id(handle: *const heif_image_handle) -> heif_item_id;
}
extern "C" {
    #[doc = " Get the resolution of an image."]
    pub fn heif_image_handle_get_width(handle: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_height(handle: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_has_alpha_channel(arg1: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_is_premultiplied_alpha(arg1: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    #[doc = " Returns -1 on error, e.g. if this information is not present in the image."]
    pub fn heif_image_handle_get_luma_bits_per_pixel(arg1: *const heif_image_handle)
        -> libc::c_int;
}
extern "C" {
    #[doc = " Returns -1 on error, e.g. if this information is not present in the image."]
    pub fn heif_image_handle_get_chroma_bits_per_pixel(
        arg1: *const heif_image_handle,
    ) -> libc::c_int;
}
extern "C" {
    #[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.\n It may also return *_undefined if the file misses relevant information to determine this without decoding."]
    pub fn heif_image_handle_get_preferred_decoding_colorspace(
        image_handle: *const heif_image_handle,
        out_colorspace: *mut heif_colorspace,
        out_chroma: *mut heif_chroma,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_ispe_width(handle: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_ispe_height(handle: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_context(handle: *const heif_image_handle) -> *mut heif_context;
}
extern "C" {
    #[doc = " ------------------------- depth images -------------------------"]
    pub fn heif_image_handle_has_depth_image(arg1: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_number_of_depth_images(
        handle: *const heif_image_handle,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_list_of_depth_image_IDs(
        handle: *const heif_image_handle,
        ids: *mut heif_item_id,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_depth_image_handle(
        handle: *const heif_image_handle,
        depth_image_id: heif_item_id,
        out_depth_handle: *mut *mut heif_image_handle,
    ) -> heif_error;
}
pub const heif_depth_representation_type_heif_depth_representation_type_uniform_inverse_Z:
    heif_depth_representation_type = 0;
pub const heif_depth_representation_type_heif_depth_representation_type_uniform_disparity:
    heif_depth_representation_type = 1;
pub const heif_depth_representation_type_heif_depth_representation_type_uniform_Z:
    heif_depth_representation_type = 2;
pub const heif_depth_representation_type_heif_depth_representation_type_nonuniform_disparity:
    heif_depth_representation_type = 3;
pub type heif_depth_representation_type = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_depth_representation_info {
    pub version: u8,
    #[doc = " version 1 fields"]
    pub has_z_near: u8,
    pub has_z_far: u8,
    pub has_d_min: u8,
    pub has_d_max: u8,
    pub z_near: f64,
    pub z_far: f64,
    pub d_min: f64,
    pub d_max: f64,
    pub depth_representation_type: heif_depth_representation_type,
    pub disparity_reference_view: u32,
    pub depth_nonlinear_representation_model_size: u32,
    pub depth_nonlinear_representation_model: *mut u8,
}
#[test]
fn bindgen_test_layout_heif_depth_representation_info() {
    const UNINIT: ::std::mem::MaybeUninit<heif_depth_representation_info> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_depth_representation_info>(),
        64usize,
        concat!("Size of: ", stringify!(heif_depth_representation_info))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_depth_representation_info>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_depth_representation_info))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).has_z_near) as usize - ptr as usize },
        1usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(has_z_near)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).has_z_far) as usize - ptr as usize },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(has_z_far)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).has_d_min) as usize - ptr as usize },
        3usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(has_d_min)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).has_d_max) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(has_d_max)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).z_near) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(z_near)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).z_far) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(z_far)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).d_min) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(d_min)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).d_max) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(d_max)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).depth_representation_type) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(depth_representation_type)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).disparity_reference_view) as usize - ptr as usize },
        44usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(disparity_reference_view)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).depth_nonlinear_representation_model_size) as usize
                - ptr as usize
        },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(depth_nonlinear_representation_model_size)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).depth_nonlinear_representation_model) as usize
                - ptr as usize
        },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_depth_representation_info),
            "::",
            stringify!(depth_nonlinear_representation_model)
        )
    );
}
extern "C" {
    pub fn heif_depth_representation_info_free(info: *const heif_depth_representation_info);
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_depth_image_representation_info(
        handle: *const heif_image_handle,
        depth_image_id: heif_item_id,
        out: *mut *const heif_depth_representation_info,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " List the number of thumbnails assigned to this image handle. Usually 0 or 1."]
    pub fn heif_image_handle_get_number_of_thumbnails(
        handle: *const heif_image_handle,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_list_of_thumbnail_IDs(
        handle: *const heif_image_handle,
        ids: *mut heif_item_id,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " Get the image handle of a thumbnail image."]
    pub fn heif_image_handle_get_thumbnail(
        main_image_handle: *const heif_image_handle,
        thumbnail_id: heif_item_id,
        out_thumbnail_handle: *mut *mut heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    #[doc = " List the number of auxiliary images assigned to this image handle."]
    pub fn heif_image_handle_get_number_of_auxiliary_images(
        handle: *const heif_image_handle,
        aux_filter: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_handle_get_list_of_auxiliary_image_IDs(
        handle: *const heif_image_handle,
        aux_filter: libc::c_int,
        ids: *mut heif_item_id,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " You are responsible to deallocate the returned buffer with heif_image_handle_release_auxiliary_type()."]
    pub fn heif_image_handle_get_auxiliary_type(
        handle: *const heif_image_handle,
        out_type: *mut *const libc::c_char,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_image_handle_release_auxiliary_type(
        handle: *const heif_image_handle,
        out_type: *mut *const libc::c_char,
    );
}
extern "C" {
    #[doc = " DEPRECATED (because typo in function name). Use heif_image_handle_release_auxiliary_type() instead."]
    pub fn heif_image_handle_free_auxiliary_types(
        handle: *const heif_image_handle,
        out_type: *mut *const libc::c_char,
    );
}
extern "C" {
    #[doc = " Get the image handle of an auxiliary image."]
    pub fn heif_image_handle_get_auxiliary_image_handle(
        main_image_handle: *const heif_image_handle,
        auxiliary_id: heif_item_id,
        out_auxiliary_handle: *mut *mut heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_number_of_metadata_blocks(
        handle: *const heif_image_handle,
        type_filter: *const libc::c_char,
    ) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_list_of_metadata_block_IDs(
        handle: *const heif_image_handle,
        type_filter: *const libc::c_char,
        ids: *mut heif_item_id,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_metadata_type(
        handle: *const heif_image_handle,
        metadata_id: heif_item_id,
    ) -> *const libc::c_char;
}
extern "C" {
    #[doc = " For EXIF, the content type is empty.\n For XMP, the content type is \"application/rdf+xml\"."]
    pub fn heif_image_handle_get_metadata_content_type(
        handle: *const heif_image_handle,
        metadata_id: heif_item_id,
    ) -> *const libc::c_char;
}
extern "C" {
    #[doc = " Get the size of the raw metadata, as stored in the HEIF file."]
    pub fn heif_image_handle_get_metadata_size(
        handle: *const heif_image_handle,
        metadata_id: heif_item_id,
    ) -> usize;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_metadata(
        handle: *const heif_image_handle,
        metadata_id: heif_item_id,
        out_data: *mut libc::c_void,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Only valid for item type == \"uri \", an absolute URI"]
    pub fn heif_image_handle_get_metadata_item_uri_type(
        handle: *const heif_image_handle,
        metadata_id: heif_item_id,
    ) -> *const libc::c_char;
}
pub const heif_color_profile_type_heif_color_profile_type_not_present: heif_color_profile_type = 0;
pub const heif_color_profile_type_heif_color_profile_type_nclx: heif_color_profile_type =
    1852009592;
pub const heif_color_profile_type_heif_color_profile_type_rICC: heif_color_profile_type =
    1917403971;
pub const heif_color_profile_type_heif_color_profile_type_prof: heif_color_profile_type =
    1886547814;
#[doc = " ------------------------- color profiles -------------------------"]
pub type heif_color_profile_type = libc::c_uint;
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_color_profile_type(
        handle: *const heif_image_handle,
    ) -> heif_color_profile_type;
}
extern "C" {
    pub fn heif_image_handle_get_raw_color_profile_size(handle: *const heif_image_handle) -> usize;
}
extern "C" {
    #[doc = " Returns 'heif_error_Color_profile_does_not_exist' when there is no ICC profile."]
    pub fn heif_image_handle_get_raw_color_profile(
        handle: *const heif_image_handle,
        out_data: *mut libc::c_void,
    ) -> heif_error;
}
#[doc = " g=0.3;0.6, b=0.15;0.06, r=0.64;0.33, w=0.3127,0.3290"]
pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_709_5: heif_color_primaries = 1;
pub const heif_color_primaries_heif_color_primaries_unspecified: heif_color_primaries = 2;
pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_470_6_System_M: heif_color_primaries =
    4;
pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_470_6_System_B_G:
    heif_color_primaries = 5;
pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_601_6: heif_color_primaries = 6;
pub const heif_color_primaries_heif_color_primaries_SMPTE_240M: heif_color_primaries = 7;
pub const heif_color_primaries_heif_color_primaries_generic_film: heif_color_primaries = 8;
pub const heif_color_primaries_heif_color_primaries_ITU_R_BT_2020_2_and_2100_0:
    heif_color_primaries = 9;
pub const heif_color_primaries_heif_color_primaries_SMPTE_ST_428_1: heif_color_primaries = 10;
pub const heif_color_primaries_heif_color_primaries_SMPTE_RP_431_2: heif_color_primaries = 11;
pub const heif_color_primaries_heif_color_primaries_SMPTE_EG_432_1: heif_color_primaries = 12;
pub const heif_color_primaries_heif_color_primaries_EBU_Tech_3213_E: heif_color_primaries = 22;
pub type heif_color_primaries = libc::c_uint;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_709_5:
    heif_transfer_characteristics = 1;
pub const heif_transfer_characteristics_heif_transfer_characteristic_unspecified:
    heif_transfer_characteristics = 2;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_470_6_System_M:
    heif_transfer_characteristics = 4;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_470_6_System_B_G:
    heif_transfer_characteristics = 5;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_601_6:
    heif_transfer_characteristics = 6;
pub const heif_transfer_characteristics_heif_transfer_characteristic_SMPTE_240M:
    heif_transfer_characteristics = 7;
pub const heif_transfer_characteristics_heif_transfer_characteristic_linear:
    heif_transfer_characteristics = 8;
pub const heif_transfer_characteristics_heif_transfer_characteristic_logarithmic_100:
    heif_transfer_characteristics = 9;
pub const heif_transfer_characteristics_heif_transfer_characteristic_logarithmic_100_sqrt10:
    heif_transfer_characteristics = 10;
pub const heif_transfer_characteristics_heif_transfer_characteristic_IEC_61966_2_4:
    heif_transfer_characteristics = 11;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_1361:
    heif_transfer_characteristics = 12;
pub const heif_transfer_characteristics_heif_transfer_characteristic_IEC_61966_2_1:
    heif_transfer_characteristics = 13;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2020_2_10bit:
    heif_transfer_characteristics = 14;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2020_2_12bit:
    heif_transfer_characteristics = 15;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2100_0_PQ:
    heif_transfer_characteristics = 16;
pub const heif_transfer_characteristics_heif_transfer_characteristic_SMPTE_ST_428_1:
    heif_transfer_characteristics = 17;
pub const heif_transfer_characteristics_heif_transfer_characteristic_ITU_R_BT_2100_0_HLG:
    heif_transfer_characteristics = 18;
pub type heif_transfer_characteristics = libc::c_uint;
pub const heif_matrix_coefficients_heif_matrix_coefficients_RGB_GBR: heif_matrix_coefficients = 0;
#[doc = " TODO: or 709-6 according to h.273"]
pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_709_5:
    heif_matrix_coefficients = 1;
pub const heif_matrix_coefficients_heif_matrix_coefficients_unspecified: heif_matrix_coefficients =
    2;
pub const heif_matrix_coefficients_heif_matrix_coefficients_US_FCC_T47: heif_matrix_coefficients =
    4;
pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G:
    heif_matrix_coefficients = 5;
#[doc = " TODO: or 601-7 according to h.273"]
pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_601_6:
    heif_matrix_coefficients = 6;
pub const heif_matrix_coefficients_heif_matrix_coefficients_SMPTE_240M: heif_matrix_coefficients =
    7;
pub const heif_matrix_coefficients_heif_matrix_coefficients_YCgCo: heif_matrix_coefficients = 8;
pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance : heif_matrix_coefficients = 9 ;
pub const heif_matrix_coefficients_heif_matrix_coefficients_ITU_R_BT_2020_2_constant_luminance:
    heif_matrix_coefficients = 10;
pub const heif_matrix_coefficients_heif_matrix_coefficients_SMPTE_ST_2085:
    heif_matrix_coefficients = 11;
pub const heif_matrix_coefficients_heif_matrix_coefficients_chromaticity_derived_non_constant_luminance : heif_matrix_coefficients = 12 ;
pub const heif_matrix_coefficients_heif_matrix_coefficients_chromaticity_derived_constant_luminance : heif_matrix_coefficients = 13 ;
pub const heif_matrix_coefficients_heif_matrix_coefficients_ICtCp: heif_matrix_coefficients = 14;
pub type heif_matrix_coefficients = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_color_profile_nclx {
    #[doc = " === version 1 fields"]
    pub version: u8,
    pub color_primaries: heif_color_primaries,
    pub transfer_characteristics: heif_transfer_characteristics,
    pub matrix_coefficients: heif_matrix_coefficients,
    pub full_range_flag: u8,
    #[doc = " --- decoded values (not used when saving nclx)"]
    pub color_primary_red_x: f32,
    #[doc = " --- decoded values (not used when saving nclx)"]
    pub color_primary_red_y: f32,
    pub color_primary_green_x: f32,
    pub color_primary_green_y: f32,
    pub color_primary_blue_x: f32,
    pub color_primary_blue_y: f32,
    pub color_primary_white_x: f32,
    pub color_primary_white_y: f32,
}
#[test]
fn bindgen_test_layout_heif_color_profile_nclx() {
    const UNINIT: ::std::mem::MaybeUninit<heif_color_profile_nclx> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_color_profile_nclx>(),
        52usize,
        concat!("Size of: ", stringify!(heif_color_profile_nclx))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_color_profile_nclx>(),
        4usize,
        concat!("Alignment of ", stringify!(heif_color_profile_nclx))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primaries) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primaries)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transfer_characteristics) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(transfer_characteristics)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).matrix_coefficients) as usize - ptr as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(matrix_coefficients)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).full_range_flag) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(full_range_flag)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_red_x) as usize - ptr as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_red_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_red_y) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_red_y)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_green_x) as usize - ptr as usize },
        28usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_green_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_green_y) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_green_y)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_blue_x) as usize - ptr as usize },
        36usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_blue_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_blue_y) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_blue_y)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_white_x) as usize - ptr as usize },
        44usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_white_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_primary_white_y) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_profile_nclx),
            "::",
            stringify!(color_primary_white_y)
        )
    );
}
extern "C" {
    pub fn heif_nclx_color_profile_set_color_primaries(
        nclx: *mut heif_color_profile_nclx,
        cp: u16,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_nclx_color_profile_set_transfer_characteristics(
        nclx: *mut heif_color_profile_nclx,
        transfer_characteristics: u16,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_nclx_color_profile_set_matrix_coefficients(
        nclx: *mut heif_color_profile_nclx,
        matrix_coefficients: u16,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_image_handle_get_nclx_color_profile(
        handle: *const heif_image_handle,
        out_data: *mut *mut heif_color_profile_nclx,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_nclx_color_profile_alloc() -> *mut heif_color_profile_nclx;
}
extern "C" {
    pub fn heif_nclx_color_profile_free(nclx_profile: *mut heif_color_profile_nclx);
}
extern "C" {
    pub fn heif_image_get_color_profile_type(image: *const heif_image) -> heif_color_profile_type;
}
extern "C" {
    pub fn heif_image_get_raw_color_profile_size(image: *const heif_image) -> usize;
}
extern "C" {
    pub fn heif_image_get_raw_color_profile(
        image: *const heif_image,
        out_data: *mut libc::c_void,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_image_get_nclx_color_profile(
        image: *const heif_image,
        out_data: *mut *mut heif_color_profile_nclx,
    ) -> heif_error;
}
pub const heif_progress_step_heif_progress_step_total: heif_progress_step = 0;
pub const heif_progress_step_heif_progress_step_load_tile: heif_progress_step = 1;
#[doc = " Planar RGB images are specified as heif_colorspace_RGB / heif_chroma_444."]
pub type heif_progress_step = libc::c_uint;
pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_nearest_neighbor:
    heif_chroma_downsampling_algorithm = 1;
pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_average:
    heif_chroma_downsampling_algorithm = 2;
#[doc = " Combine with 'heif_chroma_upsampling_bilinear' for best quality.\n Makes edges look sharper when using YUV 420 with bilinear chroma upsampling."]
pub const heif_chroma_downsampling_algorithm_heif_chroma_downsampling_sharp_yuv:
    heif_chroma_downsampling_algorithm = 3;
pub type heif_chroma_downsampling_algorithm = libc::c_uint;
pub const heif_chroma_upsampling_algorithm_heif_chroma_upsampling_nearest_neighbor:
    heif_chroma_upsampling_algorithm = 1;
pub const heif_chroma_upsampling_algorithm_heif_chroma_upsampling_bilinear:
    heif_chroma_upsampling_algorithm = 2;
pub type heif_chroma_upsampling_algorithm = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_color_conversion_options {
    pub version: u8,
    #[doc = " --- version 1 options"]
    pub preferred_chroma_downsampling_algorithm: heif_chroma_downsampling_algorithm,
    pub preferred_chroma_upsampling_algorithm: heif_chroma_upsampling_algorithm,
    #[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."]
    pub only_use_preferred_chroma_algorithm: u8,
}
#[test]
fn bindgen_test_layout_heif_color_conversion_options() {
    const UNINIT: ::std::mem::MaybeUninit<heif_color_conversion_options> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_color_conversion_options>(),
        16usize,
        concat!("Size of: ", stringify!(heif_color_conversion_options))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_color_conversion_options>(),
        4usize,
        concat!("Alignment of ", stringify!(heif_color_conversion_options))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_conversion_options),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).preferred_chroma_downsampling_algorithm) as usize
                - ptr as usize
        },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_conversion_options),
            "::",
            stringify!(preferred_chroma_downsampling_algorithm)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).preferred_chroma_upsampling_algorithm) as usize
                - ptr as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_conversion_options),
            "::",
            stringify!(preferred_chroma_upsampling_algorithm)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).only_use_preferred_chroma_algorithm) as usize - ptr as usize
        },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_color_conversion_options),
            "::",
            stringify!(only_use_preferred_chroma_algorithm)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_decoding_options {
    pub version: u8,
    #[doc = " Ignore geometric transformations like cropping, rotation, mirroring.\n Default: false (do not ignore)."]
    pub ignore_transformations: u8,
    pub start_progress: ::std::option::Option<
        unsafe extern "C" fn(
            step: heif_progress_step,
            max_progress: libc::c_int,
            progress_user_data: *mut libc::c_void,
        ),
    >,
    pub on_progress: ::std::option::Option<
        unsafe extern "C" fn(
            step: heif_progress_step,
            progress: libc::c_int,
            progress_user_data: *mut libc::c_void,
        ),
    >,
    pub end_progress: ::std::option::Option<
        unsafe extern "C" fn(step: heif_progress_step, progress_user_data: *mut libc::c_void),
    >,
    pub progress_user_data: *mut libc::c_void,
    #[doc = " version 2 options"]
    pub convert_hdr_to_8bit: u8,
    #[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."]
    pub strict_decoding: u8,
    #[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."]
    pub decoder_id: *const libc::c_char,
    #[doc = " version 5 options"]
    pub color_conversion_options: heif_color_conversion_options,
}
#[test]
fn bindgen_test_layout_heif_decoding_options() {
    const UNINIT: ::std::mem::MaybeUninit<heif_decoding_options> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_decoding_options>(),
        72usize,
        concat!("Size of: ", stringify!(heif_decoding_options))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_decoding_options>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_decoding_options))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).ignore_transformations) as usize - ptr as usize },
        1usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(ignore_transformations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).start_progress) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(start_progress)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).on_progress) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(on_progress)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).end_progress) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(end_progress)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).progress_user_data) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(progress_user_data)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).convert_hdr_to_8bit) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(convert_hdr_to_8bit)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).strict_decoding) as usize - ptr as usize },
        41usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(strict_decoding)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).decoder_id) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(decoder_id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_conversion_options) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoding_options),
            "::",
            stringify!(color_conversion_options)
        )
    );
}
extern "C" {
    #[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."]
    pub fn heif_decoding_options_alloc() -> *mut heif_decoding_options;
}
extern "C" {
    pub fn heif_decoding_options_free(arg1: *mut heif_decoding_options);
}
extern "C" {
    #[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."]
    pub fn heif_decode_image(
        in_handle: *const heif_image_handle,
        out_img: *mut *mut heif_image,
        colorspace: heif_colorspace,
        chroma: heif_chroma,
        options: *const heif_decoding_options,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Get the colorspace format of the image."]
    pub fn heif_image_get_colorspace(arg1: *const heif_image) -> heif_colorspace;
}
extern "C" {
    #[doc = " Get the chroma format of the image."]
    pub fn heif_image_get_chroma_format(arg1: *const heif_image) -> heif_chroma;
}
extern "C" {
    #[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"]
    pub fn heif_image_get_width(img: *const heif_image, channel: heif_channel) -> libc::c_int;
}
extern "C" {
    #[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"]
    pub fn heif_image_get_height(img: *const heif_image, channel: heif_channel) -> libc::c_int;
}
extern "C" {
    #[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"]
    pub fn heif_image_get_primary_width(img: *const heif_image) -> libc::c_int;
}
extern "C" {
    #[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"]
    pub fn heif_image_get_primary_height(img: *const heif_image) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_crop(
        img: *mut heif_image,
        left: libc::c_int,
        right: libc::c_int,
        top: libc::c_int,
        bottom: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_image_get_bits_per_pixel(
        arg1: *const heif_image,
        channel: heif_channel,
    ) -> libc::c_int;
}
extern "C" {
    #[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)."]
    pub fn heif_image_get_bits_per_pixel_range(
        arg1: *const heif_image,
        channel: heif_channel,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_has_channel(arg1: *const heif_image, channel: heif_channel) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_image_get_plane_readonly(
        arg1: *const heif_image,
        channel: heif_channel,
        out_stride: *mut libc::c_int,
    ) -> *const u8;
}
extern "C" {
    pub fn heif_image_get_plane(
        arg1: *mut heif_image,
        channel: heif_channel,
        out_stride: *mut libc::c_int,
    ) -> *mut u8;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_scaling_options {
    _unused: [u8; 0],
}
extern "C" {
    #[doc = " Currently, heif_scaling_options is not defined yet. Pass a NULL pointer."]
    pub fn heif_image_scale_image(
        input: *const heif_image,
        output: *mut *mut heif_image,
        width: libc::c_int,
        height: libc::c_int,
        options: *const heif_scaling_options,
    ) -> heif_error;
}
extern "C" {
    #[doc = " The color profile is not attached to the image handle because we might need it\n for color space transform and encoding."]
    pub fn heif_image_set_raw_color_profile(
        image: *mut heif_image,
        profile_type_fourcc_string: *const libc::c_char,
        profile_data: *const libc::c_void,
        profile_size: usize,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_image_set_nclx_color_profile(
        image: *mut heif_image,
        color_profile: *const heif_color_profile_nclx,
    ) -> heif_error;
}
extern "C" {
    #[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'."]
    pub fn heif_image_get_decoding_warnings(
        image: *mut heif_image,
        first_warning_idx: libc::c_int,
        out_warnings: *mut heif_error,
        max_output_buffer_entries: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " This function is only for decoder plugin implementors."]
    pub fn heif_image_add_decoding_warning(image: *mut heif_image, err: heif_error);
}
extern "C" {
    #[doc = " Release heif_image."]
    pub fn heif_image_release(arg1: *const heif_image);
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_content_light_level {
    pub max_content_light_level: u16,
    pub max_pic_average_light_level: u16,
}
#[test]
fn bindgen_test_layout_heif_content_light_level() {
    const UNINIT: ::std::mem::MaybeUninit<heif_content_light_level> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_content_light_level>(),
        4usize,
        concat!("Size of: ", stringify!(heif_content_light_level))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_content_light_level>(),
        2usize,
        concat!("Alignment of ", stringify!(heif_content_light_level))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_content_light_level) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_content_light_level),
            "::",
            stringify!(max_content_light_level)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_pic_average_light_level) as usize - ptr as usize },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_content_light_level),
            "::",
            stringify!(max_pic_average_light_level)
        )
    );
}
extern "C" {
    pub fn heif_image_has_content_light_level(arg1: *const heif_image) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_get_content_light_level(
        arg1: *const heif_image,
        out: *mut heif_content_light_level,
    );
}
extern "C" {
    pub fn heif_image_set_content_light_level(
        arg1: *const heif_image,
        in_: *const heif_content_light_level,
    );
}
#[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)."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_mastering_display_colour_volume {
    pub display_primaries_x: [u16; 3usize],
    pub display_primaries_y: [u16; 3usize],
    pub white_point_x: u16,
    pub white_point_y: u16,
    pub max_display_mastering_luminance: u32,
    pub min_display_mastering_luminance: u32,
}
#[test]
fn bindgen_test_layout_heif_mastering_display_colour_volume() {
    const UNINIT: ::std::mem::MaybeUninit<heif_mastering_display_colour_volume> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_mastering_display_colour_volume>(),
        24usize,
        concat!(
            "Size of: ",
            stringify!(heif_mastering_display_colour_volume)
        )
    );
    assert_eq!(
        ::std::mem::align_of::<heif_mastering_display_colour_volume>(),
        4usize,
        concat!(
            "Alignment of ",
            stringify!(heif_mastering_display_colour_volume)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).display_primaries_x) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_mastering_display_colour_volume),
            "::",
            stringify!(display_primaries_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).display_primaries_y) as usize - ptr as usize },
        6usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_mastering_display_colour_volume),
            "::",
            stringify!(display_primaries_y)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).white_point_x) as usize - ptr as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_mastering_display_colour_volume),
            "::",
            stringify!(white_point_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).white_point_y) as usize - ptr as usize },
        14usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_mastering_display_colour_volume),
            "::",
            stringify!(white_point_y)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_display_mastering_luminance) as usize - ptr as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_mastering_display_colour_volume),
            "::",
            stringify!(max_display_mastering_luminance)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).min_display_mastering_luminance) as usize - ptr as usize
        },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_mastering_display_colour_volume),
            "::",
            stringify!(min_display_mastering_luminance)
        )
    );
}
#[doc = " The units for max_display_mastering_luminance and min_display_mastering_luminance is Candelas per square meter."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_decoded_mastering_display_colour_volume {
    pub display_primaries_x: [f32; 3usize],
    pub display_primaries_y: [f32; 3usize],
    pub white_point_x: f32,
    pub white_point_y: f32,
    pub max_display_mastering_luminance: f64,
    pub min_display_mastering_luminance: f64,
}
#[test]
fn bindgen_test_layout_heif_decoded_mastering_display_colour_volume() {
    const UNINIT: ::std::mem::MaybeUninit<heif_decoded_mastering_display_colour_volume> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_decoded_mastering_display_colour_volume>(),
        48usize,
        concat!(
            "Size of: ",
            stringify!(heif_decoded_mastering_display_colour_volume)
        )
    );
    assert_eq!(
        ::std::mem::align_of::<heif_decoded_mastering_display_colour_volume>(),
        8usize,
        concat!(
            "Alignment of ",
            stringify!(heif_decoded_mastering_display_colour_volume)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).display_primaries_x) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoded_mastering_display_colour_volume),
            "::",
            stringify!(display_primaries_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).display_primaries_y) as usize - ptr as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoded_mastering_display_colour_volume),
            "::",
            stringify!(display_primaries_y)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).white_point_x) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoded_mastering_display_colour_volume),
            "::",
            stringify!(white_point_x)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).white_point_y) as usize - ptr as usize },
        28usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoded_mastering_display_colour_volume),
            "::",
            stringify!(white_point_y)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_display_mastering_luminance) as usize - ptr as usize
        },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoded_mastering_display_colour_volume),
            "::",
            stringify!(max_display_mastering_luminance)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).min_display_mastering_luminance) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_decoded_mastering_display_colour_volume),
            "::",
            stringify!(min_display_mastering_luminance)
        )
    );
}
extern "C" {
    pub fn heif_image_has_mastering_display_colour_volume(arg1: *const heif_image) -> libc::c_int;
}
extern "C" {
    pub fn heif_image_get_mastering_display_colour_volume(
        arg1: *const heif_image,
        out: *mut heif_mastering_display_colour_volume,
    );
}
extern "C" {
    pub fn heif_image_set_mastering_display_colour_volume(
        arg1: *const heif_image,
        in_: *const heif_mastering_display_colour_volume,
    );
}
extern "C" {
    #[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)."]
    pub fn heif_mastering_display_colour_volume_decode(
        in_: *const heif_mastering_display_colour_volume,
        out: *mut heif_decoded_mastering_display_colour_volume,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_image_get_pixel_aspect_ratio(
        arg1: *const heif_image,
        aspect_h: *mut u32,
        aspect_v: *mut u32,
    );
}
extern "C" {
    pub fn heif_image_set_pixel_aspect_ratio(arg1: *mut heif_image, aspect_h: u32, aspect_v: u32);
}
extern "C" {
    #[doc = " ====================================================================================================\n  Encoding API"]
    pub fn heif_context_write_to_file(
        arg1: *mut heif_context,
        filename: *const libc::c_char,
    ) -> heif_error;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_writer {
    #[doc = " API version supported by this writer"]
    pub writer_api_version: libc::c_int,
    #[doc = " TODO: why do we need this parameter?"]
    pub write: ::std::option::Option<
        unsafe extern "C" fn(
            ctx: *mut heif_context,
            data: *const libc::c_void,
            size: usize,
            userdata: *mut libc::c_void,
        ) -> heif_error,
    >,
}
#[test]
fn bindgen_test_layout_heif_writer() {
    const UNINIT: ::std::mem::MaybeUninit<heif_writer> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_writer>(),
        16usize,
        concat!("Size of: ", stringify!(heif_writer))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_writer>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_writer))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).writer_api_version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_writer),
            "::",
            stringify!(writer_api_version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_writer),
            "::",
            stringify!(write)
        )
    );
}
extern "C" {
    pub fn heif_context_write(
        arg1: *mut heif_context,
        writer: *mut heif_writer,
        userdata: *mut libc::c_void,
    ) -> heif_error;
}
#[doc = " The encoder used for actually encoding an image."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder {
    _unused: [u8; 0],
}
#[doc = " A description of the encoder's capabilities and name."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder_descriptor {
    _unused: [u8; 0],
}
#[doc = " A configuration parameter of the encoder. Each encoder implementation may have a different\n set of parameters. For the most common settings (e.q. quality), special functions to set\n the parameters are provided."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder_parameter {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_decoder_descriptor {
    _unused: [u8; 0],
}
extern "C" {
    #[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."]
    pub fn heif_get_decoder_descriptors(
        format_filter: heif_compression_format,
        out_decoders: *mut *const heif_decoder_descriptor,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " Return a long, descriptive name of the decoder (including version information)."]
    pub fn heif_decoder_descriptor_get_name(
        arg1: *const heif_decoder_descriptor,
    ) -> *const libc::c_char;
}
extern "C" {
    #[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."]
    pub fn heif_decoder_descriptor_get_id_name(
        arg1: *const heif_decoder_descriptor,
    ) -> *const libc::c_char;
}
extern "C" {
    #[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()."]
    pub fn heif_context_get_encoder_descriptors(
        arg1: *mut heif_context,
        format_filter: heif_compression_format,
        name_filter: *const libc::c_char,
        out_encoders: *mut *const heif_encoder_descriptor,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[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()."]
    pub fn heif_get_encoder_descriptors(
        format_filter: heif_compression_format,
        name_filter: *const libc::c_char,
        out_encoders: *mut *const heif_encoder_descriptor,
        count: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " Return a long, descriptive name of the encoder (including version information)."]
    pub fn heif_encoder_descriptor_get_name(
        arg1: *const heif_encoder_descriptor,
    ) -> *const libc::c_char;
}
extern "C" {
    #[doc = " Return a short, symbolic name for identifying the encoder.\n This name should stay constant over different encoder versions."]
    pub fn heif_encoder_descriptor_get_id_name(
        arg1: *const heif_encoder_descriptor,
    ) -> *const libc::c_char;
}
extern "C" {
    pub fn heif_encoder_descriptor_get_compression_format(
        arg1: *const heif_encoder_descriptor,
    ) -> heif_compression_format;
}
extern "C" {
    pub fn heif_encoder_descriptor_supports_lossy_compression(
        arg1: *const heif_encoder_descriptor,
    ) -> libc::c_int;
}
extern "C" {
    pub fn heif_encoder_descriptor_supports_lossless_compression(
        arg1: *const heif_encoder_descriptor,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " Get an encoder instance that can be used to actually encode images from a descriptor."]
    pub fn heif_context_get_encoder(
        context: *mut heif_context,
        arg1: *const heif_encoder_descriptor,
        out_encoder: *mut *mut heif_encoder,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_have_decoder_for_format(format: heif_compression_format) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_have_encoder_for_format(format: heif_compression_format) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_context_get_encoder_for_format(
        context: *mut heif_context,
        format: heif_compression_format,
        arg1: *mut *mut heif_encoder,
    ) -> heif_error;
}
extern "C" {
    #[doc = " You have to release the encoder after use."]
    pub fn heif_encoder_release(arg1: *mut heif_encoder);
}
extern "C" {
    #[doc = " Get the encoder name from the encoder itself."]
    pub fn heif_encoder_get_name(arg1: *const heif_encoder) -> *const libc::c_char;
}
extern "C" {
    #[doc = " Set a 'quality' factor (0-100). How this is mapped to actual encoding parameters is\n encoder dependent."]
    pub fn heif_encoder_set_lossy_quality(
        arg1: *mut heif_encoder,
        quality: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_set_lossless(arg1: *mut heif_encoder, enable: libc::c_int) -> heif_error;
}
extern "C" {
    #[doc = " level should be between 0 (= none) to 4 (= full)"]
    pub fn heif_encoder_set_logging_level(
        arg1: *mut heif_encoder,
        level: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_encoder_list_parameters(
        arg1: *mut heif_encoder,
    ) -> *const *const heif_encoder_parameter;
}
extern "C" {
    #[doc = " Return the parameter name."]
    pub fn heif_encoder_parameter_get_name(
        arg1: *const heif_encoder_parameter,
    ) -> *const libc::c_char;
}
pub const heif_encoder_parameter_type_heif_encoder_parameter_type_integer:
    heif_encoder_parameter_type = 1;
pub const heif_encoder_parameter_type_heif_encoder_parameter_type_boolean:
    heif_encoder_parameter_type = 2;
pub const heif_encoder_parameter_type_heif_encoder_parameter_type_string:
    heif_encoder_parameter_type = 3;
pub type heif_encoder_parameter_type = libc::c_uint;
extern "C" {
    #[doc = " Return the parameter type."]
    pub fn heif_encoder_parameter_get_type(
        arg1: *const heif_encoder_parameter,
    ) -> heif_encoder_parameter_type;
}
extern "C" {
    #[doc = " DEPRECATED. Use heif_encoder_parameter_get_valid_integer_values() instead."]
    pub fn heif_encoder_parameter_get_valid_integer_range(
        arg1: *const heif_encoder_parameter,
        have_minimum_maximum: *mut libc::c_int,
        minimum: *mut libc::c_int,
        maximum: *mut libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_encoder_parameter_get_valid_integer_values(
        arg1: *const heif_encoder_parameter,
        have_minimum: *mut libc::c_int,
        have_maximum: *mut libc::c_int,
        minimum: *mut libc::c_int,
        maximum: *mut libc::c_int,
        num_valid_values: *mut libc::c_int,
        out_integer_array: *mut *const libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_parameter_get_valid_string_values(
        arg1: *const heif_encoder_parameter,
        out_stringarray: *mut *const *const libc::c_char,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_set_parameter_integer(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_get_parameter_integer(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: *mut libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_parameter_integer_valid_range(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        have_minimum_maximum: *mut libc::c_int,
        minimum: *mut libc::c_int,
        maximum: *mut libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_set_parameter_boolean(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_get_parameter_boolean(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: *mut libc::c_int,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_set_parameter_string(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: *const libc::c_char,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_get_parameter_string(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: *mut libc::c_char,
        value_size: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[doc = " returns a NULL-terminated list of valid strings or NULL if all values are allowed"]
    pub fn heif_encoder_parameter_string_valid_values(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        out_stringarray: *mut *const *const libc::c_char,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_encoder_parameter_integer_valid_values(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        have_minimum: *mut libc::c_int,
        have_maximum: *mut libc::c_int,
        minimum: *mut libc::c_int,
        maximum: *mut libc::c_int,
        num_valid_values: *mut libc::c_int,
        out_integer_array: *mut *const libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_encoder_set_parameter(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value: *const libc::c_char,
    ) -> heif_error;
}
extern "C" {
    #[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()."]
    pub fn heif_encoder_get_parameter(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
        value_ptr: *mut libc::c_char,
        value_size: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Query whether a specific parameter has a default value."]
    pub fn heif_encoder_has_default(
        arg1: *mut heif_encoder,
        parameter_name: *const libc::c_char,
    ) -> libc::c_int;
}
pub const heif_orientation_heif_orientation_normal: heif_orientation = 1;
pub const heif_orientation_heif_orientation_flip_horizontally: heif_orientation = 2;
pub const heif_orientation_heif_orientation_rotate_180: heif_orientation = 3;
pub const heif_orientation_heif_orientation_flip_vertically: heif_orientation = 4;
pub const heif_orientation_heif_orientation_rotate_90_cw_then_flip_horizontally: heif_orientation =
    5;
pub const heif_orientation_heif_orientation_rotate_90_cw: heif_orientation = 6;
pub const heif_orientation_heif_orientation_rotate_90_cw_then_flip_vertically: heif_orientation = 7;
pub const heif_orientation_heif_orientation_rotate_270_cw: heif_orientation = 8;
#[doc = " The orientation values are defined equal to the EXIF Orientation tag."]
pub type heif_orientation = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoding_options {
    pub version: u8,
    #[doc = " default: true"]
    pub save_alpha_channel: u8,
    #[doc = " DEPRECATED. This option is not required anymore. Its value will be ignored."]
    pub macOS_compatibility_workaround: u8,
    #[doc = " default: false"]
    pub save_two_colr_boxes_when_ICC_and_nclx_available: u8,
    #[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."]
    pub output_nclx_profile: *mut heif_color_profile_nclx,
    pub macOS_compatibility_workaround_no_nclx_profile: u8,
    #[doc = " libheif will generate irot/imir boxes to match these orientations"]
    pub image_orientation: heif_orientation,
    #[doc = " version 6 options"]
    pub color_conversion_options: heif_color_conversion_options,
}
#[test]
fn bindgen_test_layout_heif_encoding_options() {
    const UNINIT: ::std::mem::MaybeUninit<heif_encoding_options> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<heif_encoding_options>(),
        40usize,
        concat!("Size of: ", stringify!(heif_encoding_options))
    );
    assert_eq!(
        ::std::mem::align_of::<heif_encoding_options>(),
        8usize,
        concat!("Alignment of ", stringify!(heif_encoding_options))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).save_alpha_channel) as usize - ptr as usize },
        1usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(save_alpha_channel)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).macOS_compatibility_workaround) as usize - ptr as usize
        },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(macOS_compatibility_workaround)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).save_two_colr_boxes_when_ICC_and_nclx_available) as usize
                - ptr as usize
        },
        3usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(save_two_colr_boxes_when_ICC_and_nclx_available)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).output_nclx_profile) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(output_nclx_profile)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).macOS_compatibility_workaround_no_nclx_profile) as usize
                - ptr as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(macOS_compatibility_workaround_no_nclx_profile)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).image_orientation) as usize - ptr as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(image_orientation)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).color_conversion_options) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(heif_encoding_options),
            "::",
            stringify!(color_conversion_options)
        )
    );
}
extern "C" {
    pub fn heif_encoding_options_alloc() -> *mut heif_encoding_options;
}
extern "C" {
    pub fn heif_encoding_options_free(arg1: *mut heif_encoding_options);
}
extern "C" {
    #[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()."]
    pub fn heif_context_encode_image(
        arg1: *mut heif_context,
        image: *const heif_image,
        encoder: *mut heif_encoder,
        options: *const heif_encoding_options,
        out_image_handle: *mut *mut heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_context_set_primary_image(
        arg1: *mut heif_context,
        image_handle: *mut heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    #[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()."]
    pub fn heif_context_encode_thumbnail(
        arg1: *mut heif_context,
        image: *const heif_image,
        master_image_handle: *const heif_image_handle,
        encoder: *mut heif_encoder,
        options: *const heif_encoding_options,
        bbox_size: libc::c_int,
        out_thumb_image_handle: *mut *mut heif_image_handle,
    ) -> heif_error;
}
pub const heif_metadata_compression_heif_metadata_compression_off: heif_metadata_compression = 0;
pub const heif_metadata_compression_heif_metadata_compression_auto: heif_metadata_compression = 1;
pub const heif_metadata_compression_heif_metadata_compression_deflate: heif_metadata_compression =
    2;
pub type heif_metadata_compression = libc::c_uint;
extern "C" {
    #[doc = " Assign 'thumbnail_image' as the thumbnail image of 'master_image'."]
    pub fn heif_context_assign_thumbnail(
        arg1: *mut heif_context,
        master_image: *const heif_image_handle,
        thumbnail_image: *const heif_image_handle,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Add EXIF metadata to an image."]
    pub fn heif_context_add_exif_metadata(
        arg1: *mut heif_context,
        image_handle: *const heif_image_handle,
        data: *const libc::c_void,
        size: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Add XMP metadata to an image."]
    pub fn heif_context_add_XMP_metadata(
        arg1: *mut heif_context,
        image_handle: *const heif_image_handle,
        data: *const libc::c_void,
        size: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[doc = " New version of heif_context_add_XMP_metadata() with data compression (experimental)."]
    pub fn heif_context_add_XMP_metadata2(
        arg1: *mut heif_context,
        image_handle: *const heif_image_handle,
        data: *const libc::c_void,
        size: libc::c_int,
        compression: heif_metadata_compression,
    ) -> heif_error;
}
extern "C" {
    #[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."]
    pub fn heif_context_add_generic_metadata(
        ctx: *mut heif_context,
        image_handle: *const heif_image_handle,
        data: *const libc::c_void,
        size: libc::c_int,
        item_type: *const libc::c_char,
        content_type: *const libc::c_char,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Create a new image of the specified resolution and colorspace.\n Note: no memory for the actual image data is reserved yet. You have to use\n heif_image_add_plane() to add the image planes required by your colorspace/chroma."]
    pub fn heif_image_create(
        width: libc::c_int,
        height: libc::c_int,
        colorspace: heif_colorspace,
        chroma: heif_chroma,
        out_image: *mut *mut heif_image,
    ) -> heif_error;
}
extern "C" {
    #[doc = " The indicated bit_depth corresponds to the bit depth per channel.\n I.e. for interleaved formats like RRGGBB, the bit_depth would be, e.g., 10 bit instead\n of 30 bits or 3*16=48 bits.\n For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA,\n instead of the preferred 8 bits."]
    pub fn heif_image_add_plane(
        image: *mut heif_image,
        channel: heif_channel,
        width: libc::c_int,
        height: libc::c_int,
        bit_depth: libc::c_int,
    ) -> heif_error;
}
extern "C" {
    #[doc = " Signal that the image is premultiplied by the alpha pixel values."]
    pub fn heif_image_set_premultiplied_alpha(
        image: *mut heif_image,
        is_premultiplied_alpha: libc::c_int,
    );
}
extern "C" {
    pub fn heif_image_is_premultiplied_alpha(image: *mut heif_image) -> libc::c_int;
}
extern "C" {
    #[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."]
    pub fn heif_image_extend_padding_to_size(
        image: *mut heif_image,
        min_physical_width: libc::c_int,
        min_physical_height: libc::c_int,
    ) -> heif_error;
}
#[doc = " --- register plugins"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_decoder_plugin {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder_plugin {
    _unused: [u8; 0],
}
extern "C" {
    #[doc = " DEPRECATED. Use heif_register_decoder_plugin(const struct heif_decoder_plugin*) instead."]
    pub fn heif_register_decoder(
        heif: *mut heif_context,
        arg1: *const heif_decoder_plugin,
    ) -> heif_error;
}
extern "C" {
    pub fn heif_register_decoder_plugin(arg1: *const heif_decoder_plugin) -> heif_error;
}
extern "C" {
    pub fn heif_register_encoder_plugin(arg1: *const heif_encoder_plugin) -> heif_error;
}
extern "C" {
    #[doc = " DEPRECATED, typo in function name"]
    pub fn heif_encoder_descriptor_supportes_lossy_compression(
        arg1: *const heif_encoder_descriptor,
    ) -> libc::c_int;
}
extern "C" {
    #[doc = " DEPRECATED, typo in function name"]
    pub fn heif_encoder_descriptor_supportes_lossless_compression(
        arg1: *const heif_encoder_descriptor,
    ) -> libc::c_int;
}