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

ApplyGamma

Applies gamma encoding (using global GAMMA_ENCODING_TABLE) to a color, pixel array, or bitmap.

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.

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

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

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

See also ​