|
aest 0.1.0
Collection of C++ utility libraries
|
A color in an RGB color space: the primaries and white point of Gamut, with channels encoded by Transfer.
More...
Public Member Functions | |
| constexpr | BasicRGB () |
| Default constructor initializes the color to opaque black (0, 0, 0, 1). | |
| constexpr | BasicRGB (const float r, const float g, const float b, const float a=1.0f) |
| Construct a color from floating-point RGBA values. | |
Color Channels | |
| constexpr float | red () const noexcept |
| Get the red channel value. | |
| constexpr float | green () const noexcept |
| Get the green channel value. | |
| constexpr float | blue () const noexcept |
| Get the blue channel value. | |
| Public Member Functions inherited from aest::colors::ColorBase< BasicRGB< Gamut, Transfer > > | |
| constexpr float | alpha () const noexcept |
| Get the alpha channel value in the 0-1 range. | |
| constexpr float | ch1 () const noexcept |
| Get the first channel value. | |
| constexpr float | ch2 () const noexcept |
| Get the second channel value. | |
| constexpr float | ch3 () const noexcept |
| Get the third channel value. | |
| constexpr BasicRGB< Gamut, Transfer > | opacity (const float alpha) const |
| Returns a new color with the same channels and the specified alpha value. | |
Static Public Attributes | |
| static constexpr std::string_view | TYPE = RGBName<Gamut, Transfer>::VALUE |
| Color space name, used by the std::formatter specialization. | |
Additional Inherited Members | |
| Public Attributes inherited from aest::colors::ColorBase< BasicRGB< Gamut, Transfer > > | |
| friend | Derived |
| Lets the derived color reach the private constructor and channels. | |
A color in an RGB color space: the primaries and white point of Gamut, with channels encoded by Transfer.
With tf::Linear the channels are proportional to light: they are clamped at 0 only, so they hold HDR values, and the space has the ColorArithmetic operators, since blending and lighting are physically correct only there. With an encoding such as tf::SRGB the channels are clamped to the 0-1 range and have no arithmetic. Convert between spaces with convert(): a color outside the target gamut clips at 0.
Use it through the aliases, such as SRGB, LinSRGB or DisplayP3.
| Gamut | The gamut tag, such as gamut::SRGB |
| Transfer | The transfer function tag, such as tf::SRGB or tf::Linear |
Definition at line 292 of file Gamut.cppm.
|
inlineconstexpr |
Default constructor initializes the color to opaque black (0, 0, 0, 1).
Definition at line 302 of file Gamut.cppm.
|
inlineconstexpr |
Construct a color from floating-point RGBA values.
| [in] | r | Red channel value |
| [in] | g | Green channel value |
| [in] | b | Blue channel value |
| [in] | a | Alpha channel value (default 1.0) |
Definition at line 314 of file Gamut.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the blue channel value.
Transfer Definition at line 336 of file Gamut.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the green channel value.
Transfer Definition at line 330 of file Gamut.cppm.
|
inlinenodiscardconstexprnoexcept |
Get the red channel value.
Transfer Definition at line 324 of file Gamut.cppm.
|
staticconstexpr |
Color space name, used by the std::formatter specialization.
Definition at line 299 of file Gamut.cppm.