1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
/* automatically generated by rust-bindgen 0.60.1 */

pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __uint64_t = ::std::os::raw::c_ulong;
#[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 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 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 or a single extra channel"]
    #[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))
    );
    fn test_field_num_channels() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlPixelFormat>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).num_channels) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlPixelFormat),
                "::",
                stringify!(num_channels)
            )
        );
    }
    test_field_num_channels();
    fn test_field_data_type() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlPixelFormat>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).data_type) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlPixelFormat),
                "::",
                stringify!(data_type)
            )
        );
    }
    test_field_data_type();
    fn test_field_endianness() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlPixelFormat>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).endianness) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlPixelFormat),
                "::",
                stringify!(endianness)
            )
        );
    }
    test_field_endianness();
    fn test_field_align() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlPixelFormat>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).align) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlPixelFormat),
                "::",
                stringify!(align)
            )
        );
    }
    test_field_align();
}
impl Default for JxlPixelFormat {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Data type holding the 4-character type name of an ISOBMFF box."]
pub type JxlBoxType = [::std::os::raw::c_char; 4usize];
pub const kFrames: JxlProgressiveDetail = 0;
pub const kDC: JxlProgressiveDetail = 1;
pub const kLastPasses: JxlProgressiveDetail = 2;
pub const kPasses: JxlProgressiveDetail = 3;
pub const kDCProgressive: JxlProgressiveDetail = 4;
pub const kDCGroups: JxlProgressiveDetail = 5;
pub const kGroups: JxlProgressiveDetail = 6;
#[doc = " Types of progressive detail."]
#[doc = " Setting a progressive detail with value N implies all progressive details"]
#[doc = " with smaller or equal value. Currently only the following level of"]
#[doc = " progressive detail is implemented:"]
#[doc = "  - kDC (which implies kFrames)"]
#[doc = "  - kPasses (which implies kLastPasses, kDC and kFrames)"]
pub type JxlProgressiveDetail = ::std::os::raw::c_uint;
#[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 = " White point must be read from the JxlColorEncoding white_point field, or"]
#[doc = " as ICC profile. This enum value is not an exact match of the corresponding"]
#[doc = " CICP value."]
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. When decoding, the numerical xy"]
#[doc = " whitepoint value can be read from the JxlColorEncoding white_point field"]
#[doc = " regardless of the enum value. When encoding, enum values except"]
#[doc = " JXL_WHITE_POINT_CUSTOM override the numerical fields. Some enum values match"]
#[doc = " a subset of CICP (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)), however the"]
#[doc = " white point and RGB primaries are separate enums here."]
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 = " Primaries must be read from the JxlColorEncoding primaries_red_xy,"]
#[doc = " primaries_green_xy and primaries_blue_xy fields, or as ICC profile. This"]
#[doc = " enum value is not an exact match of the corresponding CICP value."]
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. When decoding, the primaries can be"]
#[doc = " read from the JxlColorEncoding primaries_red_xy, primaries_green_xy and"]
#[doc = " primaries_blue_xy fields regardless of the enum value. When encoding, the"]
#[doc = " enum values except JXL_PRIMARIES_CUSTOM override the numerical fields. Some"]
#[doc = " enum values match a subset of CICP (Rec. ITU-T H.273 | ISO/IEC"]
#[doc = " 23091-2:2019(E)), however the white point and RGB primaries are separate"]
#[doc = " enums here."]
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 2084"]
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. Enum values match a subset"]
#[doc = " of CICP (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)) unless specified"]
#[doc = " 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 if 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))
    );
    fn test_field_color_space() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).color_space) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(color_space)
            )
        );
    }
    test_field_color_space();
    fn test_field_white_point() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).white_point) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(white_point)
            )
        );
    }
    test_field_white_point();
    fn test_field_white_point_xy() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).white_point_xy) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(white_point_xy)
            )
        );
    }
    test_field_white_point_xy();
    fn test_field_primaries() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).primaries) as usize - ptr as usize
            },
            24usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(primaries)
            )
        );
    }
    test_field_primaries();
    fn test_field_primaries_red_xy() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).primaries_red_xy) as usize - ptr as usize
            },
            32usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(primaries_red_xy)
            )
        );
    }
    test_field_primaries_red_xy();
    fn test_field_primaries_green_xy() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).primaries_green_xy) as usize - ptr as usize
            },
            48usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(primaries_green_xy)
            )
        );
    }
    test_field_primaries_green_xy();
    fn test_field_primaries_blue_xy() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).primaries_blue_xy) as usize - ptr as usize
            },
            64usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(primaries_blue_xy)
            )
        );
    }
    test_field_primaries_blue_xy();
    fn test_field_transfer_function() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).transfer_function) as usize - ptr as usize
            },
            80usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(transfer_function)
            )
        );
    }
    test_field_transfer_function();
    fn test_field_gamma() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).gamma) as usize - ptr as usize
            },
            88usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(gamma)
            )
        );
    }
    test_field_gamma();
    fn test_field_rendering_intent() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorEncoding>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).rendering_intent) as usize - ptr as usize
            },
            96usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorEncoding),
                "::",
                stringify!(rendering_intent)
            )
        );
    }
    test_field_rendering_intent();
}
impl Default for JxlColorEncoding {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[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 = " @return @c NULL if the memory can not be allocated,"]
#[doc = " @return 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 NULL."]
#[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"]
#[doc = " NULL."]
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))
    );
    fn test_field_opaque() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlMemoryManagerStruct>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlMemoryManagerStruct),
                "::",
                stringify!(opaque)
            )
        );
    }
    test_field_opaque();
    fn test_field_alloc() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlMemoryManagerStruct>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).alloc) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlMemoryManagerStruct),
                "::",
                stringify!(alloc)
            )
        );
    }
    test_field_alloc();
    fn test_field_free() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlMemoryManagerStruct>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).free) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlMemoryManagerStruct),
                "::",
                stringify!(free)
            )
        );
    }
    test_field_free();
}
impl Default for JxlMemoryManagerStruct {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[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 = " Represents an input or output colorspace to a color transform, as a"]
#[doc = " serialized ICC profile."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlColorProfile {
    pub icc: JxlColorProfile__bindgen_ty_1,
    #[doc = " Structured representation of the colorspace, if applicable. If all fields"]
    #[doc = " are different from their \"unknown\" value, then this is equivalent to the"]
    #[doc = " ICC representation of the colorspace. If some are \"unknown\", those that are"]
    #[doc = " not are still valid and can still be used on their own if they are useful."]
    pub color_encoding: JxlColorEncoding,
    #[doc = " Number of components per pixel. This can be deduced from the other"]
    #[doc = " representations of the colorspace but is provided for convenience and"]
    #[doc = " validation."]
    pub num_channels: usize,
}
#[doc = " The serialized ICC profile. This is guaranteed to be present and valid."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlColorProfile__bindgen_ty_1 {
    pub data: *const u8,
    pub size: usize,
}
#[test]
fn bindgen_test_layout_JxlColorProfile__bindgen_ty_1() {
    assert_eq!(
        ::std::mem::size_of::<JxlColorProfile__bindgen_ty_1>(),
        16usize,
        concat!("Size of: ", stringify!(JxlColorProfile__bindgen_ty_1))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlColorProfile__bindgen_ty_1>(),
        8usize,
        concat!("Alignment of ", stringify!(JxlColorProfile__bindgen_ty_1))
    );
    fn test_field_data() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorProfile__bindgen_ty_1>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorProfile__bindgen_ty_1),
                "::",
                stringify!(data)
            )
        );
    }
    test_field_data();
    fn test_field_size() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorProfile__bindgen_ty_1>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorProfile__bindgen_ty_1),
                "::",
                stringify!(size)
            )
        );
    }
    test_field_size();
}
impl Default for JxlColorProfile__bindgen_ty_1 {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[test]
fn bindgen_test_layout_JxlColorProfile() {
    assert_eq!(
        ::std::mem::size_of::<JxlColorProfile>(),
        128usize,
        concat!("Size of: ", stringify!(JxlColorProfile))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlColorProfile>(),
        8usize,
        concat!("Alignment of ", stringify!(JxlColorProfile))
    );
    fn test_field_icc() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorProfile>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).icc) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorProfile),
                "::",
                stringify!(icc)
            )
        );
    }
    test_field_icc();
    fn test_field_color_encoding() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorProfile>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).color_encoding) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorProfile),
                "::",
                stringify!(color_encoding)
            )
        );
    }
    test_field_color_encoding();
    fn test_field_num_channels() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlColorProfile>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).num_channels) as usize - ptr as usize
            },
            120usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlColorProfile),
                "::",
                stringify!(num_channels)
            )
        );
    }
    test_field_num_channels();
}
impl Default for JxlColorProfile {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Allocates and returns the data needed for @p num_threads parallel transforms"]
#[doc = " from the @p input colorspace to @p output, with up to @p pixels_per_thread"]
#[doc = " pixels to transform per call to JxlCmsInterface::run. @p init_data comes"]
#[doc = " directly from the JxlCmsInterface instance. Since @c run only receives the"]
#[doc = " data returned by @c init, a reference to @p init_data should be kept there"]
#[doc = " if access to it is desired in @c run. Likewise for JxlCmsInterface::destroy."]
#[doc = ""]
#[doc = " The ICC data in @p input and @p output is guaranteed to outlive the @c init /"]
#[doc = " @c run / @c destroy cycle."]
#[doc = ""]
#[doc = " @param init_data JxlCmsInterface::init_data passed as-is."]
#[doc = " @param num_threads the maximum number of threads from which"]
#[doc = "        JxlCmsInterface::run will be called."]
#[doc = " @param pixels_per_thread the maximum number of pixels that each call to"]
#[doc = "        JxlCmsInterface::run will have to transform."]
#[doc = " @param input_profile the input colorspace for the transform."]
#[doc = " @param output_profile the colorspace to which JxlCmsInterface::run should"]
#[doc = "        convert the input data."]
#[doc = " @param intensity_target for colorspaces where luminance is relative"]
#[doc = "        (essentially: not PQ), indicates the luminance at which (1, 1, 1) will"]
#[doc = "        be displayed. This is useful for conversions between PQ and a relative"]
#[doc = "        luminance colorspace, in either direction: @p intensity_target cd/m²"]
#[doc = "        in PQ should map to and from (1, 1, 1) in the relative one.\\n"]
#[doc = "        It is also used for conversions to and from HLG, as it is"]
#[doc = "        scene-referred while other colorspaces are assumed to be"]
#[doc = "        display-referred. That is, conversions from HLG should apply the OOTF"]
#[doc = "        for a peak display luminance of @p intensity_target, and conversions"]
#[doc = "        to HLG should undo it. The OOTF is a gamma function applied to the"]
#[doc = "        luminance channel (https://www.itu.int/rec/R-REC-BT.2100-2-201807-I"]
#[doc = "        page 7), with the gamma value computed as"]
#[doc = "        <tt>1.2 * 1.111^log2(intensity_target / 1000)</tt> (footnote 2 page 8"]
#[doc = "        of the same document)."]
#[doc = " @return The data needed for the transform, or @c NULL in case of failure."]
#[doc = "         This will be passed to the other functions as @c user_data."]
pub type jpegxl_cms_init_func = ::std::option::Option<
    unsafe extern "C" fn(
        init_data: *mut ::std::os::raw::c_void,
        num_threads: usize,
        pixels_per_thread: usize,
        input_profile: *const JxlColorProfile,
        output_profile: *const JxlColorProfile,
        intensity_target: f32,
    ) -> *mut ::std::os::raw::c_void,
>;
#[doc = " Returns a buffer that can be used by callers of the interface to store the"]
#[doc = " input of the conversion or read its result, if they pass it as the input or"]
#[doc = " output of the @c run function."]
#[doc = " @param user_data the data returned by @c init."]
#[doc = " @param thread the index of the thread for which to return a buffer."]
#[doc = " @return A buffer that can be used by the caller for passing to @c run."]
pub type jpegxl_cms_get_buffer_func = ::std::option::Option<
    unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, thread: usize) -> *mut f32,
>;
#[doc = " Executes one transform and returns true on success or false on error. It"]
#[doc = " must be possible to call this from different threads with different values"]
#[doc = " for @p thread, all between 0 (inclusive) and the value of @p num_threads"]
#[doc = " passed to @c init (exclusive). It is allowed to implement this by locking"]
#[doc = " such that the transforms are essentially performed sequentially, if such a"]
#[doc = " performance profile is acceptable. @p user_data is the data returned by"]
#[doc = " @c init."]
#[doc = " The buffers each contain @p num_pixels × @c num_channels interleaved floating"]
#[doc = " point (0..1) samples where @c num_channels is the number of color channels of"]
#[doc = " their respective color profiles. It is guaranteed that the only case in which"]
#[doc = " they might overlap is if the output has fewer channels than the input, in"]
#[doc = " which case the pointers may be identical."]
#[doc = " For CMYK data, 0 represents the maximum amount of ink while 1 represents no"]
#[doc = " ink."]
#[doc = " @param user_data the data returned by @c init."]
#[doc = " @param thread the index of the thread from which the function is being"]
#[doc = "        called."]
#[doc = " @param input_buffer the buffer containing the pixel data to be transformed."]
#[doc = " @param output_buffer the buffer receiving the transformed pixel data."]
#[doc = " @param num_pixels the number of pixels to transform from @p input to"]
#[doc = " @p output."]
#[doc = " @return JXL_TRUE on success, JXL_FALSE on failure."]
pub type jpegxl_cms_run_func = ::std::option::Option<
    unsafe extern "C" fn(
        user_data: *mut ::std::os::raw::c_void,
        thread: usize,
        input_buffer: *const f32,
        output_buffer: *mut f32,
        num_pixels: usize,
    ) -> ::std::os::raw::c_int,
>;
#[doc = " Performs the necessary clean-up and frees the memory allocated for user"]
#[doc = " data."]
pub type jpegxl_cms_destroy_func =
    ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>;
