diff --git a/rtdata/languages/default b/rtdata/languages/default index 0b8b21f9f..9902fddf5 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -979,6 +979,9 @@ 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_742;Local - Exp Laplacian gamma +HISTORY_MSG_743;Local - Exp Fattal Amount +HISTORY_MSG_744;Local - Exp Fattal Detail +HISTORY_MSG_745;Local - Exp Fattal Anchor HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2136,7 +2139,11 @@ TP_LOCALLAB_NOISECHROCOARSE;Chroma coarse (Wav) TP_LOCALLAB_NOISECHRODETAIL;Chroma detail (DCT) TP_LOCALLAB_NOISECHROC_TOOLTIP;If superior to zero, high quality algorithm is enabled.\nCoarse is for slider >=2 TP_LOCALLAB_PREVIEWSEL;Preview selection deltaE -TP_LOCALLAB_PDEFRA;PDE +TP_LOCALLAB_PDEFRA;PDE Ipol +TP_LOCALLAB_FATFRA;PDE Fattal +TP_LOCALLAB_FATAMOUNT;Amount +TP_LOCALLAB_FATDETAIL;Detail +TP_LOCALLAB_FATANCHOR;Anchor TP_LOCALLAB_QUAL_METHOD;Global quality TP_LOCALLAB_QUALCURV_METHOD;Curves type TP_LOCALLAB_GAM;Gamma diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 04561b235..20e286050 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -751,7 +751,7 @@ void Crop::update(int todo) if (need_fattal) { parent->ipf.dehaze(f, params.dehaze); - parent->ipf.ToneMapFattal02(f); + parent->ipf.ToneMapFattal02(f, params.fattal); } // crop back to the size expected by the rest of the pipeline diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 32cb6aa75..89d0bb3a1 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -576,7 +576,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) } ipf.dehaze(orig_prev, params->dehaze); - ipf.ToneMapFattal02(orig_prev); + ipf.ToneMapFattal02(orig_prev, params->fattal); if (oprevi != orig_prev) { delete oprevi; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 3be4e0eac..3a2ae14a8 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -45,6 +45,7 @@ namespace procparams class ProcParams; struct DehazeParams; +struct FattalToneMappingParams; struct DirPyrDenoiseParams; struct LocalContrastParams; struct LocallabParams; @@ -415,7 +416,7 @@ public: void BadpixelsLab(LabImage * lab, double radius, int thresh, float chrom); void dehaze(Imagefloat *rgb, const DehazeParams &dehazeParams); - void ToneMapFattal02(Imagefloat *rgb); + void ToneMapFattal02(Imagefloat *rgb, const FattalToneMappingParams &fatParams); void localContrast(LabImage *lab, float **destination, const LocalContrastParams &localContrastParams, bool fftwlc, double scale); void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread); // void shadowsHighlights(LabImage *lab); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index d51effa34..7f37ee5d4 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -8838,7 +8838,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } - if (!lp.invex && (lp.exposena && (lp.expcomp != 0.f || lp.war != 0 || lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4 || lp.showmaskexpmet == 5 || (exlocalcurve && localexutili)))) { //interior ellipse renforced lightness and chroma //locallutili + if (!lp.invex && (lp.exposena && (lp.expcomp != 0.f || lp.war != 0 || lp.laplacexp > 0.1f || params->locallab.spots.at(sp).fatamount > 1.f || lp.showmaskexpmet == 2 || lp.enaExpMask || lp.showmaskexpmet == 3 || lp.showmaskexpmet == 4 || lp.showmaskexpmet == 5 || (exlocalcurve && localexutili)))) { //interior ellipse renforced lightness and chroma //locallutili 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); @@ -9085,44 +9085,68 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o //exposure_pde if (lp.expmet == 1) { - MyMutex::MyLock lock(*fftwMutex); - float *datain = new float[bfwr * bfhr]; - float *dataout = new float[bfwr * bfhr]; - float *dataor = new float[bfwr * bfhr]; - float gam = params->locallab.spots.at(sp).gamm; - float igam = 1.f / gam; -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - for (int y = 0; y < bfhr; y++) { - for (int x = 0; x < bfwr; x++) { - float L = LIM01(bufexpfin->L[y][x] / 32768.f);//change gamma for Laplacian - L = pow(L, gam); - L *= 32768.f; - datain[y * bfwr + x] = L; - dataor[y * bfwr + x] = L; - } + float enablefat = false; + Imagefloat *tmpImagefat = nullptr; + + if (params->locallab.spots.at(sp).fatamount > 1.f) { + enablefat = true; } - //call PDE equation - with Laplacian threshold - ImProcFunctions::exposure_pde(dataor, datain, dataout, bfwr, bfhr, 12.f * lp.laplacexp, lp.balanexp); -#ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) -#endif - - for (int y = 0; y < bfhr; y++) { - for (int x = 0; x < bfwr; x++) { - float Y = dataout[y * bfwr + x] / 32768.f;//inverse Laplacian gamma - Y = pow(Y, igam); - Y *= 32768.f; - bufexpfin->L[y][x] = Y; - } + if (enablefat) { + FattalToneMappingParams fatParams; + fatParams.enabled = true; + fatParams.threshold = params->locallab.spots.at(sp).fatdetail; + fatParams.amount = params->locallab.spots.at(sp).fatamount; + fatParams.anchor = params->locallab.spots.at(sp).fatanchor; + tmpImagefat = new Imagefloat(bfwr, bfhr); + lab2rgb(*bufexpfin, *tmpImagefat, params->icm.workingProfile); + ToneMapFattal02(tmpImagefat, fatParams); + rgb2lab(*tmpImagefat, *bufexpfin, params->icm.workingProfile); + delete tmpImagefat; } - delete [] datain; - delete [] dataout; - delete [] dataor; + + if (lp.laplacexp > 0.1f) { + MyMutex::MyLock lock(*fftwMutex); + float *datain = new float[bfwr * bfhr]; + float *dataout = new float[bfwr * bfhr]; + float *dataor = new float[bfwr * bfhr]; + float gam = params->locallab.spots.at(sp).gamm; + float igam = 1.f / gam; +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < bfhr; y++) { + for (int x = 0; x < bfwr; x++) { + float L = LIM01(bufexpfin->L[y][x] / 32768.f);//change gamma for Laplacian + L = pow(L, gam); + L *= 32768.f; + datain[y * bfwr + x] = L; + dataor[y * bfwr + x] = L; + } + } + + //call PDE equation - with Laplacian threshold + ImProcFunctions::exposure_pde(dataor, datain, dataout, bfwr, bfhr, 12.f * lp.laplacexp, lp.balanexp); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < bfhr; y++) { + for (int x = 0; x < bfwr; x++) { + float Y = dataout[y * bfwr + x] / 32768.f;//inverse Laplacian gamma + Y = pow(Y, igam); + Y *= 32768.f; + bufexpfin->L[y][x] = Y; + } + } + + delete [] datain; + delete [] dataout; + delete [] dataor; + } } //shadows with ipshadowshighlight diff --git a/rtengine/procevents.h b/rtengine/procevents.h index fd944ada9..5e8027e9b 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -769,6 +769,9 @@ enum ProcEventCode { Evlocallabclaricres = 739, Evlocallabresidchro = 740, Evlocallabgamm = 741, + Evlocallabfatamount = 742, + Evlocallabfatdetail = 743, + Evlocallabfatanchor = 744, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 222d0436e..a14e2d57e 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2434,7 +2434,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : expcomp(0.0), hlcompr(0), hlcomprthresh(0), - black(-6000), + black(0), shadex(20), shcompr(50), expchroma(30), @@ -2455,10 +2455,13 @@ LocallabParams::LocallabSpot::LocallabSpot() : slomaskexp(0.0), softradiusexp(0.0), expMethod("std"), - laplacexp(40.0), + laplacexp(0.0), balanexp(0.75), linear(0.3), gamm(0.4), + fatamount(1.0), + fatdetail(40.0), + fatanchor(50.0), // Shadow highlight expshadhigh(false), highlights(0), @@ -2715,6 +2718,9 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && balanexp == other.balanexp && linear == other.linear && gamm == other.gamm + && fatamount == other.fatamount + && fatdetail == other.fatdetail + && fatanchor == other.fatanchor // Shadow highlight && expshadhigh == other.expshadhigh && highlights == other.highlights @@ -3952,6 +3958,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).balanexp, "Locallab", "Balanexp_" + std::to_string(i), spot.balanexp, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).linear, "Locallab", "Linearexp_" + std::to_string(i), spot.linear, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gamm, "Locallab", "Gamm_" + std::to_string(i), spot.gamm, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fatamount, "Locallab", "Fatamount_" + std::to_string(i), spot.fatamount, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fatdetail, "Locallab", "Fatdetail_" + std::to_string(i), spot.fatdetail, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fatanchor, "Locallab", "Fatanchor_" + std::to_string(i), spot.fatanchor, keyFile); // Shadow highlight saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expshadhigh, "Locallab", "Expshadhigh_" + std::to_string(i), spot.expshadhigh, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).highlights, "Locallab", "highlights_" + std::to_string(i), spot.highlights, keyFile); @@ -5299,6 +5308,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Balanexp_" + std::to_string(i), pedited, spot.balanexp, spotEdited.balanexp); assignFromKeyfile(keyFile, "Locallab", "Linearexp_" + std::to_string(i), pedited, spot.linear, spotEdited.linear); assignFromKeyfile(keyFile, "Locallab", "Gamm_" + std::to_string(i), pedited, spot.gamm, spotEdited.gamm); + assignFromKeyfile(keyFile, "Locallab", "Fatamount_" + std::to_string(i), pedited, spot.fatamount, spotEdited.fatamount); + assignFromKeyfile(keyFile, "Locallab", "Fatdetail_" + std::to_string(i), pedited, spot.fatdetail, spotEdited.fatdetail); + assignFromKeyfile(keyFile, "Locallab", "Fatanchor_" + std::to_string(i), pedited, spot.fatanchor, spotEdited.fatanchor); // Shadow highlight assignFromKeyfile(keyFile, "Locallab", "Expshadhigh_" + std::to_string(i), pedited, spot.expshadhigh, spotEdited.expshadhigh); assignFromKeyfile(keyFile, "Locallab", "highlights_" + std::to_string(i), pedited, spot.highlights, spotEdited.highlights); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index fc7d66dec..9caa415af 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1024,6 +1024,9 @@ struct LocallabParams { double balanexp; double linear; double gamm; + double fatamount; + double fatdetail; + double fatanchor; // Shadow highlight bool expshadhigh; int highlights; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index b62f58ad4..56ef9ead5 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -768,7 +768,10 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabclarisoft LUMINANCECURVE, //Evlocallabclaricres LUMINANCECURVE, //Evlocallabresidchro - LUMINANCECURVE //Evlocallabgamm + LUMINANCECURVE, //Evlocallabgamm + LUMINANCECURVE, //Evlocallabfatamount + LUMINANCECURVE, //Evlocallabfatdetail + LUMINANCECURVE //Evlocallabfatanchor }; diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 0e03628c8..9f6a33894 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -1243,7 +1243,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT ipf.firstAnalysis (baseImg, params, hist16); ipf.dehaze(baseImg, params.dehaze); - ipf.ToneMapFattal02(baseImg); + ipf.ToneMapFattal02(baseImg, params.fattal); // perform transform if (ipf.needsTransform()) { diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 7b988821f..977498167 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -878,7 +878,7 @@ private: ipf.firstAnalysis(baseImg, params, hist16); ipf.dehaze(baseImg, params.dehaze); - ipf.ToneMapFattal02(baseImg); + ipf.ToneMapFattal02(baseImg, params.fattal); // perform transform (excepted resizing) if (ipf.needsTransform()) { diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index 76da1f03d..236f96a12 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -1047,24 +1047,23 @@ inline int find_fast_dim (int dim) } // namespace -void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) +void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb, const FattalToneMappingParams &fatParams) { - if (!params->fattal.enabled) { + if (!fatParams.enabled) { return; } - BENCHFUN const int detail_level = 3; float alpha = 1.f; - if (params->fattal.threshold < 0) { - alpha += (params->fattal.threshold * 0.9f) / 100.f; - } else if (params->fattal.threshold > 0) { - alpha += params->fattal.threshold / 100.f; + if (fatParams.threshold < 0) { + alpha += (fatParams.threshold * 0.9f) / 100.f; + } else if (fatParams.threshold > 0) { + alpha += fatParams.threshold / 100.f; } - float beta = 1.f - (params->fattal.amount * 0.3f) / 100.f; + float beta = 1.f - (fatParams.amount * 0.3f) / 100.f; // sanity check if (alpha <= 0 || beta <= 0) { @@ -1092,7 +1091,7 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) } float oldMedian; - const float percentile = float(LIM(params->fattal.anchor, 1, 100)) / 100.f; + const float percentile = float(LIM(fatParams.anchor, 1, 100)) / 100.f; findMinMaxPercentile (Yr.data(), Yr.getRows() * Yr.getCols(), percentile, oldMedian, percentile, oldMedian, multiThread); // median filter on the deep shadows, to avoid boosting noise // because w2 >= w and h2 >= h, we can use the L buffer as temporary buffer for Median_Denoise() @@ -1127,8 +1126,8 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) std::cout << "ToneMapFattal02: alpha = " << alpha << ", beta = " << beta << ", detail_level = " << detail_level << std::endl; } - rescale_nearest (Yr, L, multiThread); + tmo_fattal02 (w2, h2, L, L, alpha, beta, noise, detail_level, multiThread); const float hr = float(h2) / float(h); @@ -1158,6 +1157,7 @@ void ImProcFunctions::ToneMapFattal02 (Imagefloat *rgb) assert(std::isfinite(rgb->b(y, x))); } } + } diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index dadc961d7..e6eee9fb8 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -194,7 +194,7 @@ Locallab::Locallab(): expcomp(Gtk::manage(new Adjuster(M("TP_EXPOSURE_EXPCOMP"), -2.0, 4.0, 0.05, 0.0))), hlcompr(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0))), hlcomprthresh(Gtk::manage(new Adjuster(M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0))), - black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 10, -6000))), + black(Gtk::manage(new Adjuster(M("TP_EXPOSURE_BLACKLEVEL"), -16384, 32768, 10, 0))), shadex(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHADEX"), 0, 100, 1, 20))), shcompr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHADEXCOMP"), 0, 100, 1, 50))), expchroma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EXPCHROMA"), -50, 100, 1, 30))), @@ -208,10 +208,13 @@ Locallab::Locallab(): gammaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), slomaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), softradiusexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 0.))), - laplacexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACEXP"), 0.0, 100.0, 0.1, 40.))), + laplacexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACEXP"), 0.0, 100.0, 0.1, 0.))), balanexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALANEXP"), 0.2, 1.2, 0.01, 0.75))), linear(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LINEAR"), 0., 1., 0.01, 0.3))), gamm(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMM"), 0.2, 1.3, 0.01, 0.4))), + fatamount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATAMOUNT"), 1., 100., 1., 1.))), + fatdetail(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATDETAIL"), -100., 300., 1., 0.))), + fatanchor(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATANCHOR"), 1., 100., 1., 50., Gtk::manage(new RTImage("circle-black-small.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), //Shadow hightlights highlights(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), 0, 100, 1, 0))), h_tonalwidth(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_HLTONALW"), 10, 100, 1, 70))), @@ -403,6 +406,7 @@ Locallab::Locallab(): lumacontrastPlusButton(Gtk::manage(new Gtk::Button(M("TP_DIRPYREQUALIZER_LUMACONTRAST_PLUS")))), gridFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABGRID")))), pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), + fatFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATFRA")))), residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), clariFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), @@ -725,6 +729,9 @@ Locallab::Locallab(): balanexp->setAdjusterListener(this); linear->setAdjusterListener(this); gamm->setAdjusterListener(this); + fatamount->setAdjusterListener(this); + fatdetail->setAdjusterListener(this); + fatanchor->setAdjusterListener(this); curveEditorG->setCurveListener(this); @@ -814,11 +821,19 @@ Locallab::Locallab(): pdeBox->pack_start(*balanexp); pdeBox->pack_start(*gamm); + fatFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const fatBox = Gtk::manage(new ToolParamBlock()); + fatBox->pack_start(*fatamount); + fatBox->pack_start(*fatdetail); + fatBox->pack_start(*fatanchor); + pdeFrame->add(*pdeBox); + fatFrame->add(*fatBox); ToolParamBlock* const exposeBox = Gtk::manage(new ToolParamBlock()); exposeBox->pack_start(*expMethod); exposeBox->pack_start(*pdeFrame); + exposeBox->pack_start(*fatFrame); exposeBox->pack_start(*expcomp); exposeBox->pack_start(*hlcompr); @@ -2819,6 +2834,9 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).balanexp = balanexp->getValue(); pp->locallab.spots.at(pp->locallab.selspot).linear = linear->getValue(); pp->locallab.spots.at(pp->locallab.selspot).gamm = gamm->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).fatamount = fatamount->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).fatdetail = fatdetail->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).fatanchor = fatanchor->getValue(); // Shadow highlight pp->locallab.spots.at(pp->locallab.selspot).expshadhigh = expshadhigh->getEnabled(); @@ -3122,6 +3140,9 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).balanexp = pe->locallab.spots.at(pp->locallab.selspot).balanexp || balanexp->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).linear = pe->locallab.spots.at(pp->locallab.selspot).linear || linear->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).gamm = pe->locallab.spots.at(pp->locallab.selspot).gamm || gamm->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).fatamount = pe->locallab.spots.at(pp->locallab.selspot).fatamount || fatamount->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).fatdetail = pe->locallab.spots.at(pp->locallab.selspot).fatdetail || fatdetail->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).fatanchor = pe->locallab.spots.at(pp->locallab.selspot).fatanchor || fatanchor->getEditedState(); // Shadow highlight pe->locallab.spots.at(pp->locallab.selspot).expshadhigh = pe->locallab.spots.at(pp->locallab.selspot).expshadhigh || !expshadhigh->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).highlights = pe->locallab.spots.at(pp->locallab.selspot).highlights || highlights->getEditedState(); @@ -3382,6 +3403,9 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).balanexp = pedited->locallab.spots.at(pp->locallab.selspot).balanexp || balanexp->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).linear = pedited->locallab.spots.at(pp->locallab.selspot).linear || linear->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).gamm = pedited->locallab.spots.at(pp->locallab.selspot).gamm || gamm->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).fatamount = pedited->locallab.spots.at(pp->locallab.selspot).fatamount || fatamount->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).fatdetail = pedited->locallab.spots.at(pp->locallab.selspot).fatdetail || fatdetail->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).fatanchor = pedited->locallab.spots.at(pp->locallab.selspot).fatanchor || fatanchor->getEditedState(); // Shadow highlight pedited->locallab.spots.at(pp->locallab.selspot).expshadhigh = pedited->locallab.spots.at(pp->locallab.selspot).expshadhigh || !expshadhigh->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).highlights = pedited->locallab.spots.at(pp->locallab.selspot).highlights || highlights->getEditedState(); @@ -4119,16 +4143,24 @@ void Locallab::expMethodChanged() if (expMethod->get_active_row_number() == 0) { pdeFrame->set_sensitive(false); + fatFrame->set_sensitive(false); laplacexp->set_sensitive(false); balanexp->set_sensitive(false); linear->set_sensitive(false); gamm->set_sensitive(false); + fatamount->set_sensitive(false); + fatdetail->set_sensitive(false); + fatanchor->set_sensitive(false); } else if (expMethod->get_active_row_number() == 1) { laplacexp->set_sensitive(true); balanexp->set_sensitive(true); linear->set_sensitive(true); pdeFrame->set_sensitive(true); + fatFrame->set_sensitive(true); gamm->set_sensitive(true); + fatamount->set_sensitive(true); + fatdetail->set_sensitive(true); + fatanchor->set_sensitive(true); } enableListener(); @@ -4633,8 +4665,10 @@ void Locallab::inversexChanged() if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->show(); + fatFrame->show(); } showmaskexpMethodinv->hide(); // Being able to change Color & Light mask visibility is useless in batch mode @@ -4655,8 +4689,10 @@ void Locallab::inversexChanged() if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->hide(); + fatFrame->hide(); } } else { @@ -4671,8 +4707,10 @@ void Locallab::inversexChanged() if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->show(); + fatFrame->show(); } showmaskexpMethodinv->show(); @@ -5076,6 +5114,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe balanexp->setDefault(defSpot->balanexp); linear->setDefault(defSpot->linear); gamm->setDefault(defSpot->gamm); + fatamount->setDefault(defSpot->fatamount); + fatdetail->setDefault(defSpot->fatdetail); + fatanchor->setDefault(defSpot->fatanchor); // Shadow highlight highlights->setDefault((double)defSpot->highlights); h_tonalwidth->setDefault((double)defSpot->h_tonalwidth); @@ -5234,6 +5275,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe balanexp->setDefaultEditedState(Irrelevant); linear->setDefaultEditedState(Irrelevant); gamm->setDefaultEditedState(Irrelevant); + fatamount->setDefaultEditedState(Irrelevant); + fatdetail->setDefaultEditedState(Irrelevant); + fatanchor->setDefaultEditedState(Irrelevant); // Shadow highlight highlights->setDefaultEditedState(Irrelevant); h_tonalwidth->setDefaultEditedState(Irrelevant); @@ -5396,6 +5440,9 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe balanexp->setDefaultEditedState(defSpotState->balanexp ? Edited : UnEdited); linear->setDefaultEditedState(defSpotState->linear ? Edited : UnEdited); gamm->setDefaultEditedState(defSpotState->gamm ? Edited : UnEdited); + fatamount->setDefaultEditedState(defSpotState->fatamount ? Edited : UnEdited); + fatdetail->setDefaultEditedState(defSpotState->fatdetail ? Edited : UnEdited); + fatanchor->setDefaultEditedState(defSpotState->fatanchor ? Edited : UnEdited); // Shadow highlight highlights->setDefaultEditedState(defSpotState->highlights ? Edited : UnEdited); h_tonalwidth->setDefaultEditedState(defSpotState->h_tonalwidth ? Edited : UnEdited); @@ -5785,6 +5832,24 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == fatamount) { + if (listener) { + listener->panelChanged(Evlocallabfatamount, fatamount->getTextValue()); + } + } + + if (a == fatdetail) { + if (listener) { + listener->panelChanged(Evlocallabfatdetail, fatdetail->getTextValue()); + } + } + + if (a == fatanchor) { + if (listener) { + listener->panelChanged(Evlocallabfatanchor, fatanchor->getTextValue()); + } + } + } if (getEnabled() && expshadhigh->getEnabled()) { @@ -6529,6 +6594,9 @@ void Locallab::setBatchMode(bool batchMode) balanexp->showEditedCB(); linear->showEditedCB(); gamm->showEditedCB(); + fatamount->showEditedCB(); + fatdetail->showEditedCB(); + fatanchor->showEditedCB(); //Shadow Highlight highlights->showEditedCB(); h_tonalwidth->showEditedCB(); @@ -7042,6 +7110,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con laplacexp->setValue(pp->locallab.spots.at(index).laplacexp); balanexp->setValue(pp->locallab.spots.at(index).balanexp); linear->setValue(pp->locallab.spots.at(index).linear); + gamm->setValue(pp->locallab.spots.at(index).gamm); + fatamount->setValue(pp->locallab.spots.at(index).fatamount); + fatdetail->setValue(pp->locallab.spots.at(index).fatdetail); + fatanchor->setValue(pp->locallab.spots.at(index).fatanchor); // Shadow highlight expshadhigh->setEnabled(pp->locallab.spots.at(index).expshadhigh); @@ -7372,6 +7444,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con laplacexp->setEditedState(spotState->laplacexp ? Edited : UnEdited); balanexp->setEditedState(spotState->balanexp ? Edited : UnEdited); linear->setEditedState(spotState->linear ? Edited : UnEdited); + gamm->setEditedState(spotState->gamm ? Edited : UnEdited); + fatamount->setEditedState(spotState->fatamount ? Edited : UnEdited); + fatdetail->setEditedState(spotState->fatdetail ? Edited : UnEdited); + fatanchor->setEditedState(spotState->fatanchor ? Edited : UnEdited); // Shadow highlight expshadhigh->set_inconsistent(!spotState->expshadhigh); @@ -7634,8 +7710,10 @@ void Locallab::updateSpecificGUIState() if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->show(); + fatFrame->show(); } showmaskexpMethodinv->hide(); @@ -7646,14 +7724,17 @@ void Locallab::updateSpecificGUIState() shadex->hide(); expMethod->hide(); pdeFrame->hide(); + fatFrame->hide(); expmaskexp->show(); showmaskexpMethodinv->show(); showmaskexpMethod->hide(); if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->hide(); + fatFrame->hide(); } } else { structexp->show(); @@ -7666,8 +7747,10 @@ void Locallab::updateSpecificGUIState() if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->show(); + fatFrame->show(); } if (batchMode) { @@ -7729,8 +7812,10 @@ void Locallab::updateSpecificGUIState() if (expMethod->get_active_row_number() == 0) { pdeFrame->hide(); + fatFrame->hide(); } else if (expMethod->get_active_row_number() == 1) { pdeFrame->show(); + fatFrame->show(); } if (softMethod->get_active_row_number() == 0) { diff --git a/rtgui/locallab.h b/rtgui/locallab.h index ac0ed6e0c..7e7e954dd 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -160,6 +160,9 @@ private: Adjuster* const balanexp; Adjuster* const linear; Adjuster* const gamm; + Adjuster* const fatamount; + Adjuster* const fatdetail; + Adjuster* const fatanchor; //Shadow highlight Adjuster* const highlights; Adjuster* const h_tonalwidth; @@ -392,6 +395,7 @@ private: sigc::connection lumacontrastMinusPressedConn, lumaneutralPressedConn, lumacontrastPlusPressedConn; Gtk::Frame* gridFrame; Gtk::Frame* pdeFrame; + Gtk::Frame* fatFrame; Gtk::Frame* residFrame; Gtk::Frame* clariFrame; LabGrid *labgrid; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 4d6e28e7d..e57f77cea 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1015,6 +1015,9 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).balanexp = locallab.spots.at(j).balanexp && pSpot.balanexp == otherSpot.balanexp; locallab.spots.at(j).linear = locallab.spots.at(j).linear && pSpot.linear == otherSpot.linear; locallab.spots.at(j).gamm = locallab.spots.at(j).gamm && pSpot.gamm == otherSpot.gamm; + locallab.spots.at(j).fatamount = locallab.spots.at(j).linear && pSpot.fatamount == otherSpot.fatamount; + locallab.spots.at(j).fatdetail = locallab.spots.at(j).linear && pSpot.fatdetail == otherSpot.fatdetail; + locallab.spots.at(j).fatanchor = locallab.spots.at(j).linear && pSpot.fatanchor == otherSpot.fatanchor; // Shadow highlight locallab.spots.at(j).expshadhigh = locallab.spots.at(j).expshadhigh && pSpot.expshadhigh == otherSpot.expshadhigh; locallab.spots.at(j).highlights = locallab.spots.at(j).highlights && pSpot.highlights == otherSpot.highlights; @@ -2936,6 +2939,18 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).gamm = mods.locallab.spots.at(i).gamm; } + if (locallab.spots.at(i).fatamount) { + toEdit.locallab.spots.at(i).fatamount = mods.locallab.spots.at(i).fatamount; + } + + if (locallab.spots.at(i).fatdetail) { + toEdit.locallab.spots.at(i).fatdetail = mods.locallab.spots.at(i).fatdetail; + } + + if (locallab.spots.at(i).fatanchor) { + toEdit.locallab.spots.at(i).fatanchor = mods.locallab.spots.at(i).fatanchor; + } + // Shadow highlight if (locallab.spots.at(i).expshadhigh) { toEdit.locallab.spots.at(i).expshadhigh = mods.locallab.spots.at(i).expshadhigh; @@ -4612,6 +4627,9 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : balanexp(v), linear(v), gamm(v), + fatamount(v), + fatdetail(v), + fatanchor(v), // Shadow highlight expshadhigh(v), highlights(v), @@ -4865,6 +4883,9 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) balanexp = v; linear = v; gamm = v; + fatamount = v; + fatdetail = v; + fatanchor = v; // Shadow highlight expshadhigh = v; highlights = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index d98c6281a..a34187c94 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -438,6 +438,9 @@ public: bool balanexp; bool linear; bool gamm; + bool fatamount; + bool fatdetail; + bool fatanchor; // Shadow highlight bool expshadhigh; bool highlights;