Class PixelDataFormat
The pixel data format. This is an immutable object.
public class PixelDataFormat
- Inheritance
-
PixelDataFormat
- Inherited Members
Fields
Grayscale
Gets the PixelDataFormat defined for 8 bits per pixel with 8 bits representing grayscale intensity in the 0-255 interval.
public static PixelDataFormat Grayscale
Field Value
- PixelDataFormat
The PixelDataFormat defined for 8 bits per pixel with 8 bits representing grayscale intensity in the 0-255 interval.
Grayscale16
Defined for 16 bits per pixel with up to 16 bits representing grayscale intensity.
public static readonly PixelDataFormat Grayscale16
Field Value
Properties
BitsPerPixel
Gets the bits per pixel.
public int BitsPerPixel { get; }
Property Value
- int
The bits per pixel.
Caption
Gets the pixel data format caption.
public string Caption { get; }
Property Value
ChannelBits
Gets the bits count for each channel.
public int[] ChannelBits { get; }
Property Value
- int[]
The channel bits.
ChannelsCount
Gets the channels count.
public int ChannelsCount { get; }
Property Value
- int
The channels count.
Cmyk
Gets the PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the cyan, magenta, yellow and black.
public static PixelDataFormat Cmyk { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the cyan, magenta, yellow and black.
Cmyka
Gets the acmyk.
public static PixelDataFormat Cmyka { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 40 bits per pixel with 8 bits for each of the alpha, cyan, magenta, yellow and black.
GrayscaleAlpha
Gets the PixelDataFormat defined for 16 bits per pixel with 8 bits representing grayscale intensity in the 0-255 interval and additional 8 bit alpha component.
public static PixelDataFormat GrayscaleAlpha { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 16 bits per pixel with 8 bits representing grayscale intensity in the 0-255 interval and additional 8 bit alpha component.
PixelFormat
Gets the pixel format.
public PixelFormat PixelFormat { get; }
Property Value
- PixelFormat
The pixel format.
Rgb16Bpp555
Gets the PixelDataFormat defined for 16 bits per pixel with 5 bits for each of the red, green and blue, alpha is not defined.
public static PixelDataFormat Rgb16Bpp555 { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 16 bits per pixel with 5 bits for each of the red, green and blue, alpha is not defined.
Rgb16Bpp565
Gets the PixelDataFormat defined for 16 bits per pixel with 5 bits for red, 6 bits for green and 5 bits for blue, alpha is not defined.
public static PixelDataFormat Rgb16Bpp565 { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 16 bits per pixel with 5 bits for red, 6 bits for green and 5 bits for blue, alpha is not defined.
Rgb24Bpp
Gets the PixelDataFormat defined for 24 bits per pixel with 8 bits for each of the alpha, red, green and blue, alpha is not defined.
public static PixelDataFormat Rgb24Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 24 bits per pixel with 8 bits for each of the alpha, red, green and blue, alpha is not defined.
Rgb24BppPng
Gets the PixelDataFormat defined for 24 bits per pixel with 8 bits for each of the alpha, red, green and blue, alpha is not defined.
public static PixelDataFormat Rgb24BppPng { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 24 bits per pixel with 8 bits for each of the alpha, red, green and blue, alpha is not defined.
Rgb32Bpp
Gets the PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the alpha, red, green and blue.
public static PixelDataFormat Rgb32Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the alpha, red, green and blue.
RgbIndexed1Bpp
Gets the PixelDataFormat defined for indexed 1 bit per color. The indexed pixel data storage is intended to allow data storage and retrieval everywhere the color palette is used. Use with caution, because may require conversion from one palette to another or from RGBA to indexed color model.
public static PixelDataFormat RgbIndexed1Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for indexed 1 bit per color.
RgbIndexed2Bpp
Gets the PixelDataFormat defined for indexed 2 bit per color. The indexed pixel data storage is intended to allow data storage and retrieval everywhere the color palette is used. Use with caution, because may require conversion from one palette to another or from RGBA to indexed color model.
public static PixelDataFormat RgbIndexed2Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for indexed 2 bit per color.
RgbIndexed4Bpp
Gets the PixelDataFormat defined for indexed 4 bit per color. The indexed pixel data storage is intended to allow data storage and retrieval everywhere the color palette is used. Use with caution, because may require conversion from one palette to another or from RGBA to indexed color model.
public static PixelDataFormat RgbIndexed4Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for indexed 4 bit per color.
RgbIndexed8Bpp
Gets the PixelDataFormat defined for indexed 8 bit per color. The indexed pixel data storage is intended to allow data storage and retrieval everywhere the color palette is used. Use with caution, because may require conversion from one palette to another or from RGBA to indexed color model.
public static PixelDataFormat RgbIndexed8Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for indexed 8 bit per color.
Rgba32Bpp
Gets the PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the alpha, red, green and blue.
public static PixelDataFormat Rgba32Bpp { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the alpha, red, green and blue.
YCbCr
Gets the PixelDataFormat defined for 24 bits per pixel with 8 bits for each of the luma, blue-difference and red-difference chroma components.
public static PixelDataFormat YCbCr { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 24 bits per pixel with 8 bits for each of the luma, blue-difference and red-difference chroma components.
Ycck
Gets the PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the luma, blue-difference, red-difference and black chroma components.
public static PixelDataFormat Ycck { get; }
Property Value
- PixelDataFormat
The PixelDataFormat defined for 32 bits per pixel with 8 bits for each of the luma, blue-difference, red-difference and black chroma components.
Methods
Equals(object)
Determines whether the specified object is equal to this instance.
public override bool Equals(object obj)
Parameters
Returns
GetBgr(int)
Gets BGR color with a specified number of bits per sample.
public static PixelDataFormat GetBgr(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The BGR color.
GetBgra(int)
Gets BGRA color with a specified number of bits per sample.
public static PixelDataFormat GetBgra(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The BGRA color.
GetCieLab(int, int, int)
Gets CIE Lab color with a specified number of bits per sample.
public static PixelDataFormat GetCieLab(int bitsPerL, int bitsPerA, int bitsPerB)
Parameters
bitsPerL
intThe number of bits per L channel.
bitsPerA
intThe number of bits per A channel.
bitsPerB
intThe number of bits per B channel.
Returns
- PixelDataFormat
The CIE Lab color.
GetCmyk(int)
Gets CMYK color with a specified number of bits per sample.
public static PixelDataFormat GetCmyk(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The CMYK color.
GetCmyk(int, int, int, int)
Gets CMYK color with a specified number of bits per sample.
public static PixelDataFormat GetCmyk(int bitsPerCyanChannel, int bitsPerMagentaChannel, int bitsPerYellowChannel, int bitsPerKeyChannel)
Parameters
bitsPerCyanChannel
intThe number of bits per Cyan channel.
bitsPerMagentaChannel
intThe number of bits per Magenta channel.
bitsPerYellowChannel
intThe number of bits per Yellow channel.
bitsPerKeyChannel
intThe number of bits per Key channel.
Returns
- PixelDataFormat
The CMYK color.
GetCmyka(int, int, int, int, int)
Gets CMYKA color with a specified number of bits per sample.
public static PixelDataFormat GetCmyka(int bitsPerCyanChannel, int bitsPerMagentaChannel, int bitsPerYellowChannel, int bitsPerKeyChannel, int bitsPerAlphaChannel)
Parameters
bitsPerCyanChannel
intThe number of bits per Cyan channel.
bitsPerMagentaChannel
intThe number of bits per Magenta channel.
bitsPerYellowChannel
intThe number of bits per Yellow channel.
bitsPerKeyChannel
intThe number of bits per Key channel.
bitsPerAlphaChannel
intThe number of bits per Alpha channel.
Returns
- PixelDataFormat
The CMYK color.
GetGrayscale(int)
Gets Grayscale color with a specified number of bits per sample.
public static PixelDataFormat GetGrayscale(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The Grayscale color.
GetGrayscaleAlpha(int)
Gets GrayscaleAlpha color with a specified number of bits per sample.
public static PixelDataFormat GetGrayscaleAlpha(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The GrayscaleAlpha color.
GetGrayscaleAlpha(int, int)
Gets GrayscaleAlpha color with a specified number of bits per sample.
public static PixelDataFormat GetGrayscaleAlpha(int bitsPerSample, int alphaChannelBits)
Parameters
bitsPerSample
intThe number of bits per sample.
alphaChannelBits
intThe number of bits per sample in the alpha channel.
Returns
- PixelDataFormat
The GrayscaleAlpha color.
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
GetRgb(int)
Gets RGB color with a specified number of bits per sample.
public static PixelDataFormat GetRgb(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The RGB color.
GetRgb(int, int, int)
Gets RGB color with a specified number of bits per sample.
public static PixelDataFormat GetRgb(int bitsPerRedChannel, int bitsPerGreenChannel, int bitsPerBlueChannel)
Parameters
bitsPerRedChannel
intThe number of bits per Red channel.
bitsPerGreenChannel
intThe number of bits per Green channel.
bitsPerBlueChannel
intThe number of bits per Blue channel.
Returns
- PixelDataFormat
The RGB color.
GetRgbIndexed(int)
Gets BGRA indexed color with a specified number of bits per sample.
public static PixelDataFormat GetRgbIndexed(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The BGRA color.
GetRgba(int)
Gets RGBA color with a specified number of bits per sample.
public static PixelDataFormat GetRgba(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The RGBA color.
GetRgba(int, int, int, int)
Gets RGBA color with a specified number of bits per sample.
public static PixelDataFormat GetRgba(int bitsPerRedChannel, int bitsPerGreenChannel, int bitsPerBlueChannel, int bitsPerAlphaChannel)
Parameters
bitsPerRedChannel
intThe number of bits per Red channel.
bitsPerGreenChannel
intThe number of bits per Green channel.
bitsPerBlueChannel
intThe number of bits per Blue channel.
bitsPerAlphaChannel
intThe number of bits per Alpha channel.
Returns
- PixelDataFormat
The RGBA color.
GetYCbCr(int)
Gets YCbCr color with a specified number of bits per sample.
public static PixelDataFormat GetYCbCr(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The YCbCr color.
GetYCbCr(int, int, int)
Gets YCbCr color with a specified number of bits per sample.
public static PixelDataFormat GetYCbCr(int bitsPerY, int bitsPerCb, int bitsPerCr)
Parameters
bitsPerY
intThe number of bits per Y channel.
bitsPerCb
intThe number of bits per Cb channel.
bitsPerCr
intThe number of bits per Cr channel.
Returns
- PixelDataFormat
The YCbCr color.
GetYcck(int)
Gets YCCK color with a specified number of bits per sample.
public static PixelDataFormat GetYcck(int bitsPerSample)
Parameters
bitsPerSample
intThe number of bits per sample.
Returns
- PixelDataFormat
The YCCK color.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
Operators
operator ==(PixelDataFormat, PixelDataFormat)
Returns result of equality for two PixelDataFormat classes.
public static bool operator ==(PixelDataFormat pixelFormat1, PixelDataFormat pixelFormat2)
Parameters
pixelFormat1
PixelDataFormatThe first PixelDataFormat to compare.
pixelFormat2
PixelDataFormatThe second PixelDataFormat to compare.
Returns
- bool
True if both
pixelFormat1
andpixelFormat2
contain equal data or both parameters are null.
operator !=(PixelDataFormat, PixelDataFormat)
Returns result of non-equality for two PixelDataFormat classes.
public static bool operator !=(PixelDataFormat pixelFormat1, PixelDataFormat pixelFormat2)
Parameters
pixelFormat1
PixelDataFormatThe first PixelDataFormat to compare.
pixelFormat2
PixelDataFormatThe second PixelDataFormat to compare.
Returns
- bool
True if both
pixelFormat1
andpixelFormat2
contain non-equal data or one of the parameters is null.