Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorimetryUtils Namespace Reference

Classes

class  Colorimetry
 
struct  xy
 
struct  xyY
 
struct  XYZ
 

Functions

QMatrix4x4 matrixFromColumns (const QVector3D &first, const QVector3D &second, const QVector3D &third)
 
QDebug operator<< (QDebug debug, const Colorimetry &value)
 
QDebug operator<< (QDebug debug, const xy &value)
 
QDebug operator<< (QDebug debug, const xyY &value)
 
QDebug operator<< (QDebug debug, const XYZ &value)
 
static double triangleArea (QVector2D p1, QVector2D p2, QVector2D p3)
 

Variables

static const QMatrix4x4 s_inverseDolbyLMS = s_xyzToDolbyLMS.inverted()
 
static const QMatrix4x4 s_xyzToDolbyLMS
 

Function Documentation

◆ matrixFromColumns()

QMatrix4x4 KisColorimetryUtils::matrixFromColumns ( const QVector3D & first,
const QVector3D & second,
const QVector3D & third )

Definition at line 15 of file KisColorimetryUtils.cpp.

16{
17 QMatrix4x4 ret;
18 ret(0, 0) = first.x();
19 ret(1, 0) = first.y();
20 ret(2, 0) = first.z();
21 ret(0, 1) = second.x();
22 ret(1, 1) = second.y();
23 ret(2, 1) = second.z();
24 ret(0, 2) = third.x();
25 ret(1, 2) = third.y();
26 ret(2, 2) = third.z();
27 return ret;
28}

◆ operator<<() [1/4]

KRITASURFACECOLORMANAGEMENTAPI_EXPORT QDebug KisColorimetryUtils::operator<< ( QDebug debug,
const Colorimetry & value )

Definition at line 449 of file KisColorimetryUtils.cpp.

449 {
450 QDebugStateSaver saver(debug);
451 debug.nospace() << "Colorimetry(Red: " << value.red().toxy() << ", Green: " << value.green().toxy() << ", Blue: " << value.blue().toxy() << ", White: " << value.white().toxy() << ")";
452 return debug;
453}
float value(const T *src, size_t ch)

References value().

◆ operator<<() [2/4]

KRITASURFACECOLORMANAGEMENTAPI_EXPORT QDebug KisColorimetryUtils::operator<< ( QDebug debug,
const xy & value )

Definition at line 431 of file KisColorimetryUtils.cpp.

431 {
432 QDebugStateSaver saver(debug);
433 debug.nospace() << "xy(x: " << value.x << ", y: " << value.y << ")";
434 return debug;
435}

References value().

◆ operator<<() [3/4]

KRITASURFACECOLORMANAGEMENTAPI_EXPORT QDebug KisColorimetryUtils::operator<< ( QDebug debug,
const xyY & value )

Definition at line 437 of file KisColorimetryUtils.cpp.

437 {
438 QDebugStateSaver saver(debug);
439 debug.nospace() << "xyY(x: " << value.x << ", y: " << value.y << ", Y: " << value.Y << ")";
440 return debug;
441}

References value().

◆ operator<<() [4/4]

KRITASURFACECOLORMANAGEMENTAPI_EXPORT QDebug KisColorimetryUtils::operator<< ( QDebug debug,
const XYZ & value )

Definition at line 443 of file KisColorimetryUtils.cpp.

443 {
444 QDebugStateSaver saver(debug);
445 debug.nospace() << "XYZ(X: " << value.X << ", Y: " << value.Y << ", Z: " << value.Z << ")";
446 return debug;
447}

References value().

◆ triangleArea()

static double KisColorimetryUtils::triangleArea ( QVector2D p1,
QVector2D p2,
QVector2D p3 )
static

Definition at line 207 of file KisColorimetryUtils.cpp.

208{
209 return std::abs(0.5 * (p1.x() * (p2.y() - p3.y()) + p2.x() * (p3.y() - p1.y()) + p3.x() * (p1.y() - p2.y())));
210}
QPointF p2
QPointF p3
QPointF p1

References p1, p2, and p3.

Variable Documentation

◆ s_inverseDolbyLMS

const QMatrix4x4 KisColorimetryUtils::s_inverseDolbyLMS = s_xyzToDolbyLMS.inverted()
static

Definition at line 301 of file KisColorimetryUtils.cpp.

◆ s_xyzToDolbyLMS

const QMatrix4x4 KisColorimetryUtils::s_xyzToDolbyLMS
static
Initial value:
= []() {
QMatrix4x4 ret;
ret(0, 0) = 0.3593;
ret(0, 1) = 0.6976;
ret(0, 2) = -0.0359;
ret(1, 0) = -0.1921;
ret(1, 1) = 1.1005;
ret(1, 2) = 0.0754;
ret(2, 0) = 0.0071;
ret(2, 1) = 0.0748;
ret(2, 2) = 0.8433;
return ret;
}()

Definition at line 288 of file KisColorimetryUtils.cpp.

288 {
289 QMatrix4x4 ret;
290 ret(0, 0) = 0.3593;
291 ret(0, 1) = 0.6976;
292 ret(0, 2) = -0.0359;
293 ret(1, 0) = -0.1921;
294 ret(1, 1) = 1.1005;
295 ret(1, 2) = 0.0754;
296 ret(2, 0) = 0.0071;
297 ret(2, 1) = 0.0748;
298 ret(2, 2) = 0.8433;
299 return ret;
300}();