Declarations ​
pascal
function ApplyGamma(Color: TColor32): TColor32; overload;
procedure ApplyGamma(Color: PColor32Array; Length: Integer); overload;
procedure ApplyGamma(Bitmap: TBitmap32); overload;Overload Details
Overload 1 ​
pascal
function ApplyGamma(Color: TColor32): TColor32; overload;Applies global GAMMA_ENCODING_TABLE to the Red, Green, and Blue channels of a single TColor32 value.
| Parameter | Type | Description |
|---|---|---|
Color | TColor32 | Input 32-bit ARGB color value. |
| Type | Description |
|---|---|
TColor32 | Gamma-encoded color value with original alpha channel preserved. |
Overload 2 ​
pascal
procedure ApplyGamma(Color: PColor32Array; Length: Integer); overload;Applies global GAMMA_ENCODING_TABLE in-place to a contiguous buffer array of TColor32 pixels.
| Parameter | Type | Description |
|---|---|---|
Color | PColor32Array | Pointer to contiguous array of TColor32 pixels. |
Length | Integer | Number of pixels to process in the array. |
Overload 3 ​
pascal
procedure ApplyGamma(Bitmap: TBitmap32); overload;Applies global GAMMA_ENCODING_TABLE in-place to all pixels in a TBitmap32.
| Parameter | Type | Description |
|---|---|---|
Bitmap | TBitmap32 | Target bitmap to transform in-place. |
Description ​
ApplyGamma applies gamma encoding to RGB channels using the current global GAMMA_ENCODING_TABLE. Alpha channel values remain unchanged.
Example ​
pascal
var
EncodedColor: TColor32;
begin
EncodedColor := ApplyGamma(clRed32);
ApplyGamma(MyBitmap);
end;