From 43a0e9acf5d2b443304fa907a7404e8c209f42a3 Mon Sep 17 00:00:00 2001 From: Oliver Duis Date: Mon, 10 Sep 2012 21:26:02 +0200 Subject: [PATCH] Fixed clipped areas become light gray using "avoid color shifts" see issue 1552 --- rtengine/color.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtengine/color.cc b/rtengine/color.cc index e87ea3e83..ffa5808f3 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -669,7 +669,7 @@ namespace rtengine { void Color::gamutLchonly (float HH, float &Lprov1, float &Chprov1, float &R, float &G, float &B, double wip[3][3], const bool isHLEnabled, const float lowerCoef, const float higherCoef) #endif { - + const float ClipLevel = 65534.5f; bool inGamut; #ifdef _DEBUG neg=false, more_rgb=false; @@ -703,8 +703,8 @@ namespace rtengine { Lprov1 += lowerCoef; inGamut = false; } - // if "highlight reconstruction" is enabled, don't control Gamut - else if ((!isHLEnabled) && (R>65534.5f || G>65534.5f || B>65534.5f)) { + // if "highlight reconstruction" is enabled or the point is completely white (clipped, no color), don't control Gamut + else if (!isHLEnabled && (R>ClipLevel || G>ClipLevel || B>ClipLevel) && (R<=ClipLevel || G<=ClipLevel || B<=ClipLevel)) { #ifdef _DEBUG more_rgb=true; #endif