diff --git a/rtdata/languages/default b/rtdata/languages/default index 0571bd778..ebb825988 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2061,6 +2061,7 @@ TP_LOCALLAB_SHOWMODIFMASK;Show modifications whith mask TP_LOCALLAB_SHOWMASK;Show mask TP_LOCALLAB_SHOWSTRUC;Show structure TP_LOCALLAB_USEMASK;Use mask +TP_LOCALLAB_SHADHIGH;Shadows Highlights TP_LOCALLAB_SOFT;Soft Light TP_LOCALLAB_STRENG;Strength TP_LOCALLAB_STRENGTH;Noise diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index a58362596..266219882 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -3688,7 +3688,8 @@ void ImProcFunctions::rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer delete vCurve; } - shadowsHighlights(lab); + // shadowsHighlights(lab); + shadowsHighlights(lab, params->sh.enabled, params->sh.lab,params->sh.highlights ,params->sh.shadows, params->sh.radius, scale, params->sh.htonalwidth, params->sh.stonalwidth); if (params->localContrast.enabled) { // Alberto's local contrast diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 80cb41813..d21fbfada 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -393,7 +393,9 @@ public: void localContrast(LabImage *lab); void localContrastloc(LabImage *lab, int scale, int rad, float amo, float darkn, float lightn, float **loctemp); void colorToningLabGrid(LabImage *lab, int xstart, int xend, int ystart, int yend, bool MultiThread); - void shadowsHighlights(LabImage *lab); + // void shadowsHighlights(LabImage *lab); + void shadowsHighlights(LabImage *lab, bool ena, int labmode, int hightli, int shado, int rad, int scal, int hltonal, int shtonal); + void softLight(LabImage *lab); void softLightloc(LabImage *lab, LabImage *dst, float blend); void labColorCorrectionRegions(LabImage *lab); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 95e52c379..2e1d16090 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -139,7 +139,7 @@ struct local_params { float thr; float stru; int prox; - int chro, cont, sens, sensh, senscb, sensbn, senstm, sensex, sensexclu, sensden, senslc, senssf; + int chro, cont, sens, sensh, senscb, sensbn, senstm, sensex, sensexclu, sensden, senslc, senssf, senshs; float struco; float strengrid; float struexc; @@ -219,6 +219,11 @@ struct local_params { bool enaColorMask; bool enaExpMask; bool enaColMask; + int highlihs; + int shadowhs; + int radiushs; + int hltonalhs; + int shtonalhs; }; static void SobelCannyLuma(float **sobelL, float **luma, int bfw, int bfh, float radius) @@ -484,6 +489,13 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall double strength = (double) locallab.spots.at(sp).strength; float str = (float)locallab.spots.at(sp).str; + int local_sensihs = locallab.spots.at(sp).sensihs; + int highhs = locallab.spots.at(sp).highlights; + int hltonahs = locallab.spots.at(sp).h_tonalwidth; + int shadhs = locallab.spots.at(sp).shadows; + int shtonals = locallab.spots.at(sp).s_tonalwidth; + int radhs = locallab.spots.at(sp).sh_radius; + lp.cir = circr; lp.actsp = acti; lp.xc = w * local_center_x; @@ -596,6 +608,13 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.sensex = local_sensiex; // lp.strucc = local_struc; lp.war = local_warm; + + lp.highlihs = highhs; + lp.shadowhs = shadhs; + lp.radiushs = radhs; + lp.hltonalhs = hltonahs; + lp.shtonalhs = shtonals; + lp.senshs = local_sensihs; } diff --git a/rtengine/ipshadowshighlights.cc b/rtengine/ipshadowshighlights.cc index 450aac221..097039bbe 100644 --- a/rtengine/ipshadowshighlights.cc +++ b/rtengine/ipshadowshighlights.cc @@ -26,19 +26,19 @@ namespace rtengine { -void ImProcFunctions::shadowsHighlights(LabImage *lab) +void ImProcFunctions::shadowsHighlights(LabImage *lab, bool ena, int labmode, int hightli, int shado, int rad, int scal, int hltonal, int shtonal) { - if (!params->sh.enabled || (!params->sh.highlights && !params->sh.shadows)){ + if (!ena || (!hightli && !shado)){ return; } const int width = lab->W; const int height = lab->H; - const bool lab_mode = params->sh.lab; + const bool lab_mode = labmode; array2D mask(width, height); array2D L(width, height); - const float radius = float(params->sh.radius) * 10 / scale; + const float radius = float(rad) * 10 / scal; LUTf f(lab_mode ? 32768 : 65536); TMatrix ws = ICCStore::getInstance()->workingSpaceMatrix(params->icm.workingProfile); @@ -185,12 +185,12 @@ void ImProcFunctions::shadowsHighlights(LabImage *lab) } }; - if (params->sh.highlights > 0) { - apply(params->sh.highlights * 0.7, params->sh.htonalwidth, true); + if (hightli > 0) { + apply(hightli * 0.7, hltonal, true); } - if (params->sh.shadows > 0) { - apply(params->sh.shadows * 0.6, params->sh.stonalwidth, false); + if (shado > 0) { + apply(shado * 0.6, shtonal, false); } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index e60355fd7..3be067389 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -653,6 +653,13 @@ enum ProcEventCode { EvLocallabLabGridValue = 623, EvLocallabLabstrengthgrid = 624, EvLocallabgridMethod = 625, + EvLocenashadhigh = 626, + Evlocallabhighlights = 627, + Evlocallabh_tonalwidth = 628, + Evlocallabshadows = 629, + Evlocallabs_tonalwidth = 630, + Evlocallabsh_radius = 631, + Evlocallabsensihs = 632, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 90a81c20b..989688044 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2402,6 +2402,14 @@ LocallabParams::LocallabSpot::LocallabSpot() : LLmaskexpcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, HHmaskexpcurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, blendmaskexp(0), + // Shadow highlight + expshadhigh(false), + highlights(0), + h_tonalwidth(70), + shadows(0), + s_tonalwidth(30), + sh_radius(40), + sensihs(15), // Vibrance expvibrance(false), saturated(0), @@ -2416,8 +2424,6 @@ LocallabParams::LocallabSpot::LocallabSpot() : expsoft(false), streng(0), sensisf(15), - // Lab Region - explabregion(false), // Blur & Noise expblur(false), radius(1.0), @@ -2553,6 +2559,14 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && LLmaskexpcurve == other.LLmaskexpcurve && HHmaskexpcurve == other.HHmaskexpcurve && blendmaskexp == other.blendmaskexp + // Shadow highlight + && expshadhigh == other.expshadhigh + && highlights == other.highlights + && h_tonalwidth == other.h_tonalwidth + && shadows == other.shadows + && s_tonalwidth == other.s_tonalwidth + && sh_radius == other.sh_radius + && sensihs == other.sensihs // Vibrance && expvibrance == other.expvibrance && saturated == other.saturated @@ -2567,8 +2581,6 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && expsoft == other.expsoft && streng == other.streng && sensisf == other.sensisf - //Lab region - && explabregion == other.explabregion // Blur & Noise && expblur == other.expblur && radius == other.radius @@ -3659,6 +3671,14 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).LLmaskexpcurve, "Locallab", "LLmaskexpCurve_" + std::to_string(i), spot.LLmaskexpcurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).HHmaskexpcurve, "Locallab", "HHmaskexpCurve_" + std::to_string(i), spot.HHmaskexpcurve, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blendmaskexp, "Locallab", "Blendmaskexp_" + std::to_string(i), spot.blendmaskexp, 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); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).h_tonalwidth, "Locallab", "h_tonalwidth_" + std::to_string(i), spot.h_tonalwidth, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shadows, "Locallab", "shadows_" + std::to_string(i), spot.shadows, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).s_tonalwidth, "Locallab", "s_tonalwidth_" + std::to_string(i), spot.s_tonalwidth, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sh_radius, "Locallab", "sh_radius_" + std::to_string(i), spot.sh_radius, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensihs, "Locallab", "sensihs_" + std::to_string(i), spot.sensihs, 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); @@ -3673,8 +3693,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expsoft, "Locallab", "Expsoft_" + std::to_string(i), spot.expsoft, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).streng, "Locallab", "Streng_" + std::to_string(i), spot.streng, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensisf, "Locallab", "Sensisf_" + std::to_string(i), spot.sensisf, keyFile); - // Lab Region - saveToKeyfile(!pedited || pedited->locallab.spots.at(i).explabregion, "Locallab", "Explabregion_" + std::to_string(i), spot.explabregion, keyFile); // Blur & Noise saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expblur, "Locallab", "Expblur_" + std::to_string(i), spot.expblur, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).radius, "Locallab", "Radius_" + std::to_string(i), spot.radius, keyFile); @@ -4894,6 +4912,14 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "LLmaskexpCurve_" + std::to_string(i), pedited, spot.LLmaskexpcurve, spotEdited.LLmaskexpcurve); assignFromKeyfile(keyFile, "Locallab", "HHmaskexpCurve_" + std::to_string(i), pedited, spot.HHmaskexpcurve, spotEdited.HHmaskexpcurve); assignFromKeyfile(keyFile, "Locallab", "Blendmaskexp_" + std::to_string(i), pedited, spot.blendmaskexp, spotEdited.blendmaskexp); + // 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); + assignFromKeyfile(keyFile, "Locallab", "h_tonalwidth_" + std::to_string(i), pedited, spot.h_tonalwidth, spotEdited.h_tonalwidth); + assignFromKeyfile(keyFile, "Locallab", "shadows_" + std::to_string(i), pedited, spot.shadows, spotEdited.shadows); + assignFromKeyfile(keyFile, "Locallab", "s_tonalwidth_" + std::to_string(i), pedited, spot.s_tonalwidth, spotEdited.s_tonalwidth); + assignFromKeyfile(keyFile, "Locallab", "sh_radius_" + std::to_string(i), pedited, spot.sh_radius, spotEdited.sh_radius); + assignFromKeyfile(keyFile, "Locallab", "sensihs_" + std::to_string(i), pedited, spot.sensihs, spotEdited.sensihs); // 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); @@ -4920,8 +4946,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Expsoft_" + std::to_string(i), pedited, spot.expsoft, spotEdited.expsoft); assignFromKeyfile(keyFile, "Locallab", "Streng_" + std::to_string(i), pedited, spot.streng, spotEdited.streng); assignFromKeyfile(keyFile, "Locallab", "Sensisf_" + std::to_string(i), pedited, spot.sensisf, spotEdited.sensisf); - // Lab Region - assignFromKeyfile(keyFile, "Locallab", "Explabregion_" + std::to_string(i), pedited, spot.explabregion, spotEdited.explabregion); // Blur & Noise assignFromKeyfile(keyFile, "Locallab", "Expblur_" + std::to_string(i), pedited, spot.expblur, spotEdited.expblur); assignFromKeyfile(keyFile, "Locallab", "Radius_" + std::to_string(i), pedited, spot.radius, spotEdited.radius); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index d98e5ca55..4b24f4e37 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1003,6 +1003,14 @@ struct LocallabParams { std::vector LLmaskexpcurve; std::vector HHmaskexpcurve; int blendmaskexp; + // Shadow highlight + bool expshadhigh; + int highlights; + int h_tonalwidth; + int shadows; + int s_tonalwidth; + int sh_radius; + int sensihs; // Vibrance bool expvibrance; int saturated; @@ -1017,9 +1025,6 @@ struct LocallabParams { bool expsoft; int streng; int sensisf; - // Lab Region - bool explabregion; - // ColorToningParams::LabCorrectionRegion Labcorr; // Blur & Noise bool expblur; double radius; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 6fe659ba1..f592c0e13 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -652,7 +652,14 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabexpchroma LUMINANCECURVE, //EvLocallabLabGridValue LUMINANCECURVE, //EvLocallabLabstrengthgrid - LUMINANCECURVE //EvLocallabgridMethod + LUMINANCECURVE, //EvLocallabgridMethod + LUMINANCECURVE, //EvLocenashadhigh + LUMINANCECURVE, //EvLocallabhighlights + LUMINANCECURVE, //EvLocallabh_tonalwidth + LUMINANCECURVE, //EvLocallabshadows + LUMINANCECURVE, //EvLocallabs_tonalwidth + LUMINANCECURVE, //EvLocallabsh_radius + LUMINANCECURVE //EvLocallabsensihs }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 30d06ad2f..396bc5fc8 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -48,6 +48,7 @@ Locallab::Locallab(): expsettings(new ControlSpotPanel()), expcolor(new MyExpander(true, M("TP_LOCALLAB_COFR"))), expexpose(new MyExpander(true, M("TP_LOCALLAB_EXPOSE"))), + expshadhigh(new MyExpander(true, M("TP_LOCALLAB_SHADHIGH"))), expvibrance(new MyExpander(true, M("TP_LOCALLAB_VIBRANCE"))), expsoft(new MyExpander(true, M("TP_LOCALLAB_SOFT"))), expblur(new MyExpander(true, M("TP_LOCALLAB_BLUFR"))), @@ -58,6 +59,7 @@ Locallab::Locallab(): expcbdl(new MyExpander(true, M("TP_LOCALLAB_CBDL"))), expdenoi(new MyExpander(true, M("TP_LOCALLAB_DENOIS"))), + // CurveEditorGroup widgets // Color & Light llCurveEditorG(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_LUM"))), @@ -93,6 +95,13 @@ Locallab::Locallab(): structexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), blurexpde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), blendmaskexp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), + //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))), + shadows(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_SHADOWS"), 0, 100, 1, 0))), + s_tonalwidth(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_SHTONALW"), 10, 100, 1, 30))), + sh_radius(Gtk::manage(new Adjuster(M("TP_SHADOWSHLIGHTS_RADIUS"), 0, 100, 1, 40))), + sensihs(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), // 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.))), @@ -494,6 +503,32 @@ Locallab::Locallab(): panel->pack_start(*expexpose, false, false); + + +//shadow highlight + expshadhigh->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expshadhigh)); + enableshadhighConn = expshadhigh->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expshadhigh)); + + highlights->setAdjusterListener(this); + h_tonalwidth->setAdjusterListener(this); + shadows->setAdjusterListener(this); + s_tonalwidth->setAdjusterListener(this); + sh_radius->setAdjusterListener(this); + sensihs->setAdjusterListener(this); + + ToolParamBlock* const shadhighBox = Gtk::manage(new ToolParamBlock()); + shadhighBox->pack_start(*highlights); + shadhighBox->pack_start(*h_tonalwidth); + shadhighBox->pack_start(*shadows); + shadhighBox->pack_start(*s_tonalwidth); + shadhighBox->pack_start(*sh_radius); + shadhighBox->pack_start(*sensihs); + + expshadhigh->add(*shadhighBox); + expshadhigh->setLevel(2); + +// panel->pack_start(*expshadhigh, false, false); + // Vibrance expvibrance->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expvibrance)); enablevibranceConn = expvibrance->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expvibrance)); @@ -858,6 +893,7 @@ void Locallab::foldAllButMe(GdkEventButton* event, MyExpander *expander) expsettings->setExpanded(expsettings->getExpander() == expander); expcolor->set_expanded(expcolor == expander); expexpose->set_expanded(expexpose == expander); + expshadhigh->set_expanded(expshadhigh == expander); expvibrance->set_expanded(expvibrance == expander); expsoft->set_expanded(expsoft == expander); expblur->set_expanded(expblur == expander); @@ -884,6 +920,9 @@ void Locallab::enableToggled(MyExpander *expander) } else if (expander == expexpose) { event = EvLocenaexpose; expConn = &enableexposeConn; + } else if (expander == expshadhigh) { + event = EvLocenashadhigh; + expConn = &enableshadhighConn; } else if (expander == expvibrance) { event = EvLocenavibrance; expConn = &enablevibranceConn; @@ -940,6 +979,7 @@ void Locallab::writeOptions(std::vector &tpOpen) tpOpen.push_back(expsettings->getExpanded()); tpOpen.push_back(expcolor->get_expanded()); tpOpen.push_back(expexpose->get_expanded()); + tpOpen.push_back(expshadhigh->get_expanded()); tpOpen.push_back(expvibrance->get_expanded()); tpOpen.push_back(expsoft->get_expanded()); tpOpen.push_back(expblur->get_expanded()); @@ -1010,19 +1050,20 @@ void Locallab::updateLabel() void Locallab::updateToolState(std::vector &tpOpen) { - if (tpOpen.size() >= 13) { + if (tpOpen.size() >= 14) { expsettings->setExpanded(tpOpen.at(0)); expcolor->set_expanded(tpOpen.at(1)); expexpose->set_expanded(tpOpen.at(2)); - expvibrance->set_expanded(tpOpen.at(3)); - expsoft->set_expanded(tpOpen.at(4)); - expblur->set_expanded(tpOpen.at(5)); - exptonemap->set_expanded(tpOpen.at(6)); - expreti->set_expanded(tpOpen.at(7)); - expsharp->set_expanded(tpOpen.at(8)); - expcontrast->set_expanded(tpOpen.at(9)); - expcbdl->set_expanded(tpOpen.at(10)); - expdenoi->set_expanded(tpOpen.at(11)); + expshadhigh->set_expanded(tpOpen.at(3)); + expvibrance->set_expanded(tpOpen.at(4)); + expsoft->set_expanded(tpOpen.at(5)); + expblur->set_expanded(tpOpen.at(6)); + exptonemap->set_expanded(tpOpen.at(7)); + expreti->set_expanded(tpOpen.at(8)); + expsharp->set_expanded(tpOpen.at(9)); + expcontrast->set_expanded(tpOpen.at(10)); + expcbdl->set_expanded(tpOpen.at(11)); + expdenoi->set_expanded(tpOpen.at(12)); } } @@ -1563,6 +1604,15 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = CCmaskexpshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = HHmaskexpshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).blendmaskexp = blendmaskexp->getIntValue(); + // Shadow highlight + pp->locallab.spots.at(pp->locallab.selspot).expshadhigh = expshadhigh->getEnabled(); + pp->locallab.spots.at(pp->locallab.selspot).highlights = highlights->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).h_tonalwidth = h_tonalwidth->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).shadows = shadows->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = s_tonalwidth->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sh_radius = sh_radius->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).sensihs = sensihs->getIntValue(); + // Vibrance pp->locallab.spots.at(pp->locallab.selspot).expvibrance = expvibrance->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).saturated = saturated->getIntValue(); @@ -1727,6 +1777,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve || !HHmaskexpshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).blendmaskexp = pe->locallab.spots.at(pp->locallab.selspot).blendmaskexp || blendmaskexp->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(); + pe->locallab.spots.at(pp->locallab.selspot).h_tonalwidth = pe->locallab.spots.at(pp->locallab.selspot).h_tonalwidth || h_tonalwidth->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).shadows = pe->locallab.spots.at(pp->locallab.selspot).shadows || shadows->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = pe->locallab.spots.at(pp->locallab.selspot).s_tonalwidth || s_tonalwidth->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).sh_radius = pe->locallab.spots.at(pp->locallab.selspot).sh_radius || sh_radius->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).sensihs = pe->locallab.spots.at(pp->locallab.selspot).sensihs || sensihs->getEditedState(); // Vibrance pe->locallab.spots.at(pp->locallab.selspot).expvibrance = pe->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).saturated = pe->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); @@ -1877,6 +1935,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).HHmaskexpcurve || !HHmaskexpshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).blendmaskexp = pedited->locallab.spots.at(pp->locallab.selspot).blendmaskexp || blendmaskexp->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(); + pedited->locallab.spots.at(pp->locallab.selspot).h_tonalwidth = pedited->locallab.spots.at(pp->locallab.selspot).h_tonalwidth || h_tonalwidth->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).shadows = pedited->locallab.spots.at(pp->locallab.selspot).shadows || shadows->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).s_tonalwidth = pedited->locallab.spots.at(pp->locallab.selspot).s_tonalwidth || s_tonalwidth->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).sh_radius = pedited->locallab.spots.at(pp->locallab.selspot).sh_radius || sh_radius->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).sensihs = pedited->locallab.spots.at(pp->locallab.selspot).sensihs || sensihs->getEditedState(); // Vibrance pedited->locallab.spots.at(pp->locallab.selspot).expvibrance = pedited->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).saturated = pedited->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); @@ -2132,6 +2198,7 @@ void Locallab::curveChanged(CurveEditor* ce) } } + // Vibrance if (getEnabled() && expvibrance->getEnabled()) { if (ce == skinTonesCurve) { @@ -2552,6 +2619,8 @@ void Locallab::setParamEditable(bool cond) expcolor->set_sensitive(cond); // Exposure expexpose->set_sensitive(cond); + // Shadow highlight + expshadhigh->set_sensitive(cond); // Vibrance expvibrance->set_sensitive(cond); // Soft Light @@ -2633,6 +2702,13 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe structexp->setDefault((double)defSpot->structexp); blurexpde->setDefault((double)defSpot->blurexpde); blendmaskexp->setDefault((double)defSpot->blendmaskexp); + //Shadow highlight + highlights->setDefault((double)defSpot->highlights); + h_tonalwidth->setDefault((double)defSpot->h_tonalwidth); + shadows->setDefault((double)defSpot->shadows); + s_tonalwidth->setDefault((double)defSpot->s_tonalwidth); + sh_radius->setDefault((double)defSpot->sh_radius); + sensihs->setDefault((double)defSpot->sensihs); // Vibrance saturated->setDefault((double)defSpot->saturated); pastels->setDefault((double)defSpot->pastels); @@ -2718,6 +2794,13 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe structexp->setDefaultEditedState(Irrelevant); blurexpde->setDefaultEditedState(Irrelevant); blendmaskexp->setDefaultEditedState(Irrelevant); + //Shadow highlight + highlights->setDefaultEditedState(Irrelevant); + h_tonalwidth->setDefaultEditedState(Irrelevant); + shadows->setDefaultEditedState(Irrelevant); + s_tonalwidth->setDefaultEditedState(Irrelevant); + sh_radius->setDefaultEditedState(Irrelevant); + sensihs->setDefaultEditedState(Irrelevant); // Vibrance saturated->setDefaultEditedState(Irrelevant); pastels->setDefaultEditedState(Irrelevant); @@ -2807,6 +2890,13 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe structexp->setDefaultEditedState(defSpotState->structexp ? Edited : UnEdited); blurexpde->setDefaultEditedState(defSpotState->blurexpde ? Edited : UnEdited); blendmaskexp->setDefaultEditedState(defSpotState->blendmaskexp ? Edited : UnEdited); + //Shadow highlight + highlights->setDefaultEditedState(defSpotState->highlights ? Edited : UnEdited); + h_tonalwidth->setDefaultEditedState(defSpotState->h_tonalwidth ? Edited : UnEdited); + shadows->setDefaultEditedState(defSpotState->shadows ? Edited : UnEdited); + s_tonalwidth->setDefaultEditedState(defSpotState->s_tonalwidth ? Edited : UnEdited); + sh_radius->setDefaultEditedState(defSpotState->sh_radius ? Edited : UnEdited); + sensihs->setDefaultEditedState(defSpotState->sensihs ? Edited : UnEdited); // Vibrance saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited); pastels->setDefaultEditedState(defSpotState->pastels ? Edited : UnEdited); @@ -3040,6 +3130,45 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } + if (getEnabled() && expshadhigh->getEnabled()) { + + if (a == highlights) { + if (listener) { + listener->panelChanged(Evlocallabhighlights, highlights->getTextValue()); + } + } + + if (a == h_tonalwidth) { + if (listener) { + listener->panelChanged(Evlocallabh_tonalwidth, h_tonalwidth->getTextValue()); + } + } + + if (a == shadows) { + if (listener) { + listener->panelChanged(Evlocallabshadows, shadows->getTextValue()); + } + } + + if (a == s_tonalwidth) { + if (listener) { + listener->panelChanged(Evlocallabs_tonalwidth, s_tonalwidth->getTextValue()); + } + } + + if (a == sh_radius) { + if (listener) { + listener->panelChanged(Evlocallabsh_radius, sh_radius->getTextValue()); + } + } + + if (a == sensihs) { + if (listener) { + listener->panelChanged(Evlocallabsensihs, sensihs->getTextValue()); + } + } + + } // Vibrance if (a == pastels && pastSatTog->get_active() && !(multiImage && pastSatTog->get_inconsistent())) { saturated->setValue(newval); @@ -3428,6 +3557,13 @@ void Locallab::setBatchMode(bool batchMode) structexp->showEditedCB(); blurexpde->showEditedCB(); blendmaskexp->showEditedCB(); + //Shadow Highlight + highlights->showEditedCB(); + h_tonalwidth->showEditedCB(); + shadows->showEditedCB(); + s_tonalwidth->showEditedCB(); + sh_radius->showEditedCB(); + sensihs->showEditedCB(); // Vibrance saturated->showEditedCB(); pastels->showEditedCB(); @@ -3646,6 +3782,8 @@ void Locallab::enableListener() inversexConn.block(false); showmaskexpMethodConn.block(false); enaExpMaskConn.block(false); + // Shadow highlight + enableshadhighConn.block(false); // Vibrance enablevibranceConn.block(false); pskinsconn.block(false); @@ -3693,6 +3831,8 @@ void Locallab::disableListener() inversexConn.block(true); showmaskexpMethodConn.block(true); enaExpMaskConn.block(true); + // Shadow highlight + enableshadhighConn.block(true); // Vibrance enablevibranceConn.block(true); pskinsconn.block(true); @@ -3700,7 +3840,6 @@ void Locallab::disableListener() pastsattogconn.block(true); // Soft Light enablesoftConn.block(true); - // Lab Region // Blur & Noise enableblurConn.block(true); blurMethodConn.block(true); @@ -3783,7 +3922,14 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con LLmaskexpshape->setCurve(pp->locallab.spots.at(index).LLmaskexpcurve); HHmaskexpshape->setCurve(pp->locallab.spots.at(index).HHmaskexpcurve); blendmaskexp->setValue(pp->locallab.spots.at(index).blendmaskexp); - + // Shadow highlight + expshadhigh->setEnabled(pp->locallab.spots.at(index).expshadhigh); + highlights->setValue(pp->locallab.spots.at(index).highlights); + h_tonalwidth->setValue(pp->locallab.spots.at(index).h_tonalwidth); + shadows->setValue(pp->locallab.spots.at(index).shadows); + s_tonalwidth->setValue(pp->locallab.spots.at(index).s_tonalwidth); + sh_radius->setValue(pp->locallab.spots.at(index).sh_radius); + sensihs->setValue(pp->locallab.spots.at(index).sensihs); // Vibrance expvibrance->setEnabled(pp->locallab.spots.at(index).expvibrance); saturated->setValue(pp->locallab.spots.at(index).saturated); @@ -3978,6 +4124,15 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con HHmaskexpshape->setUnChanged(!spotState->HHmaskexpcurve); blendmaskexp->setEditedState(spotState->blendmaskexp ? Edited : UnEdited); + // Shadow highlight + expshadhigh->set_inconsistent(!spotState->expshadhigh); + highlights->setEditedState(spotState->highlights ? Edited : UnEdited); + h_tonalwidth->setEditedState(spotState->h_tonalwidth ? Edited : UnEdited); + shadows->setEditedState(spotState->shadows ? Edited : UnEdited); + s_tonalwidth->setEditedState(spotState->s_tonalwidth ? Edited : UnEdited); + sh_radius->setEditedState(spotState->sh_radius ? Edited : UnEdited); + sensihs->setEditedState(spotState->sensihs ? Edited : UnEdited); + // Vibrance expvibrance->set_inconsistent(!spotState->expvibrance); saturated->setEditedState(spotState->saturated ? Edited : UnEdited); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 3bb17c928..fe94bc274 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -50,6 +50,7 @@ private: ControlSpotPanel* const expsettings; MyExpander* const expcolor; MyExpander* const expexpose; + MyExpander* const expshadhigh; MyExpander* const expvibrance; MyExpander* const expsoft; MyExpander* const expblur; @@ -59,7 +60,7 @@ private: MyExpander* const expcontrast; MyExpander* const expcbdl; MyExpander* const expdenoi; - sigc::connection enablecolorConn, enableexposeConn, enablevibranceConn, enablesoftConn, enableblurConn, enabletonemapConn, enableretiConn, enablesharpConn, enablecontrastConn, enablecbdlConn, enabledenoiConn; + sigc::connection enablecolorConn, enableexposeConn, enableshadhighConn, enablevibranceConn, enablesoftConn, enableblurConn, enabletonemapConn, enableretiConn, enablesharpConn, enablecontrastConn, enablecbdlConn, enabledenoiConn; // Curve widgets // Color & Light @@ -109,6 +110,13 @@ private: Adjuster* const structexp; Adjuster* const blurexpde; Adjuster* const blendmaskexp; + //Shadow highlight + Adjuster* const highlights; + Adjuster* const h_tonalwidth; + Adjuster* const shadows; + Adjuster* const s_tonalwidth; + Adjuster* const sh_radius; + Adjuster* const sensihs; // Vibrance Adjuster* const saturated; Adjuster* const pastels; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 30df5caf4..f5a2b18a2 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -986,6 +986,14 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).LLmaskexpcurve = locallab.spots.at(j).LLmaskexpcurve && pSpot.LLmaskexpcurve == otherSpot.LLmaskexpcurve; locallab.spots.at(j).HHmaskexpcurve = locallab.spots.at(j).HHmaskexpcurve && pSpot.HHmaskexpcurve == otherSpot.HHmaskexpcurve; locallab.spots.at(j).blendmaskexp = locallab.spots.at(j).blendmaskexp && pSpot.blendmaskexp == otherSpot.blendmaskexp; + // 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; + locallab.spots.at(j).h_tonalwidth = locallab.spots.at(j).h_tonalwidth && pSpot.h_tonalwidth == otherSpot.h_tonalwidth; + locallab.spots.at(j).shadows = locallab.spots.at(j).shadows&& pSpot.shadows == otherSpot.shadows; + locallab.spots.at(j).s_tonalwidth = locallab.spots.at(j).s_tonalwidth && pSpot.s_tonalwidth == otherSpot.s_tonalwidth; + locallab.spots.at(j).sh_radius = locallab.spots.at(j).sh_radius && pSpot.sh_radius == otherSpot.sh_radius; + locallab.spots.at(j).sensihs = locallab.spots.at(j).sensihs && pSpot.sensihs == otherSpot.sensihs; // 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; @@ -1000,8 +1008,6 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).expsoft = locallab.spots.at(j).expsoft && pSpot.expsoft == otherSpot.expsoft; locallab.spots.at(j).streng = locallab.spots.at(j).streng && pSpot.streng == otherSpot.streng; locallab.spots.at(j).sensisf = locallab.spots.at(j).sensisf && pSpot.sensisf == otherSpot.sensisf; - // Lab Region - locallab.spots.at(j).explabregion = locallab.spots.at(j).explabregion && pSpot.explabregion == otherSpot.explabregion; // Blur & Noise locallab.spots.at(j).expblur = locallab.spots.at(j).expblur && pSpot.expblur == otherSpot.expblur; locallab.spots.at(j).radius = locallab.spots.at(j).radius && pSpot.radius == otherSpot.radius; @@ -2735,6 +2741,36 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).blendmaskexp = mods.locallab.spots.at(i).blendmaskexp; } + + // Shadow highlight + if (locallab.spots.at(i).expshadhigh) { + toEdit.locallab.spots.at(i).expshadhigh = mods.locallab.spots.at(i).expshadhigh; + } + + if (locallab.spots.at(i).highlights) { + toEdit.locallab.spots.at(i).highlights = mods.locallab.spots.at(i).highlights; + } + + if (locallab.spots.at(i).h_tonalwidth) { + toEdit.locallab.spots.at(i).h_tonalwidth = mods.locallab.spots.at(i).h_tonalwidth; + } + + if (locallab.spots.at(i).shadows) { + toEdit.locallab.spots.at(i).shadows = mods.locallab.spots.at(i).shadows; + } + + if (locallab.spots.at(i).s_tonalwidth) { + toEdit.locallab.spots.at(i).s_tonalwidth = mods.locallab.spots.at(i).s_tonalwidth; + } + + if (locallab.spots.at(i).sh_radius) { + toEdit.locallab.spots.at(i).sh_radius = mods.locallab.spots.at(i).sh_radius; + } + + if (locallab.spots.at(i).sensihs) { + toEdit.locallab.spots.at(i).sensihs = mods.locallab.spots.at(i).sensihs; + } + // Vibrance if (locallab.spots.at(i).expvibrance) { toEdit.locallab.spots.at(i).expvibrance = mods.locallab.spots.at(i).expvibrance; @@ -2785,11 +2821,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).sensisf = mods.locallab.spots.at(i).sensisf; } - // Lab Region - if (locallab.spots.at(i).explabregion) { - toEdit.locallab.spots.at(i).explabregion = mods.locallab.spots.at(i).explabregion; - } - // Blur & Noise if (locallab.spots.at(i).expblur) { toEdit.locallab.spots.at(i).expblur = mods.locallab.spots.at(i).expblur; @@ -4021,6 +4052,14 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : LLmaskexpcurve(v), HHmaskexpcurve(v), blendmaskexp(v), + // Shadow highlight + expshadhigh(v), + highlights(v), + h_tonalwidth(v), + shadows(v), + s_tonalwidth(v), + sh_radius(v), + sensihs(v), // Vibrance expvibrance(v), saturated(v), @@ -4035,8 +4074,6 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : expsoft(v), streng(v), sensisf(v), - // Lab Region - explabregion(v), // Blur & Noise expblur(v), radius(v), @@ -4169,6 +4206,14 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) LLmaskexpcurve = v; HHmaskexpcurve = v; blendmaskexp = v; + // Shadow highlight + expshadhigh = v; + highlights = v; + h_tonalwidth = v; + shadows = v; + s_tonalwidth = v; + sh_radius = v; + sensihs = v; // Vibrance expvibrance = v; saturated = v; @@ -4183,8 +4228,6 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) expsoft = v; streng = v; sensisf = v; - // Lab Region - explabregion = v; // Blur & Noise expblur = v; radius = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 56674e357..66a8d92c1 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -526,6 +526,14 @@ public: bool LLmaskexpcurve; bool HHmaskexpcurve; bool blendmaskexp; + // Shadow highlight + bool expshadhigh; + bool highlights; + bool h_tonalwidth; + bool shadows; + bool s_tonalwidth; + bool sh_radius; + bool sensihs; // Vibrance bool expvibrance; bool saturated; @@ -540,8 +548,6 @@ public: bool expsoft; bool streng; bool sensisf; - // Lab Region - bool explabregion; // Blur & Noise bool expblur; bool radius;