34#include <NDEVR/Vector.h>
67 constexpr explicit XYZColor(
const Vector<4, fltp04>& color)
79 clip(x, 0.0f, 0.9505f)
115 m_values[X] = (x > 0.9505f) ? 0.9505f : ((x < 0.0f) ? 0.0f : x);
123 m_values[Y] = (y > 1.0000f) ? 1.0000f : ((y < 0.0f) ? 0.0f : y);
131 m_values[Z] = (z > 1.0890f) ? 1.0890f : ((z < 0.0f) ? 0.0f : z);
147 static XYZColor D65(95.047f, 100.0f, 108.883f);
152 constexpr const XYZColor Constant<XYZColor>::Invalid = XYZColor();
154 constexpr const XYZColor Constant<XYZColor>::Max = XYZColor(Constant<fltp04>::Max, Constant<fltp04>::Max, Constant<fltp04>::Max);
156 constexpr const XYZColor Constant<XYZColor>::Min = XYZColor(Constant<fltp04>::Min, Constant<fltp04>::Min, Constant<fltp04>::Min);
A color identified by an AutoCAD Color Index (ACI) number from 1 through 255.
The core Color class in the NDEVR API.
A color defined by hue, saturation, and brightness components.
A color defined by hue, saturation, and luminosity components.
Forward declaration of the NDEVR translated string class.
Represents a color in the RGB space with optional alpha transparency.
XYZColor(const HSLColor &)
Constructs an XYZColor by converting from an HSLColor.
void setY(fltp04 y)
Sets the Y component, clamped to [0, 1.0].
XYZColor(const LABColor &)
Constructs an XYZColor by converting from a LABColor.
static XYZColor getD65()
Returns the CIE standard illuminant D65 reference white point.
XYZColor(const HSBColor &)
Constructs an XYZColor by converting from an HSBColor.
constexpr XYZColor(fltp04 x, fltp04 y, fltp04 z, fltp04 a=1.0f)
Constructs an XYZColor from individual X, Y, Z, and alpha components, clamped to valid ranges.
void setZ(fltp04 z)
Sets the Z component, clamped to [0, 1.089].
XYZColor(const RGBColor &)
Constructs an XYZColor by converting from an RGBColor.
constexpr XYZColor()
Constructs an invalid XYZColor with all components set to Invalid.
constexpr XYZColor(const Vector< 4, fltp04 > &color)
Constructs an XYZColor from a 4-component vector.
void setA(fltp04 a)
Sets the alpha component.
XYZColor(const ACIColor &)
Constructs an XYZColor by converting from an ACIColor.
void setX(fltp04 x)
Sets the X component, clamped to [0, 0.9505].
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
constexpr t_type clip(const t_type &value, const t_type &lower_bound, const t_type &upper_bound)
Clips the value given so that that the returned value falls between upper and lower bound.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...