diff --git a/rtdata/languages/default b/rtdata/languages/default index 6acd4f76a..2fafdd15a 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1066,6 +1066,9 @@ HISTORY_MSG_826;Local - Exp gradient strength HISTORY_MSG_827;Local - Exp gradient angle HISTORY_MSG_828;Local - SH gradient strength HISTORY_MSG_829;Local - SH gradient angle +HISTORY_MSG_830;Local - Color gradient strength L +HISTORY_MSG_831;Local - Color gradient angle +HISTORY_MSG_832;Local - Color gradient strength C HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -2333,6 +2336,8 @@ TP_LOCALLAB_FATANCHOR;Anchor TP_LOCALLAB_FATLEVEL;Detail levels TP_LOCALLAB_GRADANG;Gradient angle TP_LOCALLAB_GRADSTR;Gradient strength +TP_LOCALLAB_GRADSTRLUM;Gradient strength Luminance +TP_LOCALLAB_GRADSTRCHRO;Gradient strength Chrominance 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 44bdbb402..514ad4cbf 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -216,6 +216,9 @@ struct local_params { float angexp; float strSH; float angSH; + float strcol; + float strcolab; + float angcol; float softradiusexp; float softradiuscol; float softradiuscb; @@ -742,6 +745,9 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float angexpo = ((float) locallab.spots.at(sp).angexp); float strSH = ((float) locallab.spots.at(sp).strSH); float angSH = ((float) locallab.spots.at(sp).angSH); + float strcol = ((float) locallab.spots.at(sp).strcol); + float strcolab = ((float) locallab.spots.at(sp).strcolab); + float angcol = ((float) locallab.spots.at(sp).angcol); float softradiusexpo = ((float) locallab.spots.at(sp).softradiusexp); float softradiuscolor = ((float) locallab.spots.at(sp).softradiuscol); float softradiusreti = ((float) locallab.spots.at(sp).softradiusret); @@ -851,6 +857,9 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.angexp = angexpo; lp.strSH = strSH; lp.angSH = angSH; + lp.strcol = strcol; + lp.strcolab = strcolab; + lp.angcol = angcol; lp.softradiusexp = softradiusexpo; lp.softradiuscol = softradiuscolor; lp.softradiusret = softradiusreti; @@ -2568,7 +2577,7 @@ static void mean_fab(int xstart, int ystart, int bfw, int bfh, LabImage* bufexpo } } -float pow3 (float x) +float pow3(float x) { return x * x * x; } @@ -2583,7 +2592,7 @@ struct grad_params { int h; }; -void calclocalGradientParams (const struct local_params& lp, struct grad_params& gp, float ystart, float xstart, int bfw, int bfh, int indic) +void calclocalGradientParams(const struct local_params& lp, struct grad_params& gp, float ystart, float xstart, int bfw, int bfh, int indic) { int w = bfw; @@ -2591,7 +2600,7 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& float stops = 0.f; float angs = 0.f; - if(indic == 0) { + if (indic == 0) { stops = -lp.strmaexp; angs = lp.angmaexp; } else if (indic == 1) { @@ -2600,18 +2609,25 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& } else if (indic == 2) { stops = lp.strSH; angs = lp.angSH; + } else if (indic == 3) { + stops = lp.strcol; + angs = lp.angcol; + } else if (indic == 4) { + stops = lp.strcolab; + angs = lp.angcol; } + //printf("Indic=%d strex=%f stop=%f\n", indic, lp.strexp, stops); - + 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; - - //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); + gradient_angle = fmod(gradient_angle, 2 * rtengine::RT_PI); if (gradient_angle < 0.0) { gradient_angle += 2.0 * rtengine::RT_PI; @@ -2621,9 +2637,9 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& gp.transpose = false; gp.angle_is_zero = false; gp.h = h; - double cosgrad = cos (gradient_angle); + double cosgrad = cos(gradient_angle); - if (fabs (cosgrad) < 0.707) { + if (fabs(cosgrad) < 0.707) { // we transpose to avoid division by zero at 90 degrees // (actually we could transpose only for 90 degrees, but this way we avoid // division with extremely small numbers @@ -2634,7 +2650,7 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& gradient_center_y = gxc; } - gradient_angle = fmod (gradient_angle, 2 * rtengine::RT_PI); + gradient_angle = fmod(gradient_angle, 2 * rtengine::RT_PI); if (gradient_angle > 0.5 * rtengine::RT_PI && gradient_angle < rtengine::RT_PI) { gradient_angle += rtengine::RT_PI; @@ -2644,7 +2660,7 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& gp.bright_top = true; } - if (fabs (gradient_angle) < 0.001 || fabs (gradient_angle - 2 * rtengine::RT_PI) < 0.001) { + if (fabs(gradient_angle) < 0.001 || fabs(gradient_angle - 2 * rtengine::RT_PI) < 0.001) { gradient_angle = 0; gp.angle_is_zero = true; } @@ -2654,7 +2670,7 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& std::swap(w, h); } - gp.scale = 1.0 / pow (2, gradient_stops); + gp.scale = 1.0 / pow(2, gradient_stops); if (gp.bright_top) { gp.topmul = 1.0; @@ -2664,10 +2680,10 @@ void calclocalGradientParams (const struct local_params& lp, struct grad_params& gp.botmul = 1.0; } - gp.ta = tan (gradient_angle); + gp.ta = tan(gradient_angle); gp.xc = w * gradient_center_x; gp.yc = h * gradient_center_y; - gp.ys = sqrt ((float)h * h + (float)w * w) * (1.f / cos (gradient_angle)); + gp.ys = sqrt((float)h * h + (float)w * w) * (1.f / cos(gradient_angle)); gp.ys_inv = 1.0 / gp.ys; gp.top_edge_0 = gp.yc - gp.ys / 2.0; @@ -3725,21 +3741,22 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int rdEBuffer.reset(); } - - struct grad_params gp; - if (lp.strmaexp != 0.f) { - calclocalGradientParams (lp, gp, ystart, xstart, bfw, bfh, 0); + struct grad_params gp; + + if (lp.strmaexp != 0.f) { + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 0); #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) + #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); + factor = ImProcFunctions::calcGradientFactor(gp, jr, ir); bufmaskblurcol->L[ir][jr] *= factor; } - } + } if (lap > 0.f) { @@ -9531,14 +9548,15 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o struct grad_params gp; if (lp.strSH != 0.f) { - calclocalGradientParams (lp, gp, ystart, xstart, bfw, bfh, 2); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 2); #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) + #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); + factor = ImProcFunctions::calcGradientFactor(gp, jr, ir); bufexpfin->L[ir][jr] *= factor; } } @@ -11801,18 +11819,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o ImProcFunctions::exlabLocal(lp, bfh, bfw, bufexporig.get(), bufexpfin.get(), hltonecurveloc, shtonecurveloc, tonecurveloc, meanorig); } + //gradient struct grad_params gp; if (lp.strexp != 0.f) { - calclocalGradientParams (lp, gp, ystart, xstart, bfw, bfh, 1); + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 1); #ifdef _OPENMP - #pragma omp parallel for schedule(dynamic,16) + #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); + factor = ImProcFunctions::calcGradientFactor(gp, jr, ir); bufexpfin->L[ir][jr] *= factor; } } @@ -12102,7 +12122,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bool ctoningmerg = (a_scalemerg != 0.f || b_scalemerg != 0.f || a_basemerg != 0.f || b_basemerg != 0.f); bool nottransit = false; - if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || ctoning || lp.mergemet > 0 || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4 || lp.showmaskcolmet == 5) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili + if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || ctoning || lp.mergemet > 0 || lp.strcol != 0.f || lp.strcolab != 0.f || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4 || lp.showmaskcolmet == 5) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili /* //test for fftw blur with tiles fftw_tile_blur....not good we can see tiles - very long time int GW = original->W; @@ -12569,6 +12589,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o kd = 10.f * 0.01f * lp.strengrid; } + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) #endif @@ -12641,6 +12662,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o buf_b[ir][jr] = CLIPRET((bufcolcalcb - origptr->b[ir][jr]) / 328.f);; bufcolfin->L[ir][jr] = bufcolcalcL; + if (lp.mergemet >= 2) { bufcolfin->a[ir][jr] = bufcolcalca * (1.f + 0.01f * (chprosl + chprocu)); bufcolfin->b[ir][jr] = bufcolcalcb * (1.f + 0.01f * (chprosl + chprocu)); @@ -12648,6 +12670,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } + if (HHcurve && ctoning) {//not use ctoning and H(H) simultaneous but priority to ctoning HHcurve = false; } @@ -12704,6 +12727,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } } + //test for write text , now it compile... but does nothing // why ?? is arial found (I tried others) or I missed something /* @@ -12713,7 +12737,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o cr->select_font_face ("Arial", Cairo::FontSlant::FONT_SLANT_NORMAL, Cairo::FontWeight::FONT_WEIGHT_BOLD); cr->set_font_size (20); cr->move_to (20, 20); - cr->show_text ("Coucou"); + cr->show_text ("Coucou"); printf("OK \n"); */ JaggedArray blend(bfw, bfh); @@ -12775,7 +12799,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (conthr > 0.f && lp.mergemet != 4) { - // if (conthr > 0.f) { + // if (conthr > 0.f) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -12881,7 +12905,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - // if (conthr > 0.f) { + // if (conthr > 0.f) { if (conthr > 0.f && lp.mergemet != 4) { #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) @@ -13303,6 +13327,37 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o softproc(bufcolreserv.get(), bufcolfin.get(), lp.softradiuscol, bfh, bfw, 0.0001, 0.00001, 0.1f, sk, multiThread, 0); } + if (lp.strcol != 0.f) { + struct grad_params gp; + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 3); +#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); + bufcolfin->L[ir][jr] *= factor; + } + } + + if (lp.strcolab != 0.f) { + struct grad_params gpab; + calclocalGradientParams(lp, gpab, ystart, xstart, bfw, bfh, 4); +#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); + bufcolfin->a[ir][jr] *= factor; + bufcolfin->b[ir][jr] *= factor; + } + } + if (nottransit) { //special only transition //may be we can add preview... @@ -13340,6 +13395,22 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } if (!nottransit) { +//gradient + + if (lp.strcol != 0.f) { + struct grad_params gp; + calclocalGradientParams(lp, gp, ystart, xstart, bfw, bfh, 3); +#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); + bufcolfin->L[ir][jr] *= factor; + } + } if (lp.softradiuscol > 0.f) { softproc(bufcolorig.get(), bufcolfin.get(), lp.softradiuscol, bfh, bfw, 0.0001, 0.00001, 0.1f, sk, multiThread, 0); @@ -13352,6 +13423,13 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { buflight[ir][jr] = CLIPRET((bufcolfin->L[ir][jr] - bufcolorig->L[ir][jr]) / 328.f); + /* + float tempa = SQR((bufcolfin->a[ir][jr] - bufcolorig->a[ir][jr])/328.f); + float tempb = SQR((bufcolfin->b[ir][jr] - bufcolorig->b[ir][jr])/328.f); + if(lp.strcolab != 0.f) { + bufchro[ir][jr] = sqrt(tempa + tempb); + } + */ } } diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 04407fe4d..b1c53d073 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -853,6 +853,9 @@ enum ProcEventCode { Evlocallabangexp = 826, EvlocallabstrSH = 827, EvlocallabangSH = 828, + Evlocallabstrcol = 829, + Evlocallabangcol = 830, + Evlocallabstrcolab = 831, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index c979e4f5c..e09f738fa 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2462,6 +2462,9 @@ LocallabParams::LocallabSpot::LocallabSpot() : strengthgrid(30), sensi(15), structcol(0), + strcol(0.), + strcolab(0.), + angcol(0.), blurcolde(5), blendmaskcol(0), radmaskcol(0.0), @@ -2808,6 +2811,9 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && strengthgrid == other.strengthgrid && sensi == other.sensi && structcol == other.structcol + && strcol == other.strcol + && strcolab == other.strcolab + && angcol == other.angcol && blendmaskcol == other.blendmaskcol && radmaskcol == other.radmaskcol && chromaskcol == other.chromaskcol @@ -4148,6 +4154,9 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strengthgrid, "Locallab", "Strengthgrid_" + std::to_string(i), spot.strengthgrid, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensi, "Locallab", "Sensi_" + std::to_string(i), spot.sensi, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structcol, "Locallab", "Structcol_" + std::to_string(i), spot.structcol, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strcol, "Locallab", "Strcol_" + std::to_string(i), spot.strcol, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strcolab, "Locallab", "Strcolab_" + std::to_string(i), spot.strcolab, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).angcol, "Locallab", "Angcol_" + std::to_string(i), spot.angcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurcolde, "Locallab", "Blurcolde_" + std::to_string(i), spot.blurcolde, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blendmaskcol, "Locallab", "Blendmaskcol_" + std::to_string(i), spot.blendmaskcol, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).radmaskcol, "Locallab", "Radmaskcol_" + std::to_string(i), spot.radmaskcol, keyFile); @@ -5596,6 +5605,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Strengthgrid_" + std::to_string(i), pedited, spot.strengthgrid, spotEdited.strengthgrid); assignFromKeyfile(keyFile, "Locallab", "Sensi_" + std::to_string(i), pedited, spot.sensi, spotEdited.sensi); assignFromKeyfile(keyFile, "Locallab", "Structcol_" + std::to_string(i), pedited, spot.structcol, spotEdited.structcol); + assignFromKeyfile(keyFile, "Locallab", "Strcol_" + std::to_string(i), pedited, spot.strcol, spotEdited.strcol); + assignFromKeyfile(keyFile, "Locallab", "Strcolab_" + std::to_string(i), pedited, spot.strcolab, spotEdited.strcolab); + assignFromKeyfile(keyFile, "Locallab", "Angcol_" + std::to_string(i), pedited, spot.angcol, spotEdited.angcol); assignFromKeyfile(keyFile, "Locallab", "Blurcolde_" + std::to_string(i), pedited, spot.blurcolde, spotEdited.blurcolde); assignFromKeyfile(keyFile, "Locallab", "Blendmaskcol_" + std::to_string(i), pedited, spot.blendmaskcol, spotEdited.blendmaskcol); assignFromKeyfile(keyFile, "Locallab", "Radmaskcol_" + std::to_string(i), pedited, spot.radmaskcol, spotEdited.radmaskcol); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 431edc3e0..a010c0e3c 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1005,6 +1005,9 @@ struct LocallabParams { int strengthgrid; int sensi; int structcol; + double strcol; + double strcolab; + double angcol; int blurcolde; int blendmaskcol; double radmaskcol; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 6b48d0692..2660b8e28 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -856,7 +856,10 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // Evlocallabstrexp LUMINANCECURVE, // Evlocallabangexp LUMINANCECURVE, //EvlocallabstrSH - LUMINANCECURVE //EvlocallabangSH + LUMINANCECURVE, //EvlocallabangSH + LUMINANCECURVE, // Evlocallabstrcol + LUMINANCECURVE, // Evlocallabangcol + LUMINANCECURVE // Evlocallabstrcolab }; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index acdd851a5..b20209692 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -266,6 +266,9 @@ Locallab::Locallab(): sensi(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 15))), structcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL1"), 0, 100, 1, 0))), blurcolde(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURDE"), 2, 100, 1, 5))), + strcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTRLUM"), -4., 4., 0.05, 0.))), + strcolab(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADSTRCHRO"), -6., 6., 0.05, 0.))), + angcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GRADANG"), -90, 90, 0.1, 0.))), blendmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), radmaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), 0.0, 100.0, 0.1, 0.))), chromaskcol(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), @@ -593,6 +596,7 @@ mergecolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_MERGECOLFRA")))), merge1colFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_MERGE1COLFRA")))), pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), fatFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATFRA")))), +gradcolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), gradFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), gradSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_GRADFRA")))), fatSHFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATSHFRA")))), @@ -677,6 +681,9 @@ pe(nullptr) strengthgrid->setAdjusterListener(this); structcol->setAdjusterListener(this); blurcolde->setAdjusterListener(this); + strcol->setAdjusterListener(this); + angcol->setAdjusterListener(this); + strcolab->setAdjusterListener(this); blendmaskcol->setAdjusterListener(this); radmaskcol->setAdjusterListener(this); @@ -960,6 +967,13 @@ pe(nullptr) conthrcol->set_tooltip_text(M("TP_LOCALLAB_MERGEOPA_TOOLTIP")); } + gradcolFrame->set_label_align(0.025, 0.5); + ToolParamBlock* const gradcolBox = Gtk::manage(new ToolParamBlock()); + gradcolBox->pack_start(*strcol); + gradcolBox->pack_start(*strcolab); + gradcolBox->pack_start(*angcol); + gradcolFrame->add(*gradcolBox); + ToolParamBlock* const colorBox = Gtk::manage(new ToolParamBlock()); Gtk::Frame* const superFrame = Gtk::manage(new Gtk::Frame()); @@ -982,6 +996,7 @@ pe(nullptr) colorBox->pack_start(*sensi); colorBox->pack_start(*structcol); colorBox->pack_start(*blurcolde); + colorBox->pack_start(*gradcolFrame); colorBox->pack_start(*softradiuscol); Gtk::HBox* const qualcurvbox = Gtk::manage(new Gtk::HBox()); qualcurvbox->pack_start(*labqualcurv, Gtk::PACK_SHRINK, 4); @@ -3849,6 +3864,9 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).sensi = sensi->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).structcol = structcol->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).blurcolde = blurcolde->getIntValue(); + pp->locallab.spots.at(pp->locallab.selspot).strcol = strcol->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).angcol = angcol->getValue(); + pp->locallab.spots.at(pp->locallab.selspot).strcolab = strcolab->getValue(); if (qualitycurveMethod->get_active_row_number() == 0) { pp->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = "none"; @@ -4342,6 +4360,9 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).chroma = pe->locallab.spots.at(pp->locallab.selspot).chroma || chroma->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).sensi = pe->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).structcol = pe->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).strcol = pe->locallab.spots.at(pp->locallab.selspot).strcol || strcol->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).strcolab = pe->locallab.spots.at(pp->locallab.selspot).strcolab || strcolab->getEditedState(); + pe->locallab.spots.at(pp->locallab.selspot).angcol = pe->locallab.spots.at(pp->locallab.selspot).angcol || angcol->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pe->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).gridMethod = pe->locallab.spots.at(pp->locallab.selspot).gridMethod || gridMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).merMethod = pe->locallab.spots.at(pp->locallab.selspot).merMethod || merMethod->get_active_text() != M("GENERAL_UNCHANGED"); @@ -4692,6 +4713,9 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).strengthgrid = pedited->locallab.spots.at(pp->locallab.selspot).strengthgrid || strengthgrid->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).sensi = pedited->locallab.spots.at(pp->locallab.selspot).sensi || sensi->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).structcol = pedited->locallab.spots.at(pp->locallab.selspot).structcol || structcol->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).strcol = pedited->locallab.spots.at(pp->locallab.selspot).strcol || strcol->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).strcolab = pedited->locallab.spots.at(pp->locallab.selspot).strcolab || strcolab->getEditedState(); + pedited->locallab.spots.at(pp->locallab.selspot).angcol = pedited->locallab.spots.at(pp->locallab.selspot).angcol || angcol->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod = pedited->locallab.spots.at(pp->locallab.selspot).qualitycurveMethod || qualitycurveMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).gridMethod = pedited->locallab.spots.at(pp->locallab.selspot).gridMethod || gridMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).merMethod = pedited->locallab.spots.at(pp->locallab.selspot).merMethod || merMethod->get_active_text() != M("GENERAL_UNCHANGED"); @@ -5588,6 +5612,7 @@ void Locallab::merMethodChanged() blurcolde->set_sensitive(true); H2CurveEditorG->set_sensitive(true); rgbCurveEditorG->set_sensitive(true); + strcolab->set_sensitive(false); special->set_sensitive(true); invers->set_sensitive(true); gridmerFrame->hide(); @@ -5600,6 +5625,7 @@ void Locallab::merMethodChanged() rgbCurveEditorG->set_sensitive(true); special->set_sensitive(true); invers->set_sensitive(true); + strcolab->set_sensitive(false); conthrcol->hide(); gridmerFrame->hide(); } else if (merMethod->get_active_row_number() == 2) { @@ -5611,6 +5637,7 @@ void Locallab::merMethodChanged() rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); + strcolab->set_sensitive(true); conthrcol->show(); gridmerFrame->hide(); } else if (merMethod->get_active_row_number() == 3) { @@ -5621,6 +5648,7 @@ void Locallab::merMethodChanged() rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); + strcolab->set_sensitive(true); mask7->show(); conthrcol->show(); gridmerFrame->hide(); @@ -5634,6 +5662,7 @@ void Locallab::merMethodChanged() rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); invers->set_sensitive(false); + strcolab->set_sensitive(true); gridmerFrame->show(); } @@ -7037,6 +7066,9 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c labgridmerg->setDefault(defSpot->labgridALowmerg / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBLowmerg / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridAHighmerg / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBHighmerg / rtengine::procparams::LocallabParams::LABGRIDL_CORR_MAX); sensi->setDefault((double)defSpot->sensi); structcol->setDefault((double)defSpot->structcol); + strcol->setDefault((double)defSpot->strcol); + strcolab->setDefault((double)defSpot->strcolab); + angcol->setDefault((double)defSpot->angcol); blurcolde->setDefault((double)defSpot->blurcolde); blendmaskcol->setDefault((double)defSpot->blendmaskcol); radmaskcol->setDefault(defSpot->radmaskcol); @@ -7247,6 +7279,9 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c labgridmerg->setEdited(Edited); sensi->setDefaultEditedState(Irrelevant); structcol->setDefaultEditedState(Irrelevant); + strcol->setDefaultEditedState(Irrelevant); + strcolab->setDefaultEditedState(Irrelevant); + angcol->setDefaultEditedState(Irrelevant); strengthgrid->setDefault((double)defSpot->strengthgrid); blurcolde->setDefaultEditedState(Irrelevant); blendmaskcol->setDefaultEditedState(Irrelevant); @@ -7462,6 +7497,9 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c labgridmerg->setEdited((defSpotState->labgridALowmerg || defSpotState->labgridBLowmerg || defSpotState->labgridAHighmerg || defSpotState->labgridBHighmerg) ? Edited : UnEdited); sensi->setDefaultEditedState(defSpotState->sensi ? Edited : UnEdited); structcol->setDefaultEditedState(defSpotState->structcol ? Edited : UnEdited); + strcol->setDefaultEditedState(defSpotState->strcol ? Edited : UnEdited); + strcolab->setDefaultEditedState(defSpotState->strcolab ? Edited : UnEdited); + angcol->setDefaultEditedState(defSpotState->angcol ? Edited : UnEdited); strengthgrid->setDefaultEditedState(defSpotState->strengthgrid ? Edited : UnEdited); blurcolde->setDefaultEditedState(defSpotState->blurcolde ? Edited : UnEdited); blendmaskcol->setDefaultEditedState(defSpotState->blendmaskcol ? Edited : UnEdited); @@ -7766,6 +7804,24 @@ void Locallab::adjusterChanged(Adjuster * a, double newval) } } + if (a == strcol) { + if (listener) { + listener->panelChanged(Evlocallabstrcol, strcol->getTextValue()); + } + } + + if (a == strcolab) { + if (listener) { + listener->panelChanged(Evlocallabstrcolab, strcolab->getTextValue()); + } + } + + if (a == angcol) { + if (listener) { + listener->panelChanged(Evlocallabangcol, angcol->getTextValue()); + } + } + if (a == blendmaskcol) { if (listener) { listener->panelChanged(Evlocallabblendmaskcol, blendmaskcol->getTextValue()); @@ -8946,6 +9002,9 @@ void Locallab::setBatchMode(bool batchMode) chroma->showEditedCB(); sensi->showEditedCB(); structcol->showEditedCB(); + strcol->showEditedCB(); + strcolab->showEditedCB(); + angcol->showEditedCB(); strengthgrid->showEditedCB(); blurcolde->showEditedCB(); blendmaskcol->showEditedCB(); @@ -9505,6 +9564,9 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con strengthgrid->setValue(pp->locallab.spots.at(index).strengthgrid); sensi->setValue(pp->locallab.spots.at(index).sensi); structcol->setValue(pp->locallab.spots.at(index).structcol); + strcol->setValue(pp->locallab.spots.at(index).strcol); + angcol->setValue(pp->locallab.spots.at(index).angcol); + strcolab->setValue(pp->locallab.spots.at(index).strcolab); if (pp->locallab.spots.at(index).qualitycurveMethod == "none") { qualitycurveMethod->set_active(0); @@ -10027,6 +10089,9 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con chroma->setEditedState(spotState->chroma ? Edited : UnEdited); sensi->setEditedState(spotState->sensi ? Edited : UnEdited); structcol->setEditedState(spotState->structcol ? Edited : UnEdited); + strcol->setEditedState(spotState->strcol ? Edited : UnEdited); + strcolab->setEditedState(spotState->strcolab ? Edited : UnEdited); + angcol->setEditedState(spotState->angcol ? Edited : UnEdited); labgrid->setEdited(spotState->labgridALow || spotState->labgridBLow || spotState->labgridAHigh || spotState->labgridBHigh); labgridmerg->setEdited(spotState->labgridALowmerg || spotState->labgridBLowmerg || spotState->labgridAHighmerg || spotState->labgridBHighmerg); strengthgrid->setEditedState(spotState->strengthgrid ? Edited : UnEdited); @@ -10445,6 +10510,7 @@ void Locallab::updateSpecificGUIState() mask7->hide(); conthrcol->hide(); structcol->set_sensitive(true); + strcolab->set_sensitive(false); sensi->set_sensitive(true); blurcolde->set_sensitive(true); H2CurveEditorG->set_sensitive(true); @@ -10455,6 +10521,7 @@ void Locallab::updateSpecificGUIState() } else if (merMethod->get_active_row_number() == 1) { mask7->hide(); structcol->set_sensitive(true); + strcolab->set_sensitive(false); sensi->set_sensitive(true); blurcolde->set_sensitive(true); H2CurveEditorG->set_sensitive(true); @@ -10466,6 +10533,7 @@ void Locallab::updateSpecificGUIState() } else if (merMethod->get_active_row_number() == 2) { mask7->show(); structcol->set_sensitive(false); + strcolab->set_sensitive(true); sensi->set_sensitive(false); blurcolde->set_sensitive(false); H2CurveEditorG->set_sensitive(false); @@ -10479,6 +10547,7 @@ void Locallab::updateSpecificGUIState() structcol->set_sensitive(false); sensi->set_sensitive(false); blurcolde->set_sensitive(false); + strcolab->set_sensitive(true); H2CurveEditorG->set_sensitive(false); rgbCurveEditorG->set_sensitive(false); special->set_sensitive(false); @@ -10488,6 +10557,7 @@ void Locallab::updateSpecificGUIState() } else if (merMethod->get_active_row_number() == 3) { mask7->show(); structcol->set_sensitive(false); + strcolab->set_sensitive(true); sensi->set_sensitive(false); blurcolde->set_sensitive(false); H2CurveEditorG->set_sensitive(false); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index 8d77287fe..ee361d7f9 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -169,6 +169,9 @@ private: Adjuster* const sensi; Adjuster* const structcol; Adjuster* const blurcolde; + Adjuster* const strcol; + Adjuster* const strcolab; + Adjuster* const angcol; Adjuster* const blendmaskcol; Adjuster* const radmaskcol; Adjuster* const chromaskcol; @@ -513,6 +516,7 @@ private: Gtk::Frame* const merge1colFrame; Gtk::Frame* const pdeFrame; Gtk::Frame* const fatFrame; + Gtk::Frame* const gradcolFrame; Gtk::Frame* const gradFrame; Gtk::Frame* const gradSHFrame; Gtk::Frame* const fatSHFrame; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 4eb1bb046..543245684 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -998,6 +998,9 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).strengthgrid = locallab.spots.at(j).strengthgrid && pSpot.strengthgrid == otherSpot.strengthgrid; locallab.spots.at(j).sensi = locallab.spots.at(j).sensi && pSpot.sensi == otherSpot.sensi; locallab.spots.at(j).structcol = locallab.spots.at(j).structcol && pSpot.structcol == otherSpot.structcol; + locallab.spots.at(j).strcol = locallab.spots.at(j).strcol && pSpot.strcol == otherSpot.strcol; + locallab.spots.at(j).strcolab = locallab.spots.at(j).strcolab && pSpot.strcolab == otherSpot.strcolab; + locallab.spots.at(j).angcol = locallab.spots.at(j).angcol && pSpot.angcol == otherSpot.angcol; locallab.spots.at(j).blurcolde = locallab.spots.at(j).blurcolde && pSpot.blurcolde == otherSpot.blurcolde; locallab.spots.at(j).blendmaskcol = locallab.spots.at(j).blendmaskcol && pSpot.blendmaskcol == otherSpot.blendmaskcol; locallab.spots.at(j).radmaskcol = locallab.spots.at(j).radmaskcol && pSpot.radmaskcol == otherSpot.radmaskcol; @@ -2949,6 +2952,18 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).structcol = mods.locallab.spots.at(i).structcol; } + if (locallab.spots.at(i).strcol) { + toEdit.locallab.spots.at(i).strcol = mods.locallab.spots.at(i).strcol; + } + + if (locallab.spots.at(i).strcolab) { + toEdit.locallab.spots.at(i).strcolab = mods.locallab.spots.at(i).strcolab; + } + + if (locallab.spots.at(i).angcol) { + toEdit.locallab.spots.at(i).angcol = mods.locallab.spots.at(i).angcol; + } + if (locallab.spots.at(i).blendmaskcol) { toEdit.locallab.spots.at(i).blendmaskcol = mods.locallab.spots.at(i).blendmaskcol; } @@ -5086,6 +5101,9 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : strengthgrid(v), sensi(v), structcol(v), + strcol(v), + strcolab(v), + angcol(v), blurcolde(v), blendmaskcol(v), radmaskcol(v), @@ -5428,6 +5446,9 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) strengthgrid = v; sensi = v; structcol = v; + strcol = v; + strcolab = v; + angcol = v; blurcolde = v; blendmaskcol = v; radmaskcol = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 8335a4920..d64a00d0f 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -432,6 +432,9 @@ public: bool strengthgrid; bool sensi; bool structcol; + bool strcol; + bool strcolab; + bool angcol; bool blurcolde; bool blendmaskcol; bool radmaskcol;