|
| constexpr | XYZ () |
| | Default constructor initializes the color to opaque black (0, 0, 0, 1).
|
| constexpr | XYZ (const float x, const float y, const float z, const float a=1.0f) |
| | Construct a color from XYZ tristimulus values and alpha.
|
| constexpr float | x () const noexcept |
| | Get the X tristimulus value.
|
| constexpr float | y () const noexcept |
| | Get the Y tristimulus value, the relative luminance.
|
| constexpr float | z () const noexcept |
| | Get the Z tristimulus value.
|
| 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 XYZ | opacity (const float alpha) const |
| | Returns a new color with the same channels and the specified alpha value.
|
| constexpr XYZ & | operator+= (const XYZ &other) noexcept |
| | Adds another color to this color in place.
|
| constexpr XYZ & | operator-= (const XYZ &other) noexcept |
| | Subtracts another color from this color in place.
|
| constexpr XYZ & | operator*= (const XYZ &other) noexcept |
| | Multiplies this color by another color in place.
|
| constexpr XYZ & | operator/= (const float scalar) noexcept |
| | Divides the color channels of this color in place, keeping its alpha.
|
A color in the CIE 1931 XYZ color space, relative to the D65 white point.
XYZ describes any color the eye can see, independently of a display's primaries, and links the RGB gamuts: it is the root of the conversion tree. Y is the relative luminance, so the white of LinSRGB is (0.9505, 1, 1.0891). Channels are not clamped: XYZ itself has no bounds, and colors outside a gamut clip only when converted to it. Like LinSRGB, it is linear in light, so it has the arithmetic operators.
- See also
- CIE 015:2018
Definition at line 389 of file Color.cppm.