diff --git a/rtdata/languages/default b/rtdata/languages/default index d110293ce..abec6b8fd 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1071,6 +1071,10 @@ HISTORY_MSG_831;Local - Color gradient angle HISTORY_MSG_832;Local - Color gradient strength C HISTORY_MSG_833;Local - Gradient feather HISTORY_MSG_834;Local - Color gradient strength H +HISTORY_MSG_835;Local - Vib gradient strength L +HISTORY_MSG_836;Local - Vib gradient angle +HISTORY_MSG_837;Local - Vib gradient strength C +HISTORY_MSG_838;Local - Vib gradient strength H HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2301,7 +2305,7 @@ TP_LOCALLAB_EXECLU;Excluding spot TP_LOCALLAB_EXPOSE;Exposure TP_LOCALLAB_GRADFRA;Graduated Filter TP_LOCALLAB_FEATH_TOOLTIP;Gradient width in percent of the Spot diagonal\n.. -TP_LOCALLAB_GRADGEN_TOOLTIP;Graduated filter is supplied with Color and Light, Exposure & mask, Shadows Highlight.\n\nColor and Light & merge file are provided with GF luminance, chrominance, Hue.\nFeather is located in settings. +TP_LOCALLAB_GRADGEN_TOOLTIP;Graduated filter is supplied with Color and Light, Exposure & mask, Shadows Highlight, Vibrance.\n\nColor and Light & merge file are provided with GF luminance, chrominance, Hue.\nFeather is located in settings. TP_LOCALLAB_GRADSTR_TOOLTIP;Filter strength in stops TP_LOCALLAB_GRADANG_TOOLTIP;Rotation angle in degrees : -180 0 +180 TP_LOCALLAB_GRADSTRAB_TOOLTIP;Filter chroma strength @@ -2347,6 +2351,7 @@ TP_LOCALLAB_GRADSTR;Gradient strength TP_LOCALLAB_GRADSTRLUM;Gradient strength Luminance TP_LOCALLAB_GRADSTRCHRO;Gradient strength Chrominance TP_LOCALLAB_GRADSTRHUE;Gradient strength Hue (merge file) +TP_LOCALLAB_GRADSTRHUE2;Gradient strength Hue TP_LOCALLAB_GAMFRA;Tone response curve (TRC) TP_LOCALLAB_GAMSH;Gamma TP_LOCALLAB_SLOSH;Slope diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index bb5f4446c..4d2bc3390 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -217,6 +217,10 @@ struct local_params { float strcolab; float strcolh; float angcol; + float strvib; + float strvibab; + float strvibh; + float angvib; float softradiusexp; float softradiuscol; float softradiuscb; @@ -747,6 +751,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float strcolab = ((float) locallab.spots.at(sp).strcolab); float strcolh = ((float) locallab.spots.at(sp).strcolh); float angcol = ((float) locallab.spots.at(sp).angcol); + float strvib = ((float) locallab.spots.at(sp).strvib); + float strvibab = ((float) locallab.spots.at(sp).strvibab); + float strvibh = ((float) locallab.spots.at(sp).strvibh); + float angvib = ((float) locallab.spots.at(sp).angvib); float softradiusexpo = ((float) locallab.spots.at(sp).softradiusexp); float softradiuscolor = ((float) locallab.spots.at(sp).softradiuscol); float softradiusreti = ((float) locallab.spots.at(sp).softradiusret); @@ -861,6 +869,10 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.strcolab = strcolab; lp.strcolh = strcolh; lp.angcol = angcol; + lp.strvib = strvib; + lp.strvibab = strvibab; + lp.strvibh = strvibh; + lp.angvib = angvib; lp.softradiusexp = softradiusexpo; lp.softradiuscol = softradiuscolor; lp.softradiusret = softradiusreti; @@ -2613,20 +2625,49 @@ void calclocalGradientParams(const struct local_params& lp, struct grad_params& stops = lp.strcol; angs = lp.angcol; } else if (indic == 4) { - stops = lp.strcolab; + float redu = 1.f; + + if (lp.strcolab > 0.f) { + redu = 0.6f; + } else { + redu = 0.15f; + } + + stops = redu * lp.strcolab; angs = lp.angcol; } else if (indic == 5) { + stops = lp.strcolab; + angs = lp.angcol; + } else if (indic == 6) { stops = lp.strcolh; angs = lp.angcol; + } else if (indic == 7) { + stops = lp.strvib; + angs = lp.angvib; + } else if (indic == 8) { + float redu = 1.f; + + if (lp.strvibab > 0.f) { + redu = 1.f; + } else { + redu = 1.f; + } + + stops = redu * lp.strvibab; + angs = lp.angvib; + } else if (indic == 9) { + stops = lp.strvibh; + angs = lp.angvib; } + double gradient_stops = stops; double gradient_center_x = LIM01((lp.xc - xstart) / bfw); double gradient_center_y = LIM01((lp.yc - ystart) / bfh); double gradient_angle = angs / 180.0 * rtengine::RT_PI; double varfeath = 0.01 * lp.feath; -// printf("xstart=%f ysta=%f lpxc=%f lpyc=%f stop=%f bb=%f cc=%f ang=%f ff=%d gg=%d\n", xstart, ystart, lp.xc, lp.yc, gradient_stops, gradient_center_x, gradient_center_y, gradient_angle, w, h); + printf("xstart=%f ysta=%f lpxc=%f lpyc=%f stop=%f bb=%f cc=%f ang=%f ff=%d gg=%d\n", xstart, ystart, lp.xc, lp.yc, gradient_stops, gradient_center_x, gradient_center_y, gradient_angle, w, h); // make 0.0 <= gradient_angle < 2 * rtengine::RT_PI gradient_angle = fmod(gradient_angle, 2 * rtengine::RT_PI); @@ -4610,7 +4651,7 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo const float clc = (previewcol || previewexp || previewSH || previewvib || previewcb) ? settings->previewselection * 100.f : bufchro[y - ystart][x - xstart]; - if (senstype <= 1 || senstype == 100) { + if (senstype <= 1 || senstype == 100 || senstype == 2) {// cla = buf_a_cat[y - ystart][x - xstart]; clb = buf_b_cat[y - ystart][x - xstart]; } @@ -4720,6 +4761,11 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo if (senstype == 2 || senstype == 3 || senstype == 30 || senstype == 8 || senstype == 9 || senstype == 6 || senstype == 10) { flia = flib = ((100.f + realstrchdE) / 100.f); + + if (senstype == 2) { + flia = flib = (100.f + realstrchdE + realstradE) / 100.f; + } + } else if (senstype == 1) { flia = (100.f + realstradE + 100.f * realstrchdE) / 100.f; flib = (100.f + realstrbdE + 100.f * realstrchdE) / 100.f; @@ -4875,6 +4921,10 @@ void ImProcFunctions::transit_shapedetect(int senstype, const LabImage * bufexpo if (senstype == 2 || senstype == 3 || senstype == 30 || senstype == 8 || senstype == 9 || senstype == 6 || senstype == 10) { flia = flib = (100.f + realstrchdE) / 100.f; + + if (senstype == 2) { + flia = flib = (100.f + realstrchdE + realstradE) / 100.f; + } } else if (senstype == 1) { flia = (100.f + realstradE + 100.f * realstrchdE) / 100.f; flib = (100.f + realstrbdE + 100.f * realstrchdE) / 100.f; @@ -8959,7 +9009,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o //vibrance - if (lp.expvib && (lp.past != 0.f || lp.satur != 0.f || lp.showmaskvibmet == 2 || lp.enavibMask || lp.showmaskvibmet == 3 || lp.showmaskvibmet == 4) && lp.vibena) { //interior ellipse renforced lightness and chroma //locallutili + if (lp.expvib && (lp.past != 0.f || lp.satur != 0.f || lp.strvib != 0.f || lp.showmaskvibmet == 2 || lp.enavibMask || lp.showmaskvibmet == 3 || lp.showmaskvibmet == 4) && lp.vibena) { //interior ellipse renforced lightness and chroma //locallutili if (call <= 3) { //simpleprocess, dcrop, improccoordinator 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); @@ -8971,6 +9021,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (bfw >= mSP && bfh >= mSP) { JaggedArray buflight(bfw, bfh); JaggedArray bufl_ab(bfw, bfh); + JaggedArray buf_a(bfw, bfh); + JaggedArray buf_b(bfw, bfh); std::unique_ptr bufexporig(new LabImage(bfw, bfh)); std::unique_ptr bufexpfin(new LabImage(bfw, bfh)); std::unique_ptr bufmaskorigvib; @@ -9080,8 +9132,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o VibranceParams vibranceParams; vibranceParams.enabled = params->locallab.spots.at(sp).expvibrance; - vibranceParams.pastels = params->locallab.spots.at(sp).pastels; - vibranceParams.saturated = params->locallab.spots.at(sp).saturated; + vibranceParams.pastels = 2.f * params->locallab.spots.at(sp).pastels; + vibranceParams.saturated = 2.f * params->locallab.spots.at(sp).saturated; vibranceParams.psthreshold = params->locallab.spots.at(sp).psthreshold; vibranceParams.protectskins = params->locallab.spots.at(sp).protectskins; vibranceParams.avoidcolorshift = params->locallab.spots.at(sp).avoidcolorshift; @@ -9090,7 +9142,114 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufexpfin->CopyFrom(bufexporig.get()); + + lp.strvibh = 0.f; + if (lp.strvibh != 0.f) { + struct grad_params gph; + calclocalGradientParams(lp, gph, ystart, xstart, bfw, bfh, 9); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + double factor = 1.0; + factor = ImProcFunctions::calcGradientFactor(gph, jr, ir); + float aa = bufexpfin->a[ir][jr]; + float bb = bufexpfin->b[ir][jr]; + float chrm = sqrt(SQR(aa) + SQR(bb)); + float HH = xatan2f(bb, aa); + + float newhr = 0.f; + float cor = 0.f; + + if (factor < 1.f) { + cor = - 2.5f * (1.f - factor); + } else if (factor > 1.f) { + cor = 0.03f * (factor - 1.f); + } + + newhr = HH + cor; + + if (newhr > rtengine::RT_PI_F) { + newhr -= 2 * rtengine::RT_PI_F; + } else if (newhr < -rtengine::RT_PI_F) { + newhr += 2 * rtengine::RT_PI_F; + } + + float2 sincosval = xsincosf(newhr); + bufexpfin->a[ir][jr] = CLIPC(chrm * sincosval.y); + bufexpfin->b[ir][jr] = CLIPC(chrm * sincosval.x); + } + } + + if (lp.strvib != 0.f) { + struct grad_params gp; + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 7); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + double factor = 1.0; + factor = ImProcFunctions::calcGradientFactor(gp, jr, ir); + bufexpfin->L[ir][jr] *= factor; + } + } + lp.strvibab = 0.f; + if (lp.strvibab != 0.f) { + struct grad_params gpab; + calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 8); +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + double factor = 1.0; + factor = ImProcFunctions::calcGradientFactor(gpab, jr, ir); + bufexpfin->a[ir][jr] *= factor; + bufexpfin->b[ir][jr] *= factor; + } + } + + // bool toto = true; ImProcFunctions::vibrance(bufexpfin.get(), vibranceParams, params->toneCurve.hrenabled, params->icm.workingProfile); +/* + if (toto) { +#ifdef _OPENMP + #pragma omp parallel for schedule(dynamic,16) +#endif + + for (int y = 0; y < bfh; y++) { + const int loy = y + ystart + cy; + + for (int x = 0; x < bfw; x++) { + const int lox = x + xstart + cx; + int zone = 0; + float localFactor = 1.f; + const float achm = (float)lp.trans / 100.f; + + if (lp.shapmet == 0) { + calcTransition(lox, loy, achm, lp, zone, localFactor); + } else if (lp.shapmet == 1) { + calcTransitionrect(lox, loy, achm, lp, zone, localFactor); + } + + if (zone > 0) { + transformed->L[y + ystart][x + xstart] = bufexpfin->L[y][x]; + transformed->a[y + ystart][x + xstart] = bufexpfin->a[y][x]; + transformed->b[y + ystart][x + xstart] = bufexpfin->b[y][x]; + } + } + } + + return; + } +*/ + + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -9100,13 +9259,16 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int x = 0; x < bfw; x++) { buflight[y][x] = CLIPRET((bufexpfin->L[y][x] - bufexporig->L[y][x]) / 328.f); bufl_ab[y][x] = CLIPRET((sqrt(SQR(bufexpfin->a[y][x]) + SQR(bufexpfin->b[y][x])) - sqrt(SQR(bufexporig->a[y][x]) + SQR(bufexporig->b[y][x]))) / 250.f); + buf_a[y][x] = CLIPRET((bufexpfin->a[y][x] - bufexporig->a[y][x]) / 328.f); + buf_b[y][x] = CLIPRET((bufexpfin->b[y][x] - bufexporig->b[y][x]) / 328.f); + } } bufexpfin.reset(); } - transit_shapedetect(2, bufexporig.get(), nullptr, originalmaskvib.get(), buflight, bufl_ab, nullptr, nullptr, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); + transit_shapedetect(2, bufexporig.get(), nullptr, originalmaskvib.get(), buflight, bufl_ab, buf_a, buf_b, nullptr, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk); if (params->locallab.spots.at(sp).recurs) { original->CopyFrom(transformed); @@ -12778,7 +12940,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.strcolh != 0.f) { struct grad_params gph; - calclocalGradientParams(lp, gph, ystart, xstart, bfw, bfh, 5); + calclocalGradientParams(lp, gph, ystart, xstart, bfw, bfh, 6); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -13460,7 +13622,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (lp.strcolab != 0.f) { struct grad_params gpab; - calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 4); + calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 5); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif diff --git a/rtengine/ipvibrance.cc b/rtengine/ipvibrance.cc index a56a2c82a..e081a696b 100644 --- a/rtengine/ipvibrance.cc +++ b/rtengine/ipvibrance.cc @@ -144,6 +144,7 @@ void ImProcFunctions::vibrance (LabImage* lab, const procparams::VibranceParams if (skinCurveIsSet) { fillCurveArrayVib (dcurve, skin_curve); skin_curve /= ask; +// skin_curve *= 2.f; } if (dcurve) { diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 25236d210..7e68ebcab 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -858,6 +858,10 @@ enum ProcEventCode { Evlocallabstrcolab = 831, EvLocallabSpotfeather = 832, Evlocallabstrcolh = 833, + Evlocallabstrvib = 834, + Evlocallabangvib = 835, + Evlocallabstrvibab = 836, + Evlocallabstrvibh = 837, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 74b40fcb5..221c2fefa 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2432,7 +2432,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : circrad(18), qualityMethod("enh"), transit(60.), - feather(30.), + feather(25.), thresh(2.0), iter(2.0), balan(1.0), @@ -2595,6 +2595,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : gammaskvib(1.0), slomaskvib(0.0), lapmaskvib(0.0), + strvib(0.0), + strvibab(0.0), + strvibh(0.0), + angvib(0.0), Lmaskvibcurve{(double)DCT_NURBS, 0.0, 0.0, 1.0, 1.0}, // Soft Light expsoft(false), @@ -2954,6 +2958,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && gammaskvib == other.gammaskvib && slomaskvib == other.slomaskvib && lapmaskvib == other.lapmaskvib + && strvib == other.strvib + && strvibab == other.strvibab + && strvibh == other.strvibh + && angvib == other.angvib && Lmaskvibcurve == other.Lmaskvibcurve // Soft Light && expsoft == other.expsoft @@ -4292,6 +4300,10 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).gammaskvib, "Locallab", "Gammaskvib_" + std::to_string(i), spot.gammaskvib, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).slomaskvib, "Locallab", "Slomaskvib_" + std::to_string(i), spot.slomaskvib, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).lapmaskvib, "Locallab", "Lapmaskvib_" + std::to_string(i), spot.lapmaskvib, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strvib, "Locallab", "Strvib_" + std::to_string(i), spot.strvib, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strvibab, "Locallab", "Strvibab_" + std::to_string(i), spot.strvibab, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strvibh, "Locallab", "Strvibh_" + std::to_string(i), spot.strvibh, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).angvib, "Locallab", "Angvib_" + std::to_string(i), spot.angvib, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).Lmaskvibcurve, "Locallab", "LmaskvibCurve_" + std::to_string(i), spot.Lmaskvibcurve, keyFile); // Soft Light saveToKeyfile(!pedited || pedited->locallab.spots.at(i).expsoft, "Locallab", "Expsoft_" + std::to_string(i), spot.expsoft, keyFile); @@ -5768,6 +5780,10 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Gammaskvib_" + std::to_string(i), pedited, spot.gammaskvib, spotEdited.gammaskvib); assignFromKeyfile(keyFile, "Locallab", "Slomaskvib_" + std::to_string(i), pedited, spot.slomaskvib, spotEdited.slomaskvib); assignFromKeyfile(keyFile, "Locallab", "Lapmaskvib_" + std::to_string(i), pedited, spot.lapmaskvib, spotEdited.lapmaskvib); + assignFromKeyfile(keyFile, "Locallab", "Strvib_" + std::to_string(i), pedited, spot.strvib, spotEdited.strvib); + assignFromKeyfile(keyFile, "Locallab", "Strvibab_" + std::to_string(i), pedited, spot.strvibab, spotEdited.strvibab); + assignFromKeyfile(keyFile, "Locallab", "Strvibh_" + std::to_string(i), pedited, spot.strvibh, spotEdited.strvibh); + assignFromKeyfile(keyFile, "Locallab", "Angvib_" + std::to_string(i), pedited, spot.angvib, spotEdited.angvib); assignFromKeyfile(keyFile, "Locallab", "LmaskvibCurve_" + std::to_string(i), pedited, spot.Lmaskvibcurve, spotEdited.Lmaskvibcurve); // Soft Light assignFromKeyfile(keyFile, "Locallab", "Expsoft_" + std::to_string(i), pedited, spot.expsoft, spotEdited.expsoft); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 2eef8238c..a2469c0c9 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1138,6 +1138,10 @@ struct LocallabParams { double gammaskvib; double slomaskvib; double lapmaskvib; + double strvib; + double strvibab; + double strvibh; + double angvib; std::vector Lmaskvibcurve; // Soft Light bool expsoft; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index ab8229422..591848653 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -861,7 +861,11 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabangcol LUMINANCECURVE, // Evlocallabstrcolab LUMINANCECURVE, // EvLocallabSpotfeather - LUMINANCECURVE // Evlocallabstrcolh + LUMINANCECURVE, // Evlocallabstrcolh + LUMINANCECURVE, //Evlocallabstrvib + LUMINANCECURVE, //Evlocallabangvib + LUMINANCECURVE, //Evlocallabstrvibab + LUMINANCECURVE //Evlocallabstrvibh }; diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 05d94aafc..0ac938b3f 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -65,7 +65,7 @@ ControlSpotPanel::ControlSpotPanel(): centerY_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CENTER_Y"), -1000, 1000, 1, 0))), circrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CIRCRADIUS"), 2, 150, 1, 18))), transit_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TRANSITVALUE"), 5., 100., 0.1, 60.))), - feather_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FEATVALUE"), 10., 100., 0.1, 30.))), + feather_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_FEATVALUE"), 10., 100., 0.1, 25.))), thresh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRESDELTAE"), 0.0, 10.0, 0.1, 2.0))), iter_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_PROXI"), 0.2, 10.0, 0.1, 2.0))), balan_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BALAN"), 0.2, 2.5, 0.1, 1.0, Gtk::manage(new RTImage("rawtherapee-logo-16.png")), Gtk::manage(new RTImage("circle-white-small.png"))))), diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 88680f331..2f81853e6 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -367,6 +367,10 @@ chromaskvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0 gammaskvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.25, 4.0, 0.01, 1.))), slomaskvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), lapmaskvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))), +strvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTR"), -4., 4., 0.05, 0.))), +strvibab(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTRCHRO"), -6., 6., 0.05, 0.))), +strvibh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTRHUE2"), -6., 6., 0.05, 0.))), +angvib(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -180, 180, 0.1, 0.))), //Soft Light streng(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENG"), 1, 100, 1, 1))), laplace(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPLACE"), 0., 100., 0.5, 25.))), @@ -601,6 +605,7 @@ gradcolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), gradFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), gradFramemask(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), gradSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), +gradvibFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), 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")))), @@ -1596,6 +1601,10 @@ pe(nullptr) gammaskvib->setAdjusterListener(this); slomaskvib->setAdjusterListener(this); lapmaskvib->setAdjusterListener(this); + strvib->setAdjusterListener(this); + angvib->setAdjusterListener(this); + strvibab->setAdjusterListener(this); + strvibh->setAdjusterListener(this); curveEditorGG->setCurveListener(this); @@ -1626,6 +1635,14 @@ pe(nullptr) curveEditorGG->curveListComplete(); + gradvibFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const gradvibBox = Gtk::manage(new ToolParamBlock()); + gradvibBox->pack_start(*strvib); +// gradvibBox->pack_start(*strvibab); +// gradvibBox->pack_start(*strvibh); + gradvibBox->pack_start(*angvib); + gradvibFrame->add(*gradvibBox); + ToolParamBlock* const vibranceBox = Gtk::manage(new ToolParamBlock()); vibranceBox->pack_start(*saturated, Gtk::PACK_SHRINK, 0); vibranceBox->pack_start(*pastels, Gtk::PACK_SHRINK, 0); @@ -1635,6 +1652,7 @@ pe(nullptr) vibranceBox->pack_start(*pastSatTog, Gtk::PACK_SHRINK, 0); vibranceBox->pack_start(*sensiv, Gtk::PACK_SHRINK, 0); vibranceBox->pack_start(*curveEditorGG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor + vibranceBox->pack_start(*gradvibFrame, Gtk::PACK_SHRINK, 0); enavibMaskConn = enavibMask->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::enavibMaskChanged)); @@ -4136,6 +4154,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).slomaskvib = slomaskvib->getValue(); pp->locallab.spots.at(pp->locallab.selspot).lapmaskvib = lapmaskvib->getValue(); pp->locallab.spots.at(pp->locallab.selspot).Lmaskvibcurve = Lmaskvibshape->getCurve(); + pp->locallab.spots.at(pp->locallab.selspot).strvib = strvib->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).strvibab = strvibab->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).strvibh = strvibh->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).angvib = angvib->getValue(); // Soft Light pp->locallab.spots.at(pp->locallab.selspot).expsoft = expsoft->getEnabled(); pp->locallab.spots.at(pp->locallab.selspot).streng = streng->getIntValue(); @@ -4534,6 +4556,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).slomaskvib = pe->locallab.spots.at(pp->locallab.selspot).slomaskvib || slomaskvib->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).lapmaskvib = pe->locallab.spots.at(pp->locallab.selspot).lapmaskvib || lapmaskvib->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).Lmaskvibcurve = pe->locallab.spots.at(pp->locallab.selspot).Lmaskvibcurve || !Lmaskvibshape->isUnChanged(); + pe->locallab.spots.at(pp->locallab.selspot).strvib = pe->locallab.spots.at(pp->locallab.selspot).strvib || strvib->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).strvibab = pe->locallab.spots.at(pp->locallab.selspot).strvibab || strvibab->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).strvibh = pe->locallab.spots.at(pp->locallab.selspot).strvibh || strvibh->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).angvib = pe->locallab.spots.at(pp->locallab.selspot).angvib || angvib->getEditedState(); // Soft Light pe->locallab.spots.at(pp->locallab.selspot).expsoft = pe->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).streng = pe->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState(); @@ -4889,6 +4915,10 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).slomaskvib = pedited->locallab.spots.at(pp->locallab.selspot).slomaskvib || slomaskvib->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).lapmaskvib = pedited->locallab.spots.at(pp->locallab.selspot).lapmaskvib || lapmaskvib->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).Lmaskvibcurve = pedited->locallab.spots.at(pp->locallab.selspot).Lmaskvibcurve || !Lmaskvibshape->isUnChanged(); + pedited->locallab.spots.at(pp->locallab.selspot).strvib = pedited->locallab.spots.at(pp->locallab.selspot).strvib || strvib->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).strvibab = pedited->locallab.spots.at(pp->locallab.selspot).strvibab || strvibab->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).strvibh = pedited->locallab.spots.at(pp->locallab.selspot).strvibh || strvibh->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).angvib = pedited->locallab.spots.at(pp->locallab.selspot).angvib || angvib->getEditedState(); // Soft Light pedited->locallab.spots.at(pp->locallab.selspot).expsoft = pedited->locallab.spots.at(pp->locallab.selspot).expsoft || !expsoft->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).streng = pedited->locallab.spots.at(pp->locallab.selspot).streng || streng->getEditedState(); @@ -7194,6 +7224,10 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c gammaskvib->setDefault(defSpot->gammaskvib); slomaskvib->setDefault(defSpot->slomaskvib); lapmaskvib->setDefault(defSpot->lapmaskvib); + strvib->setDefault(defSpot->strvib); + strvibab->setDefault(defSpot->strvibab); + strvibh->setDefault(defSpot->strvibh); + angvib->setDefault(defSpot->angvib); // Soft Light streng->setDefault((double)defSpot->streng); sensisf->setDefault((double)defSpot->sensisf); @@ -7409,6 +7443,10 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c gammaskvib->setDefaultEditedState(Irrelevant); slomaskvib->setDefaultEditedState(Irrelevant); lapmaskvib->setDefaultEditedState(Irrelevant); + strvib->setDefaultEditedState(Irrelevant); + strvibab->setDefaultEditedState(Irrelevant); + strvibh->setDefaultEditedState(Irrelevant); + angvib->setDefaultEditedState(Irrelevant); // Soft Light streng->setDefaultEditedState(Irrelevant); sensisf->setDefaultEditedState(Irrelevant); @@ -7628,6 +7666,10 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c gammaskvib->setDefaultEditedState(defSpotState->gammaskvib ? Edited : UnEdited); slomaskvib->setDefaultEditedState(defSpotState->slomaskvib ? Edited : UnEdited); lapmaskvib->setDefaultEditedState(defSpotState->lapmaskvib ? Edited : UnEdited); + strvib->setDefaultEditedState(defSpotState->strvib ? Edited : UnEdited); + strvibab->setDefaultEditedState(defSpotState->strvibab ? Edited : UnEdited); + strvibh->setDefaultEditedState(defSpotState->strvibh ? Edited : UnEdited); + angvib->setDefaultEditedState(defSpotState->angvib ? Edited : UnEdited); // Soft Light streng->setDefaultEditedState(defSpotState->streng ? Edited : UnEdited); sensisf->setDefaultEditedState(defSpotState->sensisf ? Edited : UnEdited); @@ -8351,6 +8393,30 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == strvib) { + if (listener) { + listener->panelChanged(Evlocallabstrvib, strvib->getTextValue()); + } + } + + if (a == strvibab) { + if (listener) { + listener->panelChanged(Evlocallabstrvibab, strvibab->getTextValue()); + } + } + + if (a == strvibh) { + if (listener) { + listener->panelChanged(Evlocallabstrvibh, strvibh->getTextValue()); + } + } + + if (a == angvib) { + if (listener) { + listener->panelChanged(Evlocallabangvib, angvib->getTextValue()); + } + } + } // Soft Light @@ -9140,6 +9206,10 @@ void Locallab::setBatchMode(bool batchMode) gammaskvib->showEditedCB(); slomaskvib->showEditedCB(); lapmaskvib->showEditedCB(); + strvib->showEditedCB(); + strvibab->showEditedCB(); + strvibh->showEditedCB(); + angvib->showEditedCB(); // Soft Light streng->showEditedCB(); sensisf->showEditedCB(); @@ -9868,6 +9938,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con slomaskvib->setValue(pp->locallab.spots.at(index).slomaskvib); lapmaskvib->setValue(pp->locallab.spots.at(index).lapmaskvib); Lmaskvibshape->setCurve(pp->locallab.spots.at(index).Lmaskvibcurve); + strvib->setValue(pp->locallab.spots.at(index).strvib); + strvibab->setValue(pp->locallab.spots.at(index).strvibab); + strvibh->setValue(pp->locallab.spots.at(index).strvibh); + angvib->setValue(pp->locallab.spots.at(index).angvib); // Soft Light expsoft->setEnabled(pp->locallab.spots.at(index).expsoft); @@ -10309,6 +10383,10 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con slomaskvib->setEditedState(spotState->slomaskvib ? Edited : UnEdited); lapmaskvib->setEditedState(spotState->lapmaskvib ? Edited : UnEdited); Lmaskvibshape->setUnChanged(!spotState->Lmaskvibcurve); + strvib->setEditedState(spotState->strvib ? Edited : UnEdited); + strvibab->setEditedState(spotState->strvibab ? Edited : UnEdited); + strvibh->setEditedState(spotState->strvibh ? Edited : UnEdited); + angvib->setEditedState(spotState->angvib ? Edited : UnEdited); // Soft Light expsoft->set_inconsistent(!spotState->expsoft); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 50899caef..0e6517fbc 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -249,6 +249,10 @@ private: Adjuster* const gammaskvib; Adjuster* const slomaskvib; Adjuster* const lapmaskvib; + Adjuster* const strvib; + Adjuster* const strvibab; + Adjuster* const strvibh; + Adjuster* const angvib; // Soft Light Adjuster* const streng; Adjuster* const laplace; @@ -521,6 +525,7 @@ private: Gtk::Frame* const gradFrame; Gtk::Frame* const gradFramemask; Gtk::Frame* const gradSHFrame; + Gtk::Frame* const gradvibFrame; Gtk::Frame* const fatSHFrame; Gtk::Frame* const gamFrame; Gtk::Frame* const dehaFrame; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 3ee2b9dbe..6bf68a628 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1132,6 +1132,10 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).gammaskvib = locallab.spots.at(j).gammaskvib && pSpot.gammaskvib == otherSpot.gammaskvib; locallab.spots.at(j).slomaskvib = locallab.spots.at(j).slomaskvib && pSpot.slomaskvib == otherSpot.slomaskvib; locallab.spots.at(j).lapmaskvib = locallab.spots.at(j).lapmaskvib && pSpot.lapmaskvib == otherSpot.lapmaskvib; + locallab.spots.at(j).strvib = locallab.spots.at(j).strvib && pSpot.strvib == otherSpot.strvib; + locallab.spots.at(j).strvibab = locallab.spots.at(j).strvibab && pSpot.strvibab == otherSpot.strvibab; + locallab.spots.at(j).strvibh = locallab.spots.at(j).strvibh && pSpot.strvibh == otherSpot.strvibh; + locallab.spots.at(j).angvib = locallab.spots.at(j).angvib && pSpot.angvib == otherSpot.angvib; locallab.spots.at(j).Lmaskvibcurve = locallab.spots.at(j).Lmaskvibcurve && pSpot.Lmaskvibcurve == otherSpot.Lmaskvibcurve; // Soft Light locallab.spots.at(j).expsoft = locallab.spots.at(j).expsoft && pSpot.expsoft == otherSpot.expsoft; @@ -3467,6 +3471,22 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).lapmaskvib = mods.locallab.spots.at(i).lapmaskvib; } + if (locallab.spots.at(i).strvib) { + toEdit.locallab.spots.at(i).strvib = mods.locallab.spots.at(i).strvib; + } + + if (locallab.spots.at(i).strvibab) { + toEdit.locallab.spots.at(i).strvibab = mods.locallab.spots.at(i).strvibab; + } + + if (locallab.spots.at(i).strvibh) { + toEdit.locallab.spots.at(i).strvibh = mods.locallab.spots.at(i).strvibh; + } + + if (locallab.spots.at(i).angvib) { + toEdit.locallab.spots.at(i).angvib = mods.locallab.spots.at(i).angvib; + } + if (locallab.spots.at(i).Lmaskvibcurve) { toEdit.locallab.spots.at(i).Lmaskvibcurve = mods.locallab.spots.at(i).Lmaskvibcurve; } @@ -5242,6 +5262,10 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : gammaskvib(v), slomaskvib(v), lapmaskvib(v), + strvib(v), + strvibab(v), + strvibh(v), + angvib(v), Lmaskvibcurve(v), // Soft Light expsoft(v), @@ -5591,6 +5615,10 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) gammaskvib = v; slomaskvib = v; lapmaskvib = v; + strvib = v; + strvibab = v; + strvibh = v; + angvib = v; Lmaskvibcurve = v; // Soft Light expsoft = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 9b7b9f8b1..66f9ed3bb 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -564,6 +564,10 @@ public: bool gammaskvib; bool slomaskvib; bool lapmaskvib; + bool strvib; + bool strvibab; + bool strvibh; + bool angvib; bool Lmaskvibcurve; // Soft Light bool expsoft;