Enum HeicItemRole
What an item of a HEIC file is to the image Load gives.
public enum HeicItemRole
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 a 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 = 5A gain map image: of a tone-mapped derived image (tmap), or Apple's HDRGainMap auxiliary image.
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
// The other images a photo holds: thumbnails, gain maps, depth maps and mattes (portrait, skin, sky).
HeicDetails details = (HeicDetails)sdr.Metadata.FormatDetails!;
HeicItem sky = details.Items.First(i => i.AuxiliaryType == "urn:com:apple:photo:2020:aux:semanticskymatte");
using Raster matte = HeicImage.ReadItem("portrait.heic", sky.Id, context: heic);
matte.Apply(ops => ops.AutoOrient());
matte.Save("sky-matte.png");