Declarations ​
pascal
procedure SetGamma; overload;
procedure SetGamma(Gamma: Double); overload;
procedure SetGamma(Gamma: Double; var GammaTable: TGammaTable8Bit); overload;Overload Details
Overload 1 ​
pascal
procedure SetGamma; overload;Recalculated global gamma encoding and decoding tables using DEFAULT_GAMMA (1.6).
Overload 2 ​
pascal
procedure SetGamma(Gamma: Double); overload;Recalculates global gamma encoding and decoding tables using a specified power-law gamma exponent.
| Parameter | Type | Description |
|---|---|---|
Gamma | Double | Power-law gamma exponent (e.g. 1.6, 2.2). |
Overload 3 ​
pascal
procedure SetGamma(Gamma: Double; var GammaTable: TGammaTable8Bit); overload;Populates a custom 256-byte lookup table with values calculated from a specified power-law gamma exponent.
| Parameter | Type | Description |
|---|---|---|
Gamma | Double | Power-law gamma exponent. |
GammaTable | TGammaTable8Bit | Target 256-byte table array to receive calculated gamma values. |
Description ​
SetGamma calculates power-law gamma transformation values for 8-bit color channels (
- The single-value and parameterless overloads populate the global
GAMMA_ENCODING_TABLE(using exponent) and GAMMA_DECODING_TABLE(using exponent), update GAMMA_VALUE, setGAMMA_IS_SRGBtoFalse, and invoke delegates registered withRegisterGammaChangeNotification. - The 3-parameter overload populates a custom
TGammaTable8Bitarray without modifying global state or firing change notifications.
Formula ​
For each entry
Example ​
pascal
// Set global power-law gamma to standard display gamma 2.2
SetGamma(2.2);
// Or generate a custom lookup table for custom image processing
var
CustomTable: TGammaTable8Bit;
begin
SetGamma(1.8, CustomTable);
ApplyCustomGamma(MyBitmap, CustomTable);
end;