Declarations ​
pascal
function ApplyInvGamma(Color: TColor32): TColor32; overload;
procedure ApplyInvGamma(Color: PColor32Array; Length: Integer); overload;
procedure ApplyInvGamma(Bitmap: TBitmap32); overload;Overload Details
Overload 1 ​
pascal
function ApplyInvGamma(Color: TColor32): TColor32; overload;Applies global GAMMA_DECODING_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-decoded color value in linear light space with original alpha channel preserved. |
Overload 2 ​
pascal
procedure ApplyInvGamma(Color: PColor32Array; Length: Integer); overload;Applies global GAMMA_DECODING_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 ApplyInvGamma(Bitmap: TBitmap32); overload;Applies global GAMMA_DECODING_TABLE in-place to all pixels in a TBitmap32.
| Parameter | Type | Description |
|---|---|---|
Bitmap | TBitmap32 | Target bitmap to transform in-place. |
Description ​
ApplyInvGamma applies gamma decoding to RGB channels using the current global GAMMA_DECODING_TABLE, converting pixels into linear light space. Alpha channel values remain unchanged.
Example ​
pascal
var
LinearColor: TColor32;
begin
LinearColor := ApplyInvGamma(MyColor);
ApplyInvGamma(MyBitmap);
end;