Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorimetryUtils::xy Struct Reference

#include <KisColorimetryUtils.h>

Public Member Functions

QVector2D asVector () const
 
bool operator== (const xy &other) const
 
XYZ toXYZ () const
 

Public Attributes

double x
 
double y
 

Detailed Description

xyY, with Y unspecified

Definition at line 31 of file KisColorimetryUtils.h.

Member Function Documentation

◆ asVector()

QVector2D KisColorimetryUtils::xy::asVector ( ) const

Definition at line 42 of file KisColorimetryUtils.cpp.

43{
44 return QVector2D(x, y);
45}

References x, and y.

◆ operator==()

bool KisColorimetryUtils::xy::operator== ( const xy & other) const

Definition at line 47 of file KisColorimetryUtils.cpp.

48{
49 return qFuzzyCompare(x, other.x) && qFuzzyCompare(y, other.y);
50}
static bool qFuzzyCompare(half p1, half p2)

References qFuzzyCompare(), x, and y.

◆ toXYZ()

XYZ KisColorimetryUtils::xy::toXYZ ( ) const

Definition at line 30 of file KisColorimetryUtils.cpp.

31{
32 if (qFuzzyIsNull(y)) {
33 return XYZ{0, 0, 0};
34 }
35 return XYZ{
36 .X = x / y,
37 .Y = 1.0,
38 .Z = (1 - x - y) / y,
39 };
40}
static bool qFuzzyIsNull(half h)

References qFuzzyIsNull(), x, KisColorimetryUtils::XYZ::X, and y.

Member Data Documentation

◆ x

double KisColorimetryUtils::xy::x

Definition at line 32 of file KisColorimetryUtils.h.

◆ y

double KisColorimetryUtils::xy::y

Definition at line 33 of file KisColorimetryUtils.h.


The documentation for this struct was generated from the following files: