18#include <QtGui/private/qtguiglobal_p.h>
29 QColorTrc()
noexcept : m_type(Type::Uninitialized) { }
30 QColorTrc(
const QColorTransferFunction &fun) : m_type(Type::ParameterizedFunction), m_fun(fun) { }
31 QColorTrc(
const QColorTransferTable &table) : m_type(Type::Table), m_table(table) { }
32 QColorTrc(
const QColorTransferGenericFunction &hdr) : m_type(Type::GenericFunction), m_hdr(hdr) { }
33 QColorTrc(QColorTransferFunction &&fun)
noexcept : m_type(Type::ParameterizedFunction), m_fun(std::move(fun)) { }
34 QColorTrc(QColorTransferTable &&table)
noexcept : m_type(Type::Table), m_table(std::move(table)) { }
35 QColorTrc(QColorTransferGenericFunction &&hdr)
noexcept : m_type(Type::GenericFunction), m_hdr(std::move(hdr)) { }
39 ParameterizedFunction,
44 bool isIdentity()
const
46 return (m_type == Type::ParameterizedFunction && m_fun.isIdentity())
47 || (m_type == Type::Table && m_table.isIdentity());
51 return m_type != Type::Uninitialized;
53 float apply(
float x)
const
56 case Type::ParameterizedFunction:
57 return fun().apply(x);
58 case Type::GenericFunction:
59 return hdr().apply(x);
61 return table().apply(x);
67 float applyExtended(
float x)
const
70 case Type::ParameterizedFunction:
71 return std::copysign(fun().apply(std::abs(x)), x);
72 case Type::GenericFunction:
73 return hdr().apply(x);
75 return table().apply(x);
81 float applyInverse(
float x)
const
84 case Type::ParameterizedFunction:
85 return fun().inverted().apply(x);
86 case Type::GenericFunction:
87 return hdr().applyInverse(x);
89 return table().applyInverse(x);
95 float applyInverseExtended(
float x)
const
98 case Type::ParameterizedFunction:
99 return std::copysign(applyInverse(std::abs(x)), x);
100 case Type::GenericFunction:
101 return hdr().applyInverse(x);
103 return table().applyInverse(x);
110 const QColorTransferTable &table()
const {
return m_table; }
111 const QColorTransferFunction &fun()
const{
return m_fun; }
112 const QColorTransferGenericFunction &hdr()
const {
return m_hdr; }
113 Type type()
const noexcept {
return m_type; }
117 friend inline bool comparesEqual(
const QColorTrc &lhs,
const QColorTrc &rhs);
118 Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QColorTrc)
120 QColorTransferFunction m_fun;
121 QColorTransferTable m_table;
122 QColorTransferGenericFunction m_hdr;
127 if (o1.m_type != o2.m_type)
129 if (o1.m_type == QColorTrc::Type::ParameterizedFunction)
130 return o1.m_fun == o2.m_fun;
131 if (o1.m_type == QColorTrc::Type::Table)
132 return o1.m_table == o2.m_table;
133 if (o1.m_type == QColorTrc::Type::GenericFunction)
134 return o1.m_hdr == o2.m_hdr;
QColorVector apply(const QColorVector &v) const
QList< QColorVector > table
QColorMatrix inverted() const
static QColorMatrix toXyzFromSRgb()
static QColorMatrix toXyzFromAdobeRgb()
friend bool comparesEqual(const QColorMatrix &lhs, const QColorMatrix &rhs) noexcept
constexpr float determinant() const
static QColorMatrix identity()
QColorMatrix transposed() const
static QColorMatrix fromScale(QColorVector v)
friend constexpr QColorMatrix operator*(const QColorMatrix &a, const QColorMatrix &o)
bool isIdentity() const noexcept
static QColorMatrix toXyzFromDciP3D65()
static QColorMatrix chromaticAdaptation(const QColorVector &whitePoint)
static QColorMatrix toXyzFromProPhotoRgb()
QColorVector map(const QColorVector &c) const
static QColorMatrix toXyzFromBt2020()
constexpr bool isNull() const
void setTransferFunctionTables(const QList< uint16_t > &redTransferFunctionTable, const QList< uint16_t > &greenTransferFunctionTable, const QList< uint16_t > &blueTransferFunctionTable)
QColorSpacePrivate(QPointF whitePoint, const QList< uint16_t > &transferFunctionTable)
QColorSpacePrivate(QPointF whitePoint, QColorSpace::TransferFunction transferFunction, float gamma)
QColorSpacePrivate(const QColorSpace::PrimaryPoints &primaries, const QList< uint16_t > &transferFunctionTable)
QColorTransform transformationToColorSpace(const QColorSpacePrivate *out) const
void clearElementListProcessingForEdit()
void setTransferFunctionTable(const QList< uint16_t > &transferFunctionTable)
QColorTransform transformationToXYZ() const
bool isThreeComponentMatrix() const
QColorSpacePrivate(const QColorSpace::PrimaryPoints &primaries, const QList< uint16_t > &redTransferFunctionTable, const QList< uint16_t > &greenTransferFunctionTable, const QList< uint16_t > &blueRransferFunctionTable)
QColorSpacePrivate(const QColorSpacePrivate &other)=default
static const QColorSpacePrivate * get(const QColorSpace &colorSpace)
QColorSpacePrivate(const QColorSpace::PrimaryPoints &primaries, QColorSpace::TransferFunction transferFunction, float gamma)
void setTransferFunction()
static QColorSpacePrivate * get(QColorSpace &colorSpace)
void identifyColorSpace()
bool isValid() const noexcept
QColorSpacePrivate(QColorSpace::NamedColorSpace namedColorSpace)
bool equals(const QColorSpacePrivate *other) const
bool comparesEqual(const QColorVector &v1, const QColorVector &v2) noexcept
static void cleanupPredefinedColorspaces()
static bool compareElement(const QColorSpacePrivate::TransferElement &element, const QColorSpacePrivate::TransferElement &other)
QDebug operator<<(QDebug dbg, const QColorCLUT &)
QDebug operator<<(QDebug dbg, const QColorSpace &colorSpace)
QDebug operator<<(QDebug dbg, const QColorMatrix &)
static bool compareElement(const QColorMatrix &element, const QColorMatrix &other)
QDataStream & operator>>(QDataStream &s, QColorSpace &colorSpace)
QDataStream & operator<<(QDataStream &s, const QColorSpace &image)
QDebug operator<<(QDebug dbg, const QColorVector &)
QColorMatrix qColorSpacePrimaryPointsToXyzMatrix(const QColorSpace::PrimaryPoints &primaries)
static bool compareElements(const T &element, const QColorSpacePrivate::Element &other)
static bool compareElement(const QColorCLUT &element, const QColorCLUT &other)
static bool compareElement(const QColorVector &element, const QColorVector &other)
QDebug operator<<(QDebug dbg, const QColorSpacePrivate::TransferElement &)
QT_BEGIN_NAMESPACE bool qColorSpacePrimaryPointsAreValid(const QColorSpace::PrimaryPoints &primaries)
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
const std::shared_ptr< QColorTrcLut > & operator[](int i) const
std::shared_ptr< QColorTrcLut > & operator[](int i)
std::shared_ptr< QColorTrcLut > table[3]