Packed Record TGSBAPixel
Unit
Declaration
type TGSBAPixel = packed record
Description
Pixel color defined in corrected HSL colorspace.
G stands for corrected hue and B stands for actual brightness. Values range from 0 to 65535.
See THSLAPixel for this colorspace without hue and brightness correction.
Example of drawing a gradient in GSB colorspace:
procedure TForm1.FormPaint(Sender: TObject); var x,y: integer; p: PBGRAPixel; image: TBGRABitmap; gsba: TGSBAPixel; begin image := TBGRABitmap.Create(ClientWidth,ClientHeight); gsba.lightness := 32768; gsba.alpha := 65535; for y := 0 to image.Height-1 do begin p := image.Scanline[y]; gsba.saturation := y*65536 div image.Height; for x := 0 to image.Width-1 do begin gsba.hue := x*65536 div image.Width; pˆ:= GSBAToBGRA(gsba); inc(p); end; end; image.InvalidateBitmap; // changed by direct access image.Draw(Canvas,0,0,True); image.free; end;
Overview
Fields
hue: word; |
|
saturation: word; |
|
lightness: word; |
|
alpha: word; |
Methods
class function New(const AHue,ASaturation,ABrightness:word): TGSBAPixel; overload; static; |
|
class function New(const AHue,ASaturation,ABrightness,AAlpha:word): TGSBAPixel; overload; static; |
Description
Fields
hue: word; |
|
Corrected |
saturation: word; |
|
|
lightness: word; |
|
Actual perceived brightness. 0 is black, 32768 is normal, and 65535 is white. At 32768, depending on the hue, contrary to THSLAPixel, the color may or may not be mixed with black/white. Blue colors have a lower brightness and thus the full saturation is achieved under 32768. Conversely yellow colors have higher brightness and thus the full saturation is achieved over 32768. |
alpha: word; |
|
Opacity of the pixel. 0 is transparent and 65535 is opaque |
Methods
class function New(const AHue,ASaturation,ABrightness:word): TGSBAPixel; overload; static; |
|
This item has no description. |
class function New(const AHue,ASaturation,ABrightness,AAlpha:word): TGSBAPixel; overload; static; |
|
This item has no description. |