49 for(
size_t i = 0;
i < d.
size(); ++
i)
if(d[
i] < 0.0 || d[
i] > 1.0)
return false;
58 double x() {
return d[0]; }
60 double y() {
return d[1]; }
62 double z() {
return d[2]; }
64 void set(
double x,
double y,
double z) { d = {
x,
y,
z }; }
size_t size() const
Returns the number of elements in the array.
Definition array.h:76
Array< T, NumValues > lerp(const Array< T, NumValues > &other, double v) const
Returns a linearly interpolated array between this one and another.
Definition array.h:310
Dynamic array container wrapping std::vector.
Definition list.h:40
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
static String sprintf(const char *fmt,...)
Creates a formatted string using printf-style syntax.
CIE XYZ color value.
Definition xyzcolor.h:25
String toString() const
Returns a string representation of the XYZ color.
Definition xyzcolor.h:84
XYZColor lerp(const XYZColor &val, double t) const
Returns a linearly interpolated XYZColor between this and val.
Definition xyzcolor.h:78
double z()
Returns the Z component.
Definition xyzcolor.h:62
void setZ(double val)
Sets the Z component.
Definition xyzcolor.h:70
void set(double x, double y, double z)
Sets all three XYZ components.
Definition xyzcolor.h:64
XYZColor(const DataType &val)
Constructs an XYZColor from a DataType array.
Definition xyzcolor.h:37
Array< double, 3 > DataType
Underlying storage type for the three XYZ components.
Definition xyzcolor.h:28
void setX(double val)
Sets the X component.
Definition xyzcolor.h:66
double y()
Returns the Y component.
Definition xyzcolor.h:60
void setY(double val)
Sets the Y component.
Definition xyzcolor.h:68
const DataType & data() const
Returns a const reference to the underlying data array.
Definition xyzcolor.h:54
XYZColor()
Constructs an invalid XYZColor with all components set to -1.0.
Definition xyzcolor.h:31
bool isValid() const
Returns true if all components are in the valid [0.0, 1.0] range.
Definition xyzcolor.h:48
XYZColor(double x, double y, double z)
Constructs an XYZColor from individual component values.
Definition xyzcolor.h:45
double x()
Returns the X component.
Definition xyzcolor.h:58
DataType & data()
Returns a mutable reference to the underlying data array.
Definition xyzcolor.h:56
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19