#[doc = " Interface for performing colorspace transforms. The @c init function can be"]
#[doc = " called several times to instantiate several transforms, including before"]
#[doc = " other transforms have been destroyed."]
#[doc = ""]
#[doc = " The call sequence for a given colorspace transform could look like the"]
#[doc = " following:"]
#[doc = " @dot"]
#[doc = " digraph calls {"]
#[doc = "   newrank = true"]
#[doc = "   node [shape = box, fontname = monospace]"]
#[doc = "   init [label = \"user_data <- init(\\l\\"]
#[doc = "     init_data = data,\\l\\"]
#[doc = "     num_threads = 3,\\l\\"]
#[doc = "     pixels_per_thread = 20,\\l\\"]
#[doc = "     input = (sRGB, 3 channels),\\l\\"]
#[doc = "     output = (Display-P3, 3 channels),\\l\\"]
#[doc = "     intensity_target = 255\\l\\"]
#[doc = "   )\\l\"]"]
#[doc = "   subgraph cluster_0 {"]
#[doc = "   color = lightgrey"]
#[doc = "   label = \"thread 1\""]
#[doc = "   labeljust = \"c\""]
#[doc = "   run_1_1 [label = \"run(\\l\\"]
#[doc = "     user_data,\\l\\"]
#[doc = "     thread = 1,\\l\\"]
#[doc = "     input = in[0],\\l\\"]
#[doc = "     output = out[0],\\l\\"]
#[doc = "     num_pixels = 20\\l\\"]
#[doc = "   )\\l\"]"]
#[doc = "   run_1_2 [label = \"run(\\l\\"]
#[doc = "     user_data,\\l\\"]
#[doc = "     thread = 1,\\l\\"]
#[doc = "     input = in[3],\\l\\"]
#[doc = "     output = out[3],\\l\\"]
#[doc = "     num_pixels = 20\\l\\"]
#[doc = "   )\\l\"]"]
#[doc = "   }"]
#[doc = "   subgraph cluster_1 {"]
#[doc = "   color = lightgrey"]
#[doc = "   label = \"thread 2\""]
#[doc = "   labeljust = \"l\""]
#[doc = "   run_2_1 [label = \"run(\\l\\"]
#[doc = "     user_data,\\l\\"]
#[doc = "     thread = 2,\\l\\"]
#[doc = "     input = in[1],\\l\\"]
#[doc = "     output = out[1],\\l\\"]
#[doc = "     num_pixels = 20\\l\\"]
#[doc = "   )\\l\"]"]
#[doc = "   run_2_2 [label = \"run(\\l\\"]
#[doc = "     user_data,\\l\\"]
#[doc = "     thread = 2,\\l\\"]
#[doc = "     input = in[4],\\l\\"]
#[doc = "     output = out[4],\\l\\"]
#[doc = "     num_pixels = 13\\l\\"]
#[doc = "   )\\l\"]"]
#[doc = "   }"]
#[doc = "   subgraph cluster_3 {"]
#[doc = "   color = lightgrey"]
#[doc = "   label = \"thread 3\""]
#[doc = "   labeljust = \"c\""]
#[doc = "   run_3_1 [label = \"run(\\l\\"]
#[doc = "     user_data,\\l\\"]
#[doc = "     thread = 3,\\l\\"]
#[doc = "     input = in[2],\\l\\"]
#[doc = "     output = out[2],\\l\\"]
#[doc = "     num_pixels = 20\\l\\"]
#[doc = "   )\\l\"]"]
#[doc = "   }"]
#[doc = "   init -> {run_1_1; run_2_1; run_3_1; rank = same}"]
#[doc = "   run_1_1 -> run_1_2"]
#[doc = "   run_2_1 -> run_2_2"]
#[doc = "   {run_1_2; run_2_2, run_3_1} -> \"destroy(user_data)\""]
#[doc = " }"]
#[doc = " @enddot"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlCmsInterface {
    #[doc = " CMS-specific data that will be passed to @ref init."]
    pub init_data: *mut ::std::os::raw::c_void,
    #[doc = " Prepares a colorspace transform as described in the documentation of @ref"]
    #[doc = " jpegxl_cms_init_func."]
    pub init: jpegxl_cms_init_func,
    #[doc = " Returns a buffer that can be used as input to @c run."]
    pub get_src_buf: jpegxl_cms_get_buffer_func,
    #[doc = " Returns a buffer that can be used as output from @c run."]
    pub get_dst_buf: jpegxl_cms_get_buffer_func,
    #[doc = " Executes the transform on a batch of pixels, per @ref jpegxl_cms_run_func."]
    pub run: jpegxl_cms_run_func,
    #[doc = " Cleans up the transform."]
    pub destroy: jpegxl_cms_destroy_func,
}
#[test]
fn bindgen_test_layout_JxlCmsInterface() {
    assert_eq!(
        ::std::mem::size_of::<JxlCmsInterface>(),
        48usize,
        concat!("Size of: ", stringify!(JxlCmsInterface))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlCmsInterface>(),
        8usize,
        concat!("Alignment of ", stringify!(JxlCmsInterface))
    );
    fn test_field_init_data() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlCmsInterface>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).init_data) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlCmsInterface),
                "::",
                stringify!(init_data)
            )
        );
    }
    test_field_init_data();
    fn test_field_init() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlCmsInterface>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlCmsInterface),
                "::",
                stringify!(init)
            )
        );
    }
    test_field_init();
    fn test_field_get_src_buf() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlCmsInterface>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).get_src_buf) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlCmsInterface),
                "::",
                stringify!(get_src_buf)
            )
        );
    }
    test_field_get_src_buf();
    fn test_field_get_dst_buf() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlCmsInterface>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).get_dst_buf) as usize - ptr as usize
            },
            24usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlCmsInterface),
                "::",
                stringify!(get_dst_buf)
            )
        );
    }
    test_field_get_dst_buf();
    fn test_field_run() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlCmsInterface>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).run) as usize - ptr as usize
            },
            32usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlCmsInterface),
                "::",
                stringify!(run)
            )
        );
    }
    test_field_run();
    fn test_field_destroy() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlCmsInterface>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).destroy) as usize - ptr as usize
            },
            40usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlCmsInterface),
                "::",
                stringify!(destroy)
            )
        );
    }
    test_field_destroy();
}
impl Default for JxlCmsInterface {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
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))
    );
    fn test_field_xsize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlPreviewHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).xsize) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlPreviewHeader),
                "::",
                stringify!(xsize)
            )
        );
    }
    test_field_xsize();
    fn test_field_ysize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlPreviewHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).ysize) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlPreviewHeader),
                "::",
                stringify!(ysize)
            )
        );
    }
    test_field_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))
    );
    fn test_field_tps_numerator() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlAnimationHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).tps_numerator) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlAnimationHeader),
                "::",
                stringify!(tps_numerator)
            )
        );
    }
    test_field_tps_numerator();
    fn test_field_tps_denominator() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlAnimationHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).tps_denominator) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlAnimationHeader),
                "::",
                stringify!(tps_denominator)
            )
        );
    }
    test_field_tps_denominator();
    fn test_field_num_loops() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlAnimationHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).num_loops) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlAnimationHeader),
                "::",
                stringify!(num_loops)
            )
        );
    }
    test_field_num_loops();
    fn test_field_have_timecodes() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlAnimationHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).have_timecodes) as usize - ptr as usize
            },
            12usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlAnimationHeader),
                "::",
                stringify!(have_timecodes)
            )
        );
    }
    test_field_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."]
    #[doc = " Leaving this set to its default of 0 lets libjxl choose a sensible default"]
    #[doc = " value based on the color encoding."]
    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."]
    #[doc = " If present, matches the alpha_bits value of the JxlExtraChannelInfo"]
    #[doc = " associated with this alpha channel."]
    pub alpha_bits: u32,
    #[doc = " Alpha channel floating point exponent bits, or 0 if they are unsigned. If"]
    #[doc = " present, matches the alpha_bits value of the JxlExtraChannelInfo associated"]
    #[doc = " with this alpha channel. integer."]
    pub alpha_exponent_bits: u32,
    #[doc = " Whether the alpha channel is premultiplied. Only used if there is a main"]
    #[doc = " alpha channel. Matches the alpha_premultiplied value of the"]
    #[doc = " JxlExtraChannelInfo associated with this alpha channel."]
    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,
    #[doc = " Intrinsic width of the image."]
    #[doc = " The intrinsic size can be different from the actual size in pixels"]
    #[doc = " (as given by xsize and ysize) and it denotes the recommended dimensions"]
    #[doc = " for displaying the image, i.e. applications are advised to resample the"]
    #[doc = " decoded image to the intrinsic dimensions."]
    pub intrinsic_xsize: u32,
    #[doc = " Intrinsic heigth of the image."]
    #[doc = " The intrinsic size can be different from the actual size in pixels"]
    #[doc = " (as given by xsize and ysize) and it denotes the recommended dimensions"]
    #[doc = " for displaying the image, i.e. applications are advised to resample the"]
    #[doc = " decoded image to the intrinsic dimensions."]
    pub intrinsic_ysize: u32,
    #[doc = " Padding for forwards-compatibility, in case more fields are exposed"]
    #[doc = " in a future version of the library."]
    pub padding: [u8; 100usize],
}
#[test]
fn bindgen_test_layout_JxlBasicInfo() {
    assert_eq!(
        ::std::mem::size_of::<JxlBasicInfo>(),
        204usize,
        concat!("Size of: ", stringify!(JxlBasicInfo))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlBasicInfo>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlBasicInfo))
    );
    fn test_field_have_container() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).have_container) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(have_container)
            )
        );
    }
    test_field_have_container();
    fn test_field_xsize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).xsize) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(xsize)
            )
        );
    }
    test_field_xsize();
    fn test_field_ysize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).ysize) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(ysize)
            )
        );
    }
    test_field_ysize();
    fn test_field_bits_per_sample() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).bits_per_sample) as usize - ptr as usize
            },
            12usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(bits_per_sample)
            )
        );
    }
    test_field_bits_per_sample();
    fn test_field_exponent_bits_per_sample() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).exponent_bits_per_sample) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(exponent_bits_per_sample)
            )
        );
    }
    test_field_exponent_bits_per_sample();
    fn test_field_intensity_target() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).intensity_target) as usize - ptr as usize
            },
            20usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(intensity_target)
            )
        );
    }
    test_field_intensity_target();
    fn test_field_min_nits() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).min_nits) as usize - ptr as usize
            },
            24usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(min_nits)
            )
        );
    }
    test_field_min_nits();
    fn test_field_relative_to_max_display() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).relative_to_max_display) as usize - ptr as usize
            },
            28usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(relative_to_max_display)
            )
        );
    }
    test_field_relative_to_max_display();
    fn test_field_linear_below() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).linear_below) as usize - ptr as usize
            },
            32usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(linear_below)
            )
        );
    }
    test_field_linear_below();
    fn test_field_uses_original_profile() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).uses_original_profile) as usize - ptr as usize
            },
            36usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(uses_original_profile)
            )
        );
    }
    test_field_uses_original_profile();
    fn test_field_have_preview() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).have_preview) as usize - ptr as usize
            },
            40usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(have_preview)
            )
        );
    }
    test_field_have_preview();
    fn test_field_have_animation() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).have_animation) as usize - ptr as usize
            },
            44usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(have_animation)
            )
        );
    }
    test_field_have_animation();
    fn test_field_orientation() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).orientation) as usize - ptr as usize
            },
            48usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(orientation)
            )
        );
    }
    test_field_orientation();
    fn test_field_num_color_channels() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).num_color_channels) as usize - ptr as usize
            },
            52usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(num_color_channels)
            )
        );
    }
    test_field_num_color_channels();
    fn test_field_num_extra_channels() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).num_extra_channels) as usize - ptr as usize
            },
            56usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(num_extra_channels)
            )
        );
    }
    test_field_num_extra_channels();
    fn test_field_alpha_bits() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).alpha_bits) as usize - ptr as usize
            },
            60usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(alpha_bits)
            )
        );
    }
    test_field_alpha_bits();
    fn test_field_alpha_exponent_bits() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).alpha_exponent_bits) as usize - ptr as usize
            },
            64usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(alpha_exponent_bits)
            )
        );
    }
    test_field_alpha_exponent_bits();
    fn test_field_alpha_premultiplied() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).alpha_premultiplied) as usize - ptr as usize
            },
            68usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(alpha_premultiplied)
            )
        );
    }
    test_field_alpha_premultiplied();
    fn test_field_preview() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).preview) as usize - ptr as usize
            },
            72usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(preview)
            )
        );
    }
    test_field_preview();
    fn test_field_animation() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).animation) as usize - ptr as usize
            },
            80usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(animation)
            )
        );
    }
    test_field_animation();
    fn test_field_intrinsic_xsize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).intrinsic_xsize) as usize - ptr as usize
            },
            96usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(intrinsic_xsize)
            )
        );
    }
    test_field_intrinsic_xsize();
    fn test_field_intrinsic_ysize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).intrinsic_ysize) as usize - ptr as usize
            },
            100usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(intrinsic_ysize)
            )
        );
    }
    test_field_intrinsic_ysize();
    fn test_field_padding() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBasicInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize
            },
            104usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBasicInfo),
                "::",
                stringify!(padding)
            )
        );
    }
    test_field_padding();
}
impl Default for JxlBasicInfo {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[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_premultiplied: ::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))
    );
    fn test_field_type() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(type_)
            )
        );
    }
    test_field_type();
    fn test_field_bits_per_sample() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).bits_per_sample) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(bits_per_sample)
            )
        );
    }
    test_field_bits_per_sample();
    fn test_field_exponent_bits_per_sample() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).exponent_bits_per_sample) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(exponent_bits_per_sample)
            )
        );
    }
    test_field_exponent_bits_per_sample();
    fn test_field_dim_shift() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).dim_shift) as usize - ptr as usize
            },
            12usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(dim_shift)
            )
        );
    }
    test_field_dim_shift();
    fn test_field_name_length() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).name_length) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(name_length)
            )
        );
    }
    test_field_name_length();
    fn test_field_alpha_premultiplied() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).alpha_premultiplied) as usize - ptr as usize
            },
            20usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(alpha_premultiplied)
            )
        );
    }
    test_field_alpha_premultiplied();
    fn test_field_spot_color() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).spot_color) as usize - ptr as usize
            },
            24usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(spot_color)
            )
        );
    }
    test_field_spot_color();
    fn test_field_cfa_channel() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlExtraChannelInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).cfa_channel) as usize - ptr as usize
            },
            40usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlExtraChannelInfo),
                "::",
                stringify!(cfa_channel)
            )
        );
    }
    test_field_cfa_channel();
}
impl Default for JxlExtraChannelInfo {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub const JXL_BLEND_REPLACE: JxlBlendMode = 0;
pub const JXL_BLEND_ADD: JxlBlendMode = 1;
pub const JXL_BLEND_BLEND: JxlBlendMode = 2;
pub const JXL_BLEND_MULADD: JxlBlendMode = 3;
pub const JXL_BLEND_MUL: JxlBlendMode = 4;
#[doc = " Frame blend modes."]
#[doc = " When decoding, if coalescing is enabled (default), this can be ignored."]
pub type JxlBlendMode = ::std::os::raw::c_uint;
#[doc = " The information about blending the color channels or a single extra channel."]
#[doc = " When decoding, if coalescing is enabled (default), this can be ignored and"]
#[doc = " the blend mode is considered to be JXL_BLEND_REPLACE."]
#[doc = " When encoding, these settings apply to the pixel data given to the encoder."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlBlendInfo {
    #[doc = " Blend mode."]
    pub blendmode: JxlBlendMode,
    #[doc = " Reference frame ID to use as the 'bottom' layer (0-3)."]
    pub source: u32,
    #[doc = " Which extra channel to use as the 'alpha' channel for blend modes"]
    #[doc = " JXL_BLEND_BLEND and JXL_BLEND_MULADD."]
    pub alpha: u32,
    #[doc = " Clamp values to [0,1] for the purpose of blending."]
    pub clamp: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_JxlBlendInfo() {
    assert_eq!(
        ::std::mem::size_of::<JxlBlendInfo>(),
        16usize,
        concat!("Size of: ", stringify!(JxlBlendInfo))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlBlendInfo>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlBlendInfo))
    );
    fn test_field_blendmode() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBlendInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).blendmode) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBlendInfo),
                "::",
                stringify!(blendmode)
            )
        );
    }
    test_field_blendmode();
    fn test_field_source() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBlendInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBlendInfo),
                "::",
                stringify!(source)
            )
        );
    }
    test_field_source();
    fn test_field_alpha() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBlendInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBlendInfo),
                "::",
                stringify!(alpha)
            )
        );
    }
    test_field_alpha();
    fn test_field_clamp() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlBlendInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).clamp) as usize - ptr as usize
            },
            12usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlBlendInfo),
                "::",
                stringify!(clamp)
            )
        );
    }
    test_field_clamp();
}
impl Default for JxlBlendInfo {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " The information about layers."]
#[doc = " When decoding, if coalescing is enabled (default), this can be ignored."]
#[doc = " When encoding, these settings apply to the pixel data given to the encoder,"]
#[doc = " the encoder could choose an internal representation that differs."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JxlLayerInfo {
    #[doc = " Whether cropping is applied for this frame. When decoding, if false,"]
    #[doc = " crop_x0 and crop_y0 are set to zero, and xsize and ysize to the main"]
    #[doc = " image dimensions. When encoding and this is false, those fields are"]
    #[doc = " ignored. When decoding, if coalescing is enabled (default), this is always"]
    #[doc = " false, regardless of the internal encoding in the JPEG XL codestream."]
    pub have_crop: ::std::os::raw::c_int,
    #[doc = " Horizontal offset of the frame (can be negative)."]
    pub crop_x0: i32,
    #[doc = " Vertical offset of the frame (can be negative)."]
    pub crop_y0: i32,
    #[doc = " Width of the frame (number of columns)."]
    pub xsize: u32,
    #[doc = " Height of the frame (number of rows)."]
    pub ysize: u32,
    #[doc = " The blending info for the color channels. Blending info for extra channels"]
    #[doc = " has to be retrieved separately using JxlDecoderGetExtraChannelBlendInfo."]
    pub blend_info: JxlBlendInfo,
    #[doc = " After blending, save the frame as reference frame with this ID (0-3)."]
    #[doc = " Special case: if the frame duration is nonzero, ID 0 means \"will not be"]
    #[doc = " referenced in the future\". This value is not used for the last frame."]
    pub save_as_reference: u32,
}
#[test]
fn bindgen_test_layout_JxlLayerInfo() {
    assert_eq!(
        ::std::mem::size_of::<JxlLayerInfo>(),
        40usize,
        concat!("Size of: ", stringify!(JxlLayerInfo))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlLayerInfo>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlLayerInfo))
    );
    fn test_field_have_crop() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).have_crop) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(have_crop)
            )
        );
    }
    test_field_have_crop();
    fn test_field_crop_x0() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).crop_x0) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(crop_x0)
            )
        );
    }
    test_field_crop_x0();
    fn test_field_crop_y0() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).crop_y0) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(crop_y0)
            )
        );
    }
    test_field_crop_y0();
    fn test_field_xsize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).xsize) as usize - ptr as usize
            },
            12usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(xsize)
            )
        );
    }
    test_field_xsize();
    fn test_field_ysize() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).ysize) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(ysize)
            )
        );
    }
    test_field_ysize();
    fn test_field_blend_info() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).blend_info) as usize - ptr as usize
            },
            20usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(blend_info)
            )
        );
    }
    test_field_blend_info();
    fn test_field_save_as_reference() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlLayerInfo>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).save_as_reference) as usize - ptr as usize
            },
            36usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlLayerInfo),
                "::",
                stringify!(save_as_reference)
            )
        );
    }
    test_field_save_as_reference();
}
impl Default for JxlLayerInfo {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " The header of one displayed frame or non-coalesced layer."]
#[repr(C)]
#[derive(Debug, 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. This value is set by the decoder."]
    #[doc = " For the encoder, this value is ignored and @ref JxlEncoderSetFrameName is"]
    #[doc = " used instead to set the name and the length."]
    pub name_length: u32,
    #[doc = " Indicates this is the last animation frame. This value is set by the"]
    #[doc = " decoder to indicate no further frames follow. For the encoder, it is not"]
    #[doc = " required to set this value and it is ignored, @ref JxlEncoderCloseFrames is"]
    #[doc = " used to indicate the last frame to the encoder instead."]
    pub is_last: ::std::os::raw::c_int,
    #[doc = " Information about the layer in case of no coalescing."]
    pub layer_info: JxlLayerInfo,
}
#[test]
fn bindgen_test_layout_JxlFrameHeader() {
    assert_eq!(
        ::std::mem::size_of::<JxlFrameHeader>(),
        56usize,
        concat!("Size of: ", stringify!(JxlFrameHeader))
    );
    assert_eq!(
        ::std::mem::align_of::<JxlFrameHeader>(),
        4usize,
        concat!("Alignment of ", stringify!(JxlFrameHeader))
    );
    fn test_field_duration() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlFrameHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).duration) as usize - ptr as usize
            },
            0usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlFrameHeader),
                "::",
                stringify!(duration)
            )
        );
    }
    test_field_duration();
    fn test_field_timecode() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlFrameHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).timecode) as usize - ptr as usize
            },
            4usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlFrameHeader),
                "::",
                stringify!(timecode)
            )
        );
    }
    test_field_timecode();
    fn test_field_name_length() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlFrameHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).name_length) as usize - ptr as usize
            },
            8usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlFrameHeader),
                "::",
                stringify!(name_length)
            )
        );
    }
    test_field_name_length();
    fn test_field_is_last() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlFrameHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).is_last) as usize - ptr as usize
            },
            12usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlFrameHeader),
                "::",
                stringify!(is_last)
            )
        );
    }
    test_field_is_last();
    fn test_field_layer_info() {
        assert_eq!(
            unsafe {
                let uninit = ::std::mem::MaybeUninit::<JxlFrameHeader>::uninit();
                let ptr = uninit.as_ptr();
                ::std::ptr::addr_of!((*ptr).layer_info) as usize - ptr as usize
            },
            16usize,
            concat!(
                "Offset of field: ",
                stringify!(JxlFrameHeader),
                "::",
                stringify!(layer_info)
            )
        );
    }
    test_field_layer_info();
}
impl Default for JxlFrameHeader {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[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 = " @return 0 if the initialization process was successful."]
#[doc = " @return 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 = " @return 0 if the @p init call succeeded (returned 0) and no other error"]
#[doc = " occurred in the runner code."]
#[doc = " @return 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 JPEG XL 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 @ref 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 = "  - @ref JXL_SIG_NOT_ENOUGH_BYTES if not enough bytes were passed to"]
    #[doc = "    determine if a valid signature is there."]
    #[doc = "  - @ref JXL_SIG_INVALID if no valid signature found for JPEG XL decoding."]
    #[doc = "  - @ref JXL_SIG_CODESTREAM if a valid JPEG XL codestream signature was"]
    #[doc = "    found."]
    #[doc = "  - @ref JXL_SIG_CONTAINER if 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 JPEG XL decoder."]
#[doc = ""]
#[doc = " Allocated and initialized with @ref JxlDecoderCreate()."]
#[doc = " Cleaned up and deallocated with @ref JxlDecoderDestroy()."]
pub type JxlDecoder = JxlDecoderStruct;
extern "C" {
    #[doc = " Creates an instance of @ref 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 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 @ref JxlDecoder otherwise"]
    pub fn JxlDecoderCreate(memory_manager: *const JxlMemoryManager) -> *mut JxlDecoder;
}
extern "C" {
    #[doc = " Re-initializes a @ref 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 @ref 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 @ref 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 occurred, 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. Before the next @ref"]
#[doc = " JxlDecoderProcessInput call, more input data must be set, by calling @ref"]
#[doc = " JxlDecoderReleaseInput (if input was set previously) and then calling @ref"]
#[doc = " JxlDecoderSetInput. @ref JxlDecoderReleaseInput returns how many bytes"]
#[doc = " are not yet processed, before a next call to @ref JxlDecoderProcessInput"]
#[doc = " all unprocessed bytes must be provided again (the address need not match,"]
#[doc = " but the contents must), and more bytes must be concatenated after the"]
#[doc = " unprocessed 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 @ref JxlDecoderSetPreviewOutBuffer. This occurs"]
#[doc = " if @ref JXL_DEC_PREVIEW_IMAGE is requested and it is possible to decode a"]
#[doc = " preview image from the codestream and the preview out buffer was not yet"]
#[doc = " set. There 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 @ref JxlDecoderSetDCOutBuffer. This occurs if @ref"]
#[doc = " JXL_DEC_DC_IMAGE is requested and it is possible to decode a DC image from"]
#[doc = " the codestream and the DC out buffer was not yet set. This event re-occurs"]
#[doc = " for new frames if there are multiple animation frames."]
#[doc = " @deprecated The DC feature in this form will be removed. For progressive"]
#[doc = " rendering, @ref JxlDecoderFlushImage should be used."]
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 @ref JxlDecoderSetImageOutBuffer or with @ref"]
#[doc = " JxlDecoderSetImageOutCallback. This event re-occurs for new frames if"]
#[doc = " there are multiple animation frames and requires setting an output again."]
pub const JXL_DEC_NEED_IMAGE_OUT_BUFFER: JxlDecoderStatus = 5;
#[doc = " The JPEG reconstruction buffer is too small for reconstructed JPEG"]
#[doc = " codestream to fit. @ref JxlDecoderSetJPEGBuffer must be called again to"]
#[doc = " make room for remaining bytes. This event may occur multiple times"]
#[doc = " after @ref JXL_DEC_JPEG_RECONSTRUCTION."]
pub const JXL_DEC_JPEG_NEED_MORE_OUTPUT: JxlDecoderStatus = 6;
#[doc = " The box contents output buffer is too small. @ref JxlDecoderSetBoxBuffer"]
#[doc = " must be called again to make room for remaining bytes. This event may occur"]
#[doc = " multiple times after @ref JXL_DEC_BOX."]
pub const JXL_DEC_BOX_NEED_MORE_OUTPUT: JxlDecoderStatus = 7;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": Basic information such as image dimensions and"]
#[doc = " extra channels. This event occurs max once per image."]
pub const JXL_DEC_BASIC_INFO: JxlDecoderStatus = 64;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": User extensions of the codestream header. This"]
#[doc = " event occurs max once per image and always later than @ref"]
#[doc = " JXL_DEC_BASIC_INFO and earlier than any pixel data."]
pub const JXL_DEC_EXTENSIONS: JxlDecoderStatus = 128;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": Color encoding or ICC profile from the"]
#[doc = " codestream header. This event occurs max once per image and always later"]
#[doc = " than @ref JXL_DEC_BASIC_INFO and earlier than any pixel data."]
pub const JXL_DEC_COLOR_ENCODING: JxlDecoderStatus = 256;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": Preview image, a small frame, decoded. This"]
#[doc = " event can only happen if the image has a preview frame encoded. This event"]
#[doc = " occurs max once for the codestream and always later than @ref"]
#[doc = " JXL_DEC_COLOR_ENCODING and before @ref JXL_DEC_FRAME."]
pub const JXL_DEC_PREVIEW_IMAGE: JxlDecoderStatus = 512;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": Beginning of a frame. @ref"]
#[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, unless @ref JxlDecoderSetCoalescing was set to JXL_FALSE:"]
#[doc = " in that case, the individual layers are returned, without blending. Note"]
#[doc = " that even when coalescing is disabled, only frames of type kRegularFrame"]
#[doc = " are returned; frames of type kReferenceOnly and kLfFrame are always for"]
#[doc = " internal purposes only and cannot be accessed. A displayed frame either has"]
#[doc = " an animation duration or is the only or last frame in the image. This event"]
#[doc = " occurs max once per displayed frame, always later than @ref"]
#[doc = " JXL_DEC_COLOR_ENCODING, and always earlier than any pixel data. While"]
#[doc = " JPEG XL supports encoding a single frame as the composition of multiple"]
#[doc = " internal sub-frames also called frames, this event is not indicated for the"]
#[doc = " internal frames."]
pub const JXL_DEC_FRAME: JxlDecoderStatus = 1024;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": DC image, 8x8 sub-sampled frame, decoded. It is"]
#[doc = " not guaranteed that the decoder will always return DC separately, but when"]
#[doc = " it does it will do so before outputting the full frame. @ref"]
#[doc = " JxlDecoderSetDCOutBuffer must be used after getting the basic image"]
#[doc = " information to be able to get the DC pixels, if not this return status only"]
#[doc = " indicates we're past this point in the codestream. This event occurs max"]
#[doc = " once per frame and always later than @ref JXL_DEC_FRAME and other header"]
#[doc = " events and earlier than full resolution pixel data."]
#[doc = ""]
#[doc = " @deprecated The DC feature in this form will be removed. For progressive"]
#[doc = " rendering, @ref JxlDecoderFlushImage should be used."]
pub const JXL_DEC_DC_IMAGE: JxlDecoderStatus = 2048;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": full frame (or layer, in case coalescing is"]
#[doc = " disabled) is decoded. @ref JxlDecoderSetImageOutBuffer must be used after"]
#[doc = " getting the basic image information to be able to get the image pixels, if"]
#[doc = " not this return status only indicates we're past this point in the"]
#[doc = " codestream. This event occurs max once per frame and always later than @ref"]
#[doc = " JXL_DEC_DC_IMAGE."]
pub const JXL_DEC_FULL_IMAGE: JxlDecoderStatus = 4096;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": JPEG reconstruction data decoded. @ref"]
#[doc = " JxlDecoderSetJPEGBuffer may be used to set a JPEG reconstruction buffer"]
#[doc = " after getting the JPEG reconstruction data. If a JPEG reconstruction buffer"]
#[doc = " is set a byte stream identical to the JPEG codestream used to encode the"]
#[doc = " image will be written to the JPEG reconstruction buffer instead of pixels"]
#[doc = " to the image out buffer. This event occurs max once per image and always"]
#[doc = " before @ref JXL_DEC_FULL_IMAGE."]
pub const JXL_DEC_JPEG_RECONSTRUCTION: JxlDecoderStatus = 8192;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": The header of a box of the container format"]
#[doc = " (BMFF) is decoded. The following API functions related to boxes can be used"]
#[doc = " after this event:"]
#[doc = "  - @ref JxlDecoderSetBoxBuffer and @ref JxlDecoderReleaseBoxBuffer"]
#[doc = "    \"JxlDecoderReleaseBoxBuffer\": set and release a buffer to get the box"]
#[doc = "    data."]
#[doc = "  - @ref JxlDecoderGetBoxType get the 4-character box typename."]
#[doc = "  - @ref JxlDecoderGetBoxSizeRaw get the size of the box as it appears in"]
#[doc = "    the container file, not decompressed."]
#[doc = "  - @ref JxlDecoderSetDecompressBoxes to configure whether to get the box"]
#[doc = "    data decompressed, or possibly compressed."]
#[doc = ""]
#[doc = " Boxes can be compressed. This is so when their box type is"]
#[doc = " \"brob\". In that case, they have an underlying decompressed box"]
#[doc = " type and decompressed data. @ref JxlDecoderSetDecompressBoxes allows"]
#[doc = " configuring which data to get. Decompressing requires"]
#[doc = " Brotli. @ref JxlDecoderGetBoxType has a flag to get the compressed box"]
#[doc = " type, which can be \"brob\", or the decompressed box type. If a box"]
#[doc = " is not compressed (its compressed type is not \"brob\"), then"]
#[doc = " the output decompressed box type and data is independent of what"]
#[doc = " setting is configured."]
#[doc = ""]
#[doc = " The buffer set with @ref JxlDecoderSetBoxBuffer must be set again for each"]
#[doc = " next box to be obtained, or can be left unset to skip outputting this box."]
#[doc = " The output buffer contains the full box data when the next @ref JXL_DEC_BOX"]
#[doc = " event or @ref JXL_DEC_SUCCESS occurs. @ref JXL_DEC_BOX occurs for all"]
#[doc = " boxes, including non-metadata boxes such as the signature box or codestream"]
#[doc = " boxes. To check whether the box is a metadata type for respectively EXIF,"]
#[doc = " XMP or JUMBF, use @ref JxlDecoderGetBoxType and check for types \"Exif\","]
#[doc = " \"xml \" and \"jumb\" respectively."]
pub const JXL_DEC_BOX: JxlDecoderStatus = 16384;
#[doc = " Informative event by @ref JxlDecoderProcessInput"]
#[doc = " \"JxlDecoderProcessInput\": a progressive step in decoding the frame is"]
#[doc = " reached. When calling @ref JxlDecoderFlushImage at this point, the flushed"]
#[doc = " image will correspond exactly to this point in decoding, and not yet"]
#[doc = " contain partial results (such as partially more fine detail) of a next"]
#[doc = " step. By default, this event will trigger maximum once per frame, when a"]
#[doc = " 8x8th resolution (DC) image is ready (the image data is still returned at"]
#[doc = " full resolution, giving upscaled DC). Use @ref"]
#[doc = " JxlDecoderSetProgressiveDetail to configure more fine-grainedness. The"]
#[doc = " event is not guaranteed to trigger, not all images have progressive steps"]
#[doc = " or DC encoded."]
pub const JXL_DEC_FRAME_PROGRESSION: JxlDecoderStatus = 32768;
#[doc = " Return value for @ref JxlDecoderProcessInput."]
#[doc = " The values from @ref JXL_DEC_BASIC_INFO onwards are optional informative"]
#[doc = " events that can be subscribed to, they are never returned if they"]
#[doc = " have not been registered with @ref JxlDecoderSubscribeEvents."]
pub type JxlDecoderStatus = ::std::os::raw::c_uint;
extern "C" {
    #[doc = " Rewinds decoder to the beginning. The same input must be given again from"]
    #[doc = " the beginning of the file and the decoder will emit events from the beginning"]
    #[doc = " again. When rewinding (as opposed to @ref JxlDecoderReset), the decoder can"]
    #[doc = " keep state about the image, which it can use to skip to a requested frame"]
    #[doc = " more efficiently with @ref JxlDecoderSkipFrames. Settings such as parallel"]
    #[doc = " runner or subscribed events are kept. After rewind, @ref"]
    #[doc = " JxlDecoderSubscribeEvents can be used again, and it is feasible to leave out"]
    #[doc = " events that were already handled before, such as @ref JXL_DEC_BASIC_INFO"]
    #[doc = " and @ref JXL_DEC_COLOR_ENCODING, since they will provide the same information"]
    #[doc = " as before."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    pub fn JxlDecoderRewind(dec: *mut JxlDecoder);
}
extern "C" {
    #[doc = " Makes the decoder skip the next `amount` frames. It still needs to process"]
    #[doc = " the input, but will not output the frame events. It can be more efficient"]
    #[doc = " when skipping frames, and even more so when using this after @ref"]
    #[doc = " JxlDecoderRewind. If the decoder is already processing a frame (could"]
    #[doc = " have emitted @ref JXL_DEC_FRAME but not yet @ref JXL_DEC_FULL_IMAGE), it"]
    #[doc = " starts skipping from the next frame. If the amount is larger than the amount"]
    #[doc = " of frames remaining in the image, all remaining frames are skipped. Calling"]
    #[doc = " this function multiple times adds the amount to skip to the already existing"]
    #[doc = " amount."]
    #[doc = ""]
    #[doc = " A frame here is defined as a frame that without skipping emits events such"]
    #[doc = " as @ref JXL_DEC_FRAME and @ref JXL_DEC_FULL_IMAGE, frames that are internal"]
    #[doc = " to the file format but are not rendered as part of an animation, or are not"]
    #[doc = " the final still frame of a still image, are not counted."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param amount the amount of frames to skip"]
    pub fn JxlDecoderSkipFrames(dec: *mut JxlDecoder, amount: usize);
}
extern "C" {
    #[doc = " Get the default pixel format for this decoder."]
    #[doc = ""]
    #[doc = " Requires that the decoder can produce JxlBasicInfo."]
    #[doc = ""]
    #[doc = " @param dec @ref JxlDecoder to query when creating the recommended pixel"]
    #[doc = "     format."]
    #[doc = " @param format JxlPixelFormat to populate with the recommended settings for"]
    #[doc = "     the data loaded into this decoder."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if no error, @ref JXL_DEC_NEED_MORE_INPUT if the"]
    #[doc = "     basic info isn't yet available, and @ref 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 @ref JXL_DEC_SUCCESS if the runner was set, @ref 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 @ref JxlDecoderGetBasicInfo available after the next @ref"]
    #[doc = " JxlDecoderProcessInput call. This is a suggested large enough value for"]
    #[doc = " the amount of bytes to provide in the next @ref JxlDecoderSetInput call, but"]
    #[doc = " it is not guaranteed to be an upper bound nor a lower bound. This number does"]
    #[doc = " not include bytes that have already been released from the input. Can be used"]
    #[doc = " before the first @ref JxlDecoderProcessInput call, and is correct the first"]
    #[doc = " time in most cases. If not, @ref JxlDecoderSizeHintBasicInfo can be called"]
    #[doc = " 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, i.e. @ref 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 @ref JxlDecoderProcessInput."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param events_wanted bitfield of desired events."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if no error, @ref 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 as-in-bitstream pixeldata"]
    #[doc = " orientation. Some images are encoded with an Orientation tag"]
    #[doc = " indicating that the decoder must perform a rotation and/or"]
    #[doc = " mirroring to the encoded image data."]
    #[doc = ""]
    #[doc = "  - If skip_reorientation is JXL_FALSE (the default): the decoder"]
    #[doc = "    will apply the transformation from the orientation setting, hence"]
    #[doc = "    rendering the image according to its specified intent. When"]
    #[doc = "    producing a JxlBasicInfo, the decoder will always set the"]
    #[doc = "    orientation field to JXL_ORIENT_IDENTITY (matching the returned"]
    #[doc = "    pixel data) and also align xsize and ysize so that they correspond"]
    #[doc = "    to the width and the height of the returned pixel data."]
    #[doc = "  - If skip_reorientation is JXL_TRUE: the decoder will skip"]
    #[doc = "    applying the transformation from the orientation setting, returning"]
    #[doc = "    the image in the as-in-bitstream pixeldata orientation."]
    #[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"]
    #[doc = "    orientation tag is not correctly taken into account by the user."]
    #[doc = ""]
    #[doc = " By default, this option is disabled, and the returned pixel data is"]
    #[doc = " re-oriented according to the image's Orientation setting."]
    #[doc = ""]
    #[doc = " This function must be called at the beginning, before decoding is performed."]
    #[doc = ""]
    #[doc = " @see JxlBasicInfo for the orientation field, and @ref JxlOrientation for the"]
    #[doc = " possible values."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param skip_reorientation JXL_TRUE to enable, JXL_FALSE to disable."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if no error, @ref JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderSetKeepOrientation(
        dec: *mut JxlDecoder,
        skip_reorientation: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Enables or disables rendering spot colors. By default, spot colors"]
    #[doc = " are rendered, which is OK for viewing the decoded image. If render_spotcolors"]
    #[doc = " is JXL_FALSE, then spot colors are not rendered, and have to be retrieved"]
    #[doc = " separately using @ref JxlDecoderSetExtraChannelBuffer. This is useful for"]
    #[doc = " e.g. printing applications."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param render_spotcolors JXL_TRUE to enable (default), JXL_FALSE to disable."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if no error, @ref JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderSetRenderSpotcolors(
        dec: *mut JxlDecoder,
        render_spotcolors: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Enables or disables coalescing of zero-duration frames. By default, frames"]
    #[doc = " are returned with coalescing enabled, i.e. all frames have the image"]
    #[doc = " dimensions, and are blended if needed. When coalescing is disabled, frames"]
    #[doc = " can have arbitrary dimensions, a non-zero crop offset, and blending is not"]
    #[doc = " performed. For display, coalescing is recommended. For loading a multi-layer"]
    #[doc = " still image as separate layers (as opposed to the merged image), coalescing"]
    #[doc = " has to be disabled."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param coalescing JXL_TRUE to enable coalescing (default), JXL_FALSE to"]
    #[doc = "     disable it."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if no error, @ref JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderSetCoalescing(
        dec: *mut JxlDecoder,
        coalescing: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Decodes JPEG XL file using the available bytes. Requires input has been"]
    #[doc = " set with @ref JxlDecoderSetInput. After @ref JxlDecoderProcessInput, input"]
    #[doc = " can optionally be released with @ref JxlDecoderReleaseInput and then set"]
    #[doc = " again to next bytes in the stream. @ref JxlDecoderReleaseInput returns how"]
    #[doc = " many bytes are not yet processed, before a next call to @ref"]
    #[doc = " JxlDecoderProcessInput all unprocessed bytes must be provided again (the"]
    #[doc = " address need not match, but the contents must), and more bytes may be"]
    #[doc = " concatenated after the unprocessed 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 @ref JXL_DEC_ERROR), new information, such"]
    #[doc = " as @ref JxlDecoderGetBasicInfo, may have become available after this call."]
    #[doc = " When the return value is not @ref JXL_DEC_ERROR or @ref JXL_DEC_SUCCESS, the"]
    #[doc = " decoding requires more @ref JxlDecoderProcessInput calls to continue."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @return @ref JXL_DEC_SUCCESS when decoding finished and all events handled."]
    #[doc = "     If you still have more unprocessed input data anyway, then you can still"]
    #[doc = "     continue by using @ref JxlDecoderSetInput and calling @ref"]
    #[doc = "     JxlDecoderProcessInput again, similar to handling @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT. @ref JXL_DEC_SUCCESS can occur instead of @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT when, for example, the input data ended right at"]
    #[doc = "     the boundary of a box of the container format, all essential codestream"]
    #[doc = "     boxes were already decoded, but extra metadata boxes are still present in"]
    #[doc = "     the next data. @ref JxlDecoderProcessInput cannot return success if all"]
    #[doc = "     codestream boxes have not been seen yet."]
    #[doc = " @return @ref JXL_DEC_ERROR when decoding failed, e.g. invalid codestream."]
    #[doc = "     TODO(lode): document the input data mechanism"]
    #[doc = " @return @ref JXL_DEC_NEED_MORE_INPUT when more input data is necessary."]
    #[doc = " @return @ref JXL_DEC_BASIC_INFO when basic info such as image dimensions is"]
    #[doc = "     available and this informative event is subscribed to."]
    #[doc = " @return @ref JXL_DEC_EXTENSIONS when JPEG XL codestream user extensions are"]
    #[doc = "     available and this informative event is subscribed to."]
    #[doc = " @return @ref JXL_DEC_COLOR_ENCODING when color profile information is"]
    #[doc = "     available and this informative event is subscribed to."]
    #[doc = " @return @ref JXL_DEC_PREVIEW_IMAGE when preview pixel information is"]
    #[doc = "     available and output in the preview buffer."]
    #[doc = " @return @ref JXL_DEC_DC_IMAGE when DC pixel information (8x8 downscaled"]
    #[doc = "     version of the image) is available and output is in the DC buffer."]
    #[doc = " @return @ref JXL_DEC_FULL_IMAGE when all pixel information at highest detail"]
    #[doc = "     is available and has been output in the pixel buffer."]
    pub fn JxlDecoderProcessInput(dec: *mut JxlDecoder) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets input data for @ref JxlDecoderProcessInput. The data is owned by the"]
    #[doc = " caller and may be used by the decoder until @ref JxlDecoderReleaseInput is"]
    #[doc = " called or the decoder is destroyed or reset so must be kept alive until then."]
    #[doc = " Cannot be called if @ref JxlDecoderSetInput was already called and @ref"]
    #[doc = " JxlDecoderReleaseInput was not yet called, and cannot be called after @ref"]
    #[doc = " JxlDecoderCloseInput indicating the end of input was called."]
    #[doc = ""]
    #[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 @ref JXL_DEC_ERROR if input was already set without releasing or @ref"]
    #[doc = "     JxlDecoderCloseInput was already called, @ref 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 @ref JxlDecoderSetInput. Between @ref"]
    #[doc = " JxlDecoderProcessInput and @ref JxlDecoderReleaseInput, the user may not"]
    #[doc = " alter the data in the buffer. Calling @ref JxlDecoderReleaseInput is required"]
    #[doc = " whenever any input is already set and new input needs to be added with @ref"]
    #[doc = " JxlDecoderSetInput, but is not required before @ref JxlDecoderDestroy or @ref"]
    #[doc = " JxlDecoderReset. Calling @ref JxlDecoderReleaseInput 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 processed that are still"]
    #[doc = "     remaining in the data set by @ref JxlDecoderSetInput, or 0 if no input is"]
    #[doc = "     set or @ref JxlDecoderReleaseInput was already called. For a next call"]
    #[doc = "     to @ref JxlDecoderProcessInput, the buffer must start with these"]
    #[doc = "     unprocessed bytes. This value doesn't provide information about how many"]
    #[doc = "     bytes the decoder truly processed internally or how large the original"]
    #[doc = "     JPEG XL codestream or file are."]
    pub fn JxlDecoderReleaseInput(dec: *mut JxlDecoder) -> usize;
}
extern "C" {
    #[doc = " Marks the input as finished, indicates that no more @ref JxlDecoderSetInput"]
    #[doc = " will be called. This function allows the decoder to determine correctly if it"]
    #[doc = " should return success, need more input or error in certain cases. For"]
    #[doc = " backwards compatibility with a previous version of the API, using this"]
    #[doc = " function is optional when not using the @ref JXL_DEC_BOX event (the decoder"]
    #[doc = " is able to determine the end of the image frames without marking the end),"]
    #[doc = " but using this function is required when using @ref JXL_DEC_BOX for getting"]
    #[doc = " metadata box contents. This function does not replace @ref"]
    #[doc = " JxlDecoderReleaseInput, that function should still be called if its return"]
    #[doc = " value is needed."]
    #[doc = ""]
    #[doc = " @ref JxlDecoderCloseInput should be called as soon as all known input bytes"]
    #[doc = " are set (e.g. at the beginning when not streaming but setting all input"]
    #[doc = " at once), before the final @ref JxlDecoderProcessInput calls."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    pub fn JxlDecoderCloseInput(dec: *mut JxlDecoder);
}
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 @ref JXL_DEC_SUCCESS if the value is available, @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT if not yet available, @ref JXL_DEC_ERROR"]
    #[doc = "     in case 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 @ref JXL_DEC_SUCCESS if the value is available, @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT if not yet available, @ref JXL_DEC_ERROR"]
    #[doc = "     in case 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 @ref JXL_DEC_SUCCESS if the value is available, @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT if not yet available, @ref JXL_DEC_ERROR"]
    #[doc = "     in case 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 JxlBasicInfo 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 @ref 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"]
    #[doc = "    status. @ref JxlDecoderGetColorAsICCProfile should be called 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 @ref 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"]
    #[doc = "    indicates an unknown or xyb color space. In that case, @ref"]
    #[doc = "    JxlDecoderGetColorAsICCProfile is not available."]
    #[doc = ""]
    #[doc = " When rendering an image on a system that supports ICC profiles, @ref"]
    #[doc = " JxlDecoderGetColorAsICCProfile should be used first. When rendering"]
    #[doc = " for a specific color space, possibly indicated in the JPEG XL"]
    #[doc = " image, @ref JxlDecoderGetColorAsEncodedProfile should be used first."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format pixel format to output the data to. Only used for @ref"]
    #[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 @ref JXL_DEC_SUCCESS if the data is available and returned, @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT if not yet available, @ref JXL_DEC_ERROR in"]
    #[doc = "     case the encoded structured color profile does not exist in the"]
    #[doc = "     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 @ref"]
    #[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, @ref JxlDecoderGetColorAsEncodedProfile must be used instead."]
    #[doc = ""]
    #[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 @ref"]
    #[doc = "     JXL_COLOR_PROFILE_TARGET_DATA, may be NULL 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 @ref JXL_DEC_SUCCESS if the ICC profile is available, @ref"]
    #[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, @ref 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 @ref"]
    #[doc = " JxlDecoderGetICCProfileSize returns success. The output buffer must have"]
    #[doc = " at least as many bytes as given by @ref JxlDecoderGetICCProfileSize."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format pixel format to output the data to. Only used for @ref"]
    #[doc = "     JXL_COLOR_PROFILE_TARGET_DATA, may be NULL 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 @ref JXL_DEC_SUCCESS if the profile was successfully returned is"]
    #[doc = "     available, @ref JXL_DEC_NEED_MORE_INPUT if not yet available, @ref"]
    #[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 = " Sets the color profile to use for @ref JXL_COLOR_PROFILE_TARGET_DATA for the"]
    #[doc = " special case when the decoder has a choice. This only has effect for a JXL"]
    #[doc = " image where uses_original_profile is false, and the original color profile is"]
    #[doc = " encoded as an ICC color profile rather than a JxlColorEncoding with known"]
    #[doc = " enum values. In most other cases (uses uses_original_profile is true, or the"]
    #[doc = " color profile is already given as a JxlColorEncoding), this setting is"]
    #[doc = " ignored and the decoder uses a profile related to the image."]
    #[doc = " No matter what, the @ref JXL_COLOR_PROFILE_TARGET_DATA must still be queried"]
    #[doc = " to know the actual data format of the decoded pixels after decoding."]
    #[doc = ""]
    #[doc = " The intended use case of this function is for cases where you are using"]
    #[doc = " a color management system to parse the original ICC color profile"]
    #[doc = " (@ref JXL_COLOR_PROFILE_TARGET_ORIGINAL), from this you know that the ICC"]
    #[doc = " profile represents one of the color profiles supported by JxlColorEncoding"]
    #[doc = " (such as sRGB, PQ or HLG): in that case it is beneficial (but not necessary)"]
    #[doc = " to use @ref JxlDecoderSetPreferredColorProfile to match the parsed profile."]
    #[doc = " The JXL decoder has no color management system built in, but can convert XYB"]
    #[doc = " color to any of the ones supported by JxlColorEncoding."]
    #[doc = ""]
    #[doc = " Can only be set after the @ref JXL_DEC_COLOR_ENCODING event occurred and"]
    #[doc = " before any other event occurred, and can affect the result of @ref"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_DATA (but not of @ref"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_ORIGINAL), so should be used after getting @ref"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_ORIGINAL but before getting @ref"]
    #[doc = " JXL_COLOR_PROFILE_TARGET_DATA. The color_encoding must be grayscale if"]
    #[doc = " num_color_channels from the basic info is 1, RGB if num_color_channels from"]
    #[doc = " the basic info is 3."]
    #[doc = ""]
    #[doc = " If @ref JxlDecoderSetPreferredColorProfile is not used, then for images for"]
    #[doc = " which uses_original_profile is false and with ICC color profile, the decoder"]
    #[doc = " will choose linear sRGB for color images, linear grayscale for grayscale"]
    #[doc = " images. This function only sets a preference, since for other images the"]
    #[doc = " decoder has no choice what color profile to use, it is determined by the"]
    #[doc = " image."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param color_encoding the default color encoding to set"]
    #[doc = " @return @ref JXL_DEC_SUCCESS if the preference was set successfully, @ref"]
    #[doc = "     JXL_DEC_ERROR otherwise."]
    pub fn JxlDecoderSetPreferredColorProfile(
        dec: *mut JxlDecoder,
        color_encoding: *const JxlColorEncoding,
    ) -> 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 @ref"]
    #[doc = " JxlDecoderSetPreviewOutBuffer. Requires the preview header information is"]
    #[doc = " 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 @ref JXL_DEC_SUCCESS on success, @ref 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 @ref"]
    #[doc = " JxlDecoderPreviewOutBufferSize. The buffer follows the format described"]
    #[doc = " by 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 @ref JXL_DEC_SUCCESS on success, @ref 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 @ref 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 @ref JXL_DEC_SUCCESS if the value is available, @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT if not yet available, @ref JXL_DEC_ERROR in"]
    #[doc = "     case 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 for name must have at least"]
    #[doc = " name_length + 1 bytes allocated, gotten from 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, including zero termination"]
    #[doc = "    character, so this must be at least JxlFrameHeader.name_length + 1."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if the value is available, @ref"]
    #[doc = "     JXL_DEC_NEED_MORE_INPUT if not yet available, @ref JXL_DEC_ERROR in"]
    #[doc = "     case of other error conditions."]
    pub fn JxlDecoderGetFrameName(
        dec: *const JxlDecoder,
        name: *mut ::std::os::raw::c_char,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs the blend information for the current frame for a specific extra"]
    #[doc = " channel. This function can be called when @ref JXL_DEC_FRAME occurred for the"]
    #[doc = " current frame, even when have_animation in the JxlBasicInfo is JXL_FALSE."]
    #[doc = " This information is only useful if coalescing is disabled; otherwise the"]
    #[doc = " decoder will have performed blending already."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param index the index of the extra channel"]
    #[doc = " @param blend_info struct to copy the information into"]
    #[doc = " @return @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error"]
    pub fn JxlDecoderGetExtraChannelBlendInfo(
        dec: *const JxlDecoder,
        index: usize,
        blend_info: *mut JxlBlendInfo,
    ) -> 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 @ref 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 @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such as"]
    #[doc = "     information not available yet."]
    #[doc = ""]
    #[doc = " @deprecated The DC feature in this form will be removed. Use @ref"]
    #[doc = "     JxlDecoderFlushImage for progressive rendering."]
    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 @ref"]
    #[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 @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such as"]
    #[doc = "     size too small."]
    #[doc = ""]
    #[doc = " @deprecated The DC feature in this form will be removed. Use @ref"]
    #[doc = "     JxlDecoderFlushImage for progressive rendering."]
    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 @ref JxlDecoderSetImageOutBuffer."]
    #[doc = " Requires that the basic image information is available in the decoder in the"]
    #[doc = " case of coalescing enabled (default). In case coalescing is disabled, this"]
    #[doc = " can only be called after the @ref JXL_DEC_FRAME event occurs. In that case,"]
    #[doc = " it will return the size required to store the possibly cropped frame (which"]
    #[doc = " can be larger or smaller than the image dimensions)."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels."]
    #[doc = " @param size output value, buffer size in bytes"]
    #[doc = " @return @ref JXL_DEC_SUCCESS on success, @ref 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 the buffer to write the full resolution image to. This can be set when"]
    #[doc = " the @ref JXL_DEC_FRAME event occurs, must be set when the @ref"]
    #[doc = " JXL_DEC_NEED_IMAGE_OUT_BUFFER event occurs, and applies only for the"]
    #[doc = " current frame. The size of the buffer must be at least as large as given"]
    #[doc = " by @ref JxlDecoderImageOutBufferSize. The buffer follows the format described"]
    #[doc = " by 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 @ref JXL_DEC_SUCCESS on success, @ref 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 = " Function type for @ref JxlDecoderSetImageOutCallback."]
#[doc = ""]
#[doc = " The callback may 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 @ref"]
#[doc = "     JxlDecoderSetImageOutCallback."]
#[doc = " @param x horizontal position of leftmost pixel of the pixel data."]
#[doc = " @param y vertical position of the pixel data."]
#[doc = " @param num_pixels 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 @ref"]
#[doc = "     JxlDecoderSetImageOutCallback. The memory is not owned by the user, and"]
#[doc = "     is 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,
        num_pixels: usize,
        pixels: *const ::std::os::raw::c_void,
    ),
