diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 6a93d1d82..b3f5b186e 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -928,6 +928,8 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (WaveParams.softrad > 0.f) { array2D ble(pW, pH); array2D guid(pW, pH); + Imagefloat *tmpImage = nullptr; + tmpImage = new Imagefloat(pW, pH); #ifdef _OPENMP #pragma omp parallel for #endif @@ -941,8 +943,14 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) Color::Lab2XYZ(L, a, b, X, Y, Z); guid[ir][jr] = Y / 32768.f; - - ble[ir][jr] = (nprevl->L[ir][jr]) / 32768.f; + float La = nprevl->L[ir][jr]; + float aa = nprevl->a[ir][jr]; + float ba = nprevl->b[ir][jr]; + Color::Lab2XYZ(La, aa, ba, X, Y, Z); + tmpImage->r(ir, jr) = X; + tmpImage->g(ir, jr) = Y; + tmpImage->b(ir, jr) = Z; + ble[ir][jr] = Y / 32768.f; } double epsilmax = 0.0001; double epsilmin = 0.00001; @@ -962,8 +970,15 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) for (int ir = 0; ir < pH; ir++) for (int jr = 0; jr < pW; jr++) { - nprevl->L[ir][jr] = 32768.f * ble[ir][jr]; + float X = tmpImage->r(ir, jr); + float Y = 32768.f * ble[ir][jr]; + float Z = tmpImage->b(ir, jr); + float L, a, b; + Color::XYZ2Lab(X, Y, Z, L, a, b); + nprevl->L[ir][jr] = L; } + delete tmpImage; + } } diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 8a2e3eeda..7db25dbd1 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -17,7 +17,7 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . -// * 2014 Jacques Desmis +// * 2014 - 2019 Jacques Desmis // * 2014 Ingo Weyrich // @@ -1269,6 +1269,8 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const if (waparams.softradend > 0.f && cp.finena) { array2D ble(lab->W, lab->H); array2D guid(lab->W, lab->H); + Imagefloat *tmpImage = nullptr; + tmpImage = new Imagefloat(lab->W, lab->H); bool multiTh = false; @@ -1284,7 +1286,6 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const for (int ir = 0; ir < lab->H; ir++) for (int jr = 0; jr < lab->W; jr++) { - ble[ir][jr] = dst->L[ir][jr] / 32768.f; float X, Y, Z; float L = provradius->L[ir][jr]; float a = provradius->a[ir][jr]; @@ -1292,8 +1293,15 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const Color::Lab2XYZ(L, a, b, X, Y, Z); guid[ir][jr] = Y / 32768.f; + float La = dst->L[ir][jr]; + float aa = dst->a[ir][jr]; + float ba = dst->b[ir][jr]; + Color::Lab2XYZ(La, aa, ba, X, Y, Z); + tmpImage->r(ir, jr) = X; + tmpImage->g(ir, jr) = Y; + tmpImage->b(ir, jr) = Z; + ble[ir][jr] = Y / 32768.f; -// guid[ir][jr] = provradius->L[ir][jr] / 32768.f; } double epsilmax = 0.001; @@ -1314,8 +1322,15 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const for (int ir = 0; ir < lab->H; ir++) for (int jr = 0; jr < lab->W; jr++) { - dst->L[ir][jr] = 32768.f * ble[ir][jr]; + float X = tmpImage->r(ir, jr); + float Y = 32768.f * ble[ir][jr]; + float Z = tmpImage->b(ir, jr); + float L, a, b; + Color::XYZ2Lab(X, Y, Z, L, a, b); + + dst->L[ir][jr] = L; } + delete tmpImage; } if (waparams.softradend > 0.f && cp.finena) { diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc index dde60b93e..e3460e685 100644 --- a/rtgui/wavelet.cc +++ b/rtgui/wavelet.cc @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . * - * 2014 Jacques Desmis + * 2014 - 2019Jacques Desmis */ #include "wavelet.h" @@ -688,7 +688,6 @@ Wavelet::Wavelet() : resBox->pack_start(*contrast); //keep the possibility to reinstall reschro->setAdjusterListener(this); -// resBox->pack_start(*reschro); chromaFrame->set_label_align(0.025, 0.5); ToolParamBlock* const chromaBox = Gtk::manage(new ToolParamBlock()); @@ -734,13 +733,11 @@ Wavelet::Wavelet() : hueskin2->set_tooltip_markup(M("TP_WAVELET_HUESKY_TOOLTIP")); hueskin2->setBgGradient(milestones); -// resBox->pack_start(*hueskin2); hueskin2->setAdjusterListener(this); sky->set_tooltip_text(M("TP_WAVELET_SKY_TOOLTIP")); sky->setAdjusterListener(this); -// resBox->pack_start(*sky); // whole hue range const std::vector milestones3 = makeWholeHueRange();