Table of Contents

Struct PixelComponentInfo

Namespace
SixLabors.ImageSharp.PixelFormats
Assembly
SixLabors.ImageSharp.dll

Represents pixel component information within a pixel format.

public readonly struct PixelComponentInfo
Inherited Members

Properties

ComponentCount

Gets the number of components within the pixel.

public int ComponentCount { get; }

Property Value

int

Padding

Gets the number of bytes of padding within the pixel.

public int Padding { get; }

Property Value

int

Methods

Create(int, int, params int[])

Creates a new PixelComponentInfo instance.

public static PixelComponentInfo Create(int count, int bitsPerPixel, params int[] precision)

Parameters

count int

The number of components within the pixel format.

bitsPerPixel int

The number of bits per pixel.

precision int[]

The precision in bits of each component.

Returns

PixelComponentInfo

The PixelComponentInfo.

Exceptions

ArgumentOutOfRangeException

The component precision and index cannot exceed the component range.

Create<TPixel>(int, params int[])

Creates a new PixelComponentInfo instance.

public static PixelComponentInfo Create<TPixel>(int count, params int[] precision) where TPixel : unmanaged, IPixel<TPixel>

Parameters

count int

The number of components within the pixel format.

precision int[]

The precision in bits of each component.

Returns

PixelComponentInfo

The PixelComponentInfo.

Type Parameters

TPixel

The type of pixel format.

Exceptions

ArgumentOutOfRangeException

The component precision and index cannot exceed the component range.

GetComponentPrecision(int)

Returns the precision of the component in bits at the given index.

public int GetComponentPrecision(int componentIndex)

Parameters

componentIndex int

The component index.

Returns

int

The int.

Exceptions

ArgumentOutOfRangeException

The component index cannot exceed the component range.

GetMaximumComponentPrecision()

Returns the maximum precision in bits of all components.

public int GetMaximumComponentPrecision()

Returns

int

The int.