Bug fixed in the xyYtoXYZ and XYZtoxyY functions

This commit is contained in:
Gianpaolo Palma 2017-01-25 20:02:43 +01:00
parent 8eda1c1d2f
commit 424b74bfcd
1 changed files with 4 additions and 4 deletions

View File

@ -1900,9 +1900,9 @@ public:
// CIE xyY --> CIE XYZ
static void xyYtoXYZ(double x, double y, double _Y, double &X, double &Y, double &Z)
{
X = x * (Y / y);
X = x * (_Y / y);
Y = _Y;
Z = (1.0 - x - y) * (Y / y);
Z = (1.0 - x - y) * (_Y / y);
}
static Color4<T> XYZtoxyY(const Color4<T> & color)
@ -1916,11 +1916,11 @@ public:
}
// CIE XYZ --> CIE xyY
static void XYZtoxyY(double X, double _Y, double Z, double &x, double &y, double &Y)
static void XYZtoxyY(double X, double Y, double Z, double &x, double &y, double &_Y)
{
x = X / (X + Y + Z);
y = Y / (X + Y + Z);
Y = _Y;
_Y = Y;
}
// XYZ (Illuminant src) --> XYZ (Illuminant dest) - [ILLUMINANT CHANGE]