7#ifndef KISCOLORIMETRYUTILS_H
8#define KISCOLORIMETRYUTILS_H
13#include <boost/operators.hpp>
16#include <kritapigment_export.h>
24QMatrix4x4
matrixFromColumns(
const QVector3D &first,
const QVector3D &second,
const QVector3D &third);
31struct KRITAPIGMENT_EXPORT
xy {
36 QVector2D asVector()
const;
40struct KRITAPIGMENT_EXPORT
xyY {
49struct KRITAPIGMENT_EXPORT
XYZ {
56 QVector3D asVector()
const;
57 XYZ operator*(
double factor)
const;
58 XYZ operator/(
double factor)
const;
59 XYZ operator+(
const XYZ &other)
const;
62 static XYZ fromVector(
const QVector3D &vector);
87 static QMatrix4x4 chromaticAdaptationMatrix(
XYZ sourceWhitepoint,
XYZ destinationWhitepoint);
89 static QMatrix4x4 calculateToXYZMatrix(
XYZ red,
XYZ green,
XYZ blue,
XYZ white);
94 static bool isValid(
xy red,
xy green,
xy blue,
xy white);
98 static bool isReal(
xy red,
xy green,
xy blue,
xy white);
107 const QMatrix4x4 &toXYZ()
const;
111 const QMatrix4x4 &fromXYZ()
const;
112 QMatrix4x4 toLMS()
const;
113 QMatrix4x4 fromLMS()
const;
130 QMatrix4x4 relativeColorimetricTo(
const Colorimetry &other)
const;
131 QMatrix4x4 absoluteColorimetricTo(
const Colorimetry &other)
const;
133 const XYZ &red()
const;
134 const XYZ &green()
const;
135 const XYZ &blue()
const;
136 const XYZ &white()
const;
float value(const T *src, size_t ch)
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
static const Colorimetry DCIP3
static const Colorimetry BT2020
static const Colorimetry PAL_M
static const Colorimetry PAL
static const Colorimetry CIEXYZ
static const Colorimetry BT709
static const Colorimetry DisplayP3
static const Colorimetry AdobeRGB
static const Colorimetry NTSC
static const Colorimetry GenericFilm
QDebug operator<<(QDebug debug, const xy &value)
QMatrix4x4 matrixFromColumns(const QVector3D &first, const QVector3D &second, const QVector3D &third)