Enum AvifItemRole
What an item of an AVIF file is to the image Load gives (design question 13).
public enum AvifItemRole
Fields
Alpha = 2The primary image's alpha, or part of it.
Auxiliary = 4Another auxiliary image of the primary image, such as a matte; see AuxiliaryType.
Depth = 3A depth map of the primary image (an auxiliary image of the depth type).
Derived = 6An image another image is made from or derived from it: a grid cell, an overlay layer, or the tmap item itself.
GainMap = 5The gain map image of a tone-mapped derived image (tmap).
Metadata = 7Metadata: an Exif or XMP item.
Other = 8Anything else.
Primary = 0The primary image, which Load gives.
Thumbnail = 1A thumbnail of the primary image (a thmb reference).
Examples
// Every item of the file, with what it is to the image Load gives: alpha, thumbnails, depth maps, grid cells, metadata.
using Raster image = Raster.Load("duck.avif");
IReadOnlyList<AvifItem> items = ((AvifDetails)image.Metadata.FormatDetails!).Items;
AvifItem primary = items.First(i => i.Role == AvifItemRole.Primary);
// Any image item decodes on its own, with its own color, such as a depth map or a thumbnail.
using Raster item = AvifImage.ReadItem("duck.avif", primary.Id);