1language = "C++"
2include_guard = "AVIF_H"
3tab_width = 4
4usize_is_size_t = true
5namespace = "crabbyavif"
6# Some workarounds for cbindgen's potential limitations/bugs:
7# 1) In C++ mode, cbindgen balks on use of "Box" objects without this. This
8#    workaround of aliasing Box to T* comes from
9#    https://github.com/mozilla/cbindgen/blob/f1d5801d3b299fa2e87d176f03b605532f931cb6/tests/rust/box.toml.
10# 2) In C++ mode, cbindgen does not use the struct prefix for structs.  We need
11#    this so that we can have circular struct dependencies that use a pointer.
12#    So forward declare those structs which have a circular dependency.
13after_includes = """
14
15template <typename T>
16using Box = T*;
17namespace crabbyavif {
18struct avifImage;
19struct avifIO;
20}
21"""
22
23[export.rename]
24"ChromaDownsampling" = "avifChromaDownsampling"
25"ChromaSamplePosition" = "avifChromaSamplePosition"
26"ChromaUpsampling" = "avifChromaUpsampling"
27"ColorPrimaries" = "avifColorPrimaries"
28"Format" = "avifRGBFormat"
29"IOStats" = "avifIOStats"
30"ImageTiming" = "avifImageTiming"
31"MatrixCoefficients" = "avifMatrixCoefficients"
32"PixelFormat" = "avifPixelFormat"
33"ProgressiveState" = "avifProgressiveState"
34"Source" = "avifDecoderSource"
35"YuvRange" = "avifRange"
36"TransferCharacteristics" = "avifTransferCharacteristics"
37"AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE" = "CRABBY_AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE"
38"AVIF_FALSE" = "CRABBY_AVIF_FALSE"
39"AVIF_PLANE_COUNT_YUV" = "CRABBY_AVIF_PLANE_COUNT_YUV"
40"AVIF_REPETITION_COUNT_INFINITE" = "CRABBY_AVIF_REPETITION_COUNT_INFINITE"
41"AVIF_REPETITION_COUNT_UNKNOWN" = "CRABBY_AVIF_REPETITION_COUNT_UNKNOWN"
42"AVIF_TRUE" = "CRABBY_AVIF_TRUE"
43"DEFAULT_IMAGE_COUNT_LIMIT" = "CRABBY_AVIF_DEFAULT_IMAGE_COUNT_LIMIT"
44"DEFAULT_IMAGE_DIMENSION_LIMIT" = "CRABBY_AVIF_DEFAULT_IMAGE_DIMENSION_LIMIT"
45"DEFAULT_IMAGE_SIZE_LIMIT" = "CRABBY_AVIF_DEFAULT_IMAGE_SIZE_LIMIT"
46"MAX_AV1_LAYER_COUNT" = "CRABBY_AVIF_MAX_AV1_LAYER_COUNT"
47
48[enum]
49rename_variants = "QualifiedScreamingSnakeCase"
50enum_class = false
51
52[export]
53include = [
54  "avifChannelIndex",
55  "avifCodecFlag",
56  "avifCodecFlags",
57  "avifHeaderFormat",
58  "avifPlanesFlag",
59  "avifPlanesFlags",
60  "avifStrictFlag",
61]
62exclude = ["Box"]
63