|
aest 0.1.0
Collection of C++ utility libraries
|
Partition aest.colors:gamut: RGB gamuts, the BasicRGB color spaces built from a gamut and a transfer function, and their matrices to CIE XYZ, derived at compile time from chromaticities. More...
#include <array>#include <concepts>#include <cstdint>#include <string_view>#include <type_traits>import aest.colors:transfer;import aest.blas;Go to the source code of this file.
Classes | |
| struct | aest::colors::gamut::SRGB |
| The sRGB and Rec. 709 primaries, D65 white, from IEC 61966-2-1. More... | |
| struct | aest::colors::gamut::DisplayP3 |
| The DCI-P3 primaries with D65 white, from SMPTE EG 432-1. More... | |
| struct | aest::colors::gamut::Rec2020 |
| The Rec. 2020 / Rec. 2100 primaries, D65 white, from ITU-R BT.2020. More... | |
| struct | aest::colors::gamut::AP1 |
| The ACES AP1 primaries with the ACES white point (about D60), from SMPTE ST 2065-1, the gamut of ACEScg. More... | |
| struct | aest::colors::RGBName< Gamut, Transfer > |
| Name of the BasicRGB space of a gamut and a transfer function, printed by std::format. More... | |
| struct | aest::colors::RGBName< gamut::AP1, tf::Linear > |
| Linear AP1 goes by the name of its ACES working space. More... | |
| struct | aest::colors::RGBName< gamut::SRGB, tf::Rec709 > |
| The sRGB primaries with the Rec. 709 OETF are the space of Rec. 709. More... | |
| struct | aest::colors::RGBName< gamut::Rec2020, tf::Rec709 > |
| Rec. 2020 with the Rec. 709 OETF is the SDR space of Rec. 2020. More... | |
| struct | aest::colors::RGBName< gamut::Rec2020, tf::PQ > |
| Rec. 2020 with PQ is the PQ space of Rec. 2100. More... | |
| struct | aest::colors::RGBName< gamut::Rec2020, tf::HLG > |
| Rec. 2020 with HLG is the HLG space of Rec. 2100. More... | |
| struct | aest::colors::NoArithmetic |
| Empty base standing in for ColorArithmetic in encoded RGB spaces. More... | |
| class | aest::colors::BasicRGB< Gamut, Transfer > |
A color in an RGB color space: the primaries and white point of Gamut, with channels encoded by Transfer. More... | |
| struct | aest::colors::RGBParts< T > |
| The gamut and transfer function of a BasicRGB space; empty for other types. More... | |
| struct | aest::colors::RGBParts< BasicRGB< Gamut, Transfer > > |
| The gamut and transfer function of BasicRGB<Gamut, Transfer>. More... | |
Namespaces | |
| namespace | aest::colors::gamut |
| Gamut tags, the first parameter of BasicRGB. | |
Concepts | |
| concept | aest::colors::RGBGamut |
| A gamut tag, the first parameter of BasicRGB. | |
| concept | aest::colors::RGBSpace |
| Any BasicRGB color space. | |
| concept | aest::colors::LinearRGBSpace |
| A BasicRGB space with linear channels, tf::Linear. | |
| concept | aest::colors::BoundedRGBSpace |
| A BasicRGB space with an SDR encoding: channels in the 0-1 range, relative to the display's white. Linear spaces and HDR signals such as PQ are left out. | |
Typedefs | |
| using | aest::colors::Chromaticity = std::array<double, 2> |
| CIE 1931 xy chromaticity coordinates of a primary or white point. | |
| using | aest::colors::Vector3 = blas::Vector<double, 3> |
| A column of three values, such as XYZ or linear RGB channels. | |
| using | aest::colors::Matrix3 = blas::Matrix<double, 3, 3> |
| A 3x3 matrix, stored as three rows. | |
| using | aest::colors::SRGB = BasicRGB<gamut::SRGB, tf::SRGB> |
| sRGB with gamma-encoded channels: the encoding of hex codes, 8-bit channels and CSS colors. | |
| using | aest::colors::LinSRGB = BasicRGB<gamut::SRGB, tf::Linear> |
| Linear sRGB: the sRGB primaries without the gamma encoding, so channels are proportional to light and can exceed 1 for HDR values. | |
| using | aest::colors::DisplayP3 = BasicRGB<gamut::DisplayP3, tf::SRGB> |
| Display P3: the P3 primaries with the sRGB transfer function, as on Apple displays and in CSS. | |
| using | aest::colors::LinDisplayP3 = BasicRGB<gamut::DisplayP3, tf::Linear> |
| Linear Display P3. | |
| using | aest::colors::Rec709 = BasicRGB<gamut::SRGB, tf::Rec709> |
| Rec. 709: the sRGB primaries with the Rec. 709 OETF, the encoding of HD video. | |
| using | aest::colors::Rec2020 = BasicRGB<gamut::Rec2020, tf::Rec709> |
| Rec. 2020: the Rec. 2020 primaries with the Rec. 709 OETF, the encoding of SDR UHD video. | |
| using | aest::colors::LinRec2020 = BasicRGB<gamut::Rec2020, tf::Linear> |
| Linear Rec. 2020, the gamut of UHD and HDR video. | |
| using | aest::colors::ACEScg = BasicRGB<gamut::AP1, tf::Linear> |
| ACEScg: linear AP1, the working space of ACES rendering and compositing. | |
| using | aest::colors::Rec2100PQ = BasicRGB<gamut::Rec2020, tf::PQ> |
| Rec.2100 PQ: Rec. 2020 primaries with the PQ signal of HDR10, linear 1.0 at 203 cd/m² | |
| using | aest::colors::Rec2100HLG = BasicRGB<gamut::Rec2020, tf::HLG> |
| Rec.2100 HLG: Rec. 2020 primaries with the HLG signal, linear 1.0 at 75%. | |
Functions | |
| constexpr Vector3 | aest::colors::xyz_of (const Chromaticity &chromaticity) |
| The XYZ of a chromaticity at luminance Y = 1. | |
| constexpr Matrix3 | aest::colors::rgb_to_xyz (const Chromaticity &red, const Chromaticity &green, const Chromaticity &blue, const Chromaticity &white) |
| Derives the matrix from linear RGB to XYZ for a set of primaries. | |
| constexpr Matrix3 | aest::colors::bradford_to_d65 (const Chromaticity &white) |
| Derives the Bradford matrix that adapts XYZ colors from a white point to D65. | |
| template<RGBGamut Gamut> | |
| constexpr Matrix3 | aest::colors::gamut_to_xyz () |
| Derives the matrix from linear RGB of a gamut to XYZ relative to D65. | |
Variables | |
| constexpr Chromaticity | aest::colors::D65 = {0.3127, 0.3290} |
| Chromaticity of the D65 white point, as sRGB defines it: the white of XYZ. | |
| constexpr Chromaticity | aest::colors::D50 = {0.3457, 0.3585} |
| Chromaticity of the D50 white point, as CSS Color 4 and the ICC profile connection space define it: the white of CIELab. | |
| constexpr Matrix3 | aest::colors::BRADFORD |
| The Bradford cone response matrix, used to adapt a white point. | |
| template<RGBGamut Gamut> | |
| constexpr Matrix3 | aest::colors::RGB_TO_XYZ = gamut_to_xyz<Gamut>() |
Matrix from linear RGB of Gamut to XYZ, D65. | |
| template<RGBGamut Gamut> | |
| constexpr Matrix3 | aest::colors::XYZ_TO_RGB = blas::inverse(RGB_TO_XYZ<Gamut>) |
Matrix from XYZ, D65, to linear RGB of Gamut. | |
| template<RGBGamut Gamut, TransferFunction Transfer> | |
| constexpr auto | aest::colors::RGB_NAME_CHARS |
| The characters of the default BasicRGB name: the transfer prefix, then the gamut name. | |
Partition aest.colors:gamut: RGB gamuts, the BasicRGB color spaces built from a gamut and a transfer function, and their matrices to CIE XYZ, derived at compile time from chromaticities.
Definition in file Gamut.cppm.
|
export |
ACEScg: linear AP1, the working space of ACES rendering and compositing.
Definition at line 394 of file Gamut.cppm.
|
export |
CIE 1931 xy chromaticity coordinates of a primary or white point.
Definition at line 24 of file Gamut.cppm.
|
export |
Display P3: the P3 primaries with the sRGB transfer function, as on Apple displays and in CSS.
Definition at line 379 of file Gamut.cppm.
|
export |
Linear Display P3.
Definition at line 382 of file Gamut.cppm.
|
export |
Linear Rec. 2020, the gamut of UHD and HDR video.
Definition at line 391 of file Gamut.cppm.
|
export |
Linear sRGB: the sRGB primaries without the gamma encoding, so channels are proportional to light and can exceed 1 for HDR values.
Definition at line 376 of file Gamut.cppm.
| using aest::colors::Matrix3 = blas::Matrix<double, 3, 3> |
A 3x3 matrix, stored as three rows.
Definition at line 116 of file Gamut.cppm.
|
export |
Rec. 2020: the Rec. 2020 primaries with the Rec. 709 OETF, the encoding of SDR UHD video.
Definition at line 388 of file Gamut.cppm.
|
export |
Rec.2100 HLG: Rec. 2020 primaries with the HLG signal, linear 1.0 at 75%.
Definition at line 400 of file Gamut.cppm.
|
export |
Rec.2100 PQ: Rec. 2020 primaries with the PQ signal of HDR10, linear 1.0 at 203 cd/m²
Definition at line 397 of file Gamut.cppm.
|
export |
Rec. 709: the sRGB primaries with the Rec. 709 OETF, the encoding of HD video.
Definition at line 385 of file Gamut.cppm.
|
export |
sRGB with gamma-encoded channels: the encoding of hex codes, 8-bit channels and CSS colors.
Convert it to LinSRGB with convert() before blending or other color math.
Definition at line 370 of file Gamut.cppm.
| using aest::colors::Vector3 = blas::Vector<double, 3> |
A column of three values, such as XYZ or linear RGB channels.
Definition at line 113 of file Gamut.cppm.
|
constexpr |
Derives the Bradford matrix that adapts XYZ colors from a white point to D65.
| [in] | white | Chromaticity of the source white point |
white to XYZ relative to D65. Definition at line 166 of file Gamut.cppm.
|
constexpr |
Derives the matrix from linear RGB of a gamut to XYZ relative to D65.
| Gamut | The gamut tag |
Definition at line 182 of file Gamut.cppm.
|
constexpr |
Derives the matrix from linear RGB to XYZ for a set of primaries.
Each primary contributes the XYZ of its chromaticity, scaled so that equal channels of 1 give the white point at luminance Y = 1.
| [in] | red | Chromaticity of the red primary |
| [in] | green | Chromaticity of the green primary |
| [in] | blue | Chromaticity of the blue primary |
| [in] | white | Chromaticity of the white point |
white. Definition at line 149 of file Gamut.cppm.
|
constexpr |
The XYZ of a chromaticity at luminance Y = 1.
| [in] | chromaticity | The xy coordinates |
Definition at line 130 of file Gamut.cppm.
|
constexpr |
The Bradford cone response matrix, used to adapt a white point.
Definition at line 119 of file Gamut.cppm.
|
inlineconstexprexport |
Chromaticity of the D50 white point, as CSS Color 4 and the ICC profile connection space define it: the white of CIELab.
Definition at line 33 of file Gamut.cppm.
|
inlineconstexprexport |
Chromaticity of the D65 white point, as sRGB defines it: the white of XYZ.
Definition at line 27 of file Gamut.cppm.
|
inlineconstexpr |
The characters of the default BasicRGB name: the transfer prefix, then the gamut name.
| Gamut | The gamut tag |
| Transfer | The transfer function tag |
Definition at line 210 of file Gamut.cppm.
|
inlineconstexpr |
Matrix from linear RGB of Gamut to XYZ, D65.
| Gamut | The gamut tag |
Definition at line 194 of file Gamut.cppm.
|
inlineconstexpr |
Matrix from XYZ, D65, to linear RGB of Gamut.
| Gamut | The gamut tag |
Definition at line 201 of file Gamut.cppm.