Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_Gamma🞂ApplyInvGammaFunction

ApplyInvGamma

Applies gamma decoding (using global GAMMA_DECODING_TABLE) to a color, pixel array, or bitmap.

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.

ParameterTypeDescription
ColorTColor32Input 32-bit ARGB color value.
TypeDescription
TColor32Gamma-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.

ParameterTypeDescription
ColorPColor32ArrayPointer to contiguous array of TColor32 pixels.
LengthIntegerNumber 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.

ParameterTypeDescription
BitmapTBitmap32Target 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;

See also ​