6#include <Common/assertion.h>
11template<EChromaticAdaptation ALGORITHM>
38 PH_ASSERT(srcRefWhite != dstRefWhite);
63 PH_ASSERT_NE(srcConeResponse[0], 0);
64 PH_ASSERT_NE(srcConeResponse[1], 0);
65 PH_ASSERT_NE(srcConeResponse[2], 0);
68 dstConeResponse[0] / srcConeResponse[0],
69 dstConeResponse[1] / srcConeResponse[1],
70 dstConeResponse[2] / srcConeResponse[2]
74 return ConeResponseToCIEXYZ.
mul(coneResponseScaleMat).mul(CIEXYZToConeResponse);
100 getCIEXYZToConeResponse(),
101 getConeResponseToCIEXYZ(),
105 return CATMatrix.multiplyVector(CIEXYZColor);
124 0.8951000, 0.2664000, -0.1614000,
125 -0.7502000, 1.7135000, 0.0367000,
126 0.0389000, -0.0685000, 1.0296000));
132 0.9869929054667121899, -0.14705425642099010066, 0.15996265166373123948,
133 0.43230526972339451002, 0.51836027153677753834, 0.049291228212855612148,
134 -0.0085286645751773312464, 0.040042821654084864313, 0.96848669578754998478));
143 getCIEXYZToConeResponse(),
144 getConeResponseToCIEXYZ(),
148 return CATMatrix.multiplyVector(CIEXYZColor);
160 0.4002400, 0.7076000, -0.0808100,
161 -0.2263000, 1.1653200, 0.0457000,
162 0.0000000, 0.0000000, 0.9182200));
168 1.8599363874558397422, -1.1293816185800914784, 0.21989740959619327624,
169 0.36119143624176752624, 0.63881246328504213303, -0.0000063705968386570599758,
170 0, 0, 1.0890636230968613186));
179 getCIEXYZToConeResponse(),
180 getConeResponseToCIEXYZ(),
184 return CATMatrix.multiplyVector(CIEXYZColor);
191static_assert(!CChromaticAdaptationDefinition<
194template<EChromaticAdaptation ALGORITHM,
typename T>
203 "No definition for the specified chromatic adaptation ALGORITHM.");
205 return ChromaticAdapter::adapt(srcCIEXYZColor, srcRefWhite, dstRefWhite);
Marks the derived class as uninstantiable.
Definition IUninstantiable.h:13
static TMatrix3< T > getCIEXYZToConeResponse()
Definition chromatic_adaptations.ipp:121
static TTristimulusValues< T > adapt(const TTristimulusValues< T > &CIEXYZColor, const EReferenceWhite srcRefWhite, const EReferenceWhite dstRefWhite)
Definition chromatic_adaptations.ipp:137
static TMatrix3< T > getConeResponseToCIEXYZ()
Definition chromatic_adaptations.ipp:129
static TTristimulusValues< T > adapt(const TTristimulusValues< T > &CIEXYZColor, const EReferenceWhite srcRefWhite, const EReferenceWhite dstRefWhite)
Definition chromatic_adaptations.ipp:173
static TMatrix3< T > getConeResponseToCIEXYZ()
Definition chromatic_adaptations.ipp:165
static TMatrix3< T > getCIEXYZToConeResponse()
Definition chromatic_adaptations.ipp:157
static TMatrix3< T > getConeResponseToCIEXYZ()
Definition chromatic_adaptations.ipp:89
static TTristimulusValues< T > adapt(const TTristimulusValues< T > &CIEXYZColor, const EReferenceWhite srcRefWhite, const EReferenceWhite dstRefWhite)
Definition chromatic_adaptations.ipp:94
static TMatrix3< T > getCIEXYZToConeResponse()
Definition chromatic_adaptations.ipp:84
Definition chromatic_adaptations.ipp:13
static consteval EChromaticAdaptation getAlgorithm() noexcept
Definition chromatic_adaptations.ipp:17
Sinkhole for undefined chromatic adaptation routines. Specialize the class to provide definitions for...
Definition chromatic_adaptations.h:28
Represents a 3x3 matrix.
Definition TMatrix3.h:16
TVector3< T > mul(const TVector3< T > &rhsColVector) const
Definition TMatrix3.ipp:68
TRawColVector< T, M > multiplyVector(const TRawColVector< T, M > &rhsColVector) const
Definition TMatrixMxNBase.ipp:57
Derived & setIdentity()
Sets the matrix to be an identity matrix.
Definition TMatrixNBase.ipp:13
Derived & setScale(const TRawColVector< T, N > &scaleFactor)
Definition TMatrixNBase.ipp:27
Definition chromatic_adaptations.h:13
Math functions and utilities.
Definition TransformInfo.h:10
TTristimulusValues< T > CIEXYZ_of(const EReferenceWhite refWhite)
Definition color_basics.h:243
real ColorValue
Definition color_basics.h:42
TTristimulusValues< T > chromatic_adapt(const TTristimulusValues< T > &srcCIEXYZColor, EReferenceWhite srcRefWhite, EReferenceWhite dstRefWhite)
Definition chromatic_adaptations.ipp:195
TMatrix3< T > create_von_kries_linear_CAT_matrix(const TMatrix3< T > &CIEXYZToConeResponse, const TMatrix3< T > &ConeResponseToCIEXYZ, const EReferenceWhite srcRefWhite, const EReferenceWhite dstRefWhite)
Definition chromatic_adaptations.ipp:30
TMatrix3< float64 > Matrix3D
Definition math_fwd.h:72
TRawColorValues< T, 3 > TTristimulusValues
Definition color_basics.h:48
EReferenceWhite
Definition color_enums.h:49
EChromaticAdaptation
Methods to map image appearance between different illumination sources. This kind of mapping is commo...
Definition color_enums.h:114