Class AvifDetails
Details only AVIF has, kept in FormatDetails.
public sealed class AvifDetails : FormatDetails
- Inheritance
-
AvifDetails
- Inherited Members
Examples
// The container alone: size, natural pixel type and orientation, without decoding any AV1.
RasterInfo info = Raster.Probe("duck.avif");
bool isAvif = info.Format == AvifFormat.Info;
long bytes = info.EstimatedBytes; // what a full load would allocate
Properties
AlphaPremultiplied
Gets or sets whether the color is premultiplied by the alpha (a prem item reference). Egami loads straight alpha.
public bool AlphaPremultiplied { get; set; }
Property Value
BitDepth
Gets or sets the bits a sample of the image Load gave has: 8, 10 or 12 as AV1 codes them, or the depth of a sample transform's output (16 in the files avifenc --depth 16 writes) when HasSampleTransform is true.
public int BitDepth { get; set; }
Property Value
Chroma
Gets or sets the chroma format: 4:0:0 (monochrome), 4:2:0, 4:2:2 or 4:4:4.
public ChromaFormat Chroma { get; set; }
Property Value
ChromaSiting
Gets or sets where 4:2:0 chroma sits, as the AV1 sequence header says: Left (vertical) or TopLeft (colocated); null when it is unknown or the image is not 4:2:0.
public ChromaSiting? ChromaSiting { get; set; }
Property Value
CodePoints
Gets or sets the color code points (ITU-T H.273) and range: the nclx colr property's when there is one, otherwise the AV1 sequence header's. With an ICC profile too, the matrix and range still come from here (design question 8).
public ColorCodePoints CodePoints { get; set; }
Property Value
CompatibleBrands
Gets or sets the ftyp box's compatible brands, such as mif1, miaf and MA1B.
public IReadOnlyList<string> CompatibleBrands { get; set; }
Property Value
FilmGrain
Gets or sets the primary image's film grain parameters as its AV1 frame header codes them, or null when it applies none. Load adds the grain unless FilmGrain is false (design question 6).
public AvifFilmGrain? FilmGrain { get; set; }
Property Value
GridColumns
Gets or sets the columns of a grid image, or 1.
public int GridColumns { get; set; }
Property Value
GridRows
Gets or sets the rows of a grid image, or 1.
public int GridRows { get; set; }
Property Value
HasAlpha
Gets or sets whether the image has an alpha item.
public bool HasAlpha { get; set; }
Property Value
HasFilmGrain
Gets or sets whether the AV1 stream carries film grain parameters.
public bool HasFilmGrain { get; set; }
Property Value
HasSampleTransform
Gets or sets whether the image Load gave is the output of a sample transform derived image (a sato item, AVIF 1.2.0), which combines several AV1 images into one of more bits (design question 4); SampleTransform set to false loads the file's fallback image instead.
public bool HasSampleTransform { get; set; }
Property Value
Examples
// 16 bits a sample, which AV1 cannot code, as a sample transform (AVIF 1.2): a 12-bit image and an 8-bit residual (or,
// lossless, the high and low bytes), with the first image as the fallback for readers without sample transforms.
using Raster<Rgb16> wide = duck.As<Rgb16>();
wide.Save("duck-16bit.avif", new AvifWriterOptions { BitDepth = 16, Quality = 90 });
using Raster deep = Raster.Load("duck-16bit.avif");
bool transformed = ((AvifDetails)deep.Metadata.FormatDetails!).HasSampleTransform; // true, at 16 bits
using Raster fallback = Raster.Load("duck-16bit.avif", options: new AvifReaderOptions { SampleTransform = false });
IsProgressive
Gets or sets whether the image is layered for progressive display (a1lx without an lsel picking one layer). Load gives the best layer, or the one Layer picks, at the image's full size.
public bool IsProgressive { get; set; }
Property Value
IsSequence
Gets or sets whether the file is an image sequence (the avis brand).
public bool IsSequence { get; set; }
Property Value
Items
Gets or sets every item of the file with what it is to the primary image (design question 13); read an image item with ReadItem(string, uint, ReaderOptions?, EgamiContext?). Empty for a sequence read from its tracks.
public IReadOnlyList<AvifItem> Items { get; set; }
Property Value
Layers
Gets or sets the size of each layer of a layered image, in the order they decode (the first is the lowest quality), as Load found them; empty when the image is not layered.
public IReadOnlyList<Size> Layers { get; set; }
Property Value
Examples
// A progressive file: a small first layer a viewer can show early, then the image (as avifenc --progressive writes it).
duck.Save("duck-progressive.avif", new AvifWriterOptions { Quality = 60, Progressive = true });
// Or up to four layers, each with its own quality and size; the last is the image at full size.
duck.Save("duck-layers.avif", new AvifWriterOptions
{
Layers = [new AvifLayer { Quality = 20, Scale = 0.5 }, new AvifLayer { Quality = 45 }, new AvifLayer { Quality = 75 }],
});
// Load gives the best layer; AvifReaderOptions.Layer picks another, at full size.
using Raster best = Raster.Load("duck-layers.avif");
IReadOnlyList<Size> layers = ((AvifDetails)best.Metadata.FormatDetails!).Layers; // 160x120, 320x240, 320x240
using Raster first = Raster.Load("duck-layers.avif", options: new AvifReaderOptions { Layer = 0 });
Level
Gets or sets the AV1 level, as seq_level_idx: 0 is level 2.0, 1 is 2.1, and so on; 31 means no level.
public int Level { get; set; }
Property Value
Lossless
Gets or sets whether the primary image's AV1 frame is coded losslessly (every segment at quantizer 0), so saving it again writes lossless unless Lossless says otherwise.
public bool Lossless { get; set; }
Property Value
MajorBrand
Gets or sets the ftyp box's major brand, such as avif or avis.
public string MajorBrand { get; set; }
Property Value
Profile
Gets or sets the AV1 profile: 0 (Main), 1 (High, 4:4:4) or 2 (Professional, 4:2:2 and 12 bits).
public int Profile { get; set; }
Property Value
Tier
Gets or sets the AV1 tier: 0 (Main) or 1 (High).
public int Tier { get; set; }
Property Value
Methods
Copy()
Returns a deep copy.
public override FormatDetails Copy()
Returns
- FormatDetails
The copy.