Enum ChromaFormat
How a YuvRaster stores chroma: at what resolution against luma, or not at all.
public enum ChromaFormat
Fields
Yuv400 = 3Luma only, with no chroma planes: a gray picture, such as a gray JPEG or monochrome AV1.
Yuv410 = 5Chroma at a quarter of the width and a quarter of the height of luma, as old codecs such as Indeo (YVU9) store it.
Yuv411 = 4Chroma at a quarter of the width and the full height of luma, as NTSC DV and some capture cards store it.
Yuv420 = 0Chroma at half the width and half the height of luma, as most video, lossy WebP and most JPEG files store it.
Yuv422 = 1Chroma at half the width and the full height of luma.
Yuv444 = 2Chroma at the full size of luma.
Examples
// A 1080p frame as video stores it: full-size luma, chroma at half width and height, BT.709 at limited range.
using YuvRaster<byte> frame = YuvRaster.Create(1920, 1080, ChromaFormat.Yuv420, YuvColor.Bt709Limited);
// 10-bit HDR planes hold samples 0 to 1023 in ushorts; an alpha plane is optional.
using YuvRaster<ushort> hdr = YuvRaster.Create(3840, 2160, ChromaFormat.Yuv420, 10, YuvColor.Bt2020Limited, alpha: true);
Console.WriteLine($"Chroma planes are {frame.U!.Width}×{frame.U.Height}");