Table of Contents

Enum AvifItemRole

Namespace
Egami.Formats.Avif
Assembly
Egami.dll

What an item of an AVIF file is to the image Load gives (design question 13).

public enum AvifItemRole

Fields

Alpha = 2

The primary image's alpha, or part of it.

Auxiliary = 4

Another auxiliary image of the primary image, such as a matte; see AuxiliaryType.

Depth = 3

A depth map of the primary image (an auxiliary image of the depth type).

Derived = 6

An image another image is made from or derived from it: a grid cell, an overlay layer, or the tmap item itself.

GainMap = 5

The gain map image of a tone-mapped derived image (tmap).

Metadata = 7

Metadata: an Exif or XMP item.

Other = 8

Anything else.

Primary = 0

The primary image, which Load gives.

Thumbnail = 1

A 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);