Table of Contents

Enum PixelChannelType

Namespace
Egami.Pixels
Assembly
Egami.dll

The storage type of every channel in a pixel type.

[SuppressMessage("Naming", "CA1720:Identifier contains type name", Justification = "Float32 names the channel encoding, as in GPU format names.")]
public enum PixelChannelType

Fields

Float16 = 4

A 16-bit IEEE float (Half), nominally 0 to 1.

Float32 = 3

A 32-bit IEEE float, nominally 0 to 1.

Other = 0

A storage type Egami does not know, or channels of different types. See Other.

Packed = 5

Channels packed into a 16 or 32-bit integer rather than whole bytes each, such as 5-6-5. ChannelBits gives their widths from the lowest bit up.

Unorm16 = 2

A 16-bit unsigned integer, 0 to 65535, meaning 0 to 1.

Unorm8 = 1

An 8-bit unsigned integer, 0 to 255, meaning 0 to 1.

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;