XYZ color representation (CIE 1931 color space).
More...
#include <colors.h>
|
|
| XYZ () |
| | Default constructor initializes XYZ to (0,0,0)
|
| |
| | XYZ (const double x, const double y, const double z) |
| | Construct XYZ from component values.
|
| |
| | XYZ (const RGB &rgb) |
| | Construct XYZ from RGB color.
|
| |
| | XYZ (const Lab &lab, const std::array< double, 3 > &white_point={ 0.95047, 1, 1.08883 }) |
| | Construct XYZ from Lab color.
|
| |
| | XYZ (const HSL &hsl) |
| | Construct XYZ from HSL color.
|
| |
| | XYZ (const LCHab &lch, const std::array< double, 3 > &white_point={ 0.95047, 1, 1.08883 }) |
| | Construct XYZ from LCHab color.
|
| |
| bool | operator== (const XYZ &other) const |
| | equality operator for XYZ colors
|
| |
| bool | operator!= (const XYZ &other) const |
| | inequality operator for XYZ colors
|
| |
| double | x () const |
| | Get X component.
|
| |
| double | y () const |
| | Get Y component (luminance)
|
| |
| double | z () const |
| | Get Z component.
|
| |
XYZ color representation (CIE 1931 color space).
Represents a color in the device-independent CIE 1931 XYZ color space. Used as an intermediate for conversions between RGB and perceptually uniform spaces (Lab, LCHab, DIN99d).
- X: [0, ~0.95] (roughly red-like)
- Y: [0, 1] (luminance)
- Z: [0, ~1.09] (roughly blue-like)
Most conversions use the D65 reference white point by default.
XYZ xyz_from_rgb(
RGB(0.5, 0.2, 0.7));
XYZ xyz_custom_white(0.4, 0.5, 0.6, { 0.96422, 1.0, 0.82521 });
RGB color representation with values in [0,1] range.
XYZ color representation (CIE 1931 color space).
- See also
- RGB, Lab, LCHab, DIN99d for conversions.
Definition at line 311 of file colors.h.
◆ XYZ() [1/5]
| qualpal::colors::XYZ::XYZ |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| |
Construct XYZ from component values.
- Parameters
-
| x | X component (roughly red-like) |
| y | Y component (luminance) |
| z | Z component (roughly blue-like) |
◆ XYZ() [2/5]
| qualpal::colors::XYZ::XYZ |
( |
const RGB & |
rgb | ) |
|
Construct XYZ from RGB color.
- Parameters
-
| rgb | RGB color to convert from |
◆ XYZ() [3/5]
| qualpal::colors::XYZ::XYZ |
( |
const Lab & |
lab, |
|
|
const std::array< double, 3 > & |
white_point = { 0.95047, 1, 1.08883 } |
|
) |
| |
Construct XYZ from Lab color.
- Parameters
-
| lab | Lab color to convert from |
| white_point | Reference white point (default: D65) |
◆ XYZ() [4/5]
| qualpal::colors::XYZ::XYZ |
( |
const HSL & |
hsl | ) |
|
Construct XYZ from HSL color.
- Parameters
-
| hsl | HSL color to convert from |
◆ XYZ() [5/5]
| qualpal::colors::XYZ::XYZ |
( |
const LCHab & |
lch, |
|
|
const std::array< double, 3 > & |
white_point = { 0.95047, 1, 1.08883 } |
|
) |
| |
Construct XYZ from LCHab color.
- Parameters
-
| lch | LCHab color to convert from |
| white_point | Reference white point (default: D65) |
◆ operator!=()
| bool qualpal::colors::XYZ::operator!= |
( |
const XYZ & |
other | ) |
const |
|
inline |
inequality operator for XYZ colors
- Parameters
-
| other | Other XYZ color to compare with |
- Returns
- true if XYZ colors are not equal, false otherwise
Definition at line 376 of file colors.h.
◆ operator==()
| bool qualpal::colors::XYZ::operator== |
( |
const XYZ & |
other | ) |
const |
|
inline |
equality operator for XYZ colors
- Parameters
-
| other | Other XYZ color to compare with |
- Returns
- true if both XYZ colors are equal, false otherwise
Definition at line 365 of file colors.h.
◆ x()
| double qualpal::colors::XYZ::x |
( |
| ) |
const |
|
inline |
Get X component.
Definition at line 379 of file colors.h.
◆ y()
| double qualpal::colors::XYZ::y |
( |
| ) |
const |
|
inline |
Get Y component (luminance)
Definition at line 381 of file colors.h.
◆ z()
| double qualpal::colors::XYZ::z |
( |
| ) |
const |
|
inline |
Get Z component.
Definition at line 383 of file colors.h.
The documentation for this class was generated from the following file: