Enum PixelChannelOrder
The order in which a pixel type stores its channels.
public enum PixelChannelOrder
Fields
Abgr = 8Alpha, blue, green, red.
Alpha = 9Alpha only: a mask. Converts to and from colors as black with that alpha.
Argb = 7Alpha, red, green, blue.
Bgr = 4Blue, green, red.
Bgra = 2Blue, green, red, alpha.
Cmyk = 10Cyan, magenta, yellow, black, as ink amounts: 0 is no ink.
Gray = 5Luminance only.
GrayAlpha = 6Luminance, then alpha.
Other = 0A layout Egami does not know, such as packed YUV or 5-6-5. Such pixels are converted only through their IPixelType<TSelf> methods, never by reinterpreting their bytes.
Rgb = 3Red, green, blue.
Rgba = 1Red, green, blue, alpha.
Examples
// What a pixel type stores, for code that handles any TPixel.
PixelLayoutInfo layout = Rgba16.Layout;
Console.WriteLine($"{layout.ChannelOrder} {layout.ChannelType}: {layout.ChannelCount} channels, {layout.BitsPerChannel} bits each, {layout.BytesPerPixel} bytes");
bool needsAlpha = layout.Alpha != AlphaKind.None;
bool eightBit = layout.ChannelType == PixelChannelType.Unorm8;
bool bgrOrder = Bgr8.Layout.ChannelOrder is PixelChannelOrder.Bgr or PixelChannelOrder.Bgra;