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
|
function EqualsExactly(constref AColor: TBGRAPixel): boolean; |
|
class function New(const ARed,AGreen,ABlue:byte): TBGRAPixel; overload; static; |
|
class function New(const ARed,AGreen,ABlue,AAlpha:byte): TBGRAPixel; overload; static; |
|
function ToColor: TColor; |
|
function ToFPColor: TFPColor; |
|
function ToGrayscale(AGammaCorrection: boolean = true): TBGRAPixel; |
|
function ToString: string; |
|
procedure FromColor(AColor: TColor; AAlpha: Byte = 255); |
|
procedure FromFPColor(AColor: TFPColor); |
|
procedure FromRGB(ARed,AGreen,ABlue: Byte; AAlpha: Byte = 255); |
|
procedure FromString(AStr: string); |
|
procedure ToRGB(out ARed,AGreen,ABlue,AAlpha: Byte); overload; |
|
procedure ToRGB(out ARed,AGreen,ABlue: Byte); overload; |
|
class Operator := (Source: TColor): TBGRAPixel; |
|
class Operator := (Source: TBGRAPixel): TColor; |
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)
|
|
class function New(const ARed,AGreen,ABlue:byte): TBGRAPixel; overload; static; |
This item has no description. |
|
class function New(const ARed,AGreen,ABlue,AAlpha:byte): TBGRAPixel; overload; static; |
This item has no description. |
|
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)
|