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
pub type __uint8_t = libc::c_uchar;
pub type __uint32_t = libc::c_uint;
pub type __int64_t = libc::c_long;
extern "C" {
pub fn heif_get_version() -> *const libc::c_char;
}
extern "C" {
pub fn heif_get_version_number() -> u32;
}
extern "C" {
pub fn heif_get_version_number_major() -> libc::c_int;
}
extern "C" {
pub fn heif_get_version_number_minor() -> libc::c_int;
}
extern "C" {
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],
}
pub const heif_error_code_heif_error_Ok: heif_error_code = 0;
pub const heif_error_code_heif_error_Input_does_not_exist: heif_error_code = 1;
pub const heif_error_code_heif_error_Invalid_input: heif_error_code = 2;
pub const heif_error_code_heif_error_Unsupported_filetype: heif_error_code = 3;
pub const heif_error_code_heif_error_Unsupported_feature: heif_error_code = 4;
pub const heif_error_code_heif_error_Usage_error: heif_error_code = 5;
pub const heif_error_code_heif_error_Memory_allocation_error: heif_error_code = 6;
pub const heif_error_code_heif_error_Decoder_plugin_error: heif_error_code = 7;
pub const heif_error_code_heif_error_Encoder_plugin_error: heif_error_code = 8;
pub const heif_error_code_heif_error_Encoding_error: heif_error_code = 9;
pub const heif_error_code_heif_error_Color_profile_does_not_exist: heif_error_code = 10;
pub type heif_error_code = libc::c_uint;
pub const heif_suberror_code_heif_suberror_Unspecified: heif_suberror_code = 0;
pub const heif_suberror_code_heif_suberror_End_of_data: heif_suberror_code = 100;
pub const heif_suberror_code_heif_suberror_Invalid_box_size: heif_suberror_code = 101;
pub const heif_suberror_code_heif_suberror_No_ftyp_box: heif_suberror_code = 102;
pub const heif_suberror_code_heif_suberror_No_idat_box: heif_suberror_code = 103;
pub const heif_suberror_code_heif_suberror_No_meta_box: heif_suberror_code = 104;
pub const heif_suberror_code_heif_suberror_No_hdlr_box: heif_suberror_code = 105;
pub const heif_suberror_code_heif_suberror_No_hvcC_box: heif_suberror_code = 106;
pub const heif_suberror_code_heif_suberror_No_pitm_box: heif_suberror_code = 107;
pub const heif_suberror_code_heif_suberror_No_ipco_box: heif_suberror_code = 108;
pub const heif_suberror_code_heif_suberror_No_ipma_box: heif_suberror_code = 109;
pub const heif_suberror_code_heif_suberror_No_iloc_box: heif_suberror_code = 110;
pub const heif_suberror_code_heif_suberror_No_iinf_box: heif_suberror_code = 111;
pub const heif_suberror_code_heif_suberror_No_iprp_box: heif_suberror_code = 112;
pub const heif_suberror_code_heif_suberror_No_iref_box: heif_suberror_code = 113;
pub const heif_suberror_code_heif_suberror_No_pict_handler: heif_suberror_code = 114;
pub const heif_suberror_code_heif_suberror_Ipma_box_references_nonexisting_property:
heif_suberror_code = 115;
pub const heif_suberror_code_heif_suberror_No_properties_assigned_to_item: heif_suberror_code = 116;
pub const heif_suberror_code_heif_suberror_No_item_data: heif_suberror_code = 117;
pub const heif_suberror_code_heif_suberror_Invalid_grid_data: heif_suberror_code = 118;
pub const heif_suberror_code_heif_suberror_Missing_grid_images: heif_suberror_code = 119;
pub const heif_suberror_code_heif_suberror_Invalid_clean_aperture: heif_suberror_code = 120;
pub const heif_suberror_code_heif_suberror_Invalid_overlay_data: heif_suberror_code = 121;
pub const heif_suberror_code_heif_suberror_Overlay_image_outside_of_canvas: heif_suberror_code =
122;
pub const heif_suberror_code_heif_suberror_Auxiliary_image_type_unspecified: heif_suberror_code =
123;
pub const heif_suberror_code_heif_suberror_No_or_invalid_primary_item: heif_suberror_code = 124;
pub const heif_suberror_code_heif_suberror_No_infe_box: heif_suberror_code = 125;
pub const heif_suberror_code_heif_suberror_Unknown_color_profile_type: heif_suberror_code = 126;
pub const heif_suberror_code_heif_suberror_Wrong_tile_image_chroma_format: heif_suberror_code = 127;
pub const heif_suberror_code_heif_suberror_Invalid_fractional_number: heif_suberror_code = 128;
pub const heif_suberror_code_heif_suberror_Invalid_image_size: heif_suberror_code = 129;
pub const heif_suberror_code_heif_suberror_Invalid_pixi_box: heif_suberror_code = 130;
pub const heif_suberror_code_heif_suberror_No_av1C_box: heif_suberror_code = 131;
pub const heif_suberror_code_heif_suberror_Wrong_tile_image_pixel_depth: heif_suberror_code = 132;
pub const heif_suberror_code_heif_suberror_Security_limit_exceeded: heif_suberror_code = 1000;
pub const heif_suberror_code_heif_suberror_Nonexisting_item_referenced: heif_suberror_code = 2000;
pub const heif_suberror_code_heif_suberror_Null_pointer_argument: heif_suberror_code = 2001;
pub const heif_suberror_code_heif_suberror_Nonexisting_image_channel_referenced:
heif_suberror_code = 2002;
pub const heif_suberror_code_heif_suberror_Unsupported_plugin_version: heif_suberror_code = 2003;
pub const heif_suberror_code_heif_suberror_Unsupported_writer_version: heif_suberror_code = 2004;
pub const heif_suberror_code_heif_suberror_Unsupported_parameter: heif_suberror_code = 2005;
pub const heif_suberror_code_heif_suberror_Invalid_parameter_value: heif_suberror_code = 2006;
pub const heif_suberror_code_heif_suberror_Unsupported_codec: heif_suberror_code = 3000;
pub const heif_suberror_code_heif_suberror_Unsupported_image_type: heif_suberror_code = 3001;
pub const heif_suberror_code_heif_suberror_Unsupported_data_version: heif_suberror_code = 3002;
pub const heif_suberror_code_heif_suberror_Unsupported_color_conversion: heif_suberror_code = 3003;
pub const heif_suberror_code_heif_suberror_Unsupported_item_construction_method:
heif_suberror_code = 3004;
pub const heif_suberror_code_heif_suberror_Unsupported_bit_depth: heif_suberror_code = 4000;
pub const heif_suberror_code_heif_suberror_Cannot_write_output_data: heif_suberror_code = 5000;
pub type heif_suberror_code = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_error {
pub code: heif_error_code,
pub subcode: heif_suberror_code,
pub message: *const libc::c_char,
}
#[test]
fn bindgen_test_layout_heif_error() {
assert_eq!(
::core::mem::size_of::<heif_error>(),
16usize,
concat!("Size of: ", stringify!(heif_error))
);
assert_eq!(
::core::mem::align_of::<heif_error>(),
8usize,
concat!("Alignment of ", stringify!(heif_error))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_error>())).code as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(heif_error),
"::",
stringify!(code)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_error>())).subcode as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(heif_error),
"::",
stringify!(subcode)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_error>())).message as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(heif_error),
"::",
stringify!(message)
)
);
}
pub type heif_item_id = u32;
pub const heif_filetype_result_heif_filetype_no: heif_filetype_result = 0;
pub const heif_filetype_result_heif_filetype_yes_supported: heif_filetype_result = 1;
pub const heif_filetype_result_heif_filetype_yes_unsupported: heif_filetype_result = 2;
pub const heif_filetype_result_heif_filetype_maybe: heif_filetype_result = 3;
pub type heif_filetype_result = libc::c_uint;
extern "C" {
pub fn heif_check_filetype(data: *const u8, len: libc::c_int) -> heif_filetype_result;
}
pub const heif_brand_heif_unknown_brand: heif_brand = 0;
pub const heif_brand_heif_heic: heif_brand = 1;
pub const heif_brand_heif_heix: heif_brand = 2;
pub const heif_brand_heif_hevc: heif_brand = 3;
pub const heif_brand_heif_hevx: heif_brand = 4;
pub const heif_brand_heif_heim: heif_brand = 5;
pub const heif_brand_heif_heis: heif_brand = 6;
pub const heif_brand_heif_hevm: heif_brand = 7;
pub const heif_brand_heif_hevs: heif_brand = 8;
pub const heif_brand_heif_mif1: heif_brand = 9;
pub const heif_brand_heif_msf1: heif_brand = 10;
pub const heif_brand_heif_avif: heif_brand = 11;
pub const heif_brand_heif_avis: heif_brand = 12;
pub type heif_brand = libc::c_uint;
extern "C" {
pub fn heif_main_brand(data: *const u8, len: libc::c_int) -> heif_brand;
}
pub type heif_brand2 = u32;
extern "C" {
pub fn heif_read_main_brand(data: *const u8, len: libc::c_int) -> heif_brand2;
}
extern "C" {
pub fn heif_fourcc_to_brand(brand_fourcc: *const libc::c_char) -> heif_brand2;
}
extern "C" {
pub fn heif_brand_to_fourcc(brand: heif_brand2, out_fourcc: *mut libc::c_char);
}
extern "C" {
pub fn heif_has_compatible_brand(
data: *const u8,
len: libc::c_int,
brand_fourcc: *const libc::c_char,
) -> libc::c_int;
}
extern "C" {
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" {
pub fn heif_get_file_mime_type(data: *const u8, len: libc::c_int) -> *const libc::c_char;
}
extern "C" {
pub fn heif_context_alloc() -> *mut heif_context;
}
extern "C" {
pub fn heif_context_free(arg1: *mut heif_context);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_reading_options {
_unused: [u8; 0],
}
pub const heif_reader_grow_status_heif_reader_grow_status_size_reached: heif_reader_grow_status = 0;
pub const heif_reader_grow_status_heif_reader_grow_status_timeout: heif_reader_grow_status = 1;
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 {
pub reader_api_version: libc::c_int,
pub get_position:
::core::option::Option<unsafe extern "C" fn(userdata: *mut libc::c_void) -> i64>,
pub read: ::core::option::Option<
unsafe extern "C" fn(
data: *mut libc::c_void,
size: usize,
userdata: *mut libc::c_void,
) -> libc::c_int,
>,
pub seek: ::core::option::Option<
unsafe extern "C" fn(position: i64, userdata: *mut libc::c_void) -> libc::c_int,
>,
pub wait_for_file_size: ::core::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() {
assert_eq!(
::core::mem::size_of::<heif_reader>(),
40usize,
concat!("Size of: ", stringify!(heif_reader))
);
assert_eq!(
::core::mem::align_of::<heif_reader>(),
8usize,
concat!("Alignment of ", stringify!(heif_reader))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_reader>())).reader_api_version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(heif_reader),
"::",
stringify!(reader_api_version)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_reader>())).get_position as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(heif_reader),
"::",
stringify!(get_position)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_reader>())).read as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(heif_reader),
"::",
stringify!(read)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_reader>())).seek as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(heif_reader),
"::",
stringify!(seek)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_reader>())).wait_for_file_size as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(heif_reader),
"::",
stringify!(wait_for_file_size)
)
);
}
extern "C" {
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" {
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" {
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" {
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" {
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" {
pub fn heif_context_get_primary_image_handle(
ctx: *mut heif_context,
arg1: *mut *mut heif_image_handle,
) -> heif_error;
}
extern "C" {
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" {
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" {
pub fn heif_image_handle_release(arg1: *const heif_image_handle);
}
extern "C" {
pub fn heif_image_handle_is_primary_image(handle: *const heif_image_handle) -> libc::c_int;
}
extern "C" {
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" {
pub fn heif_image_handle_get_luma_bits_per_pixel(arg1: *const heif_image_handle)
-> libc::c_int;
}
extern "C" {
pub fn heif_image_handle_get_chroma_bits_per_pixel(
arg1: *const heif_image_handle,
) -> libc::c_int;
}
extern "C" {
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" {
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,
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() {
assert_eq!(
::core::mem::size_of::<heif_depth_representation_info>(),
64usize,
concat!("Size of: ", stringify!(heif_depth_representation_info))
);
assert_eq!(
::core::mem::align_of::<heif_depth_representation_info>(),
8usize,
concat!("Alignment of ", stringify!(heif_depth_representation_info))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).version as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).has_z_near as *const _
as usize
},
1usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(has_z_near)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).has_z_far as *const _
as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(has_z_far)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).has_d_min as *const _
as usize
},
3usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(has_d_min)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).has_d_max as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(has_d_max)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).z_near as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(z_near)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).z_far as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(z_far)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).d_min as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(d_min)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).d_max as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(d_max)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).depth_representation_type
as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(depth_representation_type)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>())).disparity_reference_view
as *const _ as usize
},
44usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(disparity_reference_view)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>()))
.depth_nonlinear_representation_model_size as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(heif_depth_representation_info),
"::",
stringify!(depth_nonlinear_representation_model_size)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_depth_representation_info>()))
.depth_nonlinear_representation_model as *const _ 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" {
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" {
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" {
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" {
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" {
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_free_auxiliary_types(
handle: *const heif_image_handle,
out_type: *mut *const libc::c_char,
);
}
extern "C" {
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" {
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" {
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" {
pub fn heif_image_handle_get_metadata_type(
handle: *const heif_image_handle,
metadata_id: heif_item_id,
) -> *const libc::c_char;
}
extern "C" {
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" {
pub fn heif_image_handle_get_metadata_size(
handle: *const heif_image_handle,
metadata_id: heif_item_id,
) -> usize;
}
extern "C" {
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;
}
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;
pub type heif_color_profile_type = libc::c_uint;
extern "C" {
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" {
pub fn heif_image_handle_get_raw_color_profile(
handle: *const heif_image_handle,
out_data: *mut libc::c_void,
) -> heif_error;
}
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;
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;
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 {
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,
pub color_primary_red_x: f32,
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() {
assert_eq!(
::core::mem::size_of::<heif_color_profile_nclx>(),
52usize,
concat!("Size of: ", stringify!(heif_color_profile_nclx))
);
assert_eq!(
::core::mem::align_of::<heif_color_profile_nclx>(),
4usize,
concat!("Alignment of ", stringify!(heif_color_profile_nclx))
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).version as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primaries as *const _
as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primaries)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).transfer_characteristics
as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(transfer_characteristics)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).matrix_coefficients as *const _
as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(matrix_coefficients)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).full_range_flag as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(full_range_flag)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_red_x as *const _
as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_red_x)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_red_y as *const _
as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_red_y)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_green_x as *const _
as usize
},
28usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_green_x)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_green_y as *const _
as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_green_y)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_blue_x as *const _
as usize
},
36usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_blue_x)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_blue_y as *const _
as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_blue_y)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_white_x as *const _
as usize
},
44usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_white_x)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_white_y as *const _
as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_white_y)
)
);
}
extern "C" {
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" {
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_compression_format_heif_compression_undefined: heif_compression_format = 0;
pub const heif_compression_format_heif_compression_HEVC: heif_compression_format = 1;
pub const heif_compression_format_heif_compression_AVC: heif_compression_format = 2;
pub const heif_compression_format_heif_compression_JPEG: heif_compression_format = 3;
pub const heif_compression_format_heif_compression_AV1: heif_compression_format = 4;
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;
pub const heif_chroma_heif_chroma_interleaved_RRGGBB_BE: heif_chroma = 12;
pub const heif_chroma_heif_chroma_interleaved_RRGGBBAA_BE: heif_chroma = 13;
pub const heif_chroma_heif_chroma_interleaved_RRGGBB_LE: heif_chroma = 14;
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;
pub const heif_colorspace_heif_colorspace_YCbCr: heif_colorspace = 0;
pub const heif_colorspace_heif_colorspace_RGB: heif_colorspace = 1;
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;
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;
pub type heif_progress_step = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_decoding_options {
pub version: u8,
pub ignore_transformations: u8,
pub start_progress: ::core::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: ::core::option::Option<
unsafe extern "C" fn(
step: heif_progress_step,
progress: libc::c_int,
progress_user_data: *mut libc::c_void,
),
>,
pub end_progress: ::core::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,
pub convert_hdr_to_8bit: u8,
}
#[test]
fn bindgen_test_layout_heif_decoding_options() {
assert_eq!(
::core::mem::size_of::<heif_decoding_options>(),
48usize,
concat!("Size of: ", stringify!(heif_decoding_options))
);
assert_eq!(
::core::mem::align_of::<heif_decoding_options>(),
8usize,
concat!("Alignment of ", stringify!(heif_decoding_options))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_decoding_options>())).version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_decoding_options>())).ignore_transformations as *const _
as usize
},
1usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(ignore_transformations)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_decoding_options>())).start_progress as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(start_progress)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_decoding_options>())).on_progress as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(on_progress)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_decoding_options>())).end_progress as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(end_progress)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_decoding_options>())).progress_user_data as *const _
as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(progress_user_data)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_decoding_options>())).convert_hdr_to_8bit as *const _
as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(heif_decoding_options),
"::",
stringify!(convert_hdr_to_8bit)
)
);
}
extern "C" {
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" {
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" {
pub fn heif_image_get_colorspace(arg1: *const heif_image) -> heif_colorspace;
}
extern "C" {
pub fn heif_image_get_chroma_format(arg1: *const heif_image) -> heif_chroma;
}
extern "C" {
pub fn heif_image_get_width(arg1: *const heif_image, channel: heif_channel) -> libc::c_int;
}
extern "C" {
pub fn heif_image_get_height(arg1: *const heif_image, channel: heif_channel) -> libc::c_int;
}
extern "C" {
pub fn heif_image_get_primary_width(arg1: *const heif_image) -> libc::c_int;
}
extern "C" {
pub fn heif_image_get_primary_height(arg1: *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" {
pub fn heif_image_get_bits_per_pixel(
arg1: *const heif_image,
channel: heif_channel,
) -> libc::c_int;
}
extern "C" {
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" {
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" {
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" {
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" {
pub fn heif_image_release(arg1: *const heif_image);
}
extern "C" {
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 {
pub writer_api_version: libc::c_int,
pub write: ::core::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() {
assert_eq!(
::core::mem::size_of::<heif_writer>(),
16usize,
concat!("Size of: ", stringify!(heif_writer))
);
assert_eq!(
::core::mem::align_of::<heif_writer>(),
8usize,
concat!("Alignment of ", stringify!(heif_writer))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_writer>())).writer_api_version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(heif_writer),
"::",
stringify!(writer_api_version)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_writer>())).write as *const _ 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;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder_descriptor {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoder_parameter {
_unused: [u8; 0],
}
extern "C" {
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" {
pub fn heif_encoder_descriptor_get_name(
arg1: *const heif_encoder_descriptor,
) -> *const libc::c_char;
}
extern "C" {
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" {
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" {
pub fn heif_have_decoder_for_format(format: heif_compression_format) -> libc::c_int;
}
extern "C" {
pub fn heif_have_encoder_for_format(format: heif_compression_format) -> libc::c_int;
}
extern "C" {
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" {
pub fn heif_encoder_release(arg1: *mut heif_encoder);
}
extern "C" {
pub fn heif_encoder_get_name(arg1: *const heif_encoder) -> *const libc::c_char;
}
extern "C" {
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" {
pub fn heif_encoder_set_logging_level(
arg1: *mut heif_encoder,
level: libc::c_int,
) -> heif_error;
}
extern "C" {
pub fn heif_encoder_list_parameters(
arg1: *mut heif_encoder,
) -> *const *const heif_encoder_parameter;
}
extern "C" {
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" {
pub fn heif_encoder_parameter_get_type(
arg1: *const heif_encoder_parameter,
) -> heif_encoder_parameter_type;
}
extern "C" {
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" {
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" {
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" {
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" {
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" {
pub fn heif_encoder_has_default(
arg1: *mut heif_encoder,
parameter_name: *const libc::c_char,
) -> libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct heif_encoding_options {
pub version: u8,
pub save_alpha_channel: u8,
pub macOS_compatibility_workaround: u8,
pub save_two_colr_boxes_when_ICC_and_nclx_available: u8,
pub output_nclx_profile: *mut heif_color_profile_nclx,
pub macOS_compatibility_workaround_no_nclx_profile: u8,
}
#[test]
fn bindgen_test_layout_heif_encoding_options() {
assert_eq!(
::core::mem::size_of::<heif_encoding_options>(),
24usize,
concat!("Size of: ", stringify!(heif_encoding_options))
);
assert_eq!(
::core::mem::align_of::<heif_encoding_options>(),
8usize,
concat!("Alignment of ", stringify!(heif_encoding_options))
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<heif_encoding_options>())).version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(heif_encoding_options),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_encoding_options>())).save_alpha_channel as *const _
as usize
},
1usize,
concat!(
"Offset of field: ",
stringify!(heif_encoding_options),
"::",
stringify!(save_alpha_channel)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_encoding_options>())).macOS_compatibility_workaround
as *const _ as usize
},
2usize,
concat!(
"Offset of field: ",
stringify!(heif_encoding_options),
"::",
stringify!(macOS_compatibility_workaround)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_encoding_options>()))
.save_two_colr_boxes_when_ICC_and_nclx_available as *const _ as usize
},
3usize,
concat!(
"Offset of field: ",
stringify!(heif_encoding_options),
"::",
stringify!(save_two_colr_boxes_when_ICC_and_nclx_available)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_encoding_options>())).output_nclx_profile as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(heif_encoding_options),
"::",
stringify!(output_nclx_profile)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_encoding_options>()))
.macOS_compatibility_workaround_no_nclx_profile as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(heif_encoding_options),
"::",
stringify!(macOS_compatibility_workaround_no_nclx_profile)
)
);
}
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" {
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" {
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;
}
extern "C" {
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" {
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" {
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" {
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" {
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" {
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" {
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;
}
#[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" {
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" {
pub fn heif_encoder_descriptor_supportes_lossy_compression(
arg1: *const heif_encoder_descriptor,
) -> libc::c_int;
}
extern "C" {
pub fn heif_encoder_descriptor_supportes_lossless_compression(
arg1: *const heif_encoder_descriptor,
) -> libc::c_int;
}