Packed Record TBGRAPixel
Unit
BGRABitmapTypes
Declaration
type TBGRAPixel = packed record
Description
Each pixel is a sequence of 4 bytes containing blue, green, red and alpha channel. Values range from 0 to 255, color is in sRGB colorspace. The alpha value of 0 is transparent and 255 is opaque. In the bitmap data, when the pixel is fully transparent, the RGB values are supposed to be set to zero.
Overview
Fields
Methods
Properties
|
property Intensity: word read GetClassIntensity write SetClassIntensity; |
|
property Lightness: word read GetClassLightness write SetClassLightness; |
Description
Fields
|
blue: byte; |
Channels if ordered BGRA ordered
|
|
green: byte; |
Channels if ordered BGRA ordered
|
|
red: byte; |
Channels if ordered BGRA ordered
|
|
alpha: byte; |
Channels if ordered BGRA ordered
|
Methods
|
function EqualsExactly(constref AColor: TBGRAPixel): boolean; |
Check whether all channels are equal (this is generally not necessary to use this fonction unless the RGB value of a transparent color matter)
|
|
function ToFPColor: TFPColor; |
Converts to TFPColor (16-bit per channel)
|
|
function ToGrayscale(AGammaCorrection: boolean = true): TBGRAPixel; |
Compute grayscale equivalent
|
|
function ToString: string; |
Converts to a CSS string representation
|
|
procedure FromColor(AColor: TColor; AAlpha: Byte = 255); |
Sets the pixel with given TColor
|
|
procedure FromFPColor(AColor: TFPColor); |
Sets the pixel with given TFPColor (16-bit per channel)
|
|
procedure FromRGB(ARed,AGreen,ABlue: Byte; AAlpha: Byte = 255); |
Sets the pixel with given RGB values
|
|
procedure FromString(AStr: string); |
Sets the pixel according to a color name or CSS expression
|
|
procedure ToRGB(out ARed,AGreen,ABlue,AAlpha: Byte); overload; |
Extras RGBA channels
|
|
procedure ToRGB(out ARed,AGreen,ABlue: Byte); overload; |
Extras RGB channels
|
Properties
|
property Intensity: word read GetClassIntensity write SetClassIntensity; |
Intensity of the color (how much channels are saturated)
|
|
property Lightness: word read GetClassLightness write SetClassLightness; |
Lightness of the color (the resulting lightness of combined channels)
|