Table of Contents

Enum PixelChannelOrder

Namespace
Egami.Pixels
Assembly
Egami.dll

The order in which a pixel type stores its channels.

public enum PixelChannelOrder

Fields

Abgr = 8

Alpha, blue, green, red.

Alpha = 9

Alpha only: a mask. Converts to and from colors as black with that alpha.

Argb = 7

Alpha, red, green, blue.

Bgr = 4

Blue, green, red.

Bgra = 2

Blue, green, red, alpha.

Cmyk = 10

Cyan, magenta, yellow, black, as ink amounts: 0 is no ink.

Gray = 5

Luminance only.

GrayAlpha = 6

Luminance, then alpha.

Other = 0

A 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 = 3

Red, green, blue.

Rgba = 1

Red, 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;