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
//! The typed ISOBMFF/HEIF still-image box tree.
//!
//! These structs model the *structure* of a single-image ISOBMFF file — its `ftyp` brands and the
//! `meta` image items with their properties and payloads — and never the coded bitstream itself,
//! which stays opaque (carried as [`PropertyKind::CodecConfiguration`] and [`Item::payload`]). This
//! is the codec-agnostic layer both AVIF (`av01`/`av1C`) and HEIC (`hvc1`/`hvcC`) build on.
//!
//! [`crate::write`] serialises an [`IsoBmffImage`]; [`crate::read`] parses one back. The model is
//! normalised so the two are inverse for files this crate writes: it stores each item's resolved
//! [`payload`](Item::payload) (not raw `iloc` offsets) and its per-item [`properties`](Item::properties)
//! list (not raw `ipco` indices), so `read(&write(&img)) == img`.
/// A parsed or constructed ISOBMFF still-image file: its `ftyp` brands, the id of the primary
/// (displayed) item, and the image items.
/// One image item: its id, four-character type, optional name, the properties associated with it
/// (in association order), and its payload bytes.
/// An item property together with whether a reader must understand it to render the item
/// (`essential`, MIAF §7.3.6 / ISO/IEC 23008-12 §9.3.1). Transformative properties and the codec
/// configuration are essential; descriptive ones (`ispe`/`pixi`/`colr`) are not.
/// An item property box (`ipco` child). Recognised HEIF properties are modelled structurally; any
/// other property box (including a codec configuration) is carried verbatim so it round-trips.
/// The contents of a `colr` box. Only the `nclx` (CICP code points) form is modelled; an ICC
/// profile (`rICC`/`prof`) round-trips as [`PropertyKind::Other`] until a consumer needs it.
/// The `nclx` colour information written into a `colr` box (CICP code points, ITU-T H.273). For an
/// AV1 image `matrix_coefficients` and `full_range` must match the sequence header.