From 069584c50582d17a7265fc64cdd80e34b3a65b1f Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 18 Feb 2019 22:06:34 +0100 Subject: [PATCH] Fix L* and CC curve background histograms The histograms were not being drawn using the full available width. Patch by Ingo Weyrich, fixes #4933 --- rtengine/improcfun.cc | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 3c8b0d430..465e3ffe8 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -4289,17 +4289,8 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW } - LUTu hist16Clad; - LUTu hist16Llad; - - //preparate for histograms CIECAM - if (pW != 1) { //only with improccoordinator - hist16Clad (65536); - hist16Clad.clear(); - hist16Llad (65536); - hist16Llad.clear(); - - } + const float histLFactor = pW != 1 ? histLCurve.getSize() / 100.f : 1.f; + const float histCFactor = pW != 1 ? histCCurve.getSize() / 48000.f : 1.f; #ifdef _DEBUG MyTime t1e, t2e; @@ -4799,8 +4790,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW //update histogram C if (pW != 1) { //only with improccoordinator - int posp = (int)sqrt (atmp * atmp + btmp * btmp); - hist16Clad[posp]++; + histCCurve[histCFactor * sqrt(atmp * atmp + btmp * btmp)]++; } if (editPipette && editID == EUID_Lab_LCCurve) { @@ -4855,8 +4845,7 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW //update histo LC if (pW != 1) { //only with improccoordinator - int posl = Lprov1 * 327.68f; - hist16Llad[posl]++; + histLCurve[Lprov1 * histLFactor]++; } Chprov1 = sqrt (SQR (atmp) + SQR (btmp)) / 327.68f; @@ -4943,13 +4932,6 @@ void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW } } // end of parallelization - if (pW != 1) { //only with improccoordinator - //update histogram C with data chromaticity and not with CC curve - hist16Clad.compressTo (histCCurve); - //update histogram L with data luminance - hist16Llad.compressTo (histLCurve); - } - #ifdef _DEBUG if (settings->verbose) {