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
Padding
Gets the number of bytes of padding within the pixel.
public int Padding { get; }
Property Value
Methods
Create(int, int, params int[])
Creates a new PixelComponentInfo instance.
public static PixelComponentInfo Create(int count, int bitsPerPixel, params int[] precision)
Parameters
countintThe number of components within the pixel format.
bitsPerPixelintThe number of bits per pixel.
precisionint[]The precision in bits of each component.
Returns
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
countintThe number of components within the pixel format.
precisionint[]The precision in bits of each component.
Returns
Type Parameters
TPixelThe 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
componentIndexintThe component index.
Returns
Exceptions
- ArgumentOutOfRangeException
The component index cannot exceed the component range.
GetMaximumComponentPrecision()
Returns the maximum precision in bits of all components.
public int GetMaximumComponentPrecision()