From 3df0acee567abad80399a9eb075fbf76ef6b3f1f Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sun, 21 Aug 2016 15:13:17 +0200 Subject: [PATCH] Fixed wrong transition curve in ciecam02, fixes #3398 --- rtengine/color.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rtengine/color.cc b/rtengine/color.cc index c822a6f33..c6f69d968 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -199,12 +199,12 @@ void Color::init () #ifdef _OPENMP #pragma omp section #endif -{ - for (int i = 0; i < maxindex; i++) { - igammatab_srgb[i] = igammatab_srgb1[i] = igamma2 (i / 65535.0); + { + for (int i = 0; i < maxindex; i++) { + igammatab_srgb[i] = igammatab_srgb1[i] = igamma2 (i / 65535.0); + } + igammatab_srgb *= 65535.f; } - igammatab_srgb *= 65535.f; -} #ifdef _OPENMP #pragma omp section #endif @@ -1724,7 +1724,7 @@ void Color::skinred ( double J, double h, double sres, double Sp, float dred, fl if (J < 16.0) { dred = 40.0f; } else if(J < 22.0) { - dred = (4.1666f) * (float)J - 26.6f; + dred = 2.5f * (float)J; } else if(J < 60.0) { dred = 55.0f; } else if(J < 70.0) { @@ -1783,16 +1783,16 @@ void Color::skinredfloat ( float J, float h, float sres, float Sp, float dred, f float chromapro = sres / Sp; if(sk == 1) { //in C mode to adapt dred to J - if (J < 16.0) { - dred = 40.0f; - } else if(J < 22.0) { - dred = (4.1666f) * (float)J - 26.6f; - } else if(J < 60.0) { - dred = 55.0f; - } else if(J < 70.0) { - dred = -1.5f * (float)J + 145.0f; + if (J < 16.f) { + dred = 40.f; + } else if(J < 22.f) { + dred = 2.5f * J; + } else if(J < 60.f) { + dred = 55.f; + } else if(J < 70.f) { + dred = 145.f - 1.5f * J; } else { - dred = 40.0f; + dred = 40.f; } }