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

Set_sRGB

Initializes global or custom lookup tables with standard sRGB IEC 61966-2-1 transfer functions.

Declarations ​

pascal
procedure Set_sRGB; overload;
procedure Set_sRGB(var GammaTable: TGammaTable8Bit); overload;
Overload Details

Overload 1 ​

pascal
procedure Set_sRGB; overload;

Populates global encoding and decoding tables with sRGB transfer functions, sets GAMMA_IS_SRGB to True, and notifies change listeners.

Overload 2 ​

pascal
procedure Set_sRGB(var GammaTable: TGammaTable8Bit); overload;

Populates a custom 256-byte lookup table with standard forward sRGB transfer function values (linear light to sRGB space).

ParameterTypeDescription
GammaTableTGammaTable8BitTarget 256-byte table array to receive sRGB values.

Description ​

Set_sRGB populates gamma lookup tables according to the standard sRGB (IEC 61966-2-1) piecewise transfer function.

The parameterless overload populates GAMMA_ENCODING_TABLE with the forward sRGB curve (linear → sRGB) and GAMMA_DECODING_TABLE with the inverse sRGB curve (sRGB → linear), sets GAMMA_IS_SRGB to True, and invokes delegates registered with RegisterGammaChangeNotification.

Formula ​

For a normalized channel input V=i/255:

GammaTable[i]={Round(255⋅12.92⋅V)if V<0.0031308Round(255⋅(1.055⋅V1/2.4−0.055))if V≥0.0031308

Example ​

pascal
// Configure global gamma tables to use standard sRGB transfer functions
Set_sRGB;

See also ​