>;
#[doc = " Initialization callback for @ref JxlDecoderSetMultithreadedImageOutCallback."]
#[doc = ""]
#[doc = " @param init_opaque optional user data, as given to @ref"]
#[doc = "     JxlDecoderSetMultithreadedImageOutCallback."]
#[doc = " @param num_threads maximum number of threads that will call the @c run"]
#[doc = "     callback concurrently."]
#[doc = " @param num_pixels_per_thread maximum number of pixels that will be passed in"]
#[doc = "     one call to @c run."]
#[doc = " @return a pointer to data that will be passed to the @c run callback, or"]
#[doc = "     @c NULL if initialization failed."]
pub type JxlImageOutInitCallback = ::std::option::Option<
    unsafe extern "C" fn(
        init_opaque: *mut ::std::os::raw::c_void,
        num_threads: usize,
        num_pixels_per_thread: usize,
    ) -> *mut ::std::os::raw::c_void,
>;
#[doc = " Worker callback for @ref JxlDecoderSetMultithreadedImageOutCallback."]
#[doc = ""]
#[doc = " @param run_opaque user data returned by the @c init callback."]
#[doc = " @param thread_id number in `[0, num_threads)` identifying the thread of the"]
#[doc = "     current invocation of the callback."]
#[doc = " @param x horizontal position of the first (leftmost) pixel of the pixel data."]
#[doc = " @param y vertical position of the pixel data."]
#[doc = " @param num_pixels number of pixels in the pixel data. May be less than the"]
#[doc = "     full @c xsize of the image, and will be at most equal to the @c"]
#[doc = "     num_pixels_per_thread that was passed to @c init."]
#[doc = " @param pixels pixel data as a horizontal stripe, in the format passed to @ref"]
#[doc = "     JxlDecoderSetMultithreadedImageOutCallback. The data pointed to"]
#[doc = "     remains owned by the caller and is only guaranteed to outlive the current"]
#[doc = "     callback invocation."]
pub type JxlImageOutRunCallback = ::std::option::Option<
    unsafe extern "C" fn(
        run_opaque: *mut ::std::os::raw::c_void,
        thread_id: usize,
        x: usize,
        y: usize,
        num_pixels: usize,
        pixels: *const ::std::os::raw::c_void,
    ),
>;
#[doc = " Destruction callback for @ref JxlDecoderSetMultithreadedImageOutCallback,"]
#[doc = " called after all invocations of the @c run callback to perform any"]
#[doc = " appropriate clean-up of the @c run_opaque data returned by @c init."]
#[doc = ""]
#[doc = " @param run_opaque user data returned by the @c init callback."]
pub type JxlImageOutDestroyCallback =
    ::std::option::Option<unsafe extern "C" fn(run_opaque: *mut ::std::os::raw::c_void)>;
extern "C" {
    #[doc = " Sets pixel output callback. This is an alternative to @ref"]
    #[doc = " JxlDecoderSetImageOutBuffer. This can be set when the @ref JXL_DEC_FRAME"]
    #[doc = " event occurs, must be set when the @ref JXL_DEC_NEED_IMAGE_OUT_BUFFER event"]
    #[doc = " occurs, and applies only for the current frame. Only one of @ref"]
    #[doc = " JxlDecoderSetImageOutBuffer or @ref JxlDecoderSetImageOutCallback may be used"]
    #[doc = " for the same frame, not both at 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 may be called"]
    #[doc = " simultaneously by different threads when using a threaded parallel runner, on"]
    #[doc = " different pixels."]
    #[doc = ""]
    #[doc = " If @ref JxlDecoderFlushImage is not used, then each pixel will be visited"]
    #[doc = " exactly once by the different callback calls, during processing with one or"]
    #[doc = " more @ref JxlDecoderProcessInput calls. These pixels are decoded to full"]
    #[doc = " detail, they are not part of a lower resolution or lower quality progressive"]
    #[doc = " pass, but the final pass."]
    #[doc = ""]
    #[doc = " If @ref JxlDecoderFlushImage is used, then in addition each pixel will be"]
    #[doc = " visited zero or one times during the blocking @ref JxlDecoderFlushImage call."]
    #[doc = " Pixels visited as a result of @ref JxlDecoderFlushImage may represent a lower"]
    #[doc = " resolution or lower quality intermediate progressive pass of the image. Any"]
    #[doc = " visited pixel will be of a quality at least as good or better than previous"]
    #[doc = " visits of this pixel. A pixel may be visited zero times if it cannot be"]
    #[doc = " decoded yet or if it was already decoded to full precision (this behavior is"]
    #[doc = " not guaranteed)."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels. Object owned by user; its contents are"]
    #[doc = "     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 @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such"]
    #[doc = "     as @ref 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 = " Similar to @ref JxlDecoderSetImageOutCallback except that the callback is"]
    #[doc = " allowed an initialization phase during which it is informed of how many"]
    #[doc = " threads will call it concurrently, and those calls are further informed of"]
    #[doc = " which thread they are occurring in."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels. Object owned by user; its contents are"]
    #[doc = "     copied internally."]
    #[doc = " @param init_callback initialization callback."]
    #[doc = " @param run_callback the callback function receiving partial scanlines of"]
    #[doc = "     pixel data."]
    #[doc = " @param destroy_callback clean-up callback invoked after all calls to @c"]
    #[doc = "     run_callback. May be NULL if no clean-up is necessary."]
    #[doc = " @param init_opaque optional user data passed to @c init_callback, may be NULL"]
    #[doc = "     (unlike the return value from @c init_callback which may only be NULL if"]
    #[doc = "     initialization failed)."]
    #[doc = " @return @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such"]
    #[doc = "     as @ref JxlDecoderSetImageOutBuffer having already been called."]
    pub fn JxlDecoderSetMultithreadedImageOutCallback(
        dec: *mut JxlDecoder,
        format: *const JxlPixelFormat,
        init_callback: JxlImageOutInitCallback,
        run_callback: JxlImageOutRunCallback,
        destroy_callback: JxlImageOutDestroyCallback,
        init_opaque: *mut ::std::os::raw::c_void,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Returns the minimum size in bytes of an extra channel pixel buffer for the"]
    #[doc = " given format. This is the buffer for @ref JxlDecoderSetExtraChannelBuffer."]
    #[doc = " Requires the basic image information is available in the decoder."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels. The num_channels value is ignored and is"]
    #[doc = "     always treated to be 1."]
    #[doc = " @param size output value, buffer size in bytes"]
    #[doc = " @param index which extra channel to get, matching the index used in @ref"]
    #[doc = "     JxlDecoderGetExtraChannelInfo. Must be smaller than num_extra_channels in"]
    #[doc = "     the associated JxlBasicInfo."]
    #[doc = " @return @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such as"]
    #[doc = "     information not available yet or invalid index."]
    pub fn JxlDecoderExtraChannelBufferSize(
        dec: *const JxlDecoder,
        format: *const JxlPixelFormat,
        size: *mut usize,
        index: u32,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to write an extra channel to. This can be set when"]
    #[doc = " the @ref JXL_DEC_FRAME or @ref JXL_DEC_NEED_IMAGE_OUT_BUFFER event occurs,"]
    #[doc = " and applies only for the current frame. The size of the buffer must be at"]
    #[doc = " least as large as given by @ref JxlDecoderExtraChannelBufferSize. The buffer"]
    #[doc = " follows the format described by JxlPixelFormat, but where num_channels is 1."]
    #[doc = " The buffer is owned by the caller. The amount of extra channels is given by"]
    #[doc = " the num_extra_channels field in the associated JxlBasicInfo, and the"]
    #[doc = " information of individual extra channels can be queried with @ref"]
    #[doc = " JxlDecoderGetExtraChannelInfo. To get multiple extra channels, this function"]
    #[doc = " must be called multiple times, once for each wanted index. Not all images"]
    #[doc = " have extra channels. The alpha channel is an extra channel and can be gotten"]
    #[doc = " as part of the color channels when using an RGBA pixel buffer with @ref"]
    #[doc = " JxlDecoderSetImageOutBuffer, but additionally also can be gotten"]
    #[doc = " separately as extra channel. The color channels themselves cannot be gotten"]
    #[doc = " this way."]
    #[doc = ""]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param format format of the pixels. Object owned by user and its contents"]
    #[doc = "     are copied internally. The num_channels value is ignored and is always"]
    #[doc = "     treated to be 1."]
    #[doc = " @param buffer buffer type to output the pixel data to"]
    #[doc = " @param size size of buffer in bytes"]
    #[doc = " @param index which extra channel to get, matching the index used in @ref"]
    #[doc = "     JxlDecoderGetExtraChannelInfo. Must be smaller than num_extra_channels in"]
    #[doc = "     the associated JxlBasicInfo."]
    #[doc = " @return @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such as"]
    #[doc = "     size too small or invalid index."]
    pub fn JxlDecoderSetExtraChannelBuffer(
        dec: *mut JxlDecoder,
        format: *const JxlPixelFormat,
        buffer: *mut ::std::os::raw::c_void,
        size: usize,
        index: u32,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Sets output buffer for reconstructed JPEG codestream."]
    #[doc = ""]
    #[doc = " The data is owned by the caller and may be used by the decoder until @ref"]
    #[doc = " JxlDecoderReleaseJPEGBuffer is called or the decoder is destroyed or"]
    #[doc = " reset so must be kept alive until then."]
    #[doc = ""]
    #[doc = " If a JPEG buffer was set before and released with @ref"]
    #[doc = " JxlDecoderReleaseJPEGBuffer, bytes that the decoder has already output"]
    #[doc = " should not be included, only the remaining bytes output must be set."]
    #[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 @ref JXL_DEC_ERROR if output buffer was already set and @ref"]
    #[doc = "     JxlDecoderReleaseJPEGBuffer was not called on it, @ref JXL_DEC_SUCCESS"]
    #[doc = "     otherwise"]
    pub fn JxlDecoderSetJPEGBuffer(
        dec: *mut JxlDecoder,
        data: *mut u8,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Releases buffer which was provided with @ref JxlDecoderSetJPEGBuffer."]
    #[doc = ""]
    #[doc = " Calling @ref JxlDecoderReleaseJPEGBuffer is required whenever"]
    #[doc = " a buffer is already set and a new buffer needs to be added with @ref"]
    #[doc = " JxlDecoderSetJPEGBuffer, but is not required before @ref"]
    #[doc = " JxlDecoderDestroy or @ref JxlDecoderReset."]
    #[doc = ""]
    #[doc = " Calling @ref JxlDecoderReleaseJPEGBuffer when no buffer 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 @ref JxlDecoderSetJPEGBuffer, or 0 if no buffer is set or @ref"]
    #[doc = "     JxlDecoderReleaseJPEGBuffer was already called."]
    pub fn JxlDecoderReleaseJPEGBuffer(dec: *mut JxlDecoder) -> usize;
}
extern "C" {
    #[doc = " Sets output buffer for box output codestream."]
    #[doc = ""]
    #[doc = " The data is owned by the caller and may be used by the decoder until @ref"]
    #[doc = " JxlDecoderReleaseBoxBuffer is called or the decoder is destroyed or"]
    #[doc = " reset so must be kept alive until then."]
    #[doc = ""]
    #[doc = " If for the current box a box buffer was set before and released with @ref"]
    #[doc = " JxlDecoderReleaseBoxBuffer, bytes that the decoder has already output"]
    #[doc = " should not be included, only the remaining bytes output must be set."]
    #[doc = ""]
    #[doc = " The @ref JxlDecoderReleaseBoxBuffer must be used at the next @ref JXL_DEC_BOX"]
    #[doc = " event or final @ref JXL_DEC_SUCCESS event to compute the size of the output"]
    #[doc = " box bytes."]
    #[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 @ref JXL_DEC_ERROR if output buffer was already set and @ref"]
    #[doc = "     JxlDecoderReleaseBoxBuffer was not called on it, @ref JXL_DEC_SUCCESS"]
    #[doc = "     otherwise"]
    pub fn JxlDecoderSetBoxBuffer(
        dec: *mut JxlDecoder,
        data: *mut u8,
        size: usize,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Releases buffer which was provided with @ref JxlDecoderSetBoxBuffer."]
    #[doc = ""]
    #[doc = " Calling @ref JxlDecoderReleaseBoxBuffer is required whenever"]
    #[doc = " a buffer is already set and a new buffer needs to be added with @ref"]
    #[doc = " JxlDecoderSetBoxBuffer, but is not required before @ref"]
    #[doc = " JxlDecoderDestroy or @ref JxlDecoderReset."]
    #[doc = ""]
    #[doc = " Calling @ref JxlDecoderReleaseBoxBuffer when no buffer 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 @ref JxlDecoderSetBoxBuffer, or 0 if no buffer is set or @ref"]
    #[doc = "     JxlDecoderReleaseBoxBuffer was already called."]
    pub fn JxlDecoderReleaseBoxBuffer(dec: *mut JxlDecoder) -> usize;
}
extern "C" {
    #[doc = " Configures whether to get boxes in raw mode or in decompressed mode. In raw"]
    #[doc = " mode, boxes are output as their bytes appear in the container file, which may"]
    #[doc = " be decompressed, or compressed if their type is \"brob\". In decompressed mode,"]
    #[doc = " \"brob\" boxes are decompressed with Brotli before outputting them. The size of"]
    #[doc = " the decompressed stream is not known before the decompression has already"]
    #[doc = " finished."]
    #[doc = ""]
    #[doc = " The default mode is raw. This setting can only be changed before decoding, or"]
    #[doc = " directly after a @ref JXL_DEC_BOX event, and is remembered until the decoder"]
    #[doc = " is reset or destroyed."]
    #[doc = ""]
    #[doc = " Enabling decompressed mode requires Brotli support from the library."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param decompress JXL_TRUE to transparently decompress, JXL_FALSE to get"]
    #[doc = "     boxes in raw mode."]
    #[doc = " @return @ref JXL_DEC_ERROR if decompressed mode is set and Brotli is not"]
    #[doc = "     available, @ref JXL_DEC_SUCCESS otherwise."]
    pub fn JxlDecoderSetDecompressBoxes(
        dec: *mut JxlDecoder,
        decompress: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Outputs the type of the current box, after a @ref JXL_DEC_BOX event occured,"]
    #[doc = " as 4 characters without null termination character. In case of a compressed"]
    #[doc = " \"brob\" box, this will return \"brob\" if the decompressed argument is"]
    #[doc = " JXL_FALSE, or the underlying box type if the decompressed argument is"]
    #[doc = " JXL_TRUE."]
    #[doc = ""]
    #[doc = " The following box types are currently described in ISO/IEC 18181-2:"]
    #[doc = "  - \"Exif\": a box with EXIF metadata.  Starts with a 4-byte tiff header offset"]
    #[doc = "    (big-endian uint32) that indicates the start of the actual EXIF data"]
    #[doc = "    (which starts with a tiff header). Usually the offset will be zero and the"]
    #[doc = "    EXIF data starts immediately after the offset field. The Exif orientation"]
    #[doc = "    should be ignored by applications; the JPEG XL codestream orientation"]
    #[doc = "    takes precedence and libjxl will by default apply the correct orientation"]
    #[doc = "    automatically (see @ref JxlDecoderSetKeepOrientation)."]
    #[doc = "  - \"xml \": a box with XML data, in particular XMP metadata."]
    #[doc = "  - \"jumb\": a JUMBF superbox (JPEG Universal Metadata Box Format, ISO/IEC"]
    #[doc = "    19566-5)."]
    #[doc = "  - \"JXL \": mandatory signature box, must come first, 12 bytes long including"]
    #[doc = "    the box header"]
    #[doc = "  - \"ftyp\": a second mandatory signature box, must come second, 20 bytes long"]
    #[doc = "    including the box header"]
    #[doc = "  - \"jxll\": a JXL level box. This indicates if the codestream is level 5 or"]
    #[doc = "    level 10 compatible. If not present, it is level 5. Level 10 allows more"]
    #[doc = "    features such as very high image resolution and bit-depths above 16 bits"]
    #[doc = "    per channel. Added automatically by the encoder when"]
    #[doc = "    JxlEncoderSetCodestreamLevel is used"]
    #[doc = "  - \"jxlc\": a box with the image codestream, in case the codestream is not"]
    #[doc = "    split across multiple boxes. The codestream contains the JPEG XL image"]
    #[doc = "    itself, including the basic info such as image dimensions, ICC color"]
    #[doc = "    profile, and all the pixel data of all the image frames."]
    #[doc = "  - \"jxlp\": a codestream box in case it is split across multiple boxes."]
    #[doc = "    The contents are the same as in case of a jxlc box, when concatenated."]
    #[doc = "  - \"brob\": a Brotli-compressed box, which otherwise represents an existing"]
    #[doc = "    type of box such as Exif or \"xml \". When @ref JxlDecoderSetDecompressBoxes"]
    #[doc = "    is set to JXL_TRUE, these boxes will be transparently decompressed by the"]
    #[doc = "    decoder."]
    #[doc = "  - \"jxli\": frame index box, can list the keyframes in case of a JPEG XL"]
    #[doc = "    animation allowing the decoder to jump to individual frames more"]
    #[doc = "    efficiently."]
    #[doc = "  - \"jbrd\": JPEG reconstruction box, contains the information required to"]
    #[doc = "    byte-for-byte losslessly recontruct a JPEG-1 image. The JPEG DCT"]
    #[doc = "    coefficients (pixel content) themselves as well as the ICC profile are"]
    #[doc = "    encoded in the JXL codestream (jxlc or jxlp) itself. EXIF, XMP and JUMBF"]
    #[doc = "    metadata is encoded in the corresponding boxes. The jbrd box itself"]
    #[doc = "    contains information such as the remaining app markers of the JPEG-1 file"]
    #[doc = "    and everything else required to fit the information together into the"]
    #[doc = "    exact original JPEG file."]
    #[doc = ""]
    #[doc = " Other application-specific boxes can exist. Their typename should not begin"]
    #[doc = " with \"jxl\" or \"JXL\" or conflict with other existing typenames."]
    #[doc = ""]
    #[doc = " The signature, jxl* and jbrd boxes are processed by the decoder and would"]
    #[doc = " typically be ignored by applications. The typical way to use this function is"]
    #[doc = " to check if an encountered box contains metadata that the application is"]
    #[doc = " interested in (e.g. EXIF or XMP metadata), in order to conditionally set a"]
    #[doc = " box buffer."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param type buffer to copy the type into"]
    #[doc = " @param decompressed which box type to get: JXL_FALSE to get the raw box type,"]
    #[doc = "     which can be \"brob\", JXL_TRUE, get the underlying box type."]
    #[doc = " @return @ref JXL_DEC_SUCCESS if the value is available, @ref JXL_DEC_ERROR if"]
    #[doc = "     not, for example the JXL file does not use the container format."]
    pub fn JxlDecoderGetBoxType(
        dec: *mut JxlDecoder,
        type_: *mut ::std::os::raw::c_char,
        decompressed: ::std::os::raw::c_int,
    ) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Returns the size of a box as it appears in the container file, after the @ref"]
    #[doc = " JXL_DEC_BOX event. For a non-compressed box, this is the size of the"]
    #[doc = " contents, excluding the 4 bytes indicating the box type. For a compressed"]
    #[doc = " \"brob\" box, this is the size of the compressed box contents plus the"]
    #[doc = " additional 4 byte indicating the underlying box type, but excluding the 4"]
    #[doc = " bytes indicating \"brob\". This function gives the size of the data that will"]
    #[doc = " be written in the output buffer when getting boxes in the default raw"]
    #[doc = " compressed mode. When @ref JxlDecoderSetDecompressBoxes is enabled, the"]
    #[doc = " return value of function does not change, and the decompressed size is not"]
    #[doc = " known before it has already been decompressed and output."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param size raw size of the box in bytes"]
    #[doc = " @return @ref JXL_DEC_ERROR if no box size is available, @ref JXL_DEC_SUCCESS"]
    #[doc = "     otherwise."]
    pub fn JxlDecoderGetBoxSizeRaw(dec: *const JxlDecoder, size: *mut u64) -> JxlDecoderStatus;
}
extern "C" {
    #[doc = " Configures at which progressive steps in frame decoding these @ref"]
    #[doc = " JXL_DEC_FRAME_PROGRESSION event occurs. The default value for the level"]
    #[doc = " of detail if this function is never called is `kDC`."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @param detail at which level of detail to trigger @ref"]
    #[doc = "     JXL_DEC_FRAME_PROGRESSION"]
    #[doc = " @return @ref JXL_DEC_SUCCESS on success, @ref JXL_DEC_ERROR on error, such as"]
    #[doc = "     an invalid value for the progressive detail."]
    pub fn JxlDecoderSetProgressiveDetail(
        dec: *mut JxlDecoder,
        detail: JxlProgressiveDetail,
    ) -> 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 @ref"]
    #[doc = " JxlDecoderSetImageOutBuffer will contain partial image data."]
    #[doc = ""]
    #[doc = " Can be called when @ref JxlDecoderProcessInput returns @ref"]
    #[doc = " JXL_DEC_NEED_MORE_INPUT, after the @ref JXL_DEC_FRAME event already occurred"]
    #[doc = " and before the @ref JXL_DEC_FULL_IMAGE event occurred for a frame."]
    #[doc = ""]
    #[doc = " @param dec decoder object"]
    #[doc = " @return @ref JXL_DEC_SUCCESS if image data was flushed to the output buffer,"]
    #[doc = "     or @ref JXL_DEC_ERROR when no flush was done, e.g. if not enough image"]
    #[doc = "     data was available yet even for flush, or no output buffer was set yet."]
    #[doc = "     This error is not fatal, it only indicates no flushed image is available"]
    #[doc = "     right now. Regular 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 JxlEncoderFrameSettingsStruct {
    _unused: [u8; 0],
}
#[doc = " Settings and metadata for a single image frame. This includes encoder options"]
#[doc = " for a frame such as compression quality and speed."]
#[doc = ""]
#[doc = " Allocated and initialized with JxlEncoderFrameSettingsCreate()."]
#[doc = " Cleaned up and deallocated when the encoder is destroyed with"]
#[doc = " JxlEncoderDestroy()."]
pub type JxlEncoderFrameSettings = JxlEncoderFrameSettingsStruct;
#[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 = " DEPRECATED: the encoder does not return this status and there is no need"]
#[doc = " to handle or expect it."]
#[doc = " Instead, JXL_ENC_ERROR is returned with error condition"]
#[doc = " JXL_ENC_ERR_NOT_SUPPORTED."]
pub const JXL_ENC_NOT_SUPPORTED: JxlEncoderStatus = 3;
#[doc = " Return value for multiple encoder functions."]
pub type JxlEncoderStatus = ::std::os::raw::c_uint;
#[doc = " No error"]
pub const JXL_ENC_ERR_OK: JxlEncoderError = 0;
#[doc = " Generic encoder error due to unspecified cause"]
pub const JXL_ENC_ERR_GENERIC: JxlEncoderError = 1;
#[doc = " Out of memory"]
#[doc = "  TODO(jon): actually catch this and return this error"]
pub const JXL_ENC_ERR_OOM: JxlEncoderError = 2;
#[doc = " JPEG bitstream reconstruction data could not be"]
#[doc = "  represented (e.g. too much tail data)"]
pub const JXL_ENC_ERR_JBRD: JxlEncoderError = 3;
#[doc = " Input is invalid (e.g. corrupt JPEG file or ICC profile)"]
pub const JXL_ENC_ERR_BAD_INPUT: JxlEncoderError = 4;
#[doc = " The encoder doesn't (yet) support this. Either no version of libjxl"]
#[doc = " supports this, and the API is used incorrectly, or the libjxl version"]
#[doc = " should have been checked before trying to do this."]
pub const JXL_ENC_ERR_NOT_SUPPORTED: JxlEncoderError = 128;
#[doc = " The encoder API is used in an incorrect way."]
#[doc = "  In this case, a debug build of libjxl should output a specific error"]
#[doc = " message. (if not, please open an issue about it)"]
pub const JXL_ENC_ERR_API_USAGE: JxlEncoderError = 129;
#[doc = " Error conditions:"]
#[doc = " API usage errors have the 0x80 bit set to 1"]
#[doc = " Other errors have the 0x80 bit set to 0"]
pub type JxlEncoderError = ::std::os::raw::c_uint;
#[doc = " Sets encoder effort/speed level without affecting decoding speed. Valid"]
#[doc = " values are, from faster to slower speed: 1:lightning 2:thunder 3:falcon"]
#[doc = " 4:cheetah 5:hare 6:wombat 7:squirrel 8:kitten 9:tortoise."]
#[doc = " Default: squirrel (7)."]
pub const JXL_ENC_FRAME_SETTING_EFFORT: JxlEncoderFrameSettingId = 0;
#[doc = " Sets the decoding speed tier for the provided options. Minimum is 0"]
#[doc = " (slowest to decode, best quality/density), and maximum is 4 (fastest to"]
#[doc = " decode, at the cost of some quality/density). Default is 0."]
pub const JXL_ENC_FRAME_SETTING_DECODING_SPEED: JxlEncoderFrameSettingId = 1;
#[doc = " Sets resampling option. If enabled, the image is downsampled before"]
#[doc = " compression, and upsampled to original size in the decoder. Integer option,"]
#[doc = " use -1 for the default behavior (resampling only applied for low quality),"]
#[doc = " 1 for no downsampling (1x1), 2 for 2x2 downsampling, 4 for 4x4"]
#[doc = " downsampling, 8 for 8x8 downsampling."]
pub const JXL_ENC_FRAME_SETTING_RESAMPLING: JxlEncoderFrameSettingId = 2;
#[doc = " Similar to JXL_ENC_FRAME_SETTING_RESAMPLING, but for extra channels."]
#[doc = " Integer option, use -1 for the default behavior (depends on encoder"]
#[doc = " implementation), 1 for no downsampling (1x1), 2 for 2x2 downsampling, 4 for"]
#[doc = " 4x4 downsampling, 8 for 8x8 downsampling."]
pub const JXL_ENC_FRAME_SETTING_EXTRA_CHANNEL_RESAMPLING: JxlEncoderFrameSettingId = 3;
#[doc = " Indicates the frame added with @ref JxlEncoderAddImageFrame is already"]
#[doc = " downsampled by the downsampling factor set with @ref"]
#[doc = " JXL_ENC_FRAME_SETTING_RESAMPLING. The input frame must then be given in the"]
#[doc = " downsampled resolution, not the full image resolution. The downsampled"]
#[doc = " resolution is given by ceil(xsize / resampling), ceil(ysize / resampling)"]
#[doc = " with xsize and ysize the dimensions given in the basic info, and resampling"]
#[doc = " the factor set with @ref JXL_ENC_FRAME_SETTING_RESAMPLING."]
#[doc = " Use 0 to disable, 1 to enable. Default value is 0."]
pub const JXL_ENC_FRAME_SETTING_ALREADY_DOWNSAMPLED: JxlEncoderFrameSettingId = 4;
#[doc = " Adds noise to the image emulating photographic film noise, the higher the"]
#[doc = " given number, the grainier the image will be. As an example, a value of 100"]
#[doc = " gives low noise whereas a value of 3200 gives a lot of noise. The default"]
#[doc = " value is 0."]
pub const JXL_ENC_FRAME_SETTING_PHOTON_NOISE: JxlEncoderFrameSettingId = 5;
#[doc = " Enables adaptive noise generation. This setting is not recommended for"]
#[doc = " use, please use JXL_ENC_FRAME_SETTING_PHOTON_NOISE instead. Use -1 for the"]
#[doc = " default (encoder chooses), 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_NOISE: JxlEncoderFrameSettingId = 6;
#[doc = " Enables or disables dots generation. Use -1 for the default (encoder"]
#[doc = " chooses), 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_DOTS: JxlEncoderFrameSettingId = 7;
#[doc = " Enables or disables patches generation. Use -1 for the default (encoder"]
#[doc = " chooses), 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_PATCHES: JxlEncoderFrameSettingId = 8;
#[doc = " Edge preserving filter level, -1 to 3. Use -1 for the default (encoder"]
#[doc = " chooses), 0 to 3 to set a strength."]
pub const JXL_ENC_FRAME_SETTING_EPF: JxlEncoderFrameSettingId = 9;
#[doc = " Enables or disables the gaborish filter. Use -1 for the default (encoder"]
#[doc = " chooses), 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_GABORISH: JxlEncoderFrameSettingId = 10;
#[doc = " Enables modular encoding. Use -1 for default (encoder"]
#[doc = " chooses), 0 to enforce VarDCT mode (e.g. for photographic images), 1 to"]
#[doc = " enforce modular mode (e.g. for lossless images)."]
pub const JXL_ENC_FRAME_SETTING_MODULAR: JxlEncoderFrameSettingId = 11;
#[doc = " Enables or disables preserving color of invisible pixels. Use -1 for the"]
#[doc = " default (1 if lossless, 0 if lossy), 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_KEEP_INVISIBLE: JxlEncoderFrameSettingId = 12;
#[doc = " Determines the order in which 256x256 regions are stored in the codestream"]
#[doc = " for progressive rendering. Use -1 for the encoder"]
#[doc = " default, 0 for scanline order, 1 for center-first order."]
pub const JXL_ENC_FRAME_SETTING_GROUP_ORDER: JxlEncoderFrameSettingId = 13;
#[doc = " Determines the horizontal position of center for the center-first group"]
#[doc = " order. Use -1 to automatically use the middle of the image, 0..xsize to"]
#[doc = " specifically set it."]
pub const JXL_ENC_FRAME_SETTING_GROUP_ORDER_CENTER_X: JxlEncoderFrameSettingId = 14;
#[doc = " Determines the center for the center-first group order. Use -1 to"]
#[doc = " automatically use the middle of the image, 0..ysize to specifically set it."]
pub const JXL_ENC_FRAME_SETTING_GROUP_ORDER_CENTER_Y: JxlEncoderFrameSettingId = 15;
#[doc = " Enables or disables progressive encoding for modular mode. Use -1 for the"]
#[doc = " encoder default, 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_RESPONSIVE: JxlEncoderFrameSettingId = 16;
#[doc = " Set the progressive mode for the AC coefficients of VarDCT, using spectral"]
#[doc = " progression from the DCT coefficients. Use -1 for the encoder default, 0 to"]
#[doc = " disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_PROGRESSIVE_AC: JxlEncoderFrameSettingId = 17;
#[doc = " Set the progressive mode for the AC coefficients of VarDCT, using"]
#[doc = " quantization of the least significant bits. Use -1 for the encoder default,"]
#[doc = " 0 to disable, 1 to enable."]
pub const JXL_ENC_FRAME_SETTING_QPROGRESSIVE_AC: JxlEncoderFrameSettingId = 18;
#[doc = " Set the progressive mode using lower-resolution DC images for VarDCT. Use"]
#[doc = " -1 for the encoder default, 0 to disable, 1 to have an extra 64x64 lower"]
#[doc = " resolution pass, 2 to have a 512x512 and 64x64 lower resolution pass."]
pub const JXL_ENC_FRAME_SETTING_PROGRESSIVE_DC: JxlEncoderFrameSettingId = 19;
#[doc = " Use Global channel palette if the amount of colors is smaller than this"]
#[doc = " percentage of range. Use 0-100 to set an explicit percentage, -1 to use the"]
#[doc = " encoder default. Used for modular encoding."]
pub const JXL_ENC_FRAME_SETTING_CHANNEL_COLORS_GLOBAL_PERCENT: JxlEncoderFrameSettingId = 20;
#[doc = " Use Local (per-group) channel palette if the amount of colors is smaller"]
#[doc = " than this percentage of range. Use 0-100 to set an explicit percentage, -1"]
#[doc = " to use the encoder default. Used for modular encoding."]
pub const JXL_ENC_FRAME_SETTING_CHANNEL_COLORS_GROUP_PERCENT: JxlEncoderFrameSettingId = 21;
#[doc = " Use color palette if amount of colors is smaller than or equal to this"]
#[doc = " amount, or -1 to use the encoder default. Used for modular encoding."]
pub const JXL_ENC_FRAME_SETTING_PALETTE_COLORS: JxlEncoderFrameSettingId = 22;
#[doc = " Enables or disables delta palette. Use -1 for the default (encoder"]
#[doc = " chooses), 0 to disable, 1 to enable. Used in modular mode."]
pub const JXL_ENC_FRAME_SETTING_LOSSY_PALETTE: JxlEncoderFrameSettingId = 23;
#[doc = " Color transform for internal encoding: -1 = default, 0=XYB, 1=none (RGB),"]
#[doc = " 2=YCbCr. The XYB setting performs the forward XYB transform. None and"]
#[doc = " YCbCr both perform no transform, but YCbCr is used to indicate that the"]
#[doc = " encoded data losslessly represents YCbCr values."]
pub const JXL_ENC_FRAME_SETTING_COLOR_TRANSFORM: JxlEncoderFrameSettingId = 24;
#[doc = " Reversible color transform for modular encoding: -1=default, 0-41=RCT"]
#[doc = " index, e.g. index 0 = none, index 6 = YCoCg."]
#[doc = " If this option is set to a non-default value, the RCT will be globally"]
#[doc = " applied to the whole frame."]
#[doc = " The default behavior is to try several RCTs locally per modular group,"]
#[doc = " depending on the speed and distance setting."]
pub const JXL_ENC_FRAME_SETTING_MODULAR_COLOR_SPACE: JxlEncoderFrameSettingId = 25;
#[doc = " Group size for modular encoding: -1=default, 0=128, 1=256, 2=512, 3=1024."]
pub const JXL_ENC_FRAME_SETTING_MODULAR_GROUP_SIZE: JxlEncoderFrameSettingId = 26;
#[doc = " Predictor for modular encoding. -1 = default, 0=zero, 1=left, 2=top,"]
#[doc = " 3=avg0, 4=select, 5=gradient, 6=weighted, 7=topright, 8=topleft,"]
#[doc = " 9=leftleft, 10=avg1, 11=avg2, 12=avg3, 13=toptop predictive average 14=mix"]
#[doc = " 5 and 6, 15=mix everything."]
pub const JXL_ENC_FRAME_SETTING_MODULAR_PREDICTOR: JxlEncoderFrameSettingId = 27;
#[doc = " Fraction of pixels used to learn MA trees as a percentage. -1 = default,"]
#[doc = " 0 = no MA and fast decode, 50 = default value, 100 = all, values above"]
#[doc = " 100 are also permitted. Higher values use more encoder memory."]
pub const JXL_ENC_FRAME_SETTING_MODULAR_MA_TREE_LEARNING_PERCENT: JxlEncoderFrameSettingId = 28;
#[doc = " Number of extra (previous-channel) MA tree properties to use. -1 ="]
#[doc = " default, 0-11 = valid values. Recommended values are in the range 0 to 3,"]
#[doc = " or 0 to amount of channels minus 1 (including all extra channels, and"]
#[doc = " excluding color channels when using VarDCT mode). Higher value gives slower"]
#[doc = " encoding and slower decoding."]
pub const JXL_ENC_FRAME_SETTING_MODULAR_NB_PREV_CHANNELS: JxlEncoderFrameSettingId = 29;
#[doc = " Enable or disable CFL (chroma-from-luma) for lossless JPEG recompression."]
#[doc = " -1 = default, 0 = disable CFL, 1 = enable CFL."]
pub const JXL_ENC_FRAME_SETTING_JPEG_RECON_CFL: JxlEncoderFrameSettingId = 30;
#[doc = " Prepare the frame for indexing in the frame index box."]
#[doc = " 0 = ignore this frame (same as not setting a value),"]
#[doc = " 1 = index this frame within the Frame Index Box."]
#[doc = " If any frames are indexed, the first frame needs to"]
#[doc = " be indexed, too. If the first frame is not indexed, and"]
#[doc = " a later frame is attempted to be indexed, JXL_ENC_ERROR will occur."]
#[doc = " If non-keyframes, i.e., frames with cropping, blending or patches are"]
#[doc = " attempted to be indexed, JXL_ENC_ERROR will occur."]
pub const JXL_ENC_FRAME_INDEX_BOX: JxlEncoderFrameSettingId = 31;
#[doc = " Sets brotli encode effort for use in JPEG recompression and compressed"]
#[doc = " metadata boxes (brob). Can be -1 (default) or 0 (fastest) to 11 (slowest)."]
#[doc = " Default is based on the general encode effort in case of JPEG"]
#[doc = " recompression, and 4 for brob boxes."]
pub const JXL_ENC_FRAME_SETTING_BROTLI_EFFORT: JxlEncoderFrameSettingId = 32;
#[doc = " Enum value not to be used as an option. This value is added to force the"]
#[doc = " C compiler to have the enum to take a known size."]
pub const JXL_ENC_FRAME_SETTING_FILL_ENUM: JxlEncoderFrameSettingId = 65535;
#[doc = " Id of encoder options for a frame. This includes options such as setting"]
#[doc = " encoding effort/speed or overriding the use of certain coding tools, for this"]
#[doc = " frame. This does not include non-frame related encoder options such as for"]
#[doc = " boxes."]
pub type JxlEncoderFrameSettingId = ::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 = " Sets the color management system (CMS) that will be used for color conversion"]
    #[doc = " (if applicable) during encoding. May only be set before starting encoding. If"]
    #[doc = " left unset, the default CMS implementation will be used."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param cms structure representing a CMS implementation. See JxlCmsInterface"]
    #[doc = " for more details."]
    pub fn JxlEncoderSetCms(enc: *mut JxlEncoder, cms: JxlCmsInterface);
}
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 = " Get the (last) error code in case JXL_ENC_ERROR was returned."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @return the JxlEncoderError that caused the (last) JXL_ENC_ERROR to be"]
    #[doc = " returned."]
    pub fn JxlEncoderGetError(enc: *mut JxlEncoder) -> JxlEncoderError;
}
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 = " This encodes the frames and/or boxes added so far. If the last frame or last"]
    #[doc = " box has been added, @ref JxlEncoderCloseInput, @ref JxlEncoderCloseFrames"]
    #[doc = " and/or @ref JxlEncoderCloseBoxes must be called before the next"]
    #[doc = " @ref JxlEncoderProcessOutput call, or the codestream won't be encoded"]
    #[doc = " correctly."]
    #[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 frame information for this frame to the encoder. This includes"]
    #[doc = " animation information such as frame duration to store in the frame header."]
    #[doc = " The frame header fields represent the frame as passed to the encoder, but not"]
    #[doc = " necessarily the exact values as they will be encoded file format: the encoder"]
    #[doc = " could change crop and blending options of a frame for more efficient encoding"]
    #[doc = " or introduce additional internal frames. Animation duration and time code"]
    #[doc = " information is not altered since those are immutable metadata of the frame."]
    #[doc = ""]
    #[doc = " It is not required to use this function, however if have_animation is set"]
    #[doc = " to true in the basic info, then this function should be used to set the"]
    #[doc = " time duration of this individual frame. By default individual frames have a"]
    #[doc = " time duration of 0, making them form a composite still. See @ref"]
    #[doc = " JxlFrameHeader for more information."]
    #[doc = ""]
    #[doc = " This information is stored in the JxlEncoderFrameSettings and so is used for"]
    #[doc = " any frame encoded with these JxlEncoderFrameSettings. It is ok to change"]
    #[doc = " between @ref JxlEncoderAddImageFrame calls, each added image frame will have"]
    #[doc = " the frame header that was set in the options at the time of calling"]
    #[doc = " JxlEncoderAddImageFrame."]
    #[doc = ""]
    #[doc = " The is_last and name_length fields of the JxlFrameHeader are ignored, use"]
    #[doc = " @ref JxlEncoderCloseFrames to indicate last frame, and @ref"]
    #[doc = " JxlEncoderSetFrameName to indicate the name and its length instead."]
    #[doc = " Calling this function will clear any name that was previously set with @ref"]
    #[doc = " JxlEncoderSetFrameName."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param frame_header frame header data to set. Object owned by the caller and"]
    #[doc = " does not need to be kept in memory, its information is copied internally."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderSetFrameHeader(
        frame_settings: *mut JxlEncoderFrameSettings,
        frame_header: *const JxlFrameHeader,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets blend info of an extra channel. The blend info of extra channels is set"]
    #[doc = " separately from that of the color channels, the color channels are set with"]
    #[doc = " @ref JxlEncoderSetFrameHeader."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param index index of the extra channel to use."]
    #[doc = " @param blend_info blend info to set for the extra channel"]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderSetExtraChannelBlendInfo(
        frame_settings: *mut JxlEncoderFrameSettings,
        index: usize,
        blend_info: *const JxlBlendInfo,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the name of the animation frame. This function is optional, frames are"]
    #[doc = " not required to have a name. This setting is a part of the frame header, and"]
    #[doc = " the same principles as for @ref JxlEncoderSetFrameHeader apply. The"]
    #[doc = " name_length field of JxlFrameHeader is ignored by the encoder, this function"]
    #[doc = " determines the name length instead as the length in bytes of the C string."]
    #[doc = ""]
    #[doc = " The maximum possible name length is 1071 bytes (excluding terminating null"]
    #[doc = " character)."]
    #[doc = ""]
    #[doc = " Calling @ref JxlEncoderSetFrameHeader clears any name that was"]
    #[doc = " previously set."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param frame_name name of the next frame to be encoded, as a UTF-8 encoded C"]
    #[doc = " string (zero terminated). Owned by the caller, and copied internally."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderSetFrameName(
        frame_settings: *mut JxlEncoderFrameSettings,
        frame_name: *const ::std::os::raw::c_char,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to read JPEG encoded bytes from for the next frame to encode."]
    #[doc = ""]
    #[doc = " If JxlEncoderSetBasicInfo has not yet been called, calling"]
    #[doc = " JxlEncoderAddJPEGFrame will implicitly call it with the parameters of the"]
    #[doc = " added JPEG frame."]
    #[doc = ""]
    #[doc = " If JxlEncoderSetColorEncoding or JxlEncoderSetICCProfile has not yet been"]
    #[doc = " called, calling JxlEncoderAddJPEGFrame will implicitly call it with the"]
    #[doc = " parameters of the added JPEG frame."]
    #[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 = " If this is the last frame, @ref JxlEncoderCloseInput or @ref"]
    #[doc = " JxlEncoderCloseFrames must be called before the next"]
    #[doc = " @ref JxlEncoderProcessOutput call."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[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(
        frame_settings: *const JxlEncoderFrameSettings,
        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 = " JxlEncoderSetBasicInfo before JxlEncoderAddImageFrame."]
    #[doc = ""]
    #[doc = " Currently only some data types for pixel formats are supported:"]
    #[doc = " - JXL_TYPE_UINT8, with range 0..255"]
    #[doc = " - JXL_TYPE_UINT16, with range 0..65535"]
    #[doc = " - JXL_TYPE_FLOAT16, with nominal range 0..1"]
    #[doc = " - JXL_TYPE_FLOAT, with nominal range 0..1"]
    #[doc = ""]
    #[doc = " Note: the sample data type in pixel_format is allowed to be different from"]
    #[doc = " what is described in the JxlBasicInfo. The type in pixel_format describes the"]
    #[doc = " format of the uncompressed pixel buffer. The bits_per_sample and"]
    #[doc = " exponent_bits_per_sample in the JxlBasicInfo describes what will actually be"]
    #[doc = " encoded in the JPEG XL codestream. For example, to encode a 12-bit image, you"]
    #[doc = " would set bits_per_sample to 12, and you could use e.g. JXL_TYPE_UINT16"]
    #[doc = " (where the values are rescaled to 16-bit, i.e. multiplied by 65535/4095) or"]
    #[doc = " JXL_TYPE_FLOAT (where the values are rescaled to 0..1, i.e. multiplied"]
    #[doc = " by 1.f/4095.f). While it is allowed, it is obviously not recommended to use a"]
    #[doc = " pixel_format with lower precision than what is specified in the JxlBasicInfo."]
    #[doc = ""]
    #[doc = " We support interleaved channels as described by the JxlPixelFormat:"]
    #[doc = " - single-channel data, e.g. grayscale"]
    #[doc = " - single-channel + alpha"]
    #[doc = " - trichromatic, e.g. RGB"]
    #[doc = " - trichromatic + alpha"]
    #[doc = ""]
    #[doc = " Extra channels not handled here need to be set by @ref"]
    #[doc = " JxlEncoderSetExtraChannelBuffer."]
    #[doc = " If the image has alpha, and alpha is not passed here, it will implicitly be"]
    #[doc = " set to all-opaque (an alpha value of 1.0 everywhere)."]
    #[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, JXL_TYPE_UINT16), and linear"]
    #[doc = " sRGB for floating point data types (JXL_TYPE_FLOAT16, JXL_TYPE_FLOAT)."]
    #[doc = " Sample values in floating-point pixel formats are allowed to be outside the"]
    #[doc = " nominal range, e.g. to represent out-of-sRGB-gamut colors in the"]
    #[doc = " uses_original_profile=false case. They are however not allowed to be NaN or"]
    #[doc = " +-infinity."]
    #[doc = ""]
    #[doc = " If this is the last frame, @ref JxlEncoderCloseInput or @ref"]
    #[doc = " JxlEncoderCloseFrames must be called before the next"]
    #[doc = " @ref JxlEncoderProcessOutput call."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[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. This size should match what is implied"]
    #[doc = " by the frame dimensions and the pixel format."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderAddImageFrame(
        frame_settings: *const JxlEncoderFrameSettings,
        pixel_format: *const JxlPixelFormat,
        buffer: *const ::std::os::raw::c_void,
        size: usize,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the buffer to read pixels from for an extra channel at a given index."]
    #[doc = " The index must be smaller than the num_extra_channels in the associated"]
    #[doc = " JxlBasicInfo. Must call @ref JxlEncoderSetExtraChannelInfo before"]
    #[doc = " JxlEncoderSetExtraChannelBuffer."]
    #[doc = ""]
    #[doc = " TODO(firsching): mention what data types in pixel formats are supported."]
    #[doc = ""]
    #[doc = " It is required to call this function for every extra channel, except for the"]
    #[doc = " alpha channel if that was already set through @ref JxlEncoderAddImageFrame."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param pixel_format format for pixels. Object owned by the caller and its"]
    #[doc = " contents are copied internally. The num_channels value is ignored, since the"]
    #[doc = " number of channels for an extra channel is always assumed to be one."]
    #[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. This size should match what is implied"]
    #[doc = " by the frame dimensions and the pixel format."]
    #[doc = " @param index index of the extra channel to use."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderSetExtraChannelBuffer(
        frame_settings: *const JxlEncoderFrameSettings,
        pixel_format: *const JxlPixelFormat,
        buffer: *const ::std::os::raw::c_void,
        size: usize,
        index: u32,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Adds a metadata box to the file format. JxlEncoderProcessOutput must be used"]
    #[doc = " to effectively write the box to the output. @ref JxlEncoderUseBoxes must"]
    #[doc = " be enabled before using this function."]
    #[doc = ""]
    #[doc = " Boxes allow inserting application-specific data and metadata (Exif, XML/XMP,"]
    #[doc = " JUMBF and user defined boxes)."]
    #[doc = ""]
    #[doc = " The box format follows ISO BMFF and shares features and box types with other"]
    #[doc = " image and video formats, including the Exif, XML and JUMBF boxes. The box"]
    #[doc = " format for JPEG XL is specified in ISO/IEC 18181-2."]
    #[doc = ""]
    #[doc = " Boxes in general don't contain other boxes inside, except a JUMBF superbox."]
    #[doc = " Boxes follow each other sequentially and are byte-aligned. If the container"]
    #[doc = " format is used, the JXL stream consists of concatenated boxes."]
    #[doc = " It is also possible to use a direct codestream without boxes, but in that"]
    #[doc = " case metadata cannot be added."]
    #[doc = ""]
    #[doc = " Each box generally has the following byte structure in the file:"]
    #[doc = " - 4 bytes: box size including box header (Big endian. If set to 0, an"]
    #[doc = "   8-byte 64-bit size follows instead)."]
    #[doc = " - 4 bytes: type, e.g. \"JXL \" for the signature box, \"jxlc\" for a codestream"]
    #[doc = "   box."]
    #[doc = " - N bytes: box contents."]
    #[doc = ""]
    #[doc = " Only the box contents are provided to the contents argument of this function,"]
    #[doc = " the encoder encodes the size header itself. Most boxes are written"]
    #[doc = " automatically by the encoder as needed (\"JXL \", \"ftyp\", \"jxll\", \"jxlc\","]
    #[doc = " \"jxlp\", \"jxli\", \"jbrd\"), and this function only needs to be called to add"]
    #[doc = " optional metadata when encoding from pixels (using JxlEncoderAddImageFrame)."]
    #[doc = " When recompressing JPEG files (using JxlEncoderAddJPEGFrame), if the input"]
    #[doc = " JPEG contains EXIF, XMP or JUMBF metadata, the corresponding boxes are"]
    #[doc = " already added automatically."]
    #[doc = ""]
    #[doc = " Box types are given by 4 characters. The following boxes can be added with"]
    #[doc = " this function:"]
    #[doc = " - \"Exif\": a box with EXIF metadata, can be added by libjxl users, or is"]
    #[doc = "   automatically added when needed for JPEG reconstruction. The contents of"]
    #[doc = "   this box must be prepended by a 4-byte tiff header offset, which may"]
    #[doc = "   be 4 zero bytes in case the tiff header follows immediately."]
    #[doc = "   The EXIF metadata must be in sync with what is encoded in the JPEG XL"]
    #[doc = "   codestream, specifically the image orientation. While this is not"]
    #[doc = "   recommended in practice, in case of conflicting metadata, the JPEG XL"]
    #[doc = "   codestream takes precedence."]
    #[doc = " - \"xml \": a box with XML data, in particular XMP metadata, can be added by"]
    #[doc = "   libjxl users, or is automatically added when needed for JPEG reconstruction"]
    #[doc = " - \"jumb\": a JUMBF superbox, which can contain boxes with different types of"]
    #[doc = "   metadata inside. This box type can be added by the encoder transparently,"]
    #[doc = "   and other libraries to create and handle JUMBF content exist."]
    #[doc = " - Application-specific boxes. Their typename should not begin with \"jxl\" or"]
    #[doc = "   \"JXL\" or conflict with other existing typenames, and they should be"]
    #[doc = "   registered with MP4RA (mp4ra.org)."]
    #[doc = ""]
    #[doc = " These boxes can be stored uncompressed or Brotli-compressed (using a \"brob\""]
    #[doc = " box), depending on the compress_box parameter."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param type the box type, e.g. \"Exif\" for EXIF metadata, \"xml \" for XMP or"]
    #[doc = " IPTC metadata, \"jumb\" for JUMBF metadata."]
    #[doc = " @param contents the full contents of the box, for example EXIF"]
    #[doc = " data. ISO BMFF box header must not be included, only the contents. Owned by"]
    #[doc = " the caller and its contents are copied internally."]
    #[doc = " @param size size of the box contents."]
    #[doc = " @param compress_box Whether to compress this box as a \"brob\" box. Requires"]
    #[doc = " Brotli support."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error, such as when"]
    #[doc = " using this function without JxlEncoderUseContainer, or adding a box type"]
    #[doc = " that would result in an invalid file format."]
    pub fn JxlEncoderAddBox(
        enc: *mut JxlEncoder,
        type_: *mut ::std::os::raw::c_char,
        contents: *const u8,
        size: usize,
        compress_box: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Indicates the intention to add metadata boxes. This allows @ref"]
    #[doc = " JxlEncoderAddBox to be used. When using this function, then it is required"]
    #[doc = " to use @ref JxlEncoderCloseBoxes at the end."]
    #[doc = ""]
    #[doc = " By default the encoder assumes no metadata boxes will be added."]
    #[doc = ""]
    #[doc = " This setting can only be set at the beginning, before encoding starts."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    pub fn JxlEncoderUseBoxes(enc: *mut JxlEncoder) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Declares that no further boxes will be added with @ref JxlEncoderAddBox."]
    #[doc = " This function must be called after the last box is added so the encoder knows"]
    #[doc = " the stream will be finished. It is not necessary to use this function if"]
    #[doc = " @ref JxlEncoderUseBoxes is not used. Further frames may still be added."]
    #[doc = ""]
    #[doc = " Must be called between JxlEncoderAddBox of the last box"]
    #[doc = " and the next call to JxlEncoderProcessOutput, or @ref JxlEncoderProcessOutput"]
    #[doc = " won't output the last box correctly."]
    #[doc = ""]
    #[doc = " NOTE: if you don't need to close frames and boxes at separate times, you can"]
    #[doc = " use @ref JxlEncoderCloseInput instead to close both at once."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    pub fn JxlEncoderCloseBoxes(enc: *mut JxlEncoder);
}
extern "C" {
    #[doc = " Declares that no frames will be added and @ref JxlEncoderAddImageFrame and"]
    #[doc = " @ref JxlEncoderAddJPEGFrame won't be called anymore. Further metadata boxes"]
    #[doc = " may still be added. This function or @ref JxlEncoderCloseInput must be called"]
    #[doc = " after adding the last frame and the next call to"]
    #[doc = " @ref JxlEncoderProcessOutput, or the frame won't be properly marked as last."]
    #[doc = ""]
    #[doc = " NOTE: if you don't need to close frames and boxes at separate times, you can"]
    #[doc = " use @ref JxlEncoderCloseInput instead to close both at once."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    pub fn JxlEncoderCloseFrames(enc: *mut JxlEncoder);
}
extern "C" {
    #[doc = " Closes any input to the encoder, equivalent to calling JxlEncoderCloseFrames"]
    #[doc = " as well as calling JxlEncoderCloseBoxes if needed. No further input of any"]
    #[doc = " kind may be given to the encoder, but further @ref JxlEncoderProcessOutput"]
    #[doc = " calls should be done to create the final output."]
    #[doc = ""]
    #[doc = " The requirements of both @ref JxlEncoderCloseFrames and @ref"]
    #[doc = " JxlEncoderCloseBoxes apply to this function. Either this function or the"]
    #[doc = " other two must be called after the final frame and/or box, and the next"]
    #[doc = " @ref JxlEncoderProcessOutput call, or the codestream won't be encoded"]
    #[doc = " 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 = " Must be called after JxlEncoderSetBasicInfo."]
    #[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 = " Must be called after JxlEncoderSetBasicInfo."]
    #[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 = " Initializes a JxlBasicInfo struct to default values."]
    #[doc = " For forwards-compatibility, this function has to be called before values"]
    #[doc = " are assigned to the struct fields."]
    #[doc = " The default values correspond to an 8-bit RGB image, no alpha or any"]
    #[doc = " other extra channels."]
    #[doc = ""]
    #[doc = " @param info global image metadata. Object owned by the caller."]
    pub fn JxlEncoderInitBasicInfo(info: *mut JxlBasicInfo);
}
extern "C" {
    #[doc = " Initializes a JxlFrameHeader struct to default values."]
    #[doc = " For forwards-compatibility, this function has to be called before values"]
    #[doc = " are assigned to the struct fields."]
    #[doc = " The default values correspond to a frame with no animation duration and the"]
    #[doc = " 'replace' blend mode. After using this function, For animation duration must"]
    #[doc = " be set, for composite still blend settings must be set."]
    #[doc = ""]
    #[doc = " @param frame_header frame metadata. Object owned by the caller."]
    pub fn JxlEncoderInitFrameHeader(frame_header: *mut JxlFrameHeader);
}
extern "C" {
    #[doc = " Initializes a JxlBlendInfo struct to default values."]
    #[doc = " For forwards-compatibility, this function has to be called before values"]
    #[doc = " are assigned to the struct fields."]
    #[doc = ""]
    #[doc = " @param blend_info blending info. Object owned by the caller."]
    pub fn JxlEncoderInitBlendInfo(blend_info: *mut JxlBlendInfo);
}
extern "C" {
    #[doc = " Sets the global metadata of the image encoded by this encoder."]
    #[doc = ""]
    #[doc = " If the JxlBasicInfo contains information of extra channels beyond an alpha"]
    #[doc = " channel, then @ref JxlEncoderSetExtraChannelInfo must be called between"]
    #[doc = " JxlEncoderSetBasicInfo and @ref JxlEncoderAddImageFrame. In order to indicate"]
    #[doc = " extra channels, the value of `info.num_extra_channels` should be set to the"]
    #[doc = " number of extra channels, also counting the alpha channel if present."]
    #[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 = " Initializes a JxlExtraChannelInfo struct to default values."]
    #[doc = " For forwards-compatibility, this function has to be called before values"]
    #[doc = " are assigned to the struct fields."]
    #[doc = " The default values correspond to an 8-bit channel of the provided type."]
    #[doc = ""]
    #[doc = " @param type type of the extra channel."]
    #[doc = " @param info global extra channel metadata. Object owned by the caller and its"]
    #[doc = " contents are copied internally."]
    pub fn JxlEncoderInitExtraChannelInfo(
        type_: JxlExtraChannelType,
        info: *mut JxlExtraChannelInfo,
    );
}
extern "C" {
    #[doc = " Sets information for the extra channel at the given index. The index"]
    #[doc = " must be smaller than num_extra_channels in the associated JxlBasicInfo."]
    #[doc = ""]
    #[doc = " @param enc encoder object"]
    #[doc = " @param index index of the extra channel to set."]
    #[doc = " @param info global extra channel metadata. Object owned by the caller and its"]
    #[doc = " contents are copied internally."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderSetExtraChannelInfo(
        enc: *mut JxlEncoder,
        index: usize,
        info: *const JxlExtraChannelInfo,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets the name for the extra channel at the given index in UTF-8. The index"]
    #[doc = " must be smaller than the num_extra_channels in the associated JxlBasicInfo."]
    #[doc = ""]
    #[doc = " TODO(lode): remove size parameter for consistency with"]
    #[doc = " JxlEncoderSetFrameName"]
    #[doc = ""]
    #[doc = " @param enc encoder object"]
    #[doc = " @param index index of the extra channel to set."]
    #[doc = " @param name buffer with the name of the extra channel."]
    #[doc = " @param size size of the name buffer in bytes, not counting the terminating"]
    #[doc = " character."]
    #[doc = " @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error"]
    pub fn JxlEncoderSetExtraChannelName(
        enc: *mut JxlEncoder,
        index: usize,
        name: *const ::std::os::raw::c_char,
        size: usize,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Sets a frame-specific option of integer type to the encoder options."]
    #[doc = " The JxlEncoderFrameSettingId argument determines which option is set."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param option ID of the option to set."]
    #[doc = " @param value Integer value to set for this option."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR in"]
    #[doc = " case of an error, such as invalid or unknown option id, or invalid integer"]
    #[doc = " value for the given option. If an error is returned, the state of the"]
    #[doc = " JxlEncoderFrameSettings object is still valid and is the same as before this"]
    #[doc = " function was called."]
    pub fn JxlEncoderFrameSettingsSetOption(
        frame_settings: *mut JxlEncoderFrameSettings,
        option: JxlEncoderFrameSettingId,
        value: i32,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Forces the encoder to use the box-based container format (BMFF) even"]
    #[doc = " when not necessary."]
    #[doc = ""]
    #[doc = " When using @ref JxlEncoderUseBoxes, @ref JxlEncoderStoreJPEGMetadata or @ref"]
    #[doc = " JxlEncoderSetCodestreamLevel with level 10, the encoder will automatically"]
    #[doc = " also use the container format, it is not necessary to use"]
    #[doc = " JxlEncoderUseContainer for those use cases."]
    #[doc = ""]
    #[doc = " By default this setting is disabled."]
    #[doc = ""]
    #[doc = " This setting can only be set at the beginning, before encoding starts."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param use_container true if the encoder should always output the JPEG XL"]
    #[doc = " container format, false to only output it when necessary."]
    #[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 = " Configure the encoder to store JPEG reconstruction metadata in the JPEG XL"]
    #[doc = " container."]
    #[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 = " This setting can only be set at the beginning, before encoding starts."]
    #[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 = " Sets the feature level of the JPEG XL codestream. Valid values are 5 and"]
    #[doc = " 10. Keeping the default value of 5 is recommended for compatibility with all"]
    #[doc = " decoders."]
    #[doc = ""]
    #[doc = " Level 5: for end-user image delivery, this level is the most widely"]
    #[doc = " supported level by image decoders and the recommended level to use unless a"]
    #[doc = " level 10 feature is absolutely necessary. Supports a maximum resolution"]
    #[doc = " 268435456 pixels total with a maximum width or height of 262144 pixels,"]
    #[doc = " maximum 16-bit color channel depth, maximum 120 frames per second for"]
    #[doc = " animation, maximum ICC color profile size of 4 MiB, it allows all color"]
    #[doc = " models and extra channel types except CMYK and the JXL_CHANNEL_BLACK extra"]
    #[doc = " channel, and a maximum of 4 extra channels in addition to the 3 color"]
    #[doc = " channels. It also sets boundaries to certain internally used coding tools."]
    #[doc = ""]
    #[doc = " Level 10: this level removes or increases the bounds of most of the level"]
    #[doc = " 5 limitations, allows CMYK color and up to 32 bits per color channel, but"]
    #[doc = " may be less widely supported."]
    #[doc = ""]
    #[doc = " The default value is 5. To use level 10 features, the setting must be"]
    #[doc = " explicitly set to 10, the encoder will not automatically enable it. If"]
    #[doc = " incompatible parameters such as too high image resolution for the current"]
    #[doc = " level are set, the encoder will return an error. For internal coding tools,"]
    #[doc = " the encoder will only use those compatible with the level setting."]
    #[doc = ""]
    #[doc = " This setting can only be set at the beginning, before encoding starts."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @param level the level value to set, must be 5 or 10."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderSetCodestreamLevel(
        enc: *mut JxlEncoder,
        level: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " Returns the codestream level required to support the currently configured"]
    #[doc = " settings and basic info. This function can only be used at the beginning,"]
    #[doc = " before encoding starts, but after setting basic info."]
    #[doc = ""]
    #[doc = " This does not support per-frame settings, only global configuration, such as"]
    #[doc = " the image dimensions, that are known at the time of writing the header of"]
    #[doc = " the JPEG XL file."]
    #[doc = ""]
    #[doc = " If this returns 5, nothing needs to be done and the codestream can be"]
    #[doc = " compatible with any decoder. If this returns 10, JxlEncoderSetCodestreamLevel"]
    #[doc = " has to be used to set the codestream level to 10, or the encoder can be"]
    #[doc = " configured differently to allow using the more compatible level 5."]
    #[doc = ""]
    #[doc = " @param enc encoder object."]
    #[doc = " @return -1 if no level can support the configuration (e.g. image dimensions"]
    #[doc = " larger than even level 10 supports), 5 if level 5 is supported, 10 if setting"]
    #[doc = " the codestream level to 10 is required."]
    #[doc = ""]
    pub fn JxlEncoderGetRequiredCodestreamLevel(enc: *const JxlEncoder) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Enables lossless encoding."]
    #[doc = ""]
    #[doc = " This is not an option like the others on itself, but rather while enabled it"]
    #[doc = " overrides a set of existing options (such as distance, modular mode and"]
    #[doc = " color transform) that enables bit-for-bit lossless encoding."]
    #[doc = ""]
    #[doc = " When disabled, those options are not overridden, but since those options"]
    #[doc = " could still have been manually set to a combination that operates losslessly,"]
    #[doc = " using this function with lossless set to JXL_DEC_FALSE does not guarantee"]
    #[doc = " lossy encoding, though the default set of options is lossy."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param lossless whether to override options for lossless mode"]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    pub fn JxlEncoderSetFrameLossless(
        frame_settings: *mut JxlEncoderFrameSettings,
        lossless: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " DEPRECATED: use JxlEncoderSetFrameLossless instead."]
    pub fn JxlEncoderOptionsSetLossless(
        arg1: *mut JxlEncoderFrameSettings,
        arg2: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param effort the effort value to set."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    #[doc = ""]
    #[doc = " DEPRECATED: use JxlEncoderFrameSettingsSetOption(frame_settings,"]
    #[doc = " JXL_ENC_FRAME_SETTING_EFFORT, effort) instead."]
    pub fn JxlEncoderOptionsSetEffort(
        frame_settings: *mut JxlEncoderFrameSettings,
        effort: ::std::os::raw::c_int,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[doc = " @param tier the decoding speed tier to set."]
    #[doc = " @return JXL_ENC_SUCCESS if the operation was successful, JXL_ENC_ERROR"]
    #[doc = " otherwise."]
    #[doc = ""]
    #[doc = " DEPRECATED: use JxlEncoderFrameSettingsSetOption(frame_settings,"]
    #[doc = " JXL_ENC_FRAME_SETTING_DECODING_SPEED, tier) instead."]
    pub fn JxlEncoderOptionsSetDecodingSpeed(
        frame_settings: *mut JxlEncoderFrameSettings,
        tier: ::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 JxlEncoderSetFrameLossless"]
    #[doc = " instead to use true lossless, as setting distance to 0 alone is not the only"]
    #[doc = " requirement). 1.0 = visually lossless. Recommended range: 0.5 .. 3.0. Default"]
    #[doc = " value: 1.0."]
    #[doc = ""]
    #[doc = " @param frame_settings set of options and metadata for this frame. Also"]
    #[doc = " includes reference to the encoder object."]
    #[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 JxlEncoderSetFrameDistance(
        frame_settings: *mut JxlEncoderFrameSettings,
        distance: f32,
    ) -> JxlEncoderStatus;
}
extern "C" {
    #[doc = " DEPRECATED: use JxlEncoderSetFrameDistance instead."]
    pub fn JxlEncoderOptionsSetDistance(
        arg1: *mut JxlEncoderFrameSettings,
        arg2: 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 JxlEncoderFrameSettings, only"]
    #[doc = " JxlEncoderFrameSettings created with this function for the same encoder"]
    #[doc = " instance 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 JxlEncoderFrameSettingsCreate(
        enc: *mut JxlEncoder,
        source: *const JxlEncoderFrameSettings,
    ) -> *mut JxlEncoderFrameSettings;
}
extern "C" {
    #[doc = " DEPRECATED: use JxlEncoderFrameSettingsCreate instead."]
    pub fn JxlEncoderOptionsCreate(
        arg1: *mut JxlEncoder,
        arg2: *const JxlEncoderFrameSettings,
    ) -> *mut JxlEncoderFrameSettings;
}
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,
    );
}