Class PixelFormatExtensions
Extensions to Pixel
- Inheritance
-
Pixel
Format Extensions
Methods
AlphaSizeInBits(PixelFormat)
Calculate the size of the alpha channel in bits depending on the pixel format.
Parameters
format
PixelFormat The pixel format
Returns
- int
The size in bits
BlockHeight(PixelFormat)
Parameters
format
PixelFormat
Returns
BlockSize(PixelFormat)
Parameters
format
PixelFormat
Returns
BlockWidth(PixelFormat)
Parameters
format
PixelFormat
Returns
ComputePitch(PixelFormat, int, int, out int, out int)
public static void ComputePitch(this PixelFormat fmt, int width, int height, out int rowPitch, out int slicePitch)
Parameters
fmt
PixelFormat width
intheight
introwPitch
intslicePitch
int
HasAlpha(PixelFormat)
Returns true if the Pixel
Parameters
fmt
PixelFormat The format to check for an Alpha channel.
Returns
- bool
True if the Pixel
Format has an Alpha channel
HasAlpha32Bits(PixelFormat)
Returns true if the Pixel
Parameters
fmt
PixelFormat The format to check for an uncompressed 32 bit color with an Alpha channel.
Returns
- bool
True if the Pixel
Format is an uncompressed 32 bit color with an Alpha channel
HasNonSRgbEquivalent(PixelFormat)
Determine if the format has an equivalent non-sRGB format.
Parameters
format
PixelFormat the sRGB format
Returns
- bool
true if the format has an non-sRGB equivalent
HasSRgbEquivalent(PixelFormat)
Determine if the format has an equivalent sRGB format.
Parameters
format
PixelFormat the non-sRGB format
Returns
- bool
true if the format has an sRGB equivalent
IsBGRAOrder(PixelFormat)
Determines whether the specified format is in BGRA order.
Parameters
format
PixelFormat The format.
Returns
- bool
true
if the specified format is in BGRA order; otherwise,false
.
IsCompressed(PixelFormat)
Returns true if the Pixel
Parameters
fmt
PixelFormat The format to check for compressed.
Returns
- bool
True if the Pixel
Format is a compressed format
IsHDR(PixelFormat)
Determines whether the specified Pixel
Parameters
fmt
PixelFormat The FMT.
Returns
- bool
true
if the specified pixel format is HDR (floating point); otherwise,false
.
IsPacked(PixelFormat)
Determines whether the specified Pixel
Parameters
fmt
PixelFormat The DXGI Format.
Returns
- bool
true
if the specified PixelFormat is packed; otherwise,false
.
IsRGBAOrder(PixelFormat)
Determines whether the specified format is in RGBA order.
Parameters
format
PixelFormat The format.
Returns
- bool
true
if the specified format is in RGBA order; otherwise,false
.
IsSRgb(PixelFormat)
Determines whether the specified Pixel
Parameters
fmt
PixelFormat The Pixel
Format .
Returns
- bool
true
if the specified PixelFormat is a SRGB format; otherwise,false
.
IsTypeless(PixelFormat)
Determines whether the specified Pixel
Parameters
fmt
PixelFormat The Pixel
Format .
Returns
- bool
true
if the specified PixelFormat is typeless; otherwise,false
.
IsValid(PixelFormat)
Returns true if the Pixel
Parameters
format
PixelFormat A format to validate
Returns
- bool
True if the Pixel
Format is valid.
IsVideo(PixelFormat)
Determines whether the specified Pixel
Parameters
fmt
PixelFormat The Pixel
Format .
Returns
- bool
true
if the specified PixelFormat is video; otherwise,false
.
SizeInBits(PixelFormat)
Calculates the size of a Pixel
Parameters
format
PixelFormat The pixel format.
Returns
- int
The size in bits
SizeInBytes(PixelFormat)
Calculates the size of a Pixel
Parameters
format
PixelFormat The dxgi format.
Returns
- int
size of in bytes
ToNonSRgb(PixelFormat)
Find the equivalent non sRGB format to the provided sRGB format.
Parameters
format
PixelFormat The non sRGB format.
Returns
- Pixel
Format The equivalent non sRGB format if any, the provided format else.
ToSRgb(PixelFormat)
Find the equivalent sRGB format to the provided format.
Parameters
format
PixelFormat The non sRGB format.
Returns
- Pixel
Format The equivalent sRGB format if any, the provided format else.