diff --git a/rtdata/languages/default b/rtdata/languages/default index 628025e1b..6617df3a8 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1145,6 +1145,7 @@ HISTORY_MSG_907;Local - Contrast Wavelet ES amplification HISTORY_MSG_908;Local - Contrast Wavelet ES neighboring HISTORY_MSG_909;Local - Contrast Wavelet ES show HISTORY_MSG_910;Local - Wavelet Edge performance +HISTORY_MSG_911;Local - Blur Chroma Luma HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2233,6 +2234,9 @@ TP_LOCALLAB_BLACK_EV;Black Ev TP_LOCALLAB_BLENDMASKCOL;Blend TP_LOCALLAB_BLGUID;Guided Filter Luminance TP_LOCALLAB_BLINV;Inverse +TP_LOCALLAB_BLCO;Chrominance only +TP_LOCALLAB_BLLO;Luminance only +TP_LOCALLAB_BLLC;Luminance & Chrominance TP_LOCALLAB_BLMED;Median TP_LOCALLAB_BLMETHOD_TOOLTIP;Normal - direct blur and noise with all settings.\nInverse - Inverse blur and noise without scope and without enhanced algorithm.\nSymmetric - inverse blur and noise with all settings. Be careful some results may be curious TP_LOCALLAB_BLNORM;Normal diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index cb63c409f..5cc7f3c0f 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -348,6 +348,7 @@ struct local_params { int softmet; int blurmet; int blmet; + int chromet; int shmeth; int medmet; int locmet; @@ -651,6 +652,14 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.blmet = 2; } + if (locallab.spots.at(sp).chroMethod == "lum") { + lp.chromet = 0; + } else if (locallab.spots.at(sp).chroMethod == "chr") { + lp.chromet = 1; + } else if (locallab.spots.at(sp).chroMethod == "all") { + lp.chromet = 2; + } + if (locallab.spots.at(sp).shMethod == "std") { lp.shmeth = 0; } else if (locallab.spots.at(sp).shMethod == "tone") { @@ -10667,9 +10676,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.blurmet == 0 && lp.blmet == 0 && radius > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { if (fft || lp.rad > 30.f) { - ImProcFunctions::fftw_convol_blur2(tmp1->L, tmp1->L, bfwr, bfhr, radius, 0, 0); - - if (!lp.actsp) { + if (lp.chromet == 0) { + ImProcFunctions::fftw_convol_blur2(tmp1->L, tmp1->L, bfwr, bfhr, radius, 0, 0); + } + else if (lp.chromet == 1){ + ImProcFunctions::fftw_convol_blur2(tmp1->a, tmp1->a, bfwr, bfhr, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(tmp1->b, tmp1->b, bfwr, bfhr, radius, 0, 0); + } else if (lp.chromet == 2){ + ImProcFunctions::fftw_convol_blur2(tmp1->L, tmp1->L, bfwr, bfhr, radius, 0, 0); ImProcFunctions::fftw_convol_blur2(tmp1->a, tmp1->a, bfwr, bfhr, radius, 0, 0); ImProcFunctions::fftw_convol_blur2(tmp1->b, tmp1->b, bfwr, bfhr, radius, 0, 0); } @@ -10679,37 +10693,65 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o #pragma omp parallel #endif { - gaussianBlur(tmp1->L, tmp1->L, bfw, bfh, radius); - - if (!lp.actsp) - { - gaussianBlur(tmp1->a, tmp1->a, bfw, bfh, radius); - gaussianBlur(tmp1->b, tmp1->b, bfw, bfh, radius); + if (lp.chromet == 0) { + + gaussianBlur(tmp1->L, tmp1->L, bfw, bfh, radius); } + + else if (lp.chromet == 1) + { + gaussianBlur(tmp1->a, tmp1->a, bfw, bfh, radius); + gaussianBlur(tmp1->b, tmp1->b, bfw, bfh, radius); + } + else if (lp.chromet == 2) + { + gaussianBlur(tmp1->L, tmp1->L, bfw, bfh, radius); + gaussianBlur(tmp1->a, tmp1->a, bfw, bfh, radius); + gaussianBlur(tmp1->b, tmp1->b, bfw, bfh, radius); + } + } } } else if (lp.blurmet == 1 && lp.blmet == 0 && radius > (1.5 * GAUSS_SKIP) && lp.rad > 1.6) { if (fft || lp.rad > 30.f) { - ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, GW, GH, radius, 0, 0); + if (lp.chromet == 0) { + ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, GW, GH, radius, 0, 0); + } - if (!lp.actsp) { + else if (lp.chromet == 1){ ImProcFunctions::fftw_convol_blur2(original->a, tmp1->a, GW, GH, radius, 0, 0); ImProcFunctions::fftw_convol_blur2(original->b, tmp1->b, GW, GH, radius, 0, 0); - } + } + else if (lp.chromet == 2){ + ImProcFunctions::fftw_convol_blur2(original->L, tmp1->L, GW, GH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->a, tmp1->a, GW, GH, radius, 0, 0); + ImProcFunctions::fftw_convol_blur2(original->b, tmp1->b, GW, GH, radius, 0, 0); + } + } else { #ifdef _OPENMP #pragma omp parallel #endif { + if (lp.chromet == 0) { gaussianBlur(original->L, tmp1->L, GW, GH, radius); + } + else if (lp.chromet == 1) - if (!lp.actsp) { gaussianBlur(original->a, tmp1->a, GW, GH, radius); gaussianBlur(original->b, tmp1->b, GW, GH, radius); } + else if (lp.chromet == 2) + + { + gaussianBlur(original->L, tmp1->L, GW, GH, radius); + gaussianBlur(original->a, tmp1->a, GW, GH, radius); + gaussianBlur(original->b, tmp1->b, GW, GH, radius); + } + } } } @@ -10781,10 +10823,18 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int i = 0; i < hei; ++i) { tmL[i] = new float[wid]; } - - Median_Denoise(tmp1->L, tmp1->L, bfw, bfh, medianTypeL, lp.it, multiThread, tmL); - - if (!lp.actsp) { + if (lp.chromet == 0) { + Median_Denoise(tmp1->L, tmp1->L, bfw, bfh, medianTypeL, lp.it, multiThread, tmL); + } + + else if (lp.chromet == 1) + { + Median_Denoise(tmp1->a, tmp1->a, bfw, bfh, medianTypeAB, lp.it, multiThread, tmL); + Median_Denoise(tmp1->b, tmp1->b, bfw, bfh, medianTypeAB, lp.it, multiThread, tmL); + } + else if (lp.chromet == 2) + { + Median_Denoise(tmp1->L, tmp1->L, bfw, bfh, medianTypeL, lp.it, multiThread, tmL); Median_Denoise(tmp1->a, tmp1->a, bfw, bfh, medianTypeAB, lp.it, multiThread, tmL); Median_Denoise(tmp1->b, tmp1->b, bfw, bfh, medianTypeAB, lp.it, multiThread, tmL); } @@ -10804,10 +10854,15 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int i = 0; i < hei; ++i) { tmL[i] = new float[wid]; } - - Median_Denoise(tmp2->L, tmp1->L, GW, GH, medianTypeL, lp.it, multiThread, tmL); - - if (!lp.actsp) { + if (lp.chromet == 0) { + Median_Denoise(tmp2->L, tmp1->L, GW, GH, medianTypeL, lp.it, multiThread, tmL); + } + else if (lp.chromet == 1) { + Median_Denoise(tmp2->a, tmp1->a, GW, GH, medianTypeAB, lp.it, multiThread, tmL); + Median_Denoise(tmp2->b, tmp1->b, GW, GH, medianTypeAB, lp.it, multiThread, tmL); + } + else if (lp.chromet == 2) { + Median_Denoise(tmp2->L, tmp1->L, GW, GH, medianTypeL, lp.it, multiThread, tmL); Median_Denoise(tmp2->a, tmp1->a, GW, GH, medianTypeAB, lp.it, multiThread, tmL); Median_Denoise(tmp2->b, tmp1->b, GW, GH, medianTypeAB, lp.it, multiThread, tmL); } @@ -10822,7 +10877,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.blurmet == 0 && lp.blmet == 2) { if (lp.guidb > 0) { - lp.actsp = true; #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -10830,39 +10884,66 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int y = ystart; y < yend ; y++) { for (int x = xstart; x < xend; x++) { tmp1->L[y - ystart][x - xstart] = original->L[y][x]; + tmp1->a[y - ystart][x - xstart] = original->a[y][x]; + tmp1->b[y - ystart][x - xstart] = original->b[y][x]; bufgb->L[y - ystart][x - xstart] = original->L[y][x]; } } - - array2D LL(bfw, bfh); + Imagefloat *tmpImage = nullptr; + tmpImage = new Imagefloat(bfw, bfh); + lab2rgb(*tmp1, *tmpImage, params->icm.workingProfile); + array2D rr(bfw, bfh); + array2D gg(bfw, bfh); + array2D bb(bfw, bfh); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < bfh ; y++) { for (int x = 0; x < bfw; x++) { - LL[y][x] = tmp1->L[y][x]; + rr[y][x] = tmpImage->r(y, x); + gg[y][x] = tmpImage->g(y, x); + bb[y][x] = tmpImage->b(y, x); + } } - int r = max(int(lp.guidb / sk), 1); const float epsil = 0.001f * std::pow(2, - lp.epsb); - rtengine::guidedFilterLog(10.f, LL, r, epsil, multiThread); + if (lp.chromet == 0) { + rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread); + } + else if (lp.chromet == 1) { + rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); + rtengine::guidedFilterLog(10.f, bb, r, epsil, multiThread); + } + else if (lp.chromet == 2) { + rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread); + rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); + rtengine::guidedFilterLog(10.f, bb, r, epsil, multiThread); + } + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < bfh ; y++) { for (int x = 0; x < bfw; x++) { - tmp1->L[y][x] = LL[y][x]; + tmpImage->r(y, x)= rr[y][x]; + tmpImage->g(y, x)= gg[y][x]; + tmpImage->b(y, x)= bb[y][x]; + } } + + rgb2lab(*tmpImage, *tmp1, params->icm.workingProfile); + + delete tmpImage; } } else if (lp.blurmet == 1 && lp.blmet == 2) { + if (lp.guidb > 0) { - lp.actsp = true; #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -10870,33 +10951,62 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int y = 0; y < GH ; y++) { for (int x = 0; x < GW; x++) { tmp1->L[y][x] = original->L[y][x]; + tmp1->a[y][x] = original->a[y][x]; + tmp1->b[y][x] = original->b[y][x]; tmp2->L[y][x] = original->L[y][x]; } } - - array2D LLI(GW, GH); + + Imagefloat *tmpImage = nullptr; + tmpImage = new Imagefloat(GW, GH); + lab2rgb(*tmp1, *tmpImage, params->icm.workingProfile); + array2D rr(GW, GH); + array2D gg(GW, GH); + array2D bb(GW, GH); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < GH ; y++) { for (int x = 0; x < GW; x++) { - LLI[y][x] = tmp1->L[y][x]; + rr[y][x] = tmpImage->r(y, x); + gg[y][x] = tmpImage->g(y, x); + bb[y][x] = tmpImage->b(y, x); + } } - int r = max(int(lp.guidb / sk), 1); + const float epsil = 0.001f * std::pow(2, - lp.epsb); - rtengine::guidedFilterLog(10.f, LLI, r, epsil, multiThread); + if (lp.chromet == 0) { + rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread); + } + else if (lp.chromet == 1) { + rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); + rtengine::guidedFilterLog(10.f, bb, r, epsil, multiThread); + } + else if (lp.chromet == 2) { + rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread); + rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); + rtengine::guidedFilterLog(10.f, bb, r, epsil, multiThread); + } + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif for (int y = 0; y < GH ; y++) { for (int x = 0; x < GW; x++) { - tmp1->L[y][x] = LLI[y][x]; + tmpImage->r(y, x)= rr[y][x]; + tmpImage->g(y, x)= gg[y][x]; + tmpImage->b(y, x)= bb[y][x]; + } } + + rgb2lab(*tmpImage, *tmp1, params->icm.workingProfile); + + delete tmpImage; } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 7db518524..615c03826 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -936,6 +936,7 @@ enum ProcEventCode { EvlocallablocalneiMethod = 907, Evlocallabwaveshow = 908, EvLocallabSpotwavMethod = 909, + EvlocallabchroMethod = 910, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 9b57d10ad..18aef1eee 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2628,6 +2628,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : scalegr(100), epsbl(0), blMethod("guid"), + chroMethod("lum"), blurMethod("norm"), medMethod("33"), activlum(true), @@ -3076,7 +3077,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && scalegr == other.scalegr && epsbl == other.epsbl && blMethod == other.blMethod - && blurMethod == other.blurMethod + && blMethod == other.blMethod + && chroMethod == other.chroMethod && medMethod == other.medMethod && activlum == other.activlum && CCmaskblcurve == other.CCmaskblcurve @@ -4491,6 +4493,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).scalegr, "Locallab", "Scalegr_" + std::to_string(i), spot.scalegr, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).epsbl, "Locallab", "Epsbl_" + std::to_string(i), spot.epsbl, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blMethod, "Locallab", "BlMethod_" + std::to_string(i), spot.blMethod, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).chroMethod, "Locallab", "ChroMethod_" + std::to_string(i), spot.chroMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurMethod, "Locallab", "BlurMethod_" + std::to_string(i), spot.blurMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).medMethod, "Locallab", "MedMethod_" + std::to_string(i), spot.medMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).activlum, "Locallab", "activlum_" + std::to_string(i), spot.activlum, keyFile); @@ -6050,6 +6053,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Scalegr_" + std::to_string(i), pedited, spot.scalegr, spotEdited.scalegr); assignFromKeyfile(keyFile, "Locallab", "Epsbl_" + std::to_string(i), pedited, spot.epsbl, spotEdited.epsbl); assignFromKeyfile(keyFile, "Locallab", "BlMethod_" + std::to_string(i), pedited, spot.blMethod, spotEdited.blMethod); + assignFromKeyfile(keyFile, "Locallab", "ChroMethod_" + std::to_string(i), pedited, spot.chroMethod, spotEdited.chroMethod); assignFromKeyfile(keyFile, "Locallab", "BlurMethod_" + std::to_string(i), pedited, spot.blurMethod, spotEdited.blurMethod); assignFromKeyfile(keyFile, "Locallab", "MedMethod_" + std::to_string(i), pedited, spot.medMethod, spotEdited.medMethod); assignFromKeyfile(keyFile, "Locallab", "activlum_" + std::to_string(i), pedited, spot.activlum, spotEdited.activlum); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 815c8c18b..a59919384 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1171,6 +1171,7 @@ struct LocallabParams { int scalegr; int epsbl; Glib::ustring blMethod; + Glib::ustring chroMethod; Glib::ustring blurMethod; Glib::ustring medMethod; bool activlum; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index aae18e0e1..ad568f70e 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -939,7 +939,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabbasew LUMINANCECURVE, //EvlocallablocalneiMethod LUMINANCECURVE, //Evlocallabwaveshow - LUMINANCECURVE // EvLocallabSpotwavMethod + LUMINANCECURVE, // EvLocallabSpotwavMethod + LUMINANCECURVE // EvlocallabchroMethod }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 45929a40d..51a3aecd2 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -751,6 +751,7 @@ softMethod(Gtk::manage(new MyComboBoxText())), showmasksoftMethod(Gtk::manage(new MyComboBoxText())), //Blur blMethod(Gtk::manage(new MyComboBoxText())), +chroMethod(Gtk::manage(new MyComboBoxText())), medMethod(Gtk::manage(new MyComboBoxText())), showmaskblMethod(Gtk::manage(new MyComboBoxText())), csThresholdblur(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLDBLUR"), 0, 9, 0, 0, 6, 5, 0, false))), @@ -3593,6 +3594,14 @@ pe(nullptr) blMethodConn = blMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::blMethodChanged)); + chroMethod->append(M("TP_LOCALLAB_BLLO")); + chroMethod->append(M("TP_LOCALLAB_BLCO")); + chroMethod->append(M("TP_LOCALLAB_BLLC")); + chroMethod->set_active(0); + + + chroMethodConn = chroMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::chroMethodChanged)); + radius->setAdjusterListener(this); strength->setAdjusterListener(this); @@ -3810,9 +3819,9 @@ pe(nullptr) ToolParamBlock* const blurrBox = Gtk::manage(new ToolParamBlock()); - if (complexsoft < 2) { +// if (complexsoft < 2) { blurrBox->pack_start(*blMethod); - } +// } if (complexsoft < 2) { blurrBox->pack_start(*fftwbl, Gtk::PACK_SHRINK, 0); @@ -3827,7 +3836,8 @@ pe(nullptr) blurrBox->pack_start(*epsbl); blurrBox->pack_start(*sensibn); blurrBox->pack_start(*blurMethod); - blurrBox->pack_start(*activlum); + blurrBox->pack_start(*chroMethod); +// blurrBox->pack_start(*activlum); // blurrBox->pack_start(*expmaskbl); expblur->add(*blurrBox, false); expblur->setLevel(2); @@ -5471,6 +5481,14 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).blMethod = "guid"; } + if (chroMethod->get_active_row_number() == 0) { + pp->locallab.spots.at(pp->locallab.selspot).chroMethod = "lum"; + } else if (chroMethod->get_active_row_number() == 1) { + pp->locallab.spots.at(pp->locallab.selspot).chroMethod = "chr"; + } else if (chroMethod->get_active_row_number() == 2) { + pp->locallab.spots.at(pp->locallab.selspot).chroMethod = "all"; + } + if (medMethod->get_active_row_number() == 0) { pp->locallab.spots.at(pp->locallab.selspot).medMethod = "none"; } else if (medMethod->get_active_row_number() == 1) { @@ -5949,6 +5967,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).guidbl = pe->locallab.spots.at(pp->locallab.selspot).guidbl || guidbl->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).epsbl = pe->locallab.spots.at(pp->locallab.selspot).epsbl || epsbl->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).blMethod = pe->locallab.spots.at(pp->locallab.selspot).blMethod || blMethod->get_active_text() != M("GENERAL_UNCHANGED"); + pe->locallab.spots.at(pp->locallab.selspot).chroMethod = pe->locallab.spots.at(pp->locallab.selspot).chroMethod || chroMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).blurMethod = pe->locallab.spots.at(pp->locallab.selspot).blurMethod || blurMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).medMethod = pe->locallab.spots.at(pp->locallab.selspot).medMethod || medMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).activlum = pe->locallab.spots.at(pp->locallab.selspot).activlum || !activlum->get_inconsistent(); @@ -6384,6 +6403,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).guidbl = pedited->locallab.spots.at(pp->locallab.selspot).guidbl || guidbl->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).epsbl = pedited->locallab.spots.at(pp->locallab.selspot).epsbl || epsbl->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).blMethod = pedited->locallab.spots.at(pp->locallab.selspot).blMethod || blMethod->get_active_text() != M("GENERAL_UNCHANGED"); + pedited->locallab.spots.at(pp->locallab.selspot).chroMethod = pedited->locallab.spots.at(pp->locallab.selspot).chroMethod || chroMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).blurMethod = pedited->locallab.spots.at(pp->locallab.selspot).blurMethod || blurMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).medMethod = pedited->locallab.spots.at(pp->locallab.selspot).medMethod || medMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).activlum = pedited->locallab.spots.at(pp->locallab.selspot).activlum || !activlum->get_inconsistent(); @@ -7294,6 +7314,15 @@ void Locallab::blMethodChanged() } } +void Locallab::chroMethodChanged() +{ + if (getEnabled() && expblur->getEnabled()) { + if (listener) { + listener->panelChanged(EvlocallabchroMethod, chroMethod->get_active_text()); + } + } +} + void Locallab::blurMethodChanged() { @@ -11932,6 +11961,7 @@ void Locallab::setBatchMode(bool batchMode) softMethod->append(M("GENERAL_UNCHANGED")); // Blur & Noise blMethod->append(M("GENERAL_UNCHANGED")); + chroMethod->append(M("GENERAL_UNCHANGED")); blurMethod->append(M("GENERAL_UNCHANGED")); medMethod->append(M("GENERAL_UNCHANGED")); // Retinex @@ -12137,6 +12167,7 @@ void Locallab::enableListener() // Blur & Noise enableblurConn.block(false); blMethodConn.block(false); + chroMethodConn.block(false); blurMethodConn.block(false); medMethodConn.block(false); activlumConn.block(false); @@ -12246,6 +12277,7 @@ void Locallab::disableListener() // Blur & Noise enableblurConn.block(true); blMethodConn.block(true); + chroMethodConn.block(true); blurMethodConn.block(true); medMethodConn.block(true); activlumConn.block(true); @@ -12754,11 +12786,19 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con blMethod->set_active(2); } + if (pp->locallab.spots.at(index).chroMethod == "lum") { + chroMethod->set_active(0); + } else if (pp->locallab.spots.at(index).chroMethod == "chr") { + chroMethod->set_active(1); + } else if (pp->locallab.spots.at(index).chroMethod == "all") { + chroMethod->set_active(2); + } +/* if (complexsoft == 2) { blMethod->set_active(0); guidbl->setValue(0); } - +*/ if (pp->locallab.spots.at(index).blurMethod == "norm") { blurMethod->set_active(0); @@ -13405,6 +13445,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con blMethod->set_active_text(M("GENERAL_UNCHANGED")); } + if (!spotState->chroMethod) { + chroMethod->set_active_text(M("GENERAL_UNCHANGED")); + } + if (!spotState->blurMethod) { blurMethod->set_active_text(M("GENERAL_UNCHANGED")); } diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 1617dc5fc..98764f932 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -585,6 +585,8 @@ private: //Blur and noise MyComboBoxText* const blMethod; sigc::connection blMethodConn; + MyComboBoxText* const chroMethod; + sigc::connection chroMethodConn; MyComboBoxText* const medMethod; sigc::connection medMethodConn; MyComboBoxText* const showmaskblMethod; @@ -781,6 +783,7 @@ private: void showmaskvibMethodChanged(); // Blur & Noise void blMethodChanged(); + void chroMethodChanged(); void medMethodChanged(); // Soft light void softMethodChanged(); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 507767674..11491dafa 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1165,6 +1165,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).strengr = locallab.spots.at(j).strengr && pSpot.strengr == otherSpot.strengr; locallab.spots.at(j).epsbl = locallab.spots.at(j).epsbl && pSpot.epsbl == otherSpot.epsbl; locallab.spots.at(j).blMethod = locallab.spots.at(j).blMethod && pSpot.blMethod == otherSpot.blMethod; + locallab.spots.at(j).chroMethod = locallab.spots.at(j).chroMethod && pSpot.chroMethod == otherSpot.chroMethod; locallab.spots.at(j).blurMethod = locallab.spots.at(j).blurMethod && pSpot.blurMethod == otherSpot.blurMethod; locallab.spots.at(j).medMethod = locallab.spots.at(j).medMethod && pSpot.medMethod == otherSpot.medMethod; locallab.spots.at(j).activlum = locallab.spots.at(j).activlum && pSpot.activlum == otherSpot.activlum; @@ -3675,6 +3676,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blMethod = mods.locallab.spots.at(i).blMethod; } + if (locallab.spots.at(i).chroMethod) { + toEdit.locallab.spots.at(i).chroMethod = mods.locallab.spots.at(i).chroMethod; + } + if (locallab.spots.at(i).blurMethod) { toEdit.locallab.spots.at(i).blurMethod = mods.locallab.spots.at(i).blurMethod; } @@ -5654,6 +5659,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : guidbl(v), epsbl(v), blMethod(v), + chroMethod(v), blurMethod(v), medMethod(v), activlum(v), @@ -6079,6 +6085,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) guidbl = v; epsbl = v; blMethod = v; + chroMethod = v; blurMethod = v; medMethod = v; activlum = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 2f8eea083..4d9dd9912 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -597,6 +597,7 @@ public: bool guidbl; bool epsbl; bool blMethod; + bool chroMethod; bool blurMethod; bool medMethod; bool activlum;