From 5579b591211e4245e5f7b03198147087cf1a59ee Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 2 Sep 2019 08:23:31 +0200 Subject: [PATCH] Add Chroma to Clarity Sharp mask --- rtdata/languages/default | 8 ++- rtengine/iplocallab.cc | 128 +++++++++++++++++++++++++++++++++++---- rtengine/procevents.h | 2 + rtengine/procparams.cc | 8 +++ rtengine/procparams.h | 2 + rtengine/refreshmap.cc | 4 +- rtgui/locallab.cc | 44 ++++++++++++++ rtgui/locallab.h | 2 + rtgui/paramsedited.cc | 14 +++++ rtgui/paramsedited.h | 2 + 10 files changed, 199 insertions(+), 15 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 56fe51929..ce6f989c9 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -959,7 +959,7 @@ HISTORY_MSG_714;Local - TM mask slope HISTORY_MSG_716;Local - Local method HISTORY_MSG_717;Local - Local contrast HISTORY_MSG_718;Local - Local contrast levels -HISTORY_MSG_719;Local - Local contrast residual +HISTORY_MSG_719;Local - Local contrast residual L HISTORY_MSG_720;Local - Blur mask C HISTORY_MSG_721;Local - Blur mask L HISTORY_MSG_722;Local - Blur mask CL @@ -976,6 +976,8 @@ HISTORY_MSG_733;Local - soft radius HISTORY_MSG_734;Local - threshold HISTORY_MSG_738;Local - Local contrast Merge L HISTORY_MSG_739;Local - Local contrast Soft radius +HISTORY_MSG_740;Local - Local contrast Merge C +HISTORY_MSG_741;Local - Local contrast Residual C HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2066,6 +2068,7 @@ TP_LOCALLAB_CIRCRADIUS;Spot size TP_LOCALLAB_COFR;Color & Light - Small defects : red eyes, dust TP_LOCALLAB_EXPCOLOR_TOOLTIP;In the case of small defects.\n\nRed-eyes : red-centered circular selector, spot delimiters close to the eye, weak scope, "lightness" -100, "chrominance" -100.\n\nSpotIR :Circular selector centered on the defect, spot delimiters close to the default - reduce "chrominance", possibly act on "scope" to reduce the extent of the action.\n\nDust - grease (small) :Circular selector centered on the defect (adapt the size of the spot), spot delimiters not too close to the defect to allow an inconspicuous transition. a) "Transition" (low values) and "Transition weak" (high values); b) act on "lightness" and possibly on "chrominance" or "Color correction grid - direct" to approach the rendering of the polluted zone to that of the healthy zone; c) act moderately on "scope" to modulate the desired action.\n\nYou can also complete with Gaussian blur (Smooth Blur and noise) TP_LOCALLAB_CLARILRES;Merge Luma +TP_LOCALLAB_CLARICRES;Merge Chroma TP_LOCALLAB_CLARISOFT;Soft radius TP_LOCALLAB_CLARIFRA;Sharp mask and Clarity TP_LOCALLAB_CLARI_TOOLTIP;Under or equal level wavelet 4, 'Sharp mask' is enabled.\nAbove level wavelet 5 'Clarity' is enabled. @@ -2222,7 +2225,8 @@ TP_LOCALLAB_WAVE;Wavelet TP_LOCALLAB_LOCCONT;Unsharp Mask TP_LOCALLAB_WAV;Levels local contrast TP_LOCALLAB_LEVELWAV;Wavelets Levels -TP_LOCALLAB_RESIDCONT;Residual image contrast +TP_LOCALLAB_RESIDCONT;Residual image Contrast +TP_LOCALLAB_RESIDCHRO;Residual image Chroma TP_LOCALLAB_CURVEEDITOR_TONES_LABEL;Tone curve TP_LOCALLAB_TM_MASK;Use transmission map TP_LOCALLAB_TRANSIT;Transition Gradient diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 59e4fb893..74536c18f 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -7735,7 +7735,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } //params->locallab.spots.at(sp).clarilres != 0.f) - if ((lp.lcamount > 0.f || wavcurve || params->locallab.spots.at(sp).residcont != 0.f || params->locallab.spots.at(sp).clarilres != 0.f) && call < 3 && lp.lcena) { + if ((lp.lcamount > 0.f || wavcurve || params->locallab.spots.at(sp).residcont != 0.f || params->locallab.spots.at(sp).clarilres != 0.f || params->locallab.spots.at(sp).claricres != 0.f) && call < 3 && lp.lcena) { int ystart = std::max(static_cast(lp.yc - lp.lyT) - cy, 0); int yend = std::min(static_cast(lp.yc + lp.ly) - cy, original->H); int xstart = std::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -7820,8 +7820,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o JaggedArray bufchro(bfw, bfh); std::unique_ptr bufgb(new LabImage(bfw, bfh)); std::unique_ptr tmp1(new LabImage(bfw, bfh)); - // int GW = original->W; - // int GH = original->H; std::unique_ptr tmpresid(new LabImage(bfw, bfh)); std::unique_ptr tmpres(new LabImage(bfw, bfh)); @@ -7892,8 +7890,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o int wavelet_level = params->locallab.spots.at(sp).levelwav; float mL = (float)(params->locallab.spots.at(sp).clarilres / 100.f); + float mC = (float)(params->locallab.spots.at(sp).claricres / 100.f); + printf("mCCCC=%f\n", mC); float softr = (float)(params->locallab.spots.at(sp).clarisoft); float mL0; + float mC0; #ifdef _OPENMP const int numThreads = omp_get_max_threads(); #else @@ -7949,6 +7950,22 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o wavelet_level = min(wavelet_level, maxlevelspot); + bool exec = false; + + if(mL != 0.f && mC == 0.f) { + mC = 0.0001f; + exec = true; + } + + if(mC != 0.f && mL == 0.f) { + mL = 0.0001f; + exec = true; + } + + if(mL != 0.f && mC != 0.f) { + exec = true; + } + if (mL != 0.f) { wavelet_decomposition *wdspotresid = new wavelet_decomposition(tmpresid->L[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, 6); @@ -7957,10 +7974,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o return; } - int maxlvlresid = wdspotresid->maxlevel(); - // printf("maxlvlresid=%i maxlevelspot=%i\n", maxlvlresid, maxlevelspot); if (maxlvlresid > 4) {//Clarity for (int dir = 1; dir < 4; dir++) { for (int level = 0; level < maxlvlresid; ++level) { @@ -7983,12 +7998,85 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - wdspotresid->reconstruct(tmpresid->L[0], 1.f); delete wdspotresid; } - wavelet_decomposition wdspot(tmp1->data, bfw, bfh, wavelet_level, 1, sk, numThreads, 6); + + if (mC != 0.f) { + + wavelet_decomposition *wdspotresida = new wavelet_decomposition(tmpresid->a[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, 6); + + if (wdspotresida->memoryAllocationFailed) { + return; + } + + int maxlvlresid = wdspotresida->maxlevel(); + + if (maxlvlresid > 4) {//Clarity + for (int dir = 1; dir < 4; dir++) { + for (int level = 0; level < maxlvlresid; ++level) { + int W_L = wdspotresida->level_W(level); + int H_L = wdspotresida->level_H(level); + float **wav_Lresida = wdspotresida->level_coeffs(level); + + for (int i = 0; i < W_L * H_L; i++) { + wav_Lresida[dir][i] = 0.f; + } + } + } + } else {//Sharp + float *wav_L0resida = wdspotresida->coeff0; + int W_L = wdspotresida->level_W(0); + int H_L = wdspotresida->level_H(0); + + for (int i = 0; i < W_L * H_L; i++) { + wav_L0resida[i] = 0.f; + } + } + + wdspotresida->reconstruct(tmpresid->a[0], 1.f); + delete wdspotresida; + } + + + if (mC != 0.f) { + + wavelet_decomposition *wdspotresidb = new wavelet_decomposition(tmpresid->b[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, 6); + + if (wdspotresidb->memoryAllocationFailed) { + return; + } + + int maxlvlresid = wdspotresidb->maxlevel(); + + if (maxlvlresid > 4) {//Clarity + for (int dir = 1; dir < 4; dir++) { + for (int level = 0; level < maxlvlresid; ++level) { + int W_L = wdspotresidb->level_W(level); + int H_L = wdspotresidb->level_H(level); + float **wav_Lresidb = wdspotresidb->level_coeffs(level); + + for (int i = 0; i < W_L * H_L; i++) { + wav_Lresidb[dir][i] = 0.f; + } + } + } + } else {//Sharp + float *wav_L0residb = wdspotresidb->coeff0; + int W_L = wdspotresidb->level_W(0); + int H_L = wdspotresidb->level_H(0); + + for (int i = 0; i < W_L * H_L; i++) { + wav_L0residb[i] = 0.f; + } + } + + wdspotresidb->reconstruct(tmpresid->b[0], 1.f); + delete wdspotresidb; + } + + wavelet_decomposition wdspot(tmp1->L[0], bfw, bfh, wavelet_level, 1, sk, numThreads, 6); if (wdspot.memoryAllocationFailed) { return; @@ -8095,32 +8183,40 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - wdspot.reconstruct(tmp1->data, 1.f); + wdspot.reconstruct(tmp1->L[0], 1.f); float thr = 0.001f; int flag = 0; + if (maxlvl <= 4) { mL0 = 0.f; + mC0 = 0.f; mL = -1.5f * mL;//increase only for sharpen + mC = -mC; thr = 1.f; flag = 0; - } else { + } else if (maxlvl > 4) { mL0 = mL; + mC0 = mC; thr = 1.f; flag = 0; + } else { + mL0 = mL = mC0 = mC = 0.f; } - if (mL != 0.f) { + if (exec) { #ifdef _OPENMP #pragma omp parallel for #endif for (int x = 0; x < bfh; x++) for (int y = 0; y < bfw; y++) { - tmp1->L[x][y] = CLIPLOC((1.f + mL0) * (tmp1->L[x][y]) - mL * tmpresid->L[x][y]); + tmp1->L[x][y] = CLIPLOC((1.f + mL0) * tmp1->L[x][y] - mL * tmpresid->L[x][y]); + tmp1->a[x][y] = CLIPC((1.f + mC0) * tmp1->a[x][y] - mC * tmpresid->a[x][y]); + tmp1->b[x][y] = CLIPC((1.f + mC0) * tmp1->b[x][y] - mC * tmpresid->b[x][y]); } - if (softr > 0.f) { + if (softr > 0.f && fabs(mL > 1.f)) { softproc(tmpres.get(), tmp1.get(), softr, bfh, bfw, 0.0001, 0.00001, thr, sk, multiThread, flag); } } @@ -8128,6 +8224,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float minL = tmp1->L[0][0] - bufgb->L[0][0]; float maxL = minL; + float minC = sqrt(SQR(tmp1->a[0][0]) + SQR(tmp1->b[0][0])) - sqrt(SQR(bufgb->a[0][0]) + SQR(bufgb->b[0][0])); + float maxC = minC; + #ifdef _OPENMP #pragma omp parallel for reduction(max:maxL) reduction(min:minL) schedule(dynamic,16) #endif @@ -8138,10 +8237,14 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufchro[ir][jr] = sqrt(SQR(tmp1->a[ir][jr]) + SQR(tmp1->b[ir][jr])) - sqrt(SQR(bufgb->a[ir][jr]) + SQR(bufgb->b[ir][jr])); minL = rtengine::min(minL, buflight[ir][jr]); maxL = rtengine::max(maxL, buflight[ir][jr]); + minC = rtengine::min(minC, bufchro[ir][jr]); + maxC = rtengine::max(maxC, bufchro[ir][jr]); } } float coef = 0.01f * (max(fabs(minL), fabs(maxL))); + float coefC = 0.01f * (max(fabs(minC), fabs(maxC))); + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -8149,6 +8252,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int y = 0; y < bfhr; y++) { for (int x = 0; x < bfwr; x++) { buflight[y][x] /= coef; + bufchro[y][x] /= coefC; } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 111d348b0..4b7ef358f 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -766,6 +766,8 @@ enum ProcEventCode { EvlocallabshowmaskSHMethodinv = 736, Evlocallabclarilres = 737, Evlocallabclarisoft = 738, + Evlocallabclaricres = 739, + Evlocallabresidchro = 740, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index b0941f933..f1837bef7 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2581,7 +2581,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : lclightness(1.0), levelwav(4), residcont(0.0), + residchro(0.0), clarilres(0.0), + claricres(0.0), clarisoft(0.0), sensilc(19), fftwlc(false), @@ -2834,7 +2836,9 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && lclightness == other.lclightness && levelwav == other.levelwav && residcont == other.residcont + && residchro == other.residchro && clarilres == other.clarilres + && claricres == other.claricres && clarisoft == other.clarisoft && sensilc == other.sensilc && fftwlc == other.fftwlc @@ -4068,7 +4072,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).lclightness, "Locallab", "Lclightness_" + std::to_string(i), spot.lclightness, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).levelwav, "Locallab", "Levelwav_" + std::to_string(i), spot.levelwav, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residcont, "Locallab", "Residcont_" + std::to_string(i), spot.residcont, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).residchro, "Locallab", "Residchro_" + std::to_string(i), spot.residchro, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).clarilres, "Locallab", "ClariLres_" + std::to_string(i), spot.clarilres, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).claricres, "Locallab", "ClariCres_" + std::to_string(i), spot.claricres, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).clarisoft, "Locallab", "Clarisoft_" + std::to_string(i), spot.clarisoft, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensilc, "Locallab", "Sensilc_" + std::to_string(i), spot.sensilc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fftwlc, "Locallab", "Fftwlc_" + std::to_string(i), spot.fftwlc, keyFile); @@ -5424,7 +5430,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Lclightness_" + std::to_string(i), pedited, spot.lclightness, spotEdited.lclightness); assignFromKeyfile(keyFile, "Locallab", "Levelwav_" + std::to_string(i), pedited, spot.levelwav, spotEdited.levelwav); assignFromKeyfile(keyFile, "Locallab", "Residcont_" + std::to_string(i), pedited, spot.residcont, spotEdited.residcont); + assignFromKeyfile(keyFile, "Locallab", "Residchro_" + std::to_string(i), pedited, spot.residchro, spotEdited.residchro); assignFromKeyfile(keyFile, "Locallab", "ClariLres_" + std::to_string(i), pedited, spot.clarilres, spotEdited.clarilres); + assignFromKeyfile(keyFile, "Locallab", "ClariCres_" + std::to_string(i), pedited, spot.claricres, spotEdited.claricres); assignFromKeyfile(keyFile, "Locallab", "Clarisoft_" + std::to_string(i), pedited, spot.clarisoft, spotEdited.clarisoft); assignFromKeyfile(keyFile, "Locallab", "Sensilc_" + std::to_string(i), pedited, spot.sensilc, spotEdited.sensilc); assignFromKeyfile(keyFile, "Locallab", "Fftwlc_" + std::to_string(i), pedited, spot.fftwlc, spotEdited.fftwlc); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index b37c83aed..bfefa4cd9 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1146,7 +1146,9 @@ struct LocallabParams { double lclightness; int levelwav; double residcont; + double residchro; double clarilres; + double claricres; double clarisoft; int sensilc; bool fftwlc; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index ee614b734..6bc1af45a 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -765,7 +765,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvlocallabshowmaskexpMethodinv LUMINANCECURVE, // EvlocallabshowmaskSHMethodinv LUMINANCECURVE, //Evlocallabclarilres - LUMINANCECURVE //Evlocallabclarisoft + LUMINANCECURVE, //Evlocallabclarisoft + LUMINANCECURVE, //Evlocallabclaricres + LUMINANCECURVE //Evlocallabresidchro }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 5e6d64c8a..15abf1241 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -295,7 +295,9 @@ Locallab::Locallab(): residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.))), clarisoft(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARISOFT"), 0., 100., 0.5, 0.))), + claricres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARICRES"), -20., 100., 0.5, 0.))), sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), + residchro(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCHRO"), -100, 100, 1, 0))), // Contrast by detail levels chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0., 1.5, 0.01, 0.))), threshold(Gtk::manage(new Adjuster(M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1., 0.01, 0.2))), @@ -1504,14 +1506,17 @@ Locallab::Locallab(): } residcont->setAdjusterListener(this); + residchro->setAdjusterListener(this); clarilres->setAdjusterListener(this); clarisoft->setAdjusterListener(this); + claricres->setAdjusterListener(this); sensilc->setAdjusterListener(this); clariFrame->set_label_align(0.025, 0.5); ToolParamBlock* const clariBox = Gtk::manage(new ToolParamBlock()); clariBox->pack_start(*clarilres); + clariBox->pack_start(*claricres); clariBox->pack_start(*clarisoft); clariFrame->add(*clariBox); @@ -1525,6 +1530,7 @@ Locallab::Locallab(): contrastBox->pack_start(*LocalcurveEditorwav, Gtk::PACK_SHRINK, 4); contrastBox->pack_start(*levelwav); contrastBox->pack_start(*residcont); +// contrastBox->pack_start(*residchro); contrastBox->pack_start(*clariFrame); contrastBox->pack_start(*sensilc); contrastBox->pack_start(*fftwlc); @@ -2972,7 +2978,9 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).lclightness = lclightness->getValue(); pp->locallab.spots.at(pp->locallab.selspot).levelwav = levelwav->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).residcont = residcont->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).residchro = residchro->getValue(); pp->locallab.spots.at(pp->locallab.selspot).clarilres = clarilres->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).claricres = claricres->getValue(); pp->locallab.spots.at(pp->locallab.selspot).clarisoft = clarisoft->getValue(); pp->locallab.spots.at(pp->locallab.selspot).sensilc = sensilc->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).fftwlc = fftwlc->get_active(); @@ -3233,7 +3241,9 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).lclightness = pe->locallab.spots.at(pp->locallab.selspot).lclightness || lclightness->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).levelwav = pe->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).residcont = pe->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).residchro = pe->locallab.spots.at(pp->locallab.selspot).residchro || residchro->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).clarilres = pe->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).claricres = pe->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).clarisoft = pe->locallab.spots.at(pp->locallab.selspot).clarisoft || clarisoft->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensilc = pe->locallab.spots.at(pp->locallab.selspot).sensilc || sensilc->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).fftwlc = pe->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); @@ -3492,7 +3502,9 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).lclightness = pedited->locallab.spots.at(pp->locallab.selspot).lclightness || lclightness->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).levelwav = pedited->locallab.spots.at(pp->locallab.selspot).levelwav || levelwav->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).residcont = pedited->locallab.spots.at(pp->locallab.selspot).residcont || residcont->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).residchro = pedited->locallab.spots.at(pp->locallab.selspot).residchro || residchro->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).clarilres = pedited->locallab.spots.at(pp->locallab.selspot).clarilres || clarilres->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).claricres = pedited->locallab.spots.at(pp->locallab.selspot).claricres || claricres->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).clarisoft = pedited->locallab.spots.at(pp->locallab.selspot).clarisoft || clarisoft->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensilc = pedited->locallab.spots.at(pp->locallab.selspot).sensilc || sensilc->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).fftwlc = pedited->locallab.spots.at(pp->locallab.selspot).fftwlc || !fftwlc->get_inconsistent(); @@ -3854,7 +3866,9 @@ void Locallab::localcontMethodChanged() if (localcontMethod->get_active_row_number() == 0) { levelwav->hide(); residcont->hide(); + residchro->hide(); clarilres->hide(); + claricres->hide(); clarisoft->hide(); clariFrame->hide(); lcradius->show(); @@ -3866,7 +3880,9 @@ void Locallab::localcontMethodChanged() } else if (localcontMethod->get_active_row_number() == 1) { levelwav->show(); residcont->show(); + residchro->show(); clarilres->show(); + claricres->show(); clarisoft->show(); clariFrame->show(); lcradius->hide(); @@ -5133,7 +5149,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefault(defSpot->lclightness); levelwav->setDefault(defSpot->levelwav); residcont->setDefault(defSpot->residcont); + residchro->setDefault(defSpot->residchro); clarilres->setDefault(defSpot->clarilres); + claricres->setDefault(defSpot->claricres); clarisoft->setDefault(defSpot->clarisoft); sensilc->setDefault((double)defSpot->sensilc); @@ -5288,7 +5306,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefaultEditedState(Irrelevant); levelwav->setDefaultEditedState(Irrelevant); residcont->setDefaultEditedState(Irrelevant); + residchro->setDefaultEditedState(Irrelevant); clarilres->setDefaultEditedState(Irrelevant); + claricres->setDefaultEditedState(Irrelevant); clarisoft->setDefaultEditedState(Irrelevant); sensilc->setDefaultEditedState(Irrelevant); @@ -5447,7 +5467,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lclightness->setDefaultEditedState(defSpotState->lclightness ? Edited : UnEdited); levelwav->setDefaultEditedState(defSpotState->levelwav ? Edited : UnEdited); residcont->setDefaultEditedState(defSpotState->residcont ? Edited : UnEdited); + residchro->setDefaultEditedState(defSpotState->residchro ? Edited : UnEdited); clarilres->setDefaultEditedState(defSpotState->clarilres ? Edited : UnEdited); + claricres->setDefaultEditedState(defSpotState->claricres ? Edited : UnEdited); clarisoft->setDefaultEditedState(defSpotState->clarisoft ? Edited : UnEdited); sensilc->setDefaultEditedState(defSpotState->sensilc ? Edited : UnEdited); @@ -6227,12 +6249,24 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == residchro) { + if (listener) { + listener->panelChanged(Evlocallabresidchro, residchro->getTextValue()); + } + } + if (a == clarilres) { if (listener) { listener->panelChanged(Evlocallabclarilres, clarilres->getTextValue()); } } + if (a == claricres) { + if (listener) { + listener->panelChanged(Evlocallabclaricres, claricres->getTextValue()); + } + } + if (a == clarisoft) { if (listener) { listener->panelChanged(Evlocallabclarisoft, clarisoft->getTextValue()); @@ -6558,7 +6592,9 @@ void Locallab::setBatchMode(bool batchMode) lclightness->showEditedCB(); levelwav->showEditedCB(); residcont->showEditedCB(); + residchro->showEditedCB(); clarilres->showEditedCB(); + claricres->showEditedCB(); clarisoft->showEditedCB(); sensilc->showEditedCB(); @@ -7157,7 +7193,9 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lclightness->setValue(pp->locallab.spots.at(index).lclightness); levelwav->setValue(pp->locallab.spots.at(index).levelwav); residcont->setValue(pp->locallab.spots.at(index).residcont); + residchro->setValue(pp->locallab.spots.at(index).residchro); clarilres->setValue(pp->locallab.spots.at(index).clarilres); + claricres->setValue(pp->locallab.spots.at(index).claricres); clarisoft->setValue(pp->locallab.spots.at(index).clarisoft); sensilc->setValue(pp->locallab.spots.at(index).sensilc); fftwlc->set_active(pp->locallab.spots.at(index).fftwlc); @@ -7465,7 +7503,9 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lclightness->setEditedState(spotState->lclightness ? Edited : UnEdited); levelwav->setEditedState(spotState->levelwav ? Edited : UnEdited); residcont->setEditedState(spotState->residcont ? Edited : UnEdited); + residchro->setEditedState(spotState->residchro ? Edited : UnEdited); clarilres->setEditedState(spotState->clarilres ? Edited : UnEdited); + claricres->setEditedState(spotState->claricres ? Edited : UnEdited); clarisoft->setEditedState(spotState->clarisoft ? Edited : UnEdited); sensilc->setEditedState(spotState->sensilc ? Edited : UnEdited); fftwlc->set_inconsistent(multiImage && !spotState->fftwlc); @@ -7727,7 +7767,9 @@ void Locallab::updateSpecificGUIState() if (localcontMethod->get_active_row_number() == 0) { levelwav->hide(); residcont->hide(); + residchro->hide(); clarilres->hide(); + claricres->hide(); clarisoft->hide(); clariFrame->hide(); lcradius->show(); @@ -7739,7 +7781,9 @@ void Locallab::updateSpecificGUIState() } else if (localcontMethod->get_active_row_number() == 1) { levelwav->show(); residcont->show(); + residchro->show(); clarilres->show(); + claricres->show(); clarisoft->show(); clariFrame->show(); lcradius->hide(); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index e32354d2d..988e2ddfc 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -243,7 +243,9 @@ private: Adjuster* const residcont; Adjuster* const clarilres; Adjuster* const clarisoft; + Adjuster* const claricres; Adjuster* const sensilc; + Adjuster* const residchro; // Contrast by detail levels Adjuster* multiplier[6]; Adjuster* const chromacbdl; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 73dc57dda..e5eb393c2 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1137,7 +1137,9 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).lclightness = locallab.spots.at(j).lclightness && pSpot.lclightness == otherSpot.lclightness; locallab.spots.at(j).levelwav = locallab.spots.at(j).levelwav && pSpot.levelwav == otherSpot.levelwav; locallab.spots.at(j).residcont = locallab.spots.at(j).residcont && pSpot.residcont == otherSpot.residcont; + locallab.spots.at(j).residchro = locallab.spots.at(j).residchro && pSpot.residchro == otherSpot.residchro; locallab.spots.at(j).clarilres = locallab.spots.at(j).clarilres && pSpot.clarilres == otherSpot.clarilres; + locallab.spots.at(j).claricres = locallab.spots.at(j).claricres && pSpot.claricres == otherSpot.claricres; locallab.spots.at(j).clarisoft = locallab.spots.at(j).clarisoft && pSpot.clarisoft == otherSpot.clarisoft; locallab.spots.at(j).sensilc = locallab.spots.at(j).sensilc && pSpot.sensilc == otherSpot.sensilc; locallab.spots.at(j).fftwlc = locallab.spots.at(j).fftwlc && pSpot.fftwlc == otherSpot.fftwlc; @@ -3397,10 +3399,18 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).residcont = mods.locallab.spots.at(i).residcont; } + if (locallab.spots.at(i).residchro) { + toEdit.locallab.spots.at(i).residchro = mods.locallab.spots.at(i).residchro; + } + if (locallab.spots.at(i).clarilres) { toEdit.locallab.spots.at(i).clarilres = mods.locallab.spots.at(i).clarilres; } + if (locallab.spots.at(i).claricres) { + toEdit.locallab.spots.at(i).claricres = mods.locallab.spots.at(i).claricres; + } + if (locallab.spots.at(i).clarisoft) { toEdit.locallab.spots.at(i).clarisoft = mods.locallab.spots.at(i).clarisoft; } @@ -4719,7 +4729,9 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : lclightness(v), levelwav(v), residcont(v), + residchro(v), clarilres(v), + claricres(v), clarisoft(v), sensilc(v), fftwlc(v), @@ -4968,7 +4980,9 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) lclightness = v; levelwav = v; residcont = v; + residchro = v; clarilres = v; + claricres = v; clarisoft = v; sensilc = v; fftwlc = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 95bd515fa..8d7ffd282 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -560,7 +560,9 @@ public: bool lclightness; bool levelwav; bool residcont; + bool residchro; bool clarilres; + bool claricres; bool clarisoft; bool sensilc; bool fftwlc;