qualpal 2.3.0
Loading...
Searching...
No Matches
qualpal::colors::XYZ Class Reference

XYZ color representation (CIE 1931 color space) More...

#include <colors.h>

Public Member Functions

 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.
 

Detailed Description

XYZ color representation (CIE 1931 color space)

Device-independent color space that serves as an intermediate for conversions between RGB and perceptually uniform spaces.

Definition at line 271 of file colors.h.

Constructor & Destructor Documentation

◆ XYZ() [1/5]

qualpal::colors::XYZ::XYZ ( const double  x,
const double  y,
const double  z 
)

Construct XYZ from component values.

Parameters
xX component (roughly red-like)
yY component (luminance)
zZ component (roughly blue-like)

◆ XYZ() [2/5]

qualpal::colors::XYZ::XYZ ( const RGB rgb)

Construct XYZ from RGB color.

Parameters
rgbRGB 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
labLab color to convert from
white_pointReference white point (default: D65)

◆ XYZ() [4/5]

qualpal::colors::XYZ::XYZ ( const HSL hsl)

Construct XYZ from HSL color.

Parameters
hslHSL 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
lchLCHab color to convert from
white_pointReference white point (default: D65)

Member Function Documentation

◆ operator!=()

bool qualpal::colors::XYZ::operator!= ( const XYZ other) const
inline

inequality operator for XYZ colors

Parameters
otherOther XYZ color to compare with
Returns
true if XYZ colors are not equal, false otherwise

Definition at line 336 of file colors.h.

◆ operator==()

bool qualpal::colors::XYZ::operator== ( const XYZ other) const
inline

equality operator for XYZ colors

Parameters
otherOther XYZ color to compare with
Returns
true if both XYZ colors are equal, false otherwise

Definition at line 325 of file colors.h.

◆ x()

double qualpal::colors::XYZ::x ( ) const
inline

Get X component.

Definition at line 339 of file colors.h.

◆ y()

double qualpal::colors::XYZ::y ( ) const
inline

Get Y component (luminance)

Definition at line 341 of file colors.h.

◆ z()

double qualpal::colors::XYZ::z ( ) const
inline

Get Z component.

Definition at line 343 of file colors.h.


The documentation for this class was generated from the following file: