[babl] CIE: Simplify code



commit 9083658c43f6d36ebae4e30d95225d79ede4bc30
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Nov 18 02:09:03 2017 +0100

    CIE: Simplify code
    
    Exploit the fact that fy is not needed to calculate the a and b
    components. This is consistent with the other monochrome conversions.

 extensions/CIE.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/extensions/CIE.c b/extensions/CIE.c
index 658fd2a..d5ed9ee 100644
--- a/extensions/CIE.c
+++ b/extensions/CIE.c
@@ -713,10 +713,7 @@ rgbaf_to_Lf (const Babl *conversion,float *src,
       float b = src[2];
 
       float yr = m_1_0 * r + m_1_1 * g + m_1_2 * b;
-
-      float fy = yr > LAB_EPSILON ? _cbrtf (yr) : (LAB_KAPPA * yr + 16.0f) / 116.0f;
-
-      float L = 116.0f * fy - 16.0f;
+      float L = yr > LAB_EPSILON ? 116.0f * _cbrtf (yr) - 16 : LAB_KAPPA * yr;
 
       dst[0] = L;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]