aest 0.1.0
Collection of C++ utility libraries
Loading...
Searching...
No Matches
aest::colors::tf::SRGB Struct Referenceexport

The sRGB transfer function of IEC 61966-2-1: a short linear segment near black, then a power curve with exponent 2.4. More...

Static Public Member Functions

static float encode (const float value)
 Encodes linear light into an sRGB channel value.
static float decode (const float value)
 Decodes an sRGB channel value to linear light.
static constexpr float clamp (const float value)
 Brings a channel value into the encoded range.

Static Public Attributes

static constexpr std::string_view PREFIX = ""
 Prefix of the color space name: none, encoded spaces go by the gamut name.

Detailed Description

The sRGB transfer function of IEC 61966-2-1: a short linear segment near black, then a power curve with exponent 2.4.

Channels are clamped to the 0-1 range. Display P3 uses it too.

See also
IEC 61966-2-1

Definition at line 166 of file Transfer.cppm.

Member Function Documentation

◆ clamp()

constexpr float aest::colors::tf::SRGB::clamp ( const float value)
inlinestaticconstexpr

Brings a channel value into the encoded range.

Parameters
[in]valueThe channel value
Returns
value clamped to the 0-1 range

Definition at line 205 of file Transfer.cppm.

◆ decode()

float aest::colors::tf::SRGB::decode ( const float value)
inlinestatic

Decodes an sRGB channel value to linear light.

Parameters
[in]valueThe encoded value in the 0-1 range
Returns
The linear value in the 0-1 range.
Note
Not constexpr: std::pow is constexpr only since C++26.

Definition at line 192 of file Transfer.cppm.

◆ encode()

float aest::colors::tf::SRGB::encode ( const float value)
inlinestatic

Encodes linear light into an sRGB channel value.

Parameters
[in]valueThe linear value, 0 or greater
Returns
The encoded value in the 0-1 range: values from 1 up give 1.
Note
Not constexpr: std::pow is constexpr only since C++26.

Definition at line 177 of file Transfer.cppm.

Member Data Documentation

◆ PREFIX

std::string_view aest::colors::tf::SRGB::PREFIX = ""
staticconstexpr

Prefix of the color space name: none, encoded spaces go by the gamut name.

Definition at line 169 of file Transfer.cppm.


The documentation for this struct was generated from the following file: