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
/* automatically generated by rust-bindgen 0.56.0 */

pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __uint32_t = ::std::os::raw::c_uint;
#[doc = " Use 32-bit single-precision floating point values, with range 0.0-1.0"]
#[doc = " (within gamut, may go outside this range for wide color gamut). Floating"]
#[doc = " point output, either JXL_TYPE_FLOAT or JXL_TYPE_FLOAT16, is recommended"]
#[doc = " for HDR and wide gamut images when color profile conversion is required."]
pub const JXL_TYPE_FLOAT: JxlDataType = 0;
#[doc = " Use 1-bit packed in uint8_t, first pixel in LSB, padded to uint8_t per"]
#[doc = " row."]
#[doc = " TODO(lode): support first in MSB, other padding."]
pub const JXL_TYPE_BOOLEAN: JxlDataType = 1;
#[doc = " Use type uint8_t. May clip wide color gamut data."]
pub const JXL_TYPE_UINT8: JxlDataType = 2;
#[doc = " Use type uint16_t. May clip wide color gamut data."]
pub const JXL_TYPE_UINT16: JxlDataType = 3;
#[doc = " Use type uint32_t. May clip wide color gamut data."]
pub const JXL_TYPE_UINT32: JxlDataType = 4;
#[doc = " Use 16-bit IEEE 754 half-precision floating point values"]
pub const JXL_TYPE_FLOAT16: JxlDataType = 5;
#[doc = " Data type for the sample values per channel per pixel."]
pub type JxlDataType = ::std::os::raw::c_uint;
#[doc = " Use the endianness of the system, either little endian or big endian,"]
#[doc = " without forcing either specific endianness. Do not use if pixel data"]
#[doc = " should be exported to a well defined format."]
pub const JXL_NATIVE_ENDIAN: JxlEndianness = 0;
#[doc = " Force little endian"]
pub const JXL_LITTLE_ENDIAN: JxlEndianness = 1;
#[doc = " Force big endian"]
pub const JXL_BIG_ENDIAN: JxlEndianness = 2;
#[doc = " Ordering of multi-byte data."]
pub type JxlEndianness = ::std::os::raw::c_uint;
#[doc = " Data type for the sample values per channel per pixel for the output buffer"]
#[doc = " for pixels. This is not necessarily the same as the data type encoded in the"]
#[doc = " codestream. The channels are interleaved per pixel. The pixels are"]
#[doc = " organized row by row, left to right, top to bottom."]
#[doc = " TODO(lode): implement padding / alignment (row stride)"]
#[doc = " TODO(lode): support different channel orders if needed (RGB, BGR, ...)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlPixelFormat {
    #[doc = " Amount of channels available in a pixel buffer."]
    #[doc = " 1: single-channel data, e.g. grayscale"]
    #[doc = " 2: single-channel + alpha"]
    #[doc = " 3: trichromatic, e.g. RGB"]
    #[doc = " 4: trichromatic + alpha"]
    #[doc = " TODO(lode): this needs finetuning. It is not yet defined how the user"]
    #[doc = " chooses output color space. CMYK+alpha needs 5 channels."]
    pub num_channels: u32,
    #[doc = " Data type of each channel."]
    pub data_type: JxlDataType,
    #[doc = " Whether multi-byte data types are represented in big endian or little"]
    #[doc = " endian format. This applies to JXL_TYPE_UINT16, JXL_TYPE_UINT32"]
    #[doc = " and JXL_TYPE_FLOAT."]
    pub endianness: JxlEndianness,
    #[doc = " Align scanlines to a multiple of align bytes, or 0 to require no"]
    #[doc = " alignment at all (which has the same effect as value 1)"]
    pub align: usize,
}
#[test]
fn bindgen_test_layout_JxlPixelFormat() {
    assert_eq!(
        ::std::mem::size_of::<JxlPixelFormat>(),
        24usize,
        concat!("Size of: ", stringify!(JxlPixelFormat))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlPixelFormat>(),
        8usize,
        concat!("Alignment of ", stringify!(JxlPixelFormat))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlPixelFormat>())).num_channels as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlPixelFormat),
            "::",
            stringify!(num_channels)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlPixelFormat>())).data_type as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlPixelFormat),
            "::",
            stringify!(data_type)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlPixelFormat>())).endianness as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlPixelFormat),
            "::",
            stringify!(endianness)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlPixelFormat>())).align as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlPixelFormat),
            "::",
            stringify!(align)
        )
    );
}
impl Default for JxlPixelFormat {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[doc = " Tristimulus RGB"]
pub const JXL_COLOR_SPACE_RGB: JxlColorSpace = 0;
#[doc = " Luminance based, the primaries in JxlColorEncoding must be ignored. This"]
#[doc = " value implies that num_color_channels in JxlBasicInfo is 1, any other value"]
#[doc = " implies num_color_channels is 3."]
pub const JXL_COLOR_SPACE_GRAY: JxlColorSpace = 1;
#[doc = " XYB (opsin) color space"]
pub const JXL_COLOR_SPACE_XYB: JxlColorSpace = 2;
#[doc = " None of the other table entries describe the color space appropriately"]
pub const JXL_COLOR_SPACE_UNKNOWN: JxlColorSpace = 3;
#[doc = " Color space of the image data."]
pub type JxlColorSpace = ::std::os::raw::c_uint;
#[doc = " CIE Standard Illuminant D65: 0.3127, 0.3290"]
pub const JXL_WHITE_POINT_D65: JxlWhitePoint = 1;
#[doc = " Custom white point stored in JxlColorEncoding white_point."]
pub const JXL_WHITE_POINT_CUSTOM: JxlWhitePoint = 2;
#[doc = " CIE Standard Illuminant E (equal-energy): 1/3, 1/3"]
pub const JXL_WHITE_POINT_E: JxlWhitePoint = 10;
#[doc = " DCI-P3 from SMPTE RP 431-2: 0.314, 0.351"]
pub const JXL_WHITE_POINT_DCI: JxlWhitePoint = 11;
#[doc = " Built-in whitepoints for color encoding. Numeric values match CICP (Rec."]
#[doc = " ITU-T H.273 | ISO/IEC 23091-2:2019(E))."]
pub type JxlWhitePoint = ::std::os::raw::c_uint;
#[doc = " The CIE xy values of the red, green and blue primaries are: 0.639998686,"]
#[doc = "0.330010138; 0.300003784, 0.600003357; 0.150002046, 0.059997204"]
pub const JXL_PRIMARIES_SRGB: JxlPrimaries = 1;
#[doc = " Custom white point stored in JxlColorEncoding primaries_red_xy,"]
#[doc = "primaries_green_xy and primaries_blue_xy."]
pub const JXL_PRIMARIES_CUSTOM: JxlPrimaries = 2;
#[doc = " As specified in Rec. ITU-R BT.2100-1"]
pub const JXL_PRIMARIES_2100: JxlPrimaries = 9;
#[doc = " As specified in SMPTE RP 431-2"]
pub const JXL_PRIMARIES_P3: JxlPrimaries = 11;
#[doc = " Built-in primaries for color encoding. Numeric values match CICP (Rec. ITU-T"]
#[doc = " H.273 | ISO/IEC 23091-2:2019(E))."]
pub type JxlPrimaries = ::std::os::raw::c_uint;
#[doc = " As specified in SMPTE RP 431-2"]
pub const JXL_TRANSFER_FUNCTION_709: JxlTransferFunction = 1;
#[doc = " None of the other table entries describe the transfer function."]
pub const JXL_TRANSFER_FUNCTION_UNKNOWN: JxlTransferFunction = 2;
#[doc = " The gamma exponent is 1"]
pub const JXL_TRANSFER_FUNCTION_LINEAR: JxlTransferFunction = 8;
#[doc = " As specified in IEC 61966-2-1 sRGB"]
pub const JXL_TRANSFER_FUNCTION_SRGB: JxlTransferFunction = 13;
#[doc = " As specified in SMPTE ST 428-1"]
pub const JXL_TRANSFER_FUNCTION_PQ: JxlTransferFunction = 16;
#[doc = " As specified in SMPTE ST 428-1"]
pub const JXL_TRANSFER_FUNCTION_DCI: JxlTransferFunction = 17;
#[doc = " As specified in Rec. ITU-R BT.2100-1 (HLG)"]
pub const JXL_TRANSFER_FUNCTION_HLG: JxlTransferFunction = 18;
#[doc = " Transfer function follows power law given by the gamma value in"]
#[doc = "JxlColorEncoding. Not a CICP value."]
pub const JXL_TRANSFER_FUNCTION_GAMMA: JxlTransferFunction = 65535;
#[doc = " Built-in transfer functions for color encoding. Numeric values match CICP"]
#[doc = " (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)) unless specified otherwise."]
pub type JxlTransferFunction = ::std::os::raw::c_uint;
#[doc = " vendor-specific"]
pub const JXL_RENDERING_INTENT_PERCEPTUAL: JxlRenderingIntent = 0;
#[doc = " media-relative"]
pub const JXL_RENDERING_INTENT_RELATIVE: JxlRenderingIntent = 1;
#[doc = " vendor-specific"]
pub const JXL_RENDERING_INTENT_SATURATION: JxlRenderingIntent = 2;
#[doc = " ICC-absolute"]
pub const JXL_RENDERING_INTENT_ABSOLUTE: JxlRenderingIntent = 3;
#[doc = " Renderig intent for color encoding, as specified in ISO 15076-1:2010"]
pub type JxlRenderingIntent = ::std::os::raw::c_uint;
#[doc = " Color encoding of the image as structured information."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlColorEncoding {
    #[doc = " Color space of the image data."]
    pub color_space: JxlColorSpace,
    #[doc = " Built-in white point. If this value is JXL_WHITE_POINT_CUSTOM, must"]
    #[doc = " use the numerical whitepoint values from white_point_xy."]
    pub white_point: JxlWhitePoint,
    #[doc = " Numerical whitepoint values in CIE xy space."]
    pub white_point_xy: [f64; 2usize],
    #[doc = " Built-in RGB primaries. If this value is JXL_PRIMARIES_CUSTOM, must"]
    #[doc = " use the numerical primaries values below. This field and the custom values"]
    #[doc = " below are unused and must be ignored if the color space is"]
    #[doc = " JXL_COLOR_SPACE_GRAY or JXL_COLOR_SPACE_XYB."]
    pub primaries: JxlPrimaries,
    #[doc = " Numerical red primary values in CIE xy space."]
    pub primaries_red_xy: [f64; 2usize],
    #[doc = " Numerical green primary values in CIE xy space."]
    pub primaries_green_xy: [f64; 2usize],
    #[doc = " Numerical blue primary values in CIE xy space."]
    pub primaries_blue_xy: [f64; 2usize],
    #[doc = " Transfer function is have_gamma is 0"]
    pub transfer_function: JxlTransferFunction,
    #[doc = " Gamma value used when transfer_function is JXL_TRANSFER_FUNCTION_GAMMA"]
    pub gamma: f64,
    #[doc = " Rendering intent defined for the color profile."]
    pub rendering_intent: JxlRenderingIntent,
}
#[test]
fn bindgen_test_layout_JxlColorEncoding() {
    assert_eq!(
        ::std::mem::size_of::<JxlColorEncoding>(),
        104usize,
        concat!("Size of: ", stringify!(JxlColorEncoding))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlColorEncoding>(),
        8usize,
        concat!("Alignment of ", stringify!(JxlColorEncoding))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlColorEncoding>())).color_space as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(color_space)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlColorEncoding>())).white_point as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(white_point)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlColorEncoding>())).white_point_xy as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(white_point_xy)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlColorEncoding>())).primaries as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(primaries)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlColorEncoding>())).primaries_red_xy as *const _ as usize
        },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(primaries_red_xy)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlColorEncoding>())).primaries_green_xy as *const _ as usize
        },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(primaries_green_xy)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlColorEncoding>())).primaries_blue_xy as *const _ as usize
        },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(primaries_blue_xy)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlColorEncoding>())).transfer_function as *const _ as usize
        },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(transfer_function)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlColorEncoding>())).gamma as *const _ as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(gamma)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlColorEncoding>())).rendering_intent as *const _ as usize
        },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlColorEncoding),
            "::",
            stringify!(rendering_intent)
        )
    );
}
impl Default for JxlColorEncoding {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
pub const JXL_ORIENT_IDENTITY: JxlOrientation = 1;
pub const JXL_ORIENT_FLIP_HORIZONTAL: JxlOrientation = 2;
pub const JXL_ORIENT_ROTATE_180: JxlOrientation = 3;
pub const JXL_ORIENT_FLIP_VERTICAL: JxlOrientation = 4;
pub const JXL_ORIENT_TRANSPOSE: JxlOrientation = 5;
pub const JXL_ORIENT_ROTATE_90_CW: JxlOrientation = 6;
pub const JXL_ORIENT_ANTI_TRANSPOSE: JxlOrientation = 7;
pub const JXL_ORIENT_ROTATE_90_CCW: JxlOrientation = 8;
#[doc = " Image orientation metadata."]
#[doc = " Values 1..8 match the EXIF definitions."]
#[doc = " The name indicates the operation to perform to transform from the encoded"]
#[doc = " image to the display image."]
pub type JxlOrientation = ::std::os::raw::c_uint;
pub const JXL_CHANNEL_ALPHA: JxlExtraChannelType = 0;
pub const JXL_CHANNEL_DEPTH: JxlExtraChannelType = 1;
pub const JXL_CHANNEL_SPOT_COLOR: JxlExtraChannelType = 2;
pub const JXL_CHANNEL_SELECTION_MASK: JxlExtraChannelType = 3;
pub const JXL_CHANNEL_BLACK: JxlExtraChannelType = 4;
pub const JXL_CHANNEL_CFA: JxlExtraChannelType = 5;
pub const JXL_CHANNEL_THERMAL: JxlExtraChannelType = 6;
pub const JXL_CHANNEL_RESERVED0: JxlExtraChannelType = 7;
pub const JXL_CHANNEL_RESERVED1: JxlExtraChannelType = 8;
pub const JXL_CHANNEL_RESERVED2: JxlExtraChannelType = 9;
pub const JXL_CHANNEL_RESERVED3: JxlExtraChannelType = 10;
pub const JXL_CHANNEL_RESERVED4: JxlExtraChannelType = 11;
pub const JXL_CHANNEL_RESERVED5: JxlExtraChannelType = 12;
pub const JXL_CHANNEL_RESERVED6: JxlExtraChannelType = 13;
pub const JXL_CHANNEL_RESERVED7: JxlExtraChannelType = 14;
pub const JXL_CHANNEL_UNKNOWN: JxlExtraChannelType = 15;
pub const JXL_CHANNEL_OPTIONAL: JxlExtraChannelType = 16;
#[doc = " Given type of an extra channel."]
pub type JxlExtraChannelType = ::std::os::raw::c_uint;
#[doc = " The codestream preview header"]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct JxlPreviewHeader {
    #[doc = " Preview width in pixels"]
    pub xsize: u32,
    #[doc = " Preview height in pixels"]
    pub ysize: u32,
}
#[test]
fn bindgen_test_layout_JxlPreviewHeader() {
    assert_eq!(
        ::std::mem::size_of::<JxlPreviewHeader>(),
        8usize,
        concat!("Size of: ", stringify!(JxlPreviewHeader))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlPreviewHeader>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlPreviewHeader))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlPreviewHeader>())).xsize as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlPreviewHeader),
            "::",
            stringify!(xsize)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlPreviewHeader>())).ysize as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlPreviewHeader),
            "::",
            stringify!(ysize)
        )
    );
}
#[doc = " The codestream animation header, optionally present in the beginning of"]
#[doc = " the codestream, and if it is it applies to all animation frames, unlike"]
#[doc = " JxlFrameHeader which applies to an individual frame."]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct JxlAnimationHeader {
    #[doc = " Numerator of ticks per second of a single animation frame time unit"]
    pub tps_numerator: u32,
    #[doc = " Denominator of ticks per second of a single animation frame time unit"]
    pub tps_denominator: u32,
    #[doc = " Amount of animation loops, or 0 to repeat infinitely"]
    pub num_loops: u32,
    #[doc = " Whether animation time codes are present at animation frames in the"]
    #[doc = " codestream"]
    pub have_timecodes: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_JxlAnimationHeader() {
    assert_eq!(
        ::std::mem::size_of::<JxlAnimationHeader>(),
        16usize,
        concat!("Size of: ", stringify!(JxlAnimationHeader))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlAnimationHeader>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlAnimationHeader))
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlAnimationHeader>())).tps_numerator as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlAnimationHeader),
            "::",
            stringify!(tps_numerator)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlAnimationHeader>())).tps_denominator as *const _ as usize
        },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlAnimationHeader),
            "::",
            stringify!(tps_denominator)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlAnimationHeader>())).num_loops as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlAnimationHeader),
            "::",
            stringify!(num_loops)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlAnimationHeader>())).have_timecodes as *const _ as usize
        },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlAnimationHeader),
            "::",
            stringify!(have_timecodes)
        )
    );
}
#[doc = " Basic image information. This information is available from the file"]
#[doc = " signature and first part of the codestream header."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlBasicInfo {
    #[doc = " Whether the codestream is embedded in the container format. If true,"]
    #[doc = " metadata information and extensions may be available in addition to the"]
    #[doc = " codestream."]
    pub have_container: ::std::os::raw::c_int,
    #[doc = " Width of the image in pixels, before applying orientation."]
    pub xsize: u32,
    #[doc = " Height of the image in pixels, before applying orientation."]
    pub ysize: u32,
    #[doc = " Original image color channel bit depth."]
    pub bits_per_sample: u32,
    #[doc = " Original image color channel floating point exponent bits, or 0 if they"]
    #[doc = " are unsigned integer. For example, if the original data is half-precision"]
    #[doc = " (binary16) floating point, bits_per_sample is 16 and"]
    #[doc = " exponent_bits_per_sample is 5, and so on for other floating point"]
    #[doc = " precisions."]
    pub exponent_bits_per_sample: u32,
    #[doc = " Upper bound on the intensity level present in the image in nits. For"]
    #[doc = " unsigned integer pixel encodings, this is the brightness of the largest"]
    #[doc = " representable value. The image does not necessarily contain a pixel"]
    #[doc = " actually this bright. An encoder is allowed to set 255 for SDR images"]
    #[doc = " without computing a histogram."]
    pub intensity_target: f32,
    #[doc = " Lower bound on the intensity level present in the image. This may be"]
    #[doc = " loose, i.e. lower than the actual darkest pixel. When tone mapping, a"]
    #[doc = " decoder will map [min_nits, intensity_target] to the display range."]
    pub min_nits: f32,
    #[doc = " See the description of @see linear_below."]
    pub relative_to_max_display: ::std::os::raw::c_int,
    #[doc = " The tone mapping will leave unchanged (linear mapping) any pixels whose"]
    #[doc = " brightness is strictly below this. The interpretation depends on"]
    #[doc = " relative_to_max_display. If true, this is a ratio [0, 1] of the maximum"]
    #[doc = " display brightness [nits], otherwise an absolute brightness [nits]."]
    pub linear_below: f32,
    #[doc = " Whether the data in the codestream is encoded in the original color"]
    #[doc = " profile that is attached to the codestream metadata header, or is"]
    #[doc = " encoded in an internally supported absolute color space (which the decoder"]
    #[doc = " can always convert to linear or non-linear sRGB or to XYB). If the original"]
    #[doc = " profile is used, the decoder outputs pixel data in the color space matching"]
    #[doc = " that profile, but doesn't convert it to any other color space. If the"]
    #[doc = " original profile is not used, the decoder only outputs the data as sRGB"]
    #[doc = " (linear if outputting to floating point, nonlinear with standard sRGB"]
    #[doc = " transfer function if outputting to unsigned integers) but will not convert"]
    #[doc = " it to to the original color profile. The decoder also does not convert to"]
    #[doc = " the target display color profile, but instead will always indicate which"]
    #[doc = " color profile the returned pixel data is encoded in when using @see"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_DATA so that a CMS can be used to convert the"]
    #[doc = " data."]
    pub uses_original_profile: ::std::os::raw::c_int,
    #[doc = " Indicates a preview image exists near the beginning of the codestream."]
    #[doc = " The preview itself or its dimensions are not included in the basic info."]
    pub have_preview: ::std::os::raw::c_int,
    #[doc = " Indicates animation frames exist in the codestream. The animation"]
    #[doc = " information is not included in the basic info."]
    pub have_animation: ::std::os::raw::c_int,
    #[doc = " Image orientation, value 1-8 matching the values used by JEITA CP-3451C"]
    #[doc = " (Exif version 2.3)."]
    pub orientation: JxlOrientation,
    #[doc = " Number of color channels encoded in the image, this is either 1 for"]
    #[doc = " grayscale data, or 3 for colored data. This count does not include"]
    #[doc = " the alpha channel or other extra channels. To check presence of an alpha"]
    #[doc = " channel, such as in the case of RGBA color, check alpha_bits != 0."]
    #[doc = " If and only if this is 1, the JxlColorSpace in the JxlColorEncoding is"]
    #[doc = " JXL_COLOR_SPACE_GRAY."]
    pub num_color_channels: u32,
    #[doc = " Number of additional image channels. This includes the main alpha channel,"]
    #[doc = " but can also include additional channels such as depth, additional alpha"]
    #[doc = " channels, spot colors, and so on. Information about the extra channels"]
    #[doc = " can be queried with JxlDecoderGetExtraChannelInfo. The main alpha channel,"]
    #[doc = " if it exists, also has its information available in the alpha_bits,"]
    #[doc = " alpha_exponent_bits and alpha_premultiplied fields in this JxlBasicInfo."]
    pub num_extra_channels: u32,
    #[doc = " Bit depth of the encoded alpha channel, or 0 if there is no alpha channel."]
    pub alpha_bits: u32,
    #[doc = " Alpha channel floating point exponent bits, or 0 if they are unsigned"]
    #[doc = " integer."]
    pub alpha_exponent_bits: u32,
    #[doc = " Whether the alpha channel is premultiplied"]
    pub alpha_premultiplied: ::std::os::raw::c_int,
    #[doc = " Dimensions of encoded preview image, only used if have_preview is"]
    #[doc = " JXL_TRUE."]
    pub preview: JxlPreviewHeader,
    #[doc = " Animation header with global animation properties for all frames, only"]
    #[doc = " used if have_animation is JXL_TRUE."]
    pub animation: JxlAnimationHeader,
}
#[test]
fn bindgen_test_layout_JxlBasicInfo() {
    assert_eq!(
        ::std::mem::size_of::<JxlBasicInfo>(),
        96usize,
        concat!("Size of: ", stringify!(JxlBasicInfo))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlBasicInfo>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlBasicInfo))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).have_container as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(have_container)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).xsize as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(xsize)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).ysize as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(ysize)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).bits_per_sample as *const _ as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(bits_per_sample)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlBasicInfo>())).exponent_bits_per_sample as *const _ as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(exponent_bits_per_sample)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).intensity_target as *const _ as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(intensity_target)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).min_nits as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(min_nits)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlBasicInfo>())).relative_to_max_display as *const _ as usize
        },
        28usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(relative_to_max_display)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).linear_below as *const _ as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(linear_below)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlBasicInfo>())).uses_original_profile as *const _ as usize
        },
        36usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(uses_original_profile)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).have_preview as *const _ as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(have_preview)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).have_animation as *const _ as usize },
        44usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(have_animation)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).orientation as *const _ as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(orientation)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).num_color_channels as *const _ as usize },
        52usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(num_color_channels)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).num_extra_channels as *const _ as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(num_extra_channels)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).alpha_bits as *const _ as usize },
        60usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(alpha_bits)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlBasicInfo>())).alpha_exponent_bits as *const _ as usize
        },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(alpha_exponent_bits)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlBasicInfo>())).alpha_premultiplied as *const _ as usize
        },
        68usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(alpha_premultiplied)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).preview as *const _ as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(preview)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlBasicInfo>())).animation as *const _ as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlBasicInfo),
            "::",
            stringify!(animation)
        )
    );
}
impl Default for JxlBasicInfo {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[doc = " Information for a single extra channel."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlExtraChannelInfo {
    #[doc = " Given type of an extra channel."]
    pub type_: JxlExtraChannelType,
    #[doc = " Total bits per sample for this channel."]
    pub bits_per_sample: u32,
    #[doc = " Floating point exponent bits per channel, or 0 if they are unsigned"]
    #[doc = " integer."]
    pub exponent_bits_per_sample: u32,
    #[doc = " The exponent the channel is downsampled by on each axis."]
    #[doc = " TODO(lode): expand this comment to match the JPEG XL specification,"]
    #[doc = " specify how to upscale, how to round the size computation, and to which"]
    #[doc = " extra channels this field applies."]
    pub dim_shift: u32,
    #[doc = " Length of the extra channel name in bytes, or 0 if no name."]
    #[doc = " Excludes null termination character."]
    pub name_length: u32,
    #[doc = " Whether alpha channel uses premultiplied alpha. Only applicable if"]
    #[doc = " type is JXL_CHANNEL_ALPHA."]
    pub alpha_associated: ::std::os::raw::c_int,
    #[doc = " Spot color of the current spot channel in linear RGBA. Only applicable if"]
    #[doc = " type is JXL_CHANNEL_SPOT_COLOR."]
    pub spot_color: [f32; 4usize],
    #[doc = " Only applicable if type is JXL_CHANNEL_CFA."]
    #[doc = " TODO(lode): add comment about the meaning of this field."]
    pub cfa_channel: u32,
}
#[test]
fn bindgen_test_layout_JxlExtraChannelInfo() {
    assert_eq!(
        ::std::mem::size_of::<JxlExtraChannelInfo>(),
        44usize,
        concat!("Size of: ", stringify!(JxlExtraChannelInfo))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlExtraChannelInfo>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlExtraChannelInfo))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlExtraChannelInfo>())).type_ as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(type_)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlExtraChannelInfo>())).bits_per_sample as *const _ as usize
        },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(bits_per_sample)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlExtraChannelInfo>())).exponent_bits_per_sample as *const _
                as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(exponent_bits_per_sample)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlExtraChannelInfo>())).dim_shift as *const _ as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(dim_shift)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlExtraChannelInfo>())).name_length as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(name_length)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<JxlExtraChannelInfo>())).alpha_associated as *const _ as usize
        },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(alpha_associated)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlExtraChannelInfo>())).spot_color as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(spot_color)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlExtraChannelInfo>())).cfa_channel as *const _ as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlExtraChannelInfo),
            "::",
            stringify!(cfa_channel)
        )
    );
}
impl Default for JxlExtraChannelInfo {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[doc = " The header of one displayed frame."]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct JxlFrameHeader {
    #[doc = " How long to wait after rendering in ticks. The duration in seconds of a"]
    #[doc = " tick is given by tps_numerator and tps_denominator in JxlAnimationHeader."]
    pub duration: u32,
    #[doc = " SMPTE timecode of the current frame in form 0xHHMMSSFF, or 0. The bits are"]
    #[doc = " interpreted from most-significant to least-significant as hour, minute,"]
    #[doc = " second, and frame. If timecode is nonzero, it is strictly larger than that"]
    #[doc = " of a previous frame with nonzero duration. These values are only available"]
    #[doc = " if have_timecodes in JxlAnimationHeader is JXL_TRUE."]
    #[doc = " This value is only used if have_timecodes in JxlAnimationHeader is"]
    #[doc = " JXL_TRUE."]
    pub timecode: u32,
    #[doc = " Length of the frame name in bytes, or 0 if no name."]
    #[doc = " Excludes null termination character."]
    pub name_length: u32,
    #[doc = " Indicates this is the last animation frame."]
    pub is_last: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_JxlFrameHeader() {
    assert_eq!(
        ::std::mem::size_of::<JxlFrameHeader>(),
        16usize,
        concat!("Size of: ", stringify!(JxlFrameHeader))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlFrameHeader>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlFrameHeader))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlFrameHeader>())).duration as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlFrameHeader),
            "::",
            stringify!(duration)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlFrameHeader>())).timecode as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlFrameHeader),
            "::",
            stringify!(timecode)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlFrameHeader>())).name_length as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlFrameHeader),
            "::",
            stringify!(name_length)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlFrameHeader>())).is_last as *const _ as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlFrameHeader),
            "::",
            stringify!(is_last)
        )
    );
}
#[doc = " Allocating function for a memory region of a given size."]
#[doc = ""]
#[doc = " Allocates a contiguous memory region of size @p size bytes. The returned"]
#[doc = " memory may not be aligned to a specific size or initialized at all."]
#[doc = ""]
#[doc = " @param opaque custom memory manager handle provided by the caller."]
#[doc = " @param size in bytes of the requested memory region."]
#[doc = " @returns @c 0 if the memory can not be allocated,"]
#[doc = " @returns pointer to the memory otherwise."]
pub type jpegxl_alloc_func = ::std::option::Option<
    unsafe extern "C" fn(
        opaque: *mut ::std::os::raw::c_void,
        size: usize,
    ) -> *mut ::std::os::raw::c_void,
>;
#[doc = " Deallocating function pointer type."]
#[doc = ""]
#[doc = " This function @b MUST do nothing if @p address is @c 0."]
#[doc = ""]
#[doc = " @param opaque custom memory manager handle provided by the caller."]
#[doc = " @param address memory region pointer returned by ::jpegxl_alloc_func, or @c 0"]
pub type jpegxl_free_func = ::std::option::Option<
    unsafe extern "C" fn(opaque: *mut ::std::os::raw::c_void, address: *mut ::std::os::raw::c_void),
>;
#[doc = " Memory Manager struct."]
#[doc = " These functions, when provided by the caller, will be used to handle memory"]
#[doc = " allocations."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlMemoryManagerStruct {
    #[doc = " The opaque pointer that will be passed as the first parameter to all the"]
    #[doc = " functions in this struct."]
    pub opaque: *mut ::std::os::raw::c_void,
    #[doc = " Memory allocation function. This can be NULL if and only if also the"]
    #[doc = " free() member in this class is NULL. All dynamic memory will be allocated"]
    #[doc = " and freed with these functions if they are not NULL."]
    pub alloc: jpegxl_alloc_func,
    #[doc = " Free function matching the alloc() member."]
    pub free: jpegxl_free_func,
}
#[test]
fn bindgen_test_layout_JxlMemoryManagerStruct() {
    assert_eq!(
        ::std::mem::size_of::<JxlMemoryManagerStruct>(),
        24usize,
        concat!("Size of: ", stringify!(JxlMemoryManagerStruct))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlMemoryManagerStruct>(),
        8usize,
        concat!("Alignment of ", stringify!(JxlMemoryManagerStruct))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlMemoryManagerStruct>())).opaque as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlMemoryManagerStruct),
            "::",
            stringify!(opaque)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlMemoryManagerStruct>())).alloc as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlMemoryManagerStruct),
            "::",
            stringify!(alloc)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<JxlMemoryManagerStruct>())).free as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(JxlMemoryManagerStruct),
            "::",
            stringify!(free)
        )
    );
}
impl Default for JxlMemoryManagerStruct {
    fn default() -> Self {
        unsafe { ::std::mem::zeroed() }
    }
}
#[doc = " Memory Manager struct."]
#[doc = " These functions, when provided by the caller, will be used to handle memory"]
#[doc = " allocations."]
pub type JxlMemoryManager = JxlMemoryManagerStruct;
#[doc = " Return code used in the JxlParallel* functions as return value. A value"]
#[doc = " of 0 means success and any other value means error. The special value"]
#[doc = " JXL_PARALLEL_RET_RUNNER_ERROR can be used by the runner to indicate any"]
#[doc = " other error."]
pub type JxlParallelRetCode = ::std::os::raw::c_int;
#[doc = " Parallel run initialization callback. See JxlParallelRunner for details."]
#[doc = ""]
#[doc = " This function MUST be called by the JxlParallelRunner only once, on the"]
#[doc = " same thread that called JxlParallelRunner, before any parallel execution."]
#[doc = " The purpose of this call is to provide the maximum number of threads that the"]
#[doc = " JxlParallelRunner will use, which can be used by JPEG XL to allocate"]
#[doc = " per-thread storage if needed."]
#[doc = ""]
#[doc = " @param jpegxl_opaque the @p jpegxl_opaque handle provided to"]
#[doc = " JxlParallelRunner() must be passed here."]
#[doc = " @param num_threads the maximum number of threads. This value must be"]
#[doc = " positive."]
#[doc = " @returns 0 if the initialization process was successful."]
#[doc = " @returns an error code if there was an error, which should be returned by"]
#[doc = " JxlParallelRunner()."]
pub type JxlParallelRunInit = ::std::option::Option<
    unsafe extern "C" fn(
        jpegxl_opaque: *mut ::std::os::raw::c_void,
        num_threads: usize,
    ) -> JxlParallelRetCode,
>;
#[doc = " Parallel run data processing callback. See JxlParallelRunner for details."]
#[doc = ""]
#[doc = " This function MUST be called once for every number in the range [start_range,"]
#[doc = " end_range) (including start_range but not including end_range) passing this"]
#[doc = " number as the @p value. Calls for different value may be executed from"]
#[doc = " different threads in parallel."]
#[doc = ""]
#[doc = " @param jpegxl_opaque the @p jpegxl_opaque handle provided to"]
#[doc = " JxlParallelRunner() must be passed here."]
#[doc = " @param value the number in the range [start_range, end_range) of the call."]
#[doc = " @param thread_id the thread number where this function is being called from."]
#[doc = " This must be lower than the @p num_threads value passed to"]
#[doc = " JxlParallelRunInit."]
pub type JxlParallelRunFunction = ::std::option::Option<
    unsafe extern "C" fn(jpegxl_opaque: *mut ::std::os::raw::c_void, value: u32, thread_id: usize),
>;
#[doc = " JxlParallelRunner function type. A parallel runner implementation can be"]
#[doc = " provided by a JPEG XL caller to allow running computations in multiple"]
#[doc = " threads. This function must call the initialization function @p init in the"]
#[doc = " same thread that called it and then call the passed @p func once for every"]
#[doc = " number in the range [start_range, end_range) (including start_range but not"]
#[doc = " including end_range) possibly from different multiple threads in parallel."]
#[doc = ""]
#[doc = " The JxlParallelRunner function does not need to be re-entrant. This means"]
#[doc = " that the same JxlParallelRunner function with the same runner_opaque"]
#[doc = " provided parameter will not be called from the library from either @p init or"]
#[doc = " @p func in the same decoder or encoder instance. However, a single decoding"]
#[doc = " or encoding instance may call the provided JxlParallelRunner multiple"]
#[doc = " times for different parts of the decoding or encoding process."]
#[doc = ""]
#[doc = " @returns 0 if the @p init call succeeded (returned 0) and no other error"]
#[doc = " occurred in the runner code."]
#[doc = " @returns JXL_PARALLEL_RET_RUNNER_ERROR if an error occurred in the runner"]
#[doc = " code, for example, setting up the threads."]
#[doc = " @return the return value of @p init() if non-zero."]
pub type JxlParallelRunner = ::std::option::Option<
    unsafe extern "C" fn(
        runner_opaque: *mut ::std::os::raw::c_void,
        jpegxl_opaque: *mut ::std::os::raw::c_void,
        init: JxlParallelRunInit,
        func: JxlParallelRunFunction,
        start_range: u32,
        end_range: u32,
    ) -> JxlParallelRetCode,
>;
extern "C" {
    #[doc = " Decoder library version."]
    #[doc = ""]
    #[doc = " @return the decoder library version as an integer:"]
    #[doc = " MAJOR_VERSION * 1000000 + MINOR_VERSION * 1000 + PATCH_VERSION. For example,"]
    #[doc = " version 1.2.3 would return 1002003."]
    pub fn JxlDecoderVersion() -> u32;
}
#[doc = " Not enough bytes were passed to determine if a valid signature was found."]
pub const JXL_SIG_NOT_ENOUGH_BYTES: JxlSignature = 0;
#[doc = " No valid JPEGXL header was found."]
pub const JXL_SIG_INVALID: JxlSignature = 1;
#[doc = " A valid JPEG XL codestream signature was found, that is a JPEG XL image"]
#[doc = " without container."]
pub const JXL_SIG_CODESTREAM: JxlSignature = 2;
#[doc = " A valid container signature was found, that is a JPEG XL image embedded"]
#[doc = " in a box format container."]
pub const JXL_SIG_CONTAINER: JxlSignature = 3;
#[doc = " The result of JxlSignatureCheck."]
pub type JxlSignature = ::std::os::raw::c_uint;
extern "C" {
    #[doc = " JPEG XL signature identification."]
    #[doc = ""]
    #[doc = " Checks if the passed buffer contains a valid JPEG XL signature. The passed @p"]
    #[doc = " buf of size"]
    #[doc = " @p size doesn't need to be a full image, only the beginning of the file."]
    #[doc = ""]
    #[doc = " @return a flag indicating if a JPEG XL signature was found and what type."]
    #[doc = "   - JXL_SIG_NOT_ENOUGH_BYTES not enough bytes were passed to determine"]
    #[doc = "       if a valid signature is there."]
    #[doc = "   - JXL_SIG_INVALID: no valid signature found for JPEG XL decoding."]
    #[doc = "   - JXL_SIG_CODESTREAM a valid JPEG XL codestream signature was found."]
    #[doc = "   - JXL_SIG_CONTAINER a valid JPEG XL container signature was found."]
    pub fn JxlSignatureCheck(buf: *const u8, len: usize) -> JxlSignature;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlDecoderStruct {
    _unused: [u8; 0],
}
#[doc = " Opaque structure that holds the JPEGXL decoder."]
#[doc = ""]
#[doc = " Allocated and initialized with JxlDecoderCreate()."]
#[doc = " Cleaned up and deallocated with JxlDecoderDestroy()."]
pub type JxlDecoder = JxlDecoderStruct;
extern "C" {
    #[doc = " Creates an instance of JxlDecoder and initializes it."]
    #[doc = ""]
    #[doc = " @p memory_manager will be used for all the library dynamic allocations made"]
    #[doc = " from this instance. The parameter may be NULL, in which case the default"]
    #[doc = " allocator will be used. See jpegxl/memory_manager.h for details."]
    #[doc = ""]
    #[doc = " @param memory_manager custom allocator function. It may be NULL. The memory"]
    #[doc = "        manager will be copied internally."]
    #[doc = " @return @c NULL if the instance can not be allocated or initialized"]
    #[doc = " @return pointer to initialized JxlDecoder otherwise"]
    pub fn JxlDecoderCreate(memory_manager: *const JxlMemoryManager) -> *mut JxlDecoder;
}
extern "C" {
    #[doc = " Re-initializes a JxlDecoder instance, so it can be re-used for decoding"]
    #[doc = " another image. All state and settings are reset as if the object was"]
    #[doc = " newly created with JxlDecoderCreate, but the memory manager is kept."]
    #[doc = ""]
    #[doc = " @param dec instance to be re-initialized."]
    pub fn JxlDecoderReset(dec: *mut JxlDecoder);
}
extern "C" {
    #[doc = " Deinitializes and frees JxlDecoder instance."]
    #[doc = ""]
    #[doc = " @param dec instance to be cleaned up and deallocated."]
    pub fn JxlDecoderDestroy(dec: *mut JxlDecoder);
}
#[doc = " Function call finished successfully, or decoding is finished and there is"]
#[doc = " nothing more to be done."]
pub const JXL_DEC_SUCCESS: JxlDecoderStatus = 0;
#[doc = " An error occured, for example invalid input file or out of memory."]
#[doc = " TODO(lode): add function to get error information from decoder."]
pub const JXL_DEC_ERROR: JxlDecoderStatus = 1;
#[doc = " The decoder needs more input bytes to continue. In the next"]
#[doc = " JxlDecoderProcessInput call, next_in and avail_in must point to more"]
#[doc = " bytes to continue. If *avail_in is not 0, the new bytes must be appended to"]
#[doc = " the *avail_in last previous bytes."]
pub const JXL_DEC_NEED_MORE_INPUT: JxlDecoderStatus = 2;
#[doc = " The decoder is able to decode a preview image and requests setting a"]
#[doc = " preview output buffer using JxlDecoderSetPreviewOutBuffer. This occurs if"]
#[doc = " JXL_DEC_PREVIEW_IMAGE is requested and it is possible to decode a preview"]
#[doc = " image from the codestream and the preview out buffer was not yet set. There"]
#[doc = " is maximum one preview image in a codestream."]
pub const JXL_DEC_NEED_PREVIEW_OUT_BUFFER: JxlDecoderStatus = 3;
#[doc = " The decoder is able to decode a DC image and requests setting a DC output"]
#[doc = " buffer using JxlDecoderSetDCOutBuffer. This occurs if JXL_DEC_DC_IMAGE is"]
#[doc = " requested and it is possible to decode a DC image from the codestream and"]
#[doc = " the DC out buffer was not yet set. This event re-occurs for new frames"]
#[doc = " if there are multiple animation frames."]
pub const JXL_DEC_NEED_DC_OUT_BUFFER: JxlDecoderStatus = 4;
#[doc = " The decoder requests an output buffer to store the full resolution image,"]
#[doc = " which can be set with JxlDecoderSetImageOutBuffer or with"]
#[doc = " JxlDecoderSetImageOutCallback. This event re-occurs for new frames if there"]
#[doc = " are multiple animation frames and requires setting an output again."]
pub const JXL_DEC_NEED_IMAGE_OUT_BUFFER: JxlDecoderStatus = 5;
#[doc = " Informative event by JxlDecoderProcessInput: JPEG reconstruction buffer is"]
#[doc = " too small for reconstructed JPEG codestream to fit."]
#[doc = " JxlDecoderSetJPEGBuffer must be called again to make room for remaining"]
#[doc = " bytes. This event may occur multiple times after"]
#[doc = " JXL_DEC_JPEG_RECONSTRUCTION"]
pub const JXL_DEC_JPEG_NEED_MORE_OUTPUT: JxlDecoderStatus = 6;
#[doc = " Informative event by JxlDecoderProcessInput: basic information such as"]
#[doc = " image dimensions and extra channels. This event occurs max once per image."]
pub const JXL_DEC_BASIC_INFO: JxlDecoderStatus = 64;
#[doc = " Informative event by JxlDecoderProcessInput: user extensions of the"]
#[doc = " codestream header. This event occurs max once per image and always later"]
#[doc = " than JXL_DEC_BASIC_INFO and earlier than any pixel data."]
pub const JXL_DEC_EXTENSIONS: JxlDecoderStatus = 128;
#[doc = " Informative event by JxlDecoderProcessInput: color encoding or ICC"]
#[doc = " profile from the codestream header. This event occurs max once per image"]
#[doc = " and always later than JXL_DEC_BASIC_INFO and earlier than any pixel"]
#[doc = " data."]
pub const JXL_DEC_COLOR_ENCODING: JxlDecoderStatus = 256;
#[doc = " Informative event by JxlDecoderProcessInput: Preview image, a small"]
#[doc = " frame, decoded. This event can only happen if the image has a preview"]
#[doc = " frame encoded. This event occurs max once for the codestream and always"]
#[doc = " later than JXL_DEC_COLOR_ENCODING and before JXL_DEC_FRAME."]
#[doc = " This event is different than JXL_DEC_PREVIEW_HEADER because the latter only"]
#[doc = " outputs the dimensions of the preview image."]
pub const JXL_DEC_PREVIEW_IMAGE: JxlDecoderStatus = 512;
#[doc = " Informative event by JxlDecoderProcessInput: Beginning of a frame."]
#[doc = " JxlDecoderGetFrameHeader can be used at this point. A note on frames:"]
#[doc = " a JPEG XL image can have internal frames that are not intended to be"]
#[doc = " displayed (e.g. used for compositing a final frame), but this only returns"]
#[doc = " displayed frames. A displayed frame either has an animation duration or is"]
#[doc = " the only or last frame in the image. This event occurs max once per"]
#[doc = " displayed frame, always later than JXL_DEC_COLOR_ENCODING, and always"]
#[doc = " earlier than any pixel data. While JPEG XL supports encoding a single frame"]
#[doc = " as the composition of multiple internal sub-frames also called frames, this"]
#[doc = " event is not indicated for the internal frames."]
pub const JXL_DEC_FRAME: JxlDecoderStatus = 1024;
#[doc = " Informative event by JxlDecoderProcessInput: DC image, 8x8 sub-sampled"]
#[doc = " frame, decoded. It is not guaranteed that the decoder will always return DC"]
#[doc = " separately, but when it does it will do so before outputting the full"]
#[doc = " frame. JxlDecoderSetDCOutBuffer must be used after getting the basic"]
#[doc = " image information to be able to get the DC pixels, if not this return"]
#[doc = " status only indicates we're past this point in the codestream. This event"]
#[doc = " occurs max once per frame and always later than JXL_DEC_FRAME_HEADER"]
#[doc = " and other header events and earlier than full resolution pixel data."]
pub const JXL_DEC_DC_IMAGE: JxlDecoderStatus = 2048;
#[doc = " Informative event by JxlDecoderProcessInput: full frame decoded."]
#[doc = " JxlDecoderSetImageOutBuffer must be used after getting the basic image"]
#[doc = " information to be able to get the image pixels, if not this return status"]
#[doc = " only indicates we're past this point in the codestream. This event occurs"]
#[doc = " max once per frame and always later than JXL_DEC_DC_IMAGE."]
pub const JXL_DEC_FULL_IMAGE: JxlDecoderStatus = 4096;
#[doc = " Informative event by JxlDecoderProcessInput: JPEG reconstruction data"]
#[doc = " decoded. JxlDecoderSetJPEGBuffer may be used to set a JPEG"]
#[doc = " reconstruction buffer after getting the JPEG reconstruction data. If a JPEG"]
#[doc = " reconstruction buffer is set a byte stream identical to the JPEG codestream"]
#[doc = " used to encode the image will be written to the JPEG reconstruction buffer"]
#[doc = " instead of pixels to the image out buffer. This event occurs max once per"]
#[doc = " image and always before JXL_DEC_FULL_IMAGE."]
pub const JXL_DEC_JPEG_RECONSTRUCTION: JxlDecoderStatus = 8192;
#[doc = " Return value for JxlDecoderProcessInput."]
#[doc = " The values above 0x40 are optional informal events that can be subscribed to,"]
#[doc = " they are never returned if they have not been registered with"]
#[doc = " JxlDecoderSubscribeEvents."]
pub type JxlDecoderStatus = ::std::os::raw::c_uint;
extern "C" {
    #[doc = " Get the default pixel format for this decoder."]
    #[doc = ""]
    #[doc = " Requires that the decoder can produce JxlBasicInfo."]
    #[doc = ""]
    #[doc = " @param dec JxlDecoder to query when creating the recommended pixel format."]
    #[doc = " @param format JxlPixelFormat to populate with the recommended settings for"]
    #[doc = " the data loaded into this decoder."]
    #[doc = " @return JXL_DEC_SUCCESS if no error, JXL_DEC_NEED_MORE_INPUT if the"]
    #[doc = " basic info isn't yet available, and JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderDefaultPixelFormat(
        dec: *const JxlDecoder,
        format: *mut JxlPixelFormat,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Set the parallel runner for multithreading. May only be set before starting"]
    #[doc = " decoding."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param parallel_runner function pointer to runner for multithreading. It may"]
    #[doc = "        be NULL to use the default, single-threaded, runner. A multithreaded"]
    #[doc = "        runner should be set to reach fast performance."]
    #[doc = " @param parallel_runner_opaque opaque pointer for parallel_runner."]
    #[doc = " @return JXL_DEC_SUCCESS if the runner was set, JXL_DEC_ERROR"]
    #[doc = " otherwise (the previous runner remains set)."]
    pub fn JxlDecoderSetParallelRunner(
        dec: *mut JxlDecoder,
        parallel_runner: JxlParallelRunner,
        parallel_runner_opaque: *mut ::std::os::raw::c_void,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Returns a hint indicating how many more bytes the decoder is expected to"]
    #[doc = " need to make JxlDecoderGetBasicInfo available after the next"]
    #[doc = " JxlDecoderProcessInput call. This is a suggested large enough value for"]
    #[doc = " the *avail_in parameter, but it is not guaranteed to be an upper bound nor"]
    #[doc = " a lower bound."]
    #[doc = " Can be used before the first JxlDecoderProcessInput call, and is correct"]
    #[doc = " the first time in most cases. If not, JxlDecoderSizeHintBasicInfo can be"]
    #[doc = " called again to get an updated hint."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @return the size hint in bytes if the basic info is not yet fully decoded."]
    #[doc = " @return 0 when the basic info is already available."]
    pub fn JxlDecoderSizeHintBasicInfo(dec: *const JxlDecoder) -> usize;
}
extern "C" {
    #[doc = " Select for which informative events (JXL_DEC_BASIC_INFO, etc...) the"]
    #[doc = " decoder should return with a status. It is not required to subscribe to any"]
    #[doc = " events, data can still be requested from the decoder as soon as it available."]
    #[doc = " By default, the decoder is subscribed to no events (events_wanted == 0), and"]
    #[doc = " the decoder will then only return when it cannot continue because it needs"]
    #[doc = " more input data or more output buffer. This function may only be be called"]
    #[doc = " before using JxlDecoderProcessInput"]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param events_wanted bitfield of desired events."]
    #[doc = " @return JXL_DEC_SUCCESS if no error, JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderSubscribeEvents(
        dec: *mut JxlDecoder,
        events_wanted: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Enables or disables preserving of original orientation. Some images are"]
    #[doc = " encoded with an orientation tag indicating the image is rotated and/or"]
    #[doc = " mirrored (here called the original orientation)."]
    #[doc = ""]
    #[doc = " *) If keep_orientation is JXL_FALSE (the default): the decoder will perform"]
    #[doc = " work to undo the transformation. This ensures the decoded pixels will not"]
    #[doc = " be rotated or mirrored. The decoder will always set the orientation field"]
    #[doc = " of the JxlBasicInfo to JXL_ORIENT_IDENTITY to match the returned pixel data."]
    #[doc = " The decoder may also swap xsize and ysize in the JxlBasicInfo compared to the"]
    #[doc = " values inside of the codestream, to correctly match the decoded pixel data,"]
    #[doc = " e.g. when a 90 degree rotation was performed."]
    #[doc = ""]
    #[doc = " *) If this option is JXL_TRUE: then the image is returned as-is, which may be"]
    #[doc = " rotated or mirrored, and the user must check the orientation field in"]
    #[doc = " JxlBasicInfo after decoding to correctly interpret the decoded pixel data."]
    #[doc = " This may be faster to decode since the decoder doesn't have to apply the"]
    #[doc = " transformation, but can cause wrong display of the image if the orientation"]
    #[doc = " tag is not correctly taken into account by the user."]
    #[doc = ""]
    #[doc = " By default, this option is disabled, and the decoder automatically corrects"]
    #[doc = " the orientation."]
    #[doc = ""]
    #[doc = " @see JxlBasicInfo for the orientation field, and @see JxlOrientation for the"]
    #[doc = " possible values."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param keep_orientation JXL_TRUE to enable, JXL_FALSE to disable."]
    #[doc = " @return JXL_DEC_SUCCESS if no error, JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderSetKeepOrientation(
        dec: *mut JxlDecoder,
        keep_orientation: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Decodes JPEG XL file using the available bytes. Requires input has been"]
    #[doc = " set with JxlDecoderSetInput. After JxlDecoderProcessInput, input can"]
    #[doc = " optionally be released with JxlDecoderReleaseInput and then set again to"]
    #[doc = " next bytes in the stream. JxlDecoderReleaseInput returns how many bytes are"]
    #[doc = " not yet processed, before a next call to JxlDecoderProcessInput all"]
    #[doc = " unprocessed bytes must be provided again (the address need not match, but the"]
    #[doc = " contents must), and more bytes may be concatenated after the unprocessed"]
    #[doc = " bytes."]
    #[doc = ""]
    #[doc = " The returned status indicates whether the decoder needs more input bytes, or"]
    #[doc = " more output buffer for a certain type of output data. No matter what the"]
    #[doc = " returned status is (other than JXL_DEC_ERROR), new information, such as"]
    #[doc = " JxlDecoderGetBasicInfo, may have become available after this call. When"]
    #[doc = " the return value is not JXL_DEC_ERROR or JXL_DEC_SUCCESS, the decoding"]
    #[doc = " requires more JxlDecoderProcessInput calls to continue."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @return JXL_DEC_SUCCESS when decoding finished and all events handled."]
    #[doc = " @return JXL_DEC_ERROR when decoding failed, e.g. invalid codestream."]
    #[doc = " TODO(lode) document the input data mechanism"]
    #[doc = " @return JXL_DEC_NEED_MORE_INPUT more input data is necessary."]
    #[doc = " @return JXL_DEC_BASIC_INFO when basic info such as image dimensions is"]
    #[doc = " available and this informative event is subscribed to."]
    #[doc = " @return JXL_DEC_EXTENSIONS when JPEG XL codestream user extensions are"]
    #[doc = " available and this informative event is subscribed to."]
    #[doc = " @return JXL_DEC_COLOR_ENCODING when color profile information is"]
    #[doc = " available and this informative event is subscribed to."]
    #[doc = " @return JXL_DEC_PREVIEW_IMAGE when preview pixel information is available and"]
    #[doc = " output in the preview buffer."]
    #[doc = " @return JXL_DEC_DC_IMAGE when DC pixel information (8x8 downscaled version"]
    #[doc = " of the image) is available and output in the DC buffer."]
    #[doc = " @return JXL_DEC_FULL_IMAGE when all pixel information at highest detail is"]
    #[doc = " available and has been output in the pixel buffer."]
    pub fn JxlDecoderProcessInput(dec: *mut JxlDecoder) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets input data for JxlDecoderProcessInput. The data is owned by the caller"]
    #[doc = " and may be used by the decoder until JxlDecoderReleaseInput is called or"]
    #[doc = " the decoder is destroyed or reset so must be kept alive until then."]
    #[doc = " @param dec decoder object"]
    #[doc = " @param data pointer to next bytes to read from"]
    #[doc = " @param size amount of bytes available starting from data"]
    #[doc = " @return JXL_DEC_ERROR if input was already set without releasing,"]
    #[doc = " JXL_DEC_SUCCESS otherwise"]
    pub fn JxlDecoderSetInput(
        dec: *mut JxlDecoder,
        data: *const u8,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Releases input which was provided with JxlDecoderSetInput. Between"]
    #[doc = " JxlDecoderProcessInput and JxlDecoderReleaseInput, the user may not alter"]
    #[doc = " the data in the buffer. Calling JxlDecoderReleaseInput is required whenever"]
    #[doc = " any input is already set and new input needs to be added with"]
    #[doc = " JxlDecoderSetInput, but is not required before JxlDecoderDestroy or"]
    #[doc = " JxlDecoderReset. Calling JxlDecoderReleaseInput when no input is set is"]
    #[doc = " not an error and returns 0."]
    #[doc = " @param dec decoder object"]
    #[doc = " @return the amount of bytes the decoder has not yet processed that are"]
    #[doc = " still remaining in the data set by JxlDecoderSetInput, or 0 if no input is"]
    #[doc = " set or JxlDecoderReleaseInput was already called. For a next call to"]
    #[doc = " JxlDecoderProcessInput, the buffer must start with these unprocessed bytes."]
    #[doc = " This value doesn't provide information about how many bytes the decoder"]
    #[doc = " truly processed internally or how large the original JPEG XL codestream or"]
    #[doc = " file are."]
    pub fn JxlDecoderReleaseInput(dec: *mut JxlDecoder) -> usize;
}
extern "C" {
    #[doc = " Outputs the basic image information, such as image dimensions, bit depth and"]
    #[doc = " all other JxlBasicInfo fields, if available."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param info struct to copy the information into, or NULL to only check"]
    #[doc = " whether the information is available through the return value."]
    #[doc = " @return JXL_DEC_SUCCESS if the value is available,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if not yet available, JXL_DEC_ERROR in case"]
    #[doc = "    of other error conditions."]
    pub fn JxlDecoderGetBasicInfo(
        dec: *const JxlDecoder,
        info: *mut JxlBasicInfo,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs information for extra channel at the given index. The index must be"]
    #[doc = " smaller than num_extra_channels in the associated JxlBasicInfo."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param index index of the extra channel to query."]
    #[doc = " @param info struct to copy the information into, or NULL to only check"]
    #[doc = " whether the information is available through the return value."]
    #[doc = " @return JXL_DEC_SUCCESS if the value is available,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if not yet available, JXL_DEC_ERROR in case"]
    #[doc = "    of other error conditions."]
    pub fn JxlDecoderGetExtraChannelInfo(
        dec: *const JxlDecoder,
        index: usize,
        info: *mut JxlExtraChannelInfo,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs name for extra channel at the given index in UTF-8. The index must be"]
    #[doc = " smaller than num_extra_channels in the associated JxlBasicInfo. The buffer"]
    #[doc = " for name must have at least name_length + 1 bytes allocated, gotten from"]
    #[doc = " the associated JxlExtraChannelInfo."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param index index of the extra channel to query."]
    #[doc = " @param name buffer to copy the name into"]
    #[doc = " @param size size of the name buffer in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS if the value is available,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if not yet available, JXL_DEC_ERROR in case"]
    #[doc = "    of other error conditions."]
    pub fn JxlDecoderGetExtraChannelName(
        dec: *const JxlDecoder,
        index: usize,
        name: *mut ::std::os::raw::c_char,
        size: usize,
    ) -> JxlDecoderStatus;
}
#[doc = " Get the color profile of the original image from the metadata.."]
pub const JXL_COLOR_PROFILE_TARGET_ORIGINAL: JxlColorProfileTarget = 0;
#[doc = " Get the color profile of the pixel data the decoder outputs."]
pub const JXL_COLOR_PROFILE_TARGET_DATA: JxlColorProfileTarget = 1;
#[doc = " Defines which color profile to get: the profile from the codestream"]
#[doc = " metadata header, which represents the color profile of the original image,"]
#[doc = " or the color profile from the pixel data received by the decoder. Both are"]
#[doc = " the same if the basic has uses_original_profile set."]
pub type JxlColorProfileTarget = ::std::os::raw::c_uint;
extern "C" {
    #[doc = " Outputs the color profile as JPEG XL encoded structured data, if available."]
    #[doc = " This is an alternative to an ICC Profile, which can represent a more limited"]
    #[doc = " amount of color spaces, but represents them exactly through enum values."]
    #[doc = ""]
    #[doc = " It is often possible to use JxlDecoderGetColorAsICCProfile as an"]
    #[doc = " alternative anyway. The following scenarios are possible:"]
    #[doc = " - The JPEG XL image has an attached ICC Profile, in that case, the encoded"]
    #[doc = "   structured data is not available, this function will return an error status"]
    #[doc = "   and you must use JxlDecoderGetColorAsICCProfile instead."]
    #[doc = " - The JPEG XL image has an encoded structured color profile, and it"]
    #[doc = "   represents an RGB or grayscale color space. This function will return it."]
    #[doc = "   You can still use JxlDecoderGetColorAsICCProfile as well as an"]
    #[doc = "   alternative if desired, though depending on which RGB color space is"]
    #[doc = "   represented, the ICC profile may be a close approximation. It is also not"]
    #[doc = "   always feasible to deduce from an ICC profile which named color space it"]
    #[doc = "   exactly represents, if any, as it can represent any arbitrary space."]
    #[doc = " - The JPEG XL image has an encoded structured color profile, and it indicates"]
    #[doc = "   an unknown or xyb color space. In that case,"]
    #[doc = "   JxlDecoderGetColorAsICCProfile is not available."]
    #[doc = ""]
    #[doc = " If you wish to render the image using a system that supports ICC profiles,"]
    #[doc = " use JxlDecoderGetColorAsICCProfile first. If you're looking for a specific"]
    #[doc = " color space possibly indicated in the JPEG XL image, use"]
    #[doc = " JxlDecoderGetColorAsEncodedProfile first."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format pixel format to output the data to. Only used for"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_DATA, may be nullptr otherwise."]
    #[doc = " @param target whether to get the original color profile from the metadata"]
    #[doc = "     or the color profile of the decoded pixels."]
    #[doc = " @param color_encoding struct to copy the information into, or NULL to only"]
    #[doc = " check whether the information is available through the return value."]
    #[doc = " @return JXL_DEC_SUCCESS if the data is available and returned,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if not yet available, JXL_DEC_ERROR in case"]
    #[doc = "    the encuded structured color profile does not exist in the codestream."]
    pub fn JxlDecoderGetColorAsEncodedProfile(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        target: JxlColorProfileTarget,
        color_encoding: *mut JxlColorEncoding,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs the size in bytes of the ICC profile returned by"]
    #[doc = " JxlDecoderGetColorAsICCProfile, if available, or indicates there is none"]
    #[doc = " available. In most cases, the image will have an ICC profile available, but"]
    #[doc = " if it does not, JxlDecoderGetColorAsEncodedProfile must be used instead."]
    #[doc = " @see JxlDecoderGetColorAsEncodedProfile for more information. The ICC"]
    #[doc = " profile is either the exact ICC profile attached to the codestream metadata,"]
    #[doc = " or a close approximation generated from JPEG XL encoded structured data,"]
    #[doc = " depending of what is encoded in the codestream."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format pixel format to output the data to. Only used for"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_DATA, may be nullptr otherwise."]
    #[doc = " @param target whether to get the original color profile from the metadata"]
    #[doc = "     or the color profile of the decoded pixels."]
    #[doc = " @param size variable to output the size into, or NULL to only check the"]
    #[doc = "    return status."]
    #[doc = " @return JXL_DEC_SUCCESS if the ICC profile is available,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if the decoder has not yet received enough"]
    #[doc = "    input data to determine whether an ICC profile is available or what its"]
    #[doc = "    size is, JXL_DEC_ERROR in case the ICC profile is not available and"]
    #[doc = "    cannot be generated."]
    pub fn JxlDecoderGetICCProfileSize(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        target: JxlColorProfileTarget,
        size: *mut usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs ICC profile if available. The profile is only available if"]
    #[doc = " JxlDecoderGetICCProfileSize returns success. The output buffer must have"]
    #[doc = " at least as many bytes as given by JxlDecoderGetICCProfileSize."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format pixel format to output the data to. Only used for"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_DATA, may be nullptr otherwise."]
    #[doc = " @param target whether to get the original color profile from the metadata"]
    #[doc = "     or the color profile of the decoded pixels."]
    #[doc = " @param icc_profile buffer to copy the ICC profile into"]
    #[doc = " @param size size of the icc_profile buffer in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS if the profile was successfully returned is"]
    #[doc = "    available, JXL_DEC_NEED_MORE_INPUT if not yet available,"]
    #[doc = "    JXL_DEC_ERROR if the profile doesn't exist or the output size is not"]
    #[doc = "    large enough."]
    pub fn JxlDecoderGetColorAsICCProfile(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        target: JxlColorProfileTarget,
        icc_profile: *mut u8,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Returns the minimum size in bytes of the preview image output pixel buffer"]
    #[doc = " for the given format. This is the buffer for JxlDecoderSetPreviewOutBuffer."]
    #[doc = " Requires the preview header information is available in the decoder."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of pixels"]
    #[doc = " @param size output value, buffer size in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = "    information not available yet."]
    pub fn JxlDecoderPreviewOutBufferSize(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        size: *mut usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to write the small resolution preview image"]
    #[doc = " to. The size of the buffer must be at least as large as given by"]
    #[doc = " JxlDecoderPreviewOutBufferSize. The buffer follows the format described by"]
    #[doc = " JxlPixelFormat. The preview image dimensions are given by the"]
    #[doc = " JxlPreviewHeader. The buffer is owned by the caller."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of pixels. Object owned by user and its contents are"]
    #[doc = " copied internally."]
    #[doc = " @param buffer buffer type to output the pixel data to"]
    #[doc = " @param size size of buffer in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = " size too small."]
    pub fn JxlDecoderSetPreviewOutBuffer(
        dec: *mut JxlDecoder,
        format: *const JxlPixelFormat,
        buffer: *mut ::std::os::raw::c_void,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs the information from the frame, such as duration when have_animation."]
    #[doc = " This function can be called when JXL_DEC_FRAME occurred for the current"]
    #[doc = " frame, even when have_animation in the JxlBasicInfo is JXL_FALSE."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param header struct to copy the information into, or NULL to only check"]
    #[doc = " whether the information is available through the return value."]
    #[doc = " @return JXL_DEC_SUCCESS if the value is available,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if not yet available, JXL_DEC_ERROR in case"]
    #[doc = "    of other error conditions."]
    pub fn JxlDecoderGetFrameHeader(
        dec: *const JxlDecoder,
        header: *mut JxlFrameHeader,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs name for the current frame. The buffer"]
    #[doc = " for name must have at least name_length + 1 bytes allocated, gotten from"]
    #[doc = " the associated JxlFrameHeader."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param name buffer to copy the name into"]
    #[doc = " @param size size of the name buffer in bytes, includig zero termination"]
    #[doc = "    character, so this must be at least JxlFrameHeader.name_length + 1."]
    #[doc = " @return JXL_DEC_SUCCESS if the value is available,"]
    #[doc = "    JXL_DEC_NEED_MORE_INPUT if not yet available, JXL_DEC_ERROR in case"]
    #[doc = "    of other error conditions."]
    pub fn JxlDecoderGetFrameName(
        dec: *const JxlDecoder,
        name: *mut ::std::os::raw::c_char,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Returns the minimum size in bytes of the DC image output buffer"]
    #[doc = " for the given format. This is the buffer for JxlDecoderSetDCOutBuffer."]
    #[doc = " Requires the basic image information is available in the decoder."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of pixels"]
    #[doc = " @param size output value, buffer size in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = "    information not available yet."]
    pub fn JxlDecoderDCOutBufferSize(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        size: *mut usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to write the lower resolution (8x8 sub-sampled) DC image"]
    #[doc = " to. The size of the buffer must be at least as large as given by"]
    #[doc = " JxlDecoderDCOutBufferSize. The buffer follows the format described by"]
    #[doc = " JxlPixelFormat. The DC image has dimensions ceil(xsize / 8) * ceil(ysize /"]
    #[doc = " 8). The buffer is owned by the caller."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of pixels. Object owned by user and its contents are"]
    #[doc = " copied internally."]
    #[doc = " @param buffer buffer type to output the pixel data to"]
    #[doc = " @param size size of buffer in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = " size too small."]
    pub fn JxlDecoderSetDCOutBuffer(
        dec: *mut JxlDecoder,
        format: *const JxlPixelFormat,
        buffer: *mut ::std::os::raw::c_void,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Returns the minimum size in bytes of the image output pixel buffer for the"]
    #[doc = " given format. This is the buffer for JxlDecoderSetImageOutBuffer. Requires"]
    #[doc = " the basic image information is available in the decoder."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels."]
    #[doc = " @param size output value, buffer size in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = "    information not available yet."]
    pub fn JxlDecoderImageOutBufferSize(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        size: *mut usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets output buffer for reconstructed JPEG codestream."]
    #[doc = ""]
    #[doc = " The data is owned by the caller"]
    #[doc = " and may be used by the decoder until JxlDecoderReleaseJPEGBuffer is called or"]
    #[doc = " the decoder is destroyed or reset so must be kept alive until then."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param data pointer to next bytes to write to"]
    #[doc = " @param size amount of bytes available starting from data"]
    #[doc = " @return JXL_DEC_ERROR if input was already set without releasing,"]
    #[doc = " JXL_DEC_SUCCESS otherwise"]
    pub fn JxlDecoderSetJPEGBuffer(
        dec: *mut JxlDecoder,
        data: *mut u8,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Releases buffer which was provided with JxlDecoderSetJPEGBuffer."]
    #[doc = ""]
    #[doc = " Calling JxlDecoderReleaseJPEGBuffer is required whenever"]
    #[doc = " a buffer is already set and a new buffer needs to be added with"]
    #[doc = " JxlDecoderSetJPEGBuffer, but is not required before JxlDecoderDestroy or"]
    #[doc = " JxlDecoderReset."]
    #[doc = ""]
    #[doc = " Calling JxlDecoderReleaseJPEGBuffer when no input is set is"]
    #[doc = " not an error and returns 0."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @return the amount of bytes the decoder has not yet written to of the data"]
    #[doc = " set by JxlDecoderSetJPEGBuffer, or 0 if no buffer is set or"]
    #[doc = " JxlDecoderReleaseJPEGBuffer was already called."]
    pub fn JxlDecoderReleaseJPEGBuffer(dec: *mut JxlDecoder) -> usize;
}
extern "C" {
    #[doc = " Sets the buffer to write the full resolution image to. This can be set when"]
    #[doc = " the JXL_DEC_FRAME event occurs, must be set when the"]
    #[doc = " JXL_DEC_NEED_IMAGE_OUT_BUFFER event occurs, and applies only for the current"]
    #[doc = " frame. The size of the buffer must be at least as large as given by"]
    #[doc = " JxlDecoderImageOutBufferSize. The buffer follows the format described by"]
    #[doc = " JxlPixelFormat. The buffer is owned by the caller."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels. Object owned by user and its contents"]
    #[doc = " are copied internally."]
    #[doc = " @param buffer buffer type to output the pixel data to"]
    #[doc = " @param size size of buffer in bytes"]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = " size too small."]
    pub fn JxlDecoderSetImageOutBuffer(
        dec: *mut JxlDecoder,
        format: *const JxlPixelFormat,
        buffer: *mut ::std::os::raw::c_void,
        size: usize,
    ) -> JxlDecoderStatus;
}
#[doc = " Callback function type for JxlDecoderSetImageOutCallback. @see"]
#[doc = " JxlDecoderSetImageOutCallback for usage."]
#[doc = ""]
#[doc = " The callback bay be called simultaneously by different threads when using a"]
#[doc = " threaded parallel runner, on different pixels."]
#[doc = ""]
#[doc = " @param opaque optional user data, as given to JxlDecoderSetImageOutCallback."]
#[doc = " @param x horizontal position of leftmost pixel of the pixel data."]
#[doc = " @param y vertical position of the pixel data."]
#[doc = " @param xsize amount of pixels included in the pixel data, horizontally."]
#[doc = " This is not the same as xsize of the full image, it may be smaller."]
#[doc = " @param pixels pixel data as a horizontal stripe, in the format passed to"]
#[doc = " JxlDecoderSetImageOutCallback. The memory is not owned by the user, and is"]
#[doc = " only valid during the time the callback is running."]
pub type JxlImageOutCallback = ::std::option::Option<
    unsafe extern "C" fn(
        opaque: *mut ::std::os::raw::c_void,
        x: usize,
        y: usize,
        xsize: usize,
        pixels: *const ::std::os::raw::c_void,
    ),
>;
extern "C" {
    #[doc = " Sets pixel output callback. This is an alternative to"]
    #[doc = " JxlDecoderSetImageOutBuffer. This can be set when the JXL_DEC_FRAME event"]
    #[doc = " occurs, must be set when the JXL_DEC_NEED_IMAGE_OUT_BUFFER event occurs, and"]
    #[doc = " applies only for the current frame. Only one of JxlDecoderSetImageOutBuffer"]
    #[doc = " or JxlDecoderSetImageOutCallback may be used for the same frame, not both at"]
    #[doc = " the same time."]
    #[doc = ""]
    #[doc = " The callback will be called multiple times, to receive the image"]
    #[doc = " data in small chunks. The callback receives a horizontal stripe of pixel"]
    #[doc = " data, 1 pixel high, xsize pixels wide, called a scanline. The xsize here is"]
    #[doc = " not the same as the full image width, the scanline may be a partial section,"]
    #[doc = " and xsize may differ between calls. The user can then process and/or copy the"]
    #[doc = " partial scanline to an image buffer. The callback bay be called"]
    #[doc = " simultaneously by different threads when using a threaded parallel runner, on"]
    #[doc = " different pixels."]
    #[doc = ""]
    #[doc = " If JxlDecoderFlushImage is not used, then each pixel will be visited exactly"]
    #[doc = " once by the different callback calls, during processing with one or more"]
    #[doc = " JxlDecoderProcessInput calls. These pixels are decoded to full detail, they"]
    #[doc = " are not part of a lower resolution or lower quality progressive pass, but the"]
    #[doc = " final pass."]
    #[doc = ""]
    #[doc = " If JxlDecoderFlushImage is used, then in addition each pixel will be visited"]
    #[doc = " zero or one times during the blocking JxlDecoderFlushImage call. Pixels"]
    #[doc = " visited as a result of JxlDecoderFlushImage may represent a lower resolution"]
    #[doc = " or lower quality intermediate progressive pass of the image. Any visited"]
    #[doc = " pixel will be of a quality at least as good or better than previous visits of"]
    #[doc = " this pixel. A pixel may be visited zero times if it cannot be decoded yet"]
    #[doc = " or if it was already decoded to full precision (this behavior is not"]
    #[doc = " guaranteed)."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels. Object owned by user and its contents"]
    #[doc = " are copied internally."]
    #[doc = " @param callback the callback function receiving partial scanlines of pixel"]
    #[doc = " data."]
    #[doc = " @param opaque optional user data, which will be passed on to the callback,"]
    #[doc = " may be NULL."]
    #[doc = " @return JXL_DEC_SUCCESS on success, JXL_DEC_ERROR on error, such as"]
    #[doc = " JxlDecoderSetImageOutBuffer already set."]
    pub fn JxlDecoderSetImageOutCallback(
        dec: *mut JxlDecoder,
        format: *const JxlPixelFormat,
        callback: JxlImageOutCallback,
        opaque: *mut ::std::os::raw::c_void,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs progressive step towards the decoded image so far when only partial"]
    #[doc = " input was received. If the flush was successful, the buffer set with"]
    #[doc = " JxlDecoderSetImageOutBuffer will contain partial image data."]
    #[doc = ""]
    #[doc = " Can be called when JxlDecoderProcessInput returns JXL_DEC_NEED_MORE_INPUT,"]
    #[doc = " after the JXL_DEC_FRAME event already occured and before the"]
    #[doc = " JXL_DEC_FULL_IMAGE event occured for a frame."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @return JXL_DEC_SUCCESS if image data was flushed to the output buffer, or"]
    #[doc = " JXL_DEC_ERROR when no flush was done, e.g. if not enough image data was"]
    #[doc = " available yet even for flush, or no output buffer was set yet. An error is"]
    #[doc = " not fatal, it only indicates no flushed image is available now, regular,"]
    #[doc = "  decoding can still be performed."]
    pub fn JxlDecoderFlushImage(dec: *mut JxlDecoder) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Encoder library version."]
    #[doc = ""]
    #[doc = " @return the encoder library version as an integer:"]
    #[doc = " MAJOR_VERSION * 1000000 + MINOR_VERSION * 1000 + PATCH_VERSION. For example,"]
    #[doc = " version 1.2.3 would return 1002003."]
    pub fn JxlEncoderVersion() -> u32;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlEncoderStruct {
    _unused: [u8; 0],
}
#[doc = " Opaque structure that holds the JPEG XL encoder."]
#[doc = ""]
#[doc = " Allocated and initialized with JxlEncoderCreate()."]
#[doc = " Cleaned up and deallocated with JxlEncoderDestroy()."]
pub type JxlEncoder = JxlEncoderStruct;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlEncoderOptionsStruct {
    _unused: [u8; 0],
}
#[doc = " Opaque structure that holds frame specific encoding options for a JPEG XL"]
#[doc = " encoder."]
#[doc = ""]
#[doc = " Allocated and initialized with JxlEncoderOptionsCreate()."]
#[doc = " Cleaned up and deallocated when the encoder is destroyed with"]
#[doc = " JxlEncoderDestroy()."]
pub type JxlEncoderOptions = JxlEncoderOptionsStruct;
#[doc = " Function call finished successfully, or encoding is finished and there is"]
#[doc = " nothing more to be done."]
pub const JXL_ENC_SUCCESS: JxlEncoderStatus = 0;
#[doc = " An error occurred, for example out of memory."]
pub const JXL_ENC_ERROR: JxlEncoderStatus = 1;
#[doc = " The encoder needs more output buffer to continue encoding."]
pub const JXL_ENC_NEED_MORE_OUTPUT: JxlEncoderStatus = 2;
#[doc = " The encoder doesn't (yet) support this."]
pub const JXL_ENC_NOT_SUPPORTED: JxlEncoderStatus = 3;
#[doc = " Return value for multiple encoder functions."]
pub type JxlEncoderStatus = ::std::os::raw::c_uint;
extern "C" {
    #[doc = " Creates an instance of JxlEncoder and initializes it."]
    #[doc = ""]
    #[doc = " @p memory_manager will be used for all the library dynamic allocations made"]
    #[doc = " from this instance. The parameter may be NULL, in which case the default"]
    #[doc = " allocator will be used. See jpegxl/memory_manager.h for details."]
    #[doc = ""]
    #[doc = " @param memory_manager custom allocator function. It may be NULL. The memory"]
    #[doc = "        manager will be copied internally."]
    #[doc = " @return @c NULL if the instance can not be allocated or initialized"]
    #[doc = " @return pointer to initialized JxlEncoder otherwise"]
    pub fn JxlEncoderCreate(memory_manager: *const JxlMemoryManager) -> *mut JxlEncoder;
}
extern "C" {
    #[doc = " Re-initializes a JxlEncoder instance, so it can be re-used for encoding"]
    #[doc = " another image. All state and settings are reset as if the object was"]
    #[doc = " newly created with JxlEncoderCreate, but the memory manager is kept."]
    #[doc = ""]
    #[doc = " @param enc instance to be re-initialized."]
    pub fn JxlEncoderReset(enc: *mut JxlEncoder);
}
extern "C" {
    #[doc = " Deinitializes and frees JxlEncoder instance."]
    #[doc = ""]
    #[doc = " @param enc instance to be cleaned up and deallocated."]
    pub fn JxlEncoderDestroy(enc: *mut JxlEncoder);
}
extern "C" {
    #[doc = " Set the parallel runner for multithreading. May only be set before starting"]
    #[doc = " encoding."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param parallel_runner function pointer to runner for multithreading. It may"]
    #[doc = "        be NULL to use the default, single-threaded, runner. A multithreaded"]
    #[doc = "        runner should be set to reach fast performance."]
    #[doc = " @param parallel_runner_opaque opaque pointer for parallel_runner."]
    #[doc = " @return JXL_ENC_SUCCESS if the runner was set, JXL_ENC_ERROR"]
    #[doc = " otherwise (the previous runner remains set)."]
    pub fn JxlEncoderSetParallelRunner(
        enc: *mut JxlEncoder,
        parallel_runner: JxlParallelRunner,
        parallel_runner_opaque: *mut ::std::os::raw::c_void,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Encodes JPEG XL file using the available bytes. @p *avail_out indicates how"]
    #[doc = " many output bytes are available, and @p *next_out points to the input bytes."]
    #[doc = " *avail_out will be decremented by the amount of bytes that have been"]
    #[doc = " processed by the encoder and *next_out will be incremented by the same"]
    #[doc = " amount, so *next_out will now point at the amount of *avail_out unprocessed"]
    #[doc = " bytes."]
    #[doc = ""]
    #[doc = " The returned status indicates whether the encoder needs more output bytes."]
    #[doc = " When the return value is not JXL_ENC_ERROR or JXL_ENC_SUCCESS, the encoding"]
    #[doc = " requires more JxlEncoderProcessOutput calls to continue."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param next_out pointer to next bytes to write to."]
    #[doc = " @param avail_out amount of bytes available starting from *next_out."]
    #[doc = " @return JXL_ENC_SUCCESS when encoding finished and all events handled."]
    #[doc = " @return JXL_ENC_ERROR when encoding failed, e.g. invalid input."]
    #[doc = " @return JXL_ENC_NEED_MORE_OUTPUT more output buffer is necessary."]
    pub fn JxlEncoderProcessOutput(
        enc: *mut JxlEncoder,
        next_out: *mut *mut u8,
        avail_out: *mut usize,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to read JPEG encoded bytes from for the next frame to encode."]
    #[doc = ""]
    #[doc = " If the encoder is set to store JPEG reconstruction metadata using @ref"]
    #[doc = " JxlEncoderStoreJPEGMetadata and a single JPEG frame is added, it will be"]
    #[doc = " possible to losslessly reconstruct the JPEG codestream."]
    #[doc = ""]
    #[doc = " @param options set of encoder options to use when encoding the frame."]
    #[doc = " @param buffer bytes to read JPEG from. Owned by the caller and its contents"]
    #[doc = " are copied internally."]
    #[doc = " @param size size of buffer in bytes."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderAddJPEGFrame(
        options: *const JxlEncoderOptions,
        buffer: *const u8,
        size: usize,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to read pixels from for the next image to encode. Must call"]
    #[doc = " JxlEncoderSetDimensions before JxlEncoderAddImageFrame."]
    #[doc = ""]
    #[doc = " Currently only some pixel formats are supported:"]
    #[doc = " - JXL_TYPE_UINT8"]
    #[doc = " - JXL_TYPE_UINT16"]
    #[doc = " - JXL_TYPE_FLOAT, with nominal range 0..1"]
    #[doc = ""]
    #[doc = " The color profile of the pixels depends on the value of uses_original_profile"]
    #[doc = " in the JxlBasicInfo. If true, the pixels are assumed to be encoded in the"]
    #[doc = " original profile that is set with JxlEncoderSetColorEncoding or"]
    #[doc = " JxlEncoderSetICCProfile. If false, the pixels are assumed to be nonlinear"]
    #[doc = " sRGB for integer data types (JXL_TYPE_UINT8 and JXL_TYPE_UINT16), and linear"]
    #[doc = " sRGB for floating point data types (JXL_TYPE_FLOAT)."]
    #[doc = ""]
    #[doc = " @param options set of encoder options to use when encoding the frame."]
    #[doc = " @param pixel_format format for pixels. Object owned by the caller and its"]
    #[doc = " contents are copied internally."]
    #[doc = " @param buffer buffer type to input the pixel data from. Owned by the caller"]
    #[doc = " and its contents are copied internally."]
    #[doc = " @param size size of buffer in bytes."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderAddImageFrame(
        options: *const JxlEncoderOptions,
        pixel_format: *const JxlPixelFormat,
        buffer: *const ::std::os::raw::c_void,
        size: usize,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Declares that this encoder will not encode anything further."]
    #[doc = ""]
    #[doc = " Must be called between JxlEncoderAddImageFrame/JPEGFrame of the last frame"]
    #[doc = " and the next call to JxlEncoderProcessOutput, or JxlEncoderProcessOutput"]
    #[doc = " won't output the last frame correctly."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    pub fn JxlEncoderCloseInput(enc: *mut JxlEncoder);
}
extern "C" {
    #[doc = " Sets the original color encoding of the image encoded by this encoder. This"]
    #[doc = " is an alternative to JxlEncoderSetICCProfile and only one of these two must"]
    #[doc = " be used. This one sets the color encoding as a @ref JxlColorEncoding, while"]
    #[doc = " the other sets it as ICC binary data."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param color color encoding. Object owned by the caller and its contents are"]
    #[doc = " copied internally."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR or"]
    #[doc = " JXL_ENC_NOT_SUPPORTED otherwise"]
    pub fn JxlEncoderSetColorEncoding(
        enc: *mut JxlEncoder,
        color: *const JxlColorEncoding,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the original color encoding of the image encoded by this encoder as an"]
    #[doc = " ICC color profile. This is an alternative to JxlEncoderSetColorEncoding and"]
    #[doc = " only one of these two must be used. This one sets the color encoding as ICC"]
    #[doc = " binary data, while the other defines it as a @ref JxlColorEncoding."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param icc_profile bytes of the original ICC profile"]
    #[doc = " @param size size of the icc_profile buffer in bytes"]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR or"]
    #[doc = " JXL_ENC_NOT_SUPPORTED otherwise"]
    pub fn JxlEncoderSetICCProfile(
        enc: *mut JxlEncoder,
        icc_profile: *const u8,
        size: usize,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the global metadata of the image encoded by this encoder."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param info global image metadata. Object owned by the caller and its"]
    #[doc = " contents are copied internally."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful,"]
    #[doc = " JXL_ENC_ERROR or JXL_ENC_NOT_SUPPORTED otherwise"]
    pub fn JxlEncoderSetBasicInfo(
        enc: *mut JxlEncoder,
        info: *const JxlBasicInfo,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Configure the encoder to store JPEG reconstruction metadata in the JPEG XL"]
    #[doc = " container."]
    #[doc = ""]
    #[doc = " The encoder must be configured to use the JPEG XL container format using @ref"]
    #[doc = " JxlEncoderUseContainer for this to have any effect."]
    #[doc = ""]
    #[doc = " If this is set to true and a single JPEG frame is added, it will be"]
    #[doc = " possible to losslessly reconstruct the JPEG codestream."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param store_jpeg_metadata true if the encoder should store JPEG metadata."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderStoreJPEGMetadata(
        enc: *mut JxlEncoder,
        store_jpeg_metadata: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Configure the encoder to use the JPEG XL container format."]
    #[doc = ""]
    #[doc = " Using the JPEG XL container format allows to store metadata such as JPEG"]
    #[doc = " reconstruction (@ref JxlEncoderStoreJPEGMetadata) or other metadata like"]
    #[doc = " EXIF; but it adds a few bytes to the encoded file for container headers even"]
    #[doc = " if there is no extra metadata."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param use_container true if the encoder should output the JPEG XL container"]
    #[doc = " format."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderUseContainer(
        enc: *mut JxlEncoder,
        use_container: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets lossless/lossy mode for the provided options. Default is lossy."]
    #[doc = ""]
    #[doc = " @param options set of encoder options to update with the new mode"]
    #[doc = " @param lossless whether the options should be lossless"]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderOptionsSetLossless(
        options: *mut JxlEncoderOptions,
        lossless: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Set the decoding speed tier for the provided options. Minimum is 0 (highest"]
    #[doc = " quality), and maximum is 4 (lowest quality). Default is 0."]
    #[doc = ""]
    #[doc = " @param options set of encoder options to update with the new decoding speed"]
    #[doc = " tier."]
    #[doc = " @param tier the decoding speed tier to set."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderOptionsSetDecodingSpeed(
        options: *mut JxlEncoderOptions,
        tier: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets encoder effort/speed level without affecting decoding speed. Valid"]
    #[doc = " values are, from faster to slower speed: 3:falcon 4:cheetah 5:hare 6:wombat"]
    #[doc = " 7:squirrel 8:kitten 9:tortoise Default: squirrel (7)."]
    #[doc = ""]
    #[doc = " @param options set of encoder options to update with the new mode."]
    #[doc = " @param effort the effort value to set."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderOptionsSetEffort(
        options: *mut JxlEncoderOptions,
        effort: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the distance level for lossy compression: target max butteraugli"]
    #[doc = "  distance, lower = higher quality. Range: 0 .. 15."]
    #[doc = "  0.0 = mathematically lossless (however, use JxlEncoderOptionsSetLossless to"]
    #[doc = "  use true lossless)."]
    #[doc = "  1.0 = visually lossless."]
    #[doc = "  Recommended range: 0.5 .. 3.0."]
    #[doc = "  Default value: 1.0."]
    #[doc = "  If JxlEncoderOptionsSetLossless is used, this value is unused and implied"]
    #[doc = "  to be 0."]
    #[doc = ""]
    #[doc = " @param options set of encoder options to update with the new mode."]
    #[doc = " @param distance the distance value to set."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderOptionsSetDistance(
        options: *mut JxlEncoderOptions,
        distance: f32,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Create a new set of encoder options, with all values initially copied from"]
    #[doc = " the @p source options, or set to default if @p source is NULL."]
    #[doc = ""]
    #[doc = " The returned pointer is an opaque struct tied to the encoder and it will be"]
    #[doc = " deallocated by the encoder when JxlEncoderDestroy() is called. For functions"]
    #[doc = " taking both a @ref JxlEncoder and a @ref JxlEncoderOptions, only"]
    #[doc = " JxlEncoderOptions created with this function for the same encoder instance"]
    #[doc = " can be used."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param source source options to copy initial values from, or NULL to get"]
    #[doc = " defaults initialized to defaults."]
    #[doc = " @return the opaque struct pointer identifying a new set of encoder options."]
    pub fn JxlEncoderOptionsCreate(
        enc: *mut JxlEncoder,
        source: *const JxlEncoderOptions,
    ) -> *mut JxlEncoderOptions;
}
extern "C" {
    #[doc = " Sets a color encoding to be sRGB."]
    #[doc = ""]
    #[doc = " @param color_encoding color encoding instance."]
    #[doc = " @param is_gray whether the color encoding should be gray scale or color."]
    pub fn JxlColorEncodingSetToSRGB(
        color_encoding: *mut JxlColorEncoding,
        is_gray: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " Sets a color encoding to be linear sRGB."]
    #[doc = ""]
    #[doc = " @param color_encoding color encoding instance."]
    #[doc = " @param is_gray whether the color encoding should be gray scale or color."]
    pub fn JxlColorEncodingSetToLinearSRGB(
        color_encoding: *mut JxlColorEncoding,
        is_gray: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " Parallel runner internally using std::thread. Use as JxlParallelRunner."]
    pub fn JxlThreadParallelRunner(
        runner_opaque: *mut ::std::os::raw::c_void,
        jpegxl_opaque: *mut ::std::os::raw::c_void,
        init: JxlParallelRunInit,
        func: JxlParallelRunFunction,
        start_range: u32,
        end_range: u32,
    ) -> JxlParallelRetCode;
}
extern "C" {
    #[doc = " Creates the runner for JxlThreadParallelRunner. Use as the opaque"]
    #[doc = " runner."]
    pub fn JxlThreadParallelRunnerCreate(
        memory_manager: *const JxlMemoryManager,
        num_worker_threads: usize,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    #[doc = " Destroys the runner created by JxlThreadParallelRunnerCreate."]
    pub fn JxlThreadParallelRunnerDestroy(runner_opaque: *mut ::std::os::raw::c_void);
}
extern "C" {
    #[doc = " Returns a default num_worker_threads value for"]
    #[doc = " JxlThreadParallelRunnerCreate."]
    pub fn JxlThreadParallelRunnerDefaultNumWorkerThreads() -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlButteraugliApiStruct {
    _unused: [u8; 0],
}
#[doc = " Opaque structure that holds a butteraugli API."]
#[doc = ""]
#[doc = " Allocated and initialized with JxlButteraugliApiCreate()."]
#[doc = " Cleaned up and deallocated with JxlButteraugliApiDestroy()."]
pub type JxlButteraugliApi = JxlButteraugliApiStruct;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlButteraugliResultStruct {
    _unused: [u8; 0],
}
#[doc = " Opaque structure that holds intermediary butteraugli results."]
#[doc = ""]
#[doc = " Allocated and initialized with JxlButteraugliCompute()."]
#[doc = " Cleaned up and deallocated with JxlButteraugliResultDestroy()."]
pub type JxlButteraugliResult = JxlButteraugliResultStruct;
extern "C" {
    #[doc = " Deinitializes and frees JxlButteraugliResult instance."]
    #[doc = ""]
    #[doc = " @param result instance to be cleaned up and deallocated."]
    pub fn JxlButteraugliResultDestroy(result: *mut JxlButteraugliResult);
}
extern "C" {
    #[doc = " Creates an instance of JxlButteraugliApi and initializes it."]
    #[doc = ""]
    #[doc = " @p memory_manager will be used for all the library dynamic allocations made"]
    #[doc = " from this instance. The parameter may be NULL, in which case the default"]
    #[doc = " allocator will be used. See jxl/memory_manager.h for details."]
    #[doc = ""]
    #[doc = " @param memory_manager custom allocator function. It may be NULL. The memory"]
    #[doc = "        manager will be copied internally."]
    #[doc = " @return @c NULL if the instance can not be allocated or initialized"]
    #[doc = " @return pointer to initialized JxlEncoder otherwise"]
    pub fn JxlButteraugliApiCreate(
        memory_manager: *const JxlMemoryManager,
    ) -> *mut JxlButteraugliApi;
}
extern "C" {
    #[doc = " Set the parallel runner for multithreading."]
    #[doc = ""]
    #[doc = " @param api api instance."]
    #[doc = " @param parallel_runner function pointer to runner for multithreading. A"]
    #[doc = " multithreaded runner should be set to reach fast performance."]
    #[doc = " @param parallel_runner_opaque opaque pointer for parallel_runner."]
    pub fn JxlButteraugliApiSetParallelRunner(
        api: *mut JxlButteraugliApi,
        parallel_runner: JxlParallelRunner,
        parallel_runner_opaque: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Set the hf_asymmetry option for butteraugli."]
    #[doc = ""]
    #[doc = " @param api api instance."]
    #[doc = " @param v new hf_asymmetry value."]
    pub fn JxlButteraugliApiSetHFAsymmetry(api: *mut JxlButteraugliApi, v: f32);
}
extern "C" {
    #[doc = " Set the intensity_target option for butteraugli."]
    #[doc = ""]
    #[doc = " @param api api instance."]
    #[doc = " @param v new intensity_target value."]
    pub fn JxlButteraugliApiSetIntensityTarget(api: *mut JxlButteraugliApi, v: f32);
}
extern "C" {
    #[doc = " Deinitializes and frees JxlButteraugliApi instance."]
    #[doc = ""]
    #[doc = " @param api instance to be cleaned up and deallocated."]
    pub fn JxlButteraugliApiDestroy(api: *mut JxlButteraugliApi);
}
extern "C" {
    #[doc = " Computes intermediary butteraugli result between an original image and a"]
    #[doc = " distortion."]
    #[doc = ""]
    #[doc = " @param api api instance for this computation."]
    #[doc = " @param xsize width of the compared images."]
    #[doc = " @param ysize height of the compared images."]
    #[doc = " @param pixel_format_orig pixel format for original image."]
    #[doc = " @param buffer_orig pixel data for original image."]
    #[doc = " @param size_orig size of buffer_orig in bytes."]
    #[doc = " @param pixel_format_dist pixel format for distortion."]
    #[doc = " @param buffer_dist pixel data for distortion."]
    #[doc = " @param size_dist size of buffer_dist in bytes."]
    #[doc = " @return @c NULL if the results can not be computed or initialized."]
    #[doc = " @return pointer to initialized and computed intermediary result."]
    pub fn JxlButteraugliCompute(
        api: *const JxlButteraugliApi,
        xsize: u32,
        ysize: u32,
        pixel_format_orig: *const JxlPixelFormat,
        buffer_orig: *const ::std::os::raw::c_void,
        size_orig: usize,
        pixel_format_dist: *const JxlPixelFormat,
        buffer_dist: *const ::std::os::raw::c_void,
        size_dist: usize,
    ) -> *mut JxlButteraugliResult;
}
extern "C" {
    #[doc = " Computes butteraugli max distance based on an intermediary butteraugli"]
    #[doc = " result."]
    #[doc = ""]
    #[doc = " @param result intermediary result instance."]
    #[doc = " @return max distance."]
    pub fn JxlButteraugliResultGetMaxDistance(result: *const JxlButteraugliResult) -> f32;
}
extern "C" {
    #[doc = " Computes a butteraugli distance based on an intermediary butteraugli result."]
    #[doc = ""]
    #[doc = " @param result intermediary result instance."]
    #[doc = " @param pnorm pnorm to calculate."]
    #[doc = " @return distance using the given pnorm."]
    pub fn JxlButteraugliResultGetDistance(result: *const JxlButteraugliResult, pnorm: f32) -> f32;
}
extern "C" {
    #[doc = " Get a pointer to the distmap in the result."]
    #[doc = ""]
    #[doc = " @param result intermediary result instance."]
    #[doc = " @param buffer will be set to the distmap. The distance value for (x,y) will"]
    #[doc = " be available at buffer + y * row_stride + x."]
    #[doc = " @param row_stride will be set to the row stride of the distmap."]
    pub fn JxlButteraugliResultGetDistmap(
        result: *const JxlButteraugliResult,
        buffer: *mut *const f32,
        row_stride: *mut u32,
    );
}