From d0c28cce5ca31ca8a18f3cdaa3b785cbc9b17896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C3=B6h?= Date: Fri, 8 Apr 2022 01:33:47 +0200 Subject: [PATCH] Clearly the wrong conversion, back to s-rgb --- sampleLightCtrl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sampleLightCtrl.c b/sampleLightCtrl.c index 3e6a8fd..f33f2a8 100644 --- a/sampleLightCtrl.c +++ b/sampleLightCtrl.c @@ -358,10 +358,10 @@ void hwLight_colorUpdate_XY2RGB(u16 xI, u16 yI, u8 level) float X = yI == 0 ? 0.0f : (x * Y) / y; float Z = yI == 0 ? 0.0f : (z * Y) / y; - // Wide Gamut RGB D50 http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - float r = max2(X * 1.4628067f + Y * -0.1840623f + Z * -0.2743606f,0); - float g = max2(X * -0.5217933f + Y * 1.4472381f + Z * 0.0677227f,0); - float b = max2(X * 0.0349342f + Y * -0.0968930f + Z * 1.2884099f,0); + // S-RGB D65 http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + float r = max2(X * 3.2404542f + Y * -1.5371385f + Z * -0.4985314f,0); + float g = max2(X * -0.9692660f + Y * 1.8760108f + Z * 0.0415560f,0); + float b = max2(X * 0.0556434f + Y * -0.2040259f + Z * 1.0572252f,0); // Apply LINEAR => SRGB Gamma correction r = LINEAR_TO_SRGB_GAMMA_CORRECTION(r);