A point in the CIE 1931 xy chromaticity diagram. More...
#include <ciepoint.h>
Public Types | |
| using | DataType = Array< double, 2 > |
| Underlying storage type for the x and y coordinates. | |
Public Member Functions | |
| CIEPoint (double x=-1.0, double y=-1.0) | |
| Constructs a CIEPoint with the given chromaticity coordinates. | |
| CIEPoint (const DataType &other) | |
| Constructs a CIEPoint from raw coordinate data. | |
| bool | isValid () const |
| Checks whether this point lies within valid chromaticity bounds. | |
| CIEPoint | lerp (const CIEPoint &other, double t) const |
| Linearly interpolates between this point and another. | |
Static Public Member Functions | |
| static bool | isValidWavelength (double val) |
| Checks whether a wavelength is within the visible range. | |
| static XYZColor | wavelengthToXYZ (double wavelength) |
| Converts a wavelength to a CIE XYZ color. | |
| static CIEPoint | wavelengthToCIEPoint (double wavelength) |
| Converts a wavelength to a CIE xy chromaticity point. | |
| static CIEPoint | colorTempToWhitePoint (double cct) |
| Computes the white point for a correlated color temperature. | |
Static Public Attributes | |
| static constexpr double | MinWavelength = 360 |
| Minimum visible wavelength in nanometers. | |
| static constexpr double | MaxWavelength = 700 |
| Maximum visible wavelength in nanometers. | |
A point in the CIE 1931 xy chromaticity diagram.
Represents a two-dimensional chromaticity coordinate (x, y) and provides conversions between wavelengths, correlated color temperatures, and CIE XYZ color space.
Constructs a CIEPoint from raw coordinate data.
| other | The coordinate array to copy from. |
Computes the white point for a correlated color temperature.
Uses Bruce Lindbloom's approximation for CCT values between 4000 K and 25000 K. Returns an invalid CIEPoint for out-of-range values.
| cct | The correlated color temperature in Kelvin. |
|
inline |
Checks whether this point lies within valid chromaticity bounds.
Checks whether a wavelength is within the visible range.
| val | The wavelength in nanometers. |
val is between MinWavelength and MaxWavelength inclusive. Converts a wavelength to a CIE xy chromaticity point.
| wavelength | The wavelength in nanometers. |
Converts a wavelength to a CIE XYZ color.
| wavelength | The wavelength in nanometers. |