diff --git a/rtdata/languages/default b/rtdata/languages/default index 3911dc12a..4ecc85b70 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1982,7 +1982,7 @@ TP_LOCALLAB_CURVEEDITOR_CC_TOOLTIP;If curves at the top, mask is completely blac TP_LOCALLAB_CURVEMETHOD_TOOLTIP;'Normal', the curve L=f(L) has the same algorithm than slider lightness.\n'Super' the curve L=f(L) has an new improved algorithm, which can leeds in some cases to artifacts. TP_LOCALLAB_EXCLUF;Excluding TP_LOCALLAB_EXCLUF_TOOLTIP;Can be used to exclude this part of datas - move Scope to extend color.\n You can apply all settings to this RT-spot. -TP_LOCALLAB_LABGRID_VALUES;HL: a=%1 b=%2\nS: a=%3 b=%4 +TP_LOCALLAB_LABGRID_VALUES;a(L)=%1 b(L)=%2\na(a)=%3 b(a)=%4 TP_LOCALLAB_LABGRID;Color correction grid TP_LOCALLAB_SENSIDEN;Scope TP_LOCALLAB_SENSIEXCLU;Scope diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index b7cbb9dca..9650655f1 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -7952,11 +7952,11 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o //local color and light - const float factor = ColorToningParams::LABGRID_CORR_MAX * 3.f; - const float scaling = ColorToningParams::LABGRID_CORR_SCALE; - float a_scale = 2.f * (lp.highA - lp.lowA) / factor / scaling; + const float factor = LocallabParams::LABGRIDL_CORR_MAX * 3.28f; + const float scaling = LocallabParams::LABGRIDL_CORR_SCALE; + float a_scale = (lp.highA - lp.lowA) / factor / scaling; float a_base = lp.lowA / scaling; - float b_scale = 2.f * (lp.highB - lp.lowB) / factor / scaling; + float b_scale = (lp.highB - lp.lowB) / factor / scaling; float b_base = lp.lowB / scaling; bool ctoning = (a_scale != 0.f || b_scale != 0.f || a_base != 0.f || b_base != 0.f); if (!lp.inv && (lp.chro != 0 || lp.ligh != 0.f || lp.cont != 0 || ctoning || lp.qualcurvemet != 0 || lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3 || lp.showmaskcolmet == 4) && lp.colorena) { // || lllocalcurve)) { //interior ellipse renforced lightness and chroma //locallutili @@ -8372,7 +8372,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o LabImage *bufcolcalc = nullptr; bufcolcalc = new LabImage(bfw, bfh); - //printf("a_s=%f a_b=%f b_s=%f b_b=%f \n", a_scale, a_base, b_scale, b_base); #ifdef _OPENMP #pragma omp parallel for schedule(dynamic,16) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f0ebaba66..362b5cc19 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2366,6 +2366,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : labgridBLow(0.0), labgridAHigh(0.0), labgridBHigh(0.0), + strengthgrid(20), sensi(15), structcol(0), @@ -2646,6 +2647,9 @@ bool LocallabParams::LocallabSpot::operator !=(const LocallabSpot& other) const return !(*this == other); } +const double LocallabParams::LABGRIDL_CORR_MAX = 10000.f; +const double LocallabParams::LABGRIDL_CORR_SCALE = 3.28f; + LocallabParams::LocallabParams() : enabled(false), nbspot(0), diff --git a/rtengine/procparams.h b/rtengine/procparams.h index c43259a10..2507253bb 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -1090,6 +1090,8 @@ struct LocallabParams { }; bool enabled; + static const double LABGRIDL_CORR_MAX; + static const double LABGRIDL_CORR_SCALE; int nbspot; int selspot; std::vector spots; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index ed5a42400..7add8f807 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1509,10 +1509,10 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pp->locallab.spots.at(pp->locallab.selspot).chroma = chroma->getIntValue(); labgrid->getParams(pp->locallab.spots.at(pp->locallab.selspot).labgridALow, pp->locallab.spots.at(pp->locallab.selspot).labgridBLow, pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh, pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh); pp->locallab.spots.at(pp->locallab.selspot).strengthgrid = strengthgrid->getIntValue(); - pp->locallab.spots.at(pp->locallab.selspot).labgridALow *= ColorToningParams::LABGRID_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh *= ColorToningParams::LABGRID_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridBLow *= ColorToningParams::LABGRID_CORR_MAX; - pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh *= ColorToningParams::LABGRID_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridALow *= LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridAHigh *= LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridBLow *= LocallabParams::LABGRIDL_CORR_MAX; + pp->locallab.spots.at(pp->locallab.selspot).labgridBHigh *= LocallabParams::LABGRIDL_CORR_MAX; 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(); @@ -2591,7 +2591,7 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe lightness->setDefault((double)defSpot->lightness); contrast->setDefault((double)defSpot->contrast); chroma->setDefault((double)defSpot->chroma); - labgrid->setDefault(defSpot->labgridALow / ColorToningParams::LABGRID_CORR_MAX, defSpot->labgridBLow / ColorToningParams::LABGRID_CORR_MAX, defSpot->labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, defSpot->labgridBHigh / ColorToningParams::LABGRID_CORR_MAX); + labgrid->setDefault(defSpot->labgridALow / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, defSpot->labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX); sensi->setDefault((double)defSpot->sensi); structcol->setDefault((double)defSpot->structcol); blurcolde->setDefault((double)defSpot->blurcolde); @@ -3708,7 +3708,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con lightness->setValue(pp->locallab.spots.at(index).lightness); contrast->setValue(pp->locallab.spots.at(index).contrast); chroma->setValue(pp->locallab.spots.at(index).chroma); - labgrid->setParams(pp->locallab.spots.at(index).labgridALow / ColorToningParams::LABGRID_CORR_MAX, pp->locallab.spots.at(index).labgridBLow / ColorToningParams::LABGRID_CORR_MAX, pp->locallab.spots.at(index).labgridAHigh / ColorToningParams::LABGRID_CORR_MAX, pp->locallab.spots.at(index).labgridBHigh / ColorToningParams::LABGRID_CORR_MAX, false); + labgrid->setParams(pp->locallab.spots.at(index).labgridALow / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBLow / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridAHigh / LocallabParams::LABGRIDL_CORR_MAX, pp->locallab.spots.at(index).labgridBHigh / LocallabParams::LABGRIDL_CORR_MAX, false); strengthgrid->setValue(pp->locallab.spots.at(index).strengthgrid); sensi->setValue(pp->locallab.spots.at(index).sensi); structcol->setValue(pp->locallab.spots.at(index).structcol);