diff --git a/rtdata/languages/default b/rtdata/languages/default index 3289e6bda..d4b1fb41e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1030,6 +1030,8 @@ HISTORY_MSG_789;Local - SH mask amount HISTORY_MSG_790;Local - SH mask anchor HISTORY_MSG_791;Local - Mask Short L curves HISTORY_MSG_792;Local - Mask Luminance Background +HISTORY_MSG_793;Local - SH TRC gamma +HISTORY_MSG_794;Local - SH TRC slope HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2244,6 +2246,9 @@ TP_LOCALLAB_FATAMOUNT;Amount TP_LOCALLAB_FATDETAIL;Detail TP_LOCALLAB_FATANCHOR;Anchor TP_LOCALLAB_FATLEVEL;Detail levels +TP_LOCALLAB_GAMFRA;Tone response curve +TP_LOCALLAB_GAMSH;Gamma +TP_LOCALLAB_SLOSH;Slope TP_LOCALLAB_QUAL_METHOD;Global quality TP_LOCALLAB_QUALCURV_METHOD;Curves type TP_LOCALLAB_GAM;Gamma diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 36248536f..cc2cf8118 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -279,7 +279,7 @@ public: void fftw_denoise(int GW, int GH, int max_numblox_W, int min_numblox_W, float **tmp1, array2D *Lin, int numThreads, const struct local_params & lp, int chrom); void ColorLight_Local(float moddE, float powdE, int call, LabImage * bufcolorig, LabImage * originalmask, float **buflight, float **bufchro, float **bufchroslid, float ** bufhh, float ** buflightslid, bool &LHutili, bool &HHutili, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const float lumaref, float sobelref, float ** blend2, LUTf & lllocalcurve, const LocLHCurve & loclhCurve, const LocHHCurve & lochhCurve, LUTf & lightCurveloc, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); - void InverseColorLight_Local(int sp, int senstype, struct local_params& lp, LabImage * originalmask, LUTf & lightCurveloc, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & exlocalcurve, LUTf & cclocalcurve, float adjustr, bool localcutili, LUTf & lllocalcurve, bool locallutili, LabImage* original, LabImage* transformed, int cx, int cy, const float hueref, const float chromaref, const float lumaref, int sk); + void InverseColorLight_Local(bool tonequ, bool tonecurv, int sp, int senstype, struct local_params& lp, LabImage * originalmask, LUTf & lightCurveloc, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & exlocalcurve, LUTf & cclocalcurve, float adjustr, bool localcutili, LUTf & lllocalcurve, bool locallutili, LabImage* original, LabImage* transformed, int cx, int cy, const float hueref, const float chromaref, const float lumaref, int sk); void Sharp_Local(int call, float **loctemp, int senstype, const float hueref, const float chromaref, const float lumaref, const local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); // void Sharp_Local(int call, float **loctemp, int senstype, const float hueplus, const float huemoins, const float hueref, const float dhue, const float chromaref, const local_params& lp, LabImage* original, LabImage* transformed, int cx, int cy, int sk); diff --git a/rtengine/iplab2rgb.cc b/rtengine/iplab2rgb.cc index 14aeb4049..b3da9cb49 100644 --- a/rtengine/iplab2rgb.cc +++ b/rtengine/iplab2rgb.cc @@ -376,7 +376,7 @@ void ImProcFunctions::workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, if (transform) { hTransform = transform; } else { - +printf("OK work\n"); double pwr = 1.0 / gampos; double ts = slpos; int five = mul; diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 3c3e9bfe3..e0f039e12 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -4500,7 +4500,7 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo } } -void ImProcFunctions::InverseColorLight_Local(int sp, int senstype, struct local_params & lp, LabImage * originalmask, LUTf & lightCurveloc, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & exlocalcurve, LUTf & cclocalcurve, float adjustr, bool localcutili, LUTf & lllocalcurve, bool locallutili, LabImage * original, LabImage * transformed, int cx, int cy, const float hueref, const float chromaref, const float lumaref, int sk) +void ImProcFunctions::InverseColorLight_Local(bool tonequ, bool tonecurv, int sp, int senstype, struct local_params & lp, LabImage * originalmask, LUTf & lightCurveloc, LUTf & hltonecurveloc, LUTf & shtonecurveloc, LUTf & tonecurveloc, LUTf & exlocalcurve, LUTf & cclocalcurve, float adjustr, bool localcutili, LUTf & lllocalcurve, bool locallutili, LabImage * original, LabImage * transformed, int cx, int cy, const float hueref, const float chromaref, const float lumaref, int sk) { // BENCHFUN float ach = (float)lp.trans / 100.f; @@ -4553,13 +4553,21 @@ void ImProcFunctions::InverseColorLight_Local(int sp, int senstype, struct loca Imagefloat *tmpImage = nullptr; tmpImage = new Imagefloat(GW, GH); lab2rgb(*temp, *tmpImage, params->icm.workingProfile); - tmpImage->normalizeFloatTo1(); - - array2D Rtemp(GW, GH, tmpImage->r.ptrs, ARRAY2D_BYREFERENCE); - array2D Gtemp(GW, GH, tmpImage->g.ptrs, ARRAY2D_BYREFERENCE); - array2D Btemp(GW, GH, tmpImage->b.ptrs, ARRAY2D_BYREFERENCE); - tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, scal, multiThread); - tmpImage->normalizeFloatTo65535(); + if(tonecurv) {//Tone response curve : does nothing if gamma=2.4 and slope=12.92 ==> gamma sRGB + float gamtone = params->locallab.spots.at(sp).gamSH; + float slotone = params->locallab.spots.at(sp).sloSH; + cmsHTRANSFORM dummy = nullptr; + workingtrc(tmpImage, tmpImage, GW, GH, -5, params->icm.workingProfile, 2.4, 12.92310, dummy, true, false, false); + workingtrc(tmpImage, tmpImage, GW, GH, 5, params->icm.workingProfile, gamtone, slotone, dummy, false, true, true); + } + if(tonequ) { + tmpImage->normalizeFloatTo1(); + array2D Rtemp(GW, GH, tmpImage->r.ptrs, ARRAY2D_BYREFERENCE); + array2D Gtemp(GW, GH, tmpImage->g.ptrs, ARRAY2D_BYREFERENCE); + array2D Btemp(GW, GH, tmpImage->b.ptrs, ARRAY2D_BYREFERENCE); + tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, scal, multiThread); + tmpImage->normalizeFloatTo65535(); + } rgb2lab(*tmpImage, *temp, params->icm.workingProfile); delete tmpImage; @@ -8659,7 +8667,13 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o tonequ = true; } - if (! lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 3 || lp.showmaskSHmet == 4) && call < 3 && lp.hsena) { + bool tonecurv = false; + + if(params->locallab.spots.at(sp).gamSH != 2.4 || params->locallab.spots.at(sp).sloSH != 12.92) { + tonecurv = true; + } + + if (! lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.showmaskSHmet == 2 || lp.enaSHMask || lp.showmaskSHmet == 3 || lp.showmaskSHmet == 4) && call < 3 && lp.hsena) { const int ystart = std::max(static_cast(lp.yc - lp.lyT) - cy, 0); const int yend = std::min(static_cast(lp.yc + lp.ly) - cy, original->H); const int xstart = std::max(static_cast(lp.xc - lp.lxL) - cx, 0); @@ -8789,13 +8803,21 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o Imagefloat *tmpImage = nullptr; tmpImage = new Imagefloat(bfw, bfh); lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile); - tmpImage->normalizeFloatTo1(); - - array2D Rtemp(bfw, bfh, tmpImage->r.ptrs, ARRAY2D_BYREFERENCE); - array2D Gtemp(bfw, bfh, tmpImage->g.ptrs, ARRAY2D_BYREFERENCE); - array2D Btemp(bfw, bfh, tmpImage->b.ptrs, ARRAY2D_BYREFERENCE); - tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, scal, multiThread); - tmpImage->normalizeFloatTo65535(); + if(tonecurv) {//Tone response curve : does nothing if gamma=2.4 and slope=12.92 ==> gamma sRGB + float gamtone = params->locallab.spots.at(sp).gamSH; + float slotone = params->locallab.spots.at(sp).sloSH; + cmsHTRANSFORM dummy = nullptr; + workingtrc(tmpImage, tmpImage, bfw, bfh, -5, params->icm.workingProfile, 2.4, 12.92310, dummy, true, false, false); + workingtrc(tmpImage, tmpImage, bfw, bfh, 5, params->icm.workingProfile, gamtone, slotone, dummy, false, true, true); + } + if(tonequ) { + tmpImage->normalizeFloatTo1(); + array2D Rtemp(bfw, bfh, tmpImage->r.ptrs, ARRAY2D_BYREFERENCE); + array2D Gtemp(bfw, bfh, tmpImage->g.ptrs, ARRAY2D_BYREFERENCE); + array2D Btemp(bfw, bfh, tmpImage->b.ptrs, ARRAY2D_BYREFERENCE); + tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, scal, multiThread); + tmpImage->normalizeFloatTo65535(); + } rgb2lab(*tmpImage, *bufexpfin, params->icm.workingProfile); delete tmpImage; @@ -8816,7 +8838,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o transit_shapedetect(9, bufexpfin.get(), originalmaskSH.get(), buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); } } - } else if (lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || lp.showmaskSHmetinv == 1 || lp.enaSHMaskinv) && call < 3 && lp.hsena) { + } else if (lp.invsh && (lp.highlihs > 0.f || lp.shadowhs > 0.f || tonequ || tonecurv || lp.showmaskSHmetinv == 1 || lp.enaSHMaskinv) && call < 3 && lp.hsena) { std::unique_ptr bufmaskblurcol; std::unique_ptr originalmaskSH; std::unique_ptr bufcolorig; @@ -8898,7 +8920,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } float adjustr = 2.f; - InverseColorLight_Local(sp, 2, lp, originalmaskSH.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); + InverseColorLight_Local(tonequ, tonecurv, sp, 2, lp, originalmaskSH.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); } @@ -11197,7 +11219,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o return; } - InverseColorLight_Local(sp, 1, lp, originalmaskexp.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); + InverseColorLight_Local(false, false, sp, 1, lp, originalmaskexp.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); } @@ -11687,7 +11709,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } if (lp.showmaskcolmetinv == 0 || lp.enaColorMaskinv) { - InverseColorLight_Local(sp, 0, lp, originalmaskcol.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); + InverseColorLight_Local(false, false, sp, 0, lp, originalmaskcol.get(), lightCurveloc, hltonecurveloc, shtonecurveloc, tonecurveloc, exlocalcurve, cclocalcurve, adjustr, localcutili, lllocalcurve, locallutili, original, transformed, cx, cy, hueref, chromaref, lumaref, sk); } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 14d485b17..989c7aaf4 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -819,6 +819,8 @@ enum ProcEventCode { EvlocallabfatanchorSH = 789, Evlocallabshortc = 790, EvLocallabSpotlumask = 791, + EvlocallabgamSH = 792, + EvlocallabsloSH = 793, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index e64dd6d44..d5904eb6d 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2537,6 +2537,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : LmaskSHcurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, fatamountSH(1.0), fatanchorSH(50.0), + gamSH(2.4), + sloSH(12.92), // Vibrance expvibrance(false), saturated(0), @@ -2851,6 +2853,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && LmaskSHcurve == other.LmaskSHcurve && fatamountSH == other.fatamountSH && fatanchorSH == other.fatanchorSH + && gamSH == other.gamSH + && sloSH == other.sloSH // Vibrance && expvibrance == other.expvibrance && saturated == other.saturated @@ -4144,6 +4148,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo } saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fatamountSH, "Locallab", "FatamountSH_" + std::to_string(i), spot.fatamountSH, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).fatanchorSH, "Locallab", "FatanchorSH_" + std::to_string(i), spot.fatanchorSH, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gamSH, "Locallab", "GamSH_" + std::to_string(i), spot.gamSH, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sloSH, "Locallab", "SloSH_" + std::to_string(i), spot.sloSH, keyFile); // Vibrance saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expvibrance, "Locallab", "Expvibrance_" + std::to_string(i), spot.expvibrance, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).saturated, "Locallab", "Saturated_" + std::to_string(i), spot.saturated, keyFile); @@ -5563,6 +5569,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } assignFromKeyfile(keyFile, "Locallab", "FatamountSH_" + std::to_string(i), pedited, spot.fatamountSH, spotEdited.fatamountSH); assignFromKeyfile(keyFile, "Locallab", "FatanchorSH_" + std::to_string(i), pedited, spot.fatanchorSH, spotEdited.fatanchorSH); + assignFromKeyfile(keyFile, "Locallab", "GamSH_" + std::to_string(i), pedited, spot.gamSH, spotEdited.gamSH); + assignFromKeyfile(keyFile, "Locallab", "SloSH_" + std::to_string(i), pedited, spot.sloSH, spotEdited.sloSH); // Vibrance assignFromKeyfile(keyFile, "Locallab", "Expvibrance_" + std::to_string(i), pedited, spot.expvibrance, spotEdited.expvibrance); assignFromKeyfile(keyFile, "Locallab", "Saturated_" + std::to_string(i), pedited, spot.saturated, spotEdited.saturated); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 028df9df8..05781b146 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1085,6 +1085,8 @@ struct LocallabParams { std::vector LmaskSHcurve; double fatamountSH; double fatanchorSH; + double gamSH; + double sloSH; // Vibrance bool expvibrance; int saturated; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 864be0054..10baaf212 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -818,7 +818,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //EvlocallabfatamountSH LUMINANCECURVE, //EvlocallabfatanchorSH LUMINANCECURVE, //Evlocallabshortc - LUMINANCECURVE //EvLocallabSpotlumask + LUMINANCECURVE, //EvLocallabSpotlumask + LUMINANCECURVE, //EvlocallabgamSH + LUMINANCECURVE //EvlocallabsloSH }; namespace rtengine diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index e80014801..fa62ae8c0 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -5,6 +5,7 @@ * * * RawTherapee is free software: you can redistribute it and/or modify + * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -247,6 +248,8 @@ Locallab::Locallab(): detailSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DETAILSH"), -5, 5, 1, 0))), fatamountSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FATAMOUNT"), 1., 100., 1., 1.))), fatanchorSH(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"))))), + gamSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMSH"), 0.25, 5.0, 0.01, 2.4))), + sloSH(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOSH"), 0.0, 20.0, 0.01, 12.92))), // Vibrance saturated(Gtk::manage(new Adjuster(M("TP_VIBRANCE_SATURATED"), -100., 100., 1., 0.))), pastels(Gtk::manage(new Adjuster(M("TP_VIBRANCE_PASTELS"), -100., 100., 1., 0.))), @@ -447,6 +450,7 @@ Locallab::Locallab(): pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), fatFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATFRA")))), fatSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATSHFRA")))), + gamFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GAMFRA")))), dehaFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DEHAFRA")))), retiFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETIFRA")))), retitoolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETITOOLFRA")))), @@ -1099,6 +1103,8 @@ Locallab::Locallab(): detailSH->setAdjusterListener(this); fatamountSH->setAdjusterListener(this); fatanchorSH->setAdjusterListener(this); + gamSH->setAdjusterListener(this); + sloSH->setAdjusterListener(this); if (showtooltip) { radmaskSH->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); @@ -1191,8 +1197,14 @@ Locallab::Locallab(): for (int i = 0; i < 5; i++) { shadhighBox->pack_start(*multipliersh[i]); } + gamFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const gammBox = Gtk::manage(new ToolParamBlock()); + gammBox->pack_start(*gamSH); + gammBox->pack_start(*sloSH); + gamFrame->add(*gammBox); shadhighBox->pack_start(*detailSH); + shadhighBox->pack_start(*gamFrame); shadhighBox->pack_start(*highlights); shadhighBox->pack_start(*h_tonalwidth); shadhighBox->pack_start(*shadows); @@ -3480,6 +3492,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = LmaskSHshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).fatamountSH = fatamountSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).fatanchorSH = fatanchorSH->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).gamSH = gamSH->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).sloSH = sloSH->getValue(); if (shMethod->get_active_row_number() == 0) { pp->locallab.spots.at(pp->locallab.selspot).shMethod = "std"; @@ -3845,6 +3859,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } pe->locallab.spots.at(pp->locallab.selspot).fatamountSH = pe->locallab.spots.at(pp->locallab.selspot).fatamountSH || fatamountSH->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).fatanchorSH = pe->locallab.spots.at(pp->locallab.selspot).fatanchorSH || fatanchorSH->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).gamSH = pe->locallab.spots.at(pp->locallab.selspot).gamSH || gamSH->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).sloSH = pe->locallab.spots.at(pp->locallab.selspot).sloSH || sloSH->getEditedState(); // Vibrance pe->locallab.spots.at(pp->locallab.selspot).expvibrance = pe->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); @@ -4158,6 +4174,8 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } pedited->locallab.spots.at(pp->locallab.selspot).fatamountSH = pedited->locallab.spots.at(pp->locallab.selspot).fatamountSH || fatamountSH->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).fatanchorSH = pedited->locallab.spots.at(pp->locallab.selspot).fatanchorSH || fatanchorSH->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).gamSH = pedited->locallab.spots.at(pp->locallab.selspot).gamSH || gamSH->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).sloSH = pedited->locallab.spots.at(pp->locallab.selspot).sloSH || sloSH->getEditedState(); // Vibrance pedited->locallab.spots.at(pp->locallab.selspot).expvibrance = pedited->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); @@ -5034,6 +5052,7 @@ void Locallab::shMethodChanged() } detailSH->hide(); + gamFrame->hide(); highlights->show(); h_tonalwidth->show(); shadows->show(); @@ -5046,6 +5065,7 @@ void Locallab::shMethodChanged() } detailSH->show(); + gamFrame->show(); highlights->hide(); h_tonalwidth->hide(); shadows->hide(); @@ -6164,6 +6184,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe } fatamountSH->setDefault(defSpot->fatamountSH); fatanchorSH->setDefault(defSpot->fatanchorSH); + gamSH->setDefault(defSpot->gamSH); + sloSH->setDefault(defSpot->sloSH); // Vibrance saturated->setDefault((double)defSpot->saturated); @@ -6353,6 +6375,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe } fatamountSH->setDefaultEditedState(Irrelevant); fatanchorSH->setDefaultEditedState(Irrelevant); + gamSH->setDefaultEditedState(Irrelevant); + sloSH->setDefaultEditedState(Irrelevant); // Vibrance saturated->setDefaultEditedState(Irrelevant); @@ -6546,6 +6570,8 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe } fatamountSH->setDefaultEditedState(defSpotState->fatamountSH ? Edited : UnEdited); fatanchorSH->setDefaultEditedState(defSpotState->fatanchorSH ? Edited : UnEdited); + gamSH->setDefaultEditedState(defSpotState->gamSH ? Edited : UnEdited); + sloSH->setDefaultEditedState(defSpotState->sloSH ? Edited : UnEdited); // Vibrance saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited); @@ -7110,6 +7136,17 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == gamSH) { + if (listener) { + listener->panelChanged(EvlocallabgamSH, gamSH->getTextValue()); + } + } + + if (a == sloSH) { + if (listener) { + listener->panelChanged(EvlocallabsloSH, sloSH->getTextValue()); + } + } } @@ -7889,6 +7926,8 @@ void Locallab::setBatchMode(bool batchMode) } fatamountSH->showEditedCB(); fatanchorSH->showEditedCB(); + gamSH->showEditedCB(); + sloSH->showEditedCB(); // Vibrance saturated->showEditedCB(); @@ -8489,6 +8528,8 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con } fatamountSH->setValue(pp->locallab.spots.at(index).fatamountSH); fatanchorSH->setValue(pp->locallab.spots.at(index).fatanchorSH); + gamSH->setValue(pp->locallab.spots.at(index).gamSH); + sloSH->setValue(pp->locallab.spots.at(index).sloSH); // Vibrance expvibrance->setEnabled(pp->locallab.spots.at(index).expvibrance); @@ -8878,6 +8919,8 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con } fatamountSH->setEditedState(spotState->fatamountSH ? Edited : UnEdited); fatanchorSH->setEditedState(spotState->fatanchorSH ? Edited : UnEdited); + gamSH->setEditedState(spotState->gamSH ? Edited : UnEdited); + sloSH->setEditedState(spotState->sloSH ? Edited : UnEdited); // Vibrance expvibrance->set_inconsistent(!spotState->expvibrance); @@ -9224,6 +9267,7 @@ void Locallab::updateSpecificGUIState() } detailSH->hide(); + gamFrame->hide(); highlights->show(); h_tonalwidth->show(); shadows->show(); @@ -9233,6 +9277,7 @@ void Locallab::updateSpecificGUIState() for (int i = 0; i < 5; i++) { multipliersh[i]->show(); } + gamFrame->show(); detailSH->show(); highlights->hide(); @@ -9306,6 +9351,7 @@ void Locallab::updateSpecificGUIState() } detailSH->hide(); + gamFrame->hide(); highlights->show(); h_tonalwidth->show(); shadows->show(); @@ -9317,6 +9363,7 @@ void Locallab::updateSpecificGUIState() } detailSH->show(); + gamFrame->show(); highlights->hide(); h_tonalwidth->hide(); shadows->hide(); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 0cb5be6de..cd08eeedd 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -205,6 +205,8 @@ private: Adjuster* const detailSH; Adjuster* const fatamountSH; Adjuster* const fatanchorSH; + Adjuster* const gamSH; + Adjuster* const sloSH; // Vibrance Adjuster* const saturated; Adjuster* const pastels; @@ -455,6 +457,7 @@ private: Gtk::Frame* pdeFrame; Gtk::Frame* fatFrame; Gtk::Frame* fatSHFrame; + Gtk::Frame* gamFrame; Gtk::Frame* dehaFrame; Gtk::Frame* retiFrame; Gtk::Frame* retitoolFrame; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 52da49d30..c2ecbd773 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1080,6 +1080,8 @@ void ParamsEdited::initFrom(const std::vector& } locallab.spots.at(j).fatamountSH = locallab.spots.at(j).fatamountSH && pSpot.fatamountSH == otherSpot.fatamountSH; locallab.spots.at(j).fatanchorSH = locallab.spots.at(j).fatanchorSH && pSpot.fatanchorSH == otherSpot.fatanchorSH; + locallab.spots.at(j).gamSH = locallab.spots.at(j).gamSH && pSpot.gamSH == otherSpot.gamSH; + locallab.spots.at(j).sloSH = locallab.spots.at(j).sloSH && pSpot.sloSH == otherSpot.sloSH; // Vibrance locallab.spots.at(j).expvibrance = locallab.spots.at(j).expvibrance && pSpot.expvibrance == otherSpot.expvibrance; locallab.spots.at(j).saturated = locallab.spots.at(j).saturated && pSpot.saturated == otherSpot.saturated; @@ -3217,6 +3219,15 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).fatanchorSH = mods.locallab.spots.at(i).fatanchorSH; } + if (locallab.spots.at(i).gamSH) { + toEdit.locallab.spots.at(i).gamSH = mods.locallab.spots.at(i).gamSH; + } + + if (locallab.spots.at(i).sloSH) { + toEdit.locallab.spots.at(i).sloSH = mods.locallab.spots.at(i).sloSH; + } + + // Vibrance if (locallab.spots.at(i).expvibrance) { toEdit.locallab.spots.at(i).expvibrance = mods.locallab.spots.at(i).expvibrance; @@ -4964,6 +4975,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : LmaskSHcurve(v), fatamountSH(v), fatanchorSH(v), + gamSH(v), + sloSH(v), // Vibrance expvibrance(v), saturated(v), @@ -5268,6 +5281,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) LmaskSHcurve = v; fatamountSH = v; fatanchorSH = v; + gamSH = v; + sloSH = v; // Vibrance expvibrance = v; saturated = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index bd27f5262..da5fa427b 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -496,6 +496,8 @@ public: bool LmaskSHcurve; bool fatamountSH; bool fatanchorSH; + bool gamSH; + bool sloSH; // Vibrance bool expvibrance; bool saturated;