diff --git a/rtdata/languages/default b/rtdata/languages/default index 2f3cb2d14..6ccdc97ac 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -874,6 +874,7 @@ HISTORY_MSG_618;Local - Use Color Mask HISTORY_MSG_619;Local - Use Exp Mask HISTORY_MSG_620;Local - Blur col HISTORY_MSG_621;Local - Exp inverse +HISTORY_MSG_622;Local - Exclude structure HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 054d3abb3..1a1fb8b31 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -300,7 +300,7 @@ public: void vibrancelocal(int sp, int bfw, int bfh, LabImage* lab, LabImage* dest, bool & localskutili, LUTf & sklocalcurve); void transit_shapedetect(int senstype, LabImage * bufexporig, LabImage * originalmask, float **buflight, float **bufchro, float **buf_a_cat, float ** buf_b_cat, float ** bufhh, bool HHutili, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, float ** blend2, const struct local_params & lp, LabImage * original, LabImage * transformed, int cx, int cy, int sk); void exlabLocal(const local_params& lp, int bfh, int bfw, LabImage* bufexporig, LabImage* lab, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve); - void Exclude_Local(int sen, float **deltaso, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, LabImage * reserv, int cx, int cy, int sk); + void Exclude_Local(int sen, float **deltaso, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, LabImage * reserv, int cx, int cy, int sk); void DeNoise_Local(int call, const struct local_params& lp, int levred, float hueref, float lumaref, float chromaref, LabImage* original, LabImage* transformed, LabImage &tmp1, int cx, int cy, int sk); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 6a39f8b2c..f9b241646 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -160,6 +160,7 @@ struct local_params { int prox; int chro, cont, sens, sensh, senscb, sensbn, senstm, sensex, sensexclu, sensden, senslc, senssf; float struco; + float struexc; float blendmacol; float blendmaexp; float struexp; @@ -451,6 +452,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall int local_sensibn = locallab.spots.at(sp).sensibn; int local_sensitm = locallab.spots.at(sp).sensitm; int local_sensiexclu = locallab.spots.at(sp).sensiexclu; + float structexclude = (float) locallab.spots.at(sp).structexclu; int local_sensilc = locallab.spots.at(sp).sensilc; // int local_struc = locallab.spots.at(sp).struc; int local_warm = locallab.spots.at(sp).warm; @@ -501,6 +503,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.chro = local_chroma; lp.struco = structcolor; lp.blendmacol = blendmaskcolor; + lp.struexc = structexclude; lp.blendmaexp = blendmaskexpo; lp.struexp = structexpo; lp.blurexp = blurexpo; @@ -3328,7 +3331,7 @@ void ImProcFunctions::Sharp_Local(int call, float **loctemp, int senstype, cons -void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, LabImage * reserv, int cx, int cy, int sk) +void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, float **bufchro, const float hueref, const float chromaref, const float lumaref, float sobelref, float meansobel, const struct local_params & lp, LabImage * original, LabImage * transformed, LabImage * rsv, LabImage * reserv, int cx, int cy, int sk) { BENCHFUN { @@ -3346,6 +3349,22 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, float refa = chromaref * cos(hueref); float refb = chromaref * sin(hueref); + //sobel + sobelref /= 100.; + + if (sobelref > 60.) + { + sobelref = 60.; + } + + float k = 1.f; + + if (sobelref < meansobel && sobelref < lp.stru)//does not always work wth noisy images + { + k = -1.f; + } + + sobelref = log(1.f + sobelref); LabImage *origblur = nullptr; @@ -3432,11 +3451,48 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, #else // float rhue = xatan2f(origblur->b[y][x], origblur->a[y][x]); #endif - float rL = origblur->L[y][x] / 327.68f; - float dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); + float rL = original->L[y][x] / 327.68f; float cli = 1.f; float clc = 1.f; + float csob = 0.f; + float rs = 0.f; + + if (sen == 1) { + csob = (deltaso[loy - begy][lox - begx]) / 100.f ; + + if (csob > 60.f) { + csob = 60.f; + } + + csob = log(1.f + csob + 0.001f); + + if (k == 1) { + rs = sobelref / csob; + } else { + rs = csob / sobelref; + } + } + + float dE = 0.f; + float rsob = 0.f; + float affsob = 1.f; + float affde = 1.f; + float minrs = 0.f; + + if (lp.struexc > 0.f && rs > 0.f && sen == 1) { + rsob = 0.002f * lp.struexc * rs; + minrs = 1.3f + 0.05f * lp.stru; + + if (rs < minrs) { + affsob = 1.f; + } else { + affsob = 1.f / pow((1.f + rsob), SQR(SQR(rs - minrs))); + } + } + + dE = affde * sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); + cli = (buflight[loy - begy][lox - begx]); clc = (bufchro[loy - begy][lox - begx]); @@ -3487,37 +3543,18 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, float difL; difL = rsv->L[loy - begy][lox - begx] - original->L[y][x]; - // difL *= factorx * (100.f + realstr * falL) / 100.f; - // difL *= kch * fach; difL *= factorx * (100.f + realstrdE) / 100.f; - // difL *= kch * fach; - - if (deltaso[loy - begy][lox - begx] == 0.f) { - transformed->L[y][x] = original->L[y][x]; - } else { - transformed->L[y][x] = CLIP(original->L[y][x] + difL); - } + transformed->L[y][x] = CLIP(original->L[y][x] + difL * affsob); float difa, difb; difa = rsv->a[loy - begy][lox - begx] - original->a[y][x]; difb = rsv->b[loy - begy][lox - begx] - original->b[y][x]; - // difa *= factorx * (100.f + realstrch * falu * falL) / 100.f; - // difb *= factorx * (100.f + realstrch * falu * falL) / 100.f; difa *= factorx * (100.f + realstrchdE) / 100.f; difb *= factorx * (100.f + realstrchdE) / 100.f; - - // difa *= kch * fach; - // difb *= kch * fach; - - if (deltaso[loy - begy][lox - begx] == 0.f) { - transformed->a[y][x] = original->a[y][x]; //rsv->a[loy - begy][lox - begx]; - transformed->b[y][x] = original->b[y][x]; //rsv->b[loy - begy][lox - begx]; - } else { - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - } + transformed->a[y][x] = CLIPC(original->a[y][x] + difa * affsob); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb * affsob); break; @@ -3529,16 +3566,7 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, difL = rsv->L[loy - begy][lox - begx] - original->L[y][x]; difL *= (100.f + realstrdE) / 100.f; - // difL *= kch * fach; - - if (deltaso[loy - begy][lox - begx] == 0.f) { - // printf ("0"); - transformed->L[y][x] = original->L[y][x]; //rsv->L[loy - begy][lox - begx]; - } else { - transformed->L[y][x] = CLIP(original->L[y][x] + difL); - } - - // transformed->L[y][x] = original->L[y][x] + difL; + transformed->L[y][x] = CLIP(original->L[y][x] + difL * affsob); float difa, difb; difa = rsv->a[loy - begy][lox - begx] - original->a[y][x]; @@ -3546,18 +3574,8 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, difa *= (100.f + realstrchdE) / 100.f; difb *= (100.f + realstrchdE) / 100.f; - // difa *= kch * fach; - // difb *= kch * fach; - - if (deltaso[loy - begy][lox - begx] == 0.f) { - // printf ("0"); - transformed->a[y][x] = original->a[y][x]; //rsv->a[loy - begy][lox - begx]; - transformed->b[y][x] = original->b[y][x]; //rsv->b[loy - begy][lox - begx]; - } else { - // printf ("1"); - transformed->a[y][x] = CLIPC(original->a[y][x] + difa); - transformed->b[y][x] = CLIPC(original->b[y][x] + difb); - } + transformed->a[y][x] = CLIPC(original->a[y][x] + difa * affsob); + transformed->b[y][x] = CLIPC(original->b[y][x] + difb * affsob); } } @@ -5018,7 +5036,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o LabImage *bufreserv = nullptr; LabImage *bufexclu = nullptr; float *origBuffer = nullptr; - + float meansob = 0.f; int bfh = int (lp.ly + lp.lyT) + del; //bfw bfh real size of square zone int bfw = int (lp.lx + lp.lxL) + del; int begy = lp.yc - lp.lyT; @@ -5096,18 +5114,52 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o tmpsob = new LabImage(bfw, bfh); deltasobelL = new LabImage(bfw, bfh); SobelCannyLuma(tmpsob->L, bufsob->L, bfw, bfh, radiussob); + array2D ble(bfw, bfh); + array2D guid(bfw, bfh); #ifdef _OPENMP #pragma omp parallel for #endif - for (int ir = 0; ir < bfh; ir++) //fill with 0 + for (int ir = 0; ir < bfh; ir++) for (int jr = 0; jr < bfw; jr++) { - deltasobelL->L[ir][jr] = 1.f; + ble[ir][jr] = tmpsob->L[ir][jr] / 32768.f; + guid[ir][jr] = bufsob->L[ir][jr] / 32768.f; } + float blur = 25 / sk * (10.f + 1.2f * lp.struexp); - //then restore non modified area + rtengine::guidedFilter(guid, ble, ble, blur, 0.001, multiThread); +#ifdef _OPENMP + #pragma omp parallel for +#endif + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + deltasobelL->L[ir][jr] = ble[ir][jr] * 32768.f; + } + + float sombel = 0.f; +// float stdvsobel = 0.f; + int ncsobel = 0; +// int ncstdv = 0.f; + float maxsob = -1.f; + float minsob = 100000.f; + + for (int ir = 0; ir < bfh; ir++) + for (int jr = 0; jr < bfw; jr++) { + sombel += deltasobelL->L[ir][jr]; + ncsobel++; + + if (deltasobelL->L[ir][jr] > maxsob) { + maxsob = deltasobelL->L[ir][jr]; + } + + if (deltasobelL->L[ir][jr] < minsob) { + minsob = deltasobelL->L[ir][jr]; + } + } + + meansob = sombel / ncsobel; #ifdef _OPENMP #pragma omp parallel for @@ -5143,7 +5195,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bufchro[ir][jr] = rch ; } - Exclude_Local(1, deltasobelL->L, buflight, bufchro, hueref, chromaref, lumaref, lp, original, transformed, bufreserv, reserved, cx, cy, sk); + Exclude_Local(1, deltasobelL->L, buflight, bufchro, hueref, chromaref, lumaref, sobelref, meansob, lp, original, transformed, bufreserv, reserved, cx, cy, sk); delete deltasobelL; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 3b01efa0d..8400fa5b6 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -648,6 +648,7 @@ enum ProcEventCode { EvLocallabEnaExpMask = 618, Evlocallabblurcolde = 619, Evlocallabinversex = 620, + Evlocallabstructexlu = 621, NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 317c2df06..cc8faafa5 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2342,6 +2342,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : shape("ELI"), spotMethod("norm"), sensiexclu(12), + structexclu(0), struc(4), shapeMethod("IND"), locX(250), @@ -2485,6 +2486,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && shape == other.shape && spotMethod == other.spotMethod && sensiexclu == other.sensiexclu + && structexclu == other.structexclu && struc == other.struc && shapeMethod == other.shapeMethod && locX == other.locX @@ -3581,6 +3583,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shape, "Locallab", "Shape_" + std::to_string(i), spot.shape, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).spotMethod, "Locallab", "SpotMethod_" + std::to_string(i), spot.spotMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensiexclu, "Locallab", "SensiExclu_" + std::to_string(i), spot.sensiexclu, keyFile); + saveToKeyfile(!pedited || pedited->locallab.spots.at(i).structexclu, "Locallab", "StructExclu_" + std::to_string(i), spot.structexclu, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).struc, "Locallab", "Struc_" + std::to_string(i), spot.struc, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).shapeMethod, "Locallab", "ShapeMethod_" + std::to_string(i), spot.shapeMethod, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).locX, "Locallab", "LocX_" + std::to_string(i), spot.locX, keyFile); @@ -4810,6 +4813,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "SpotMethod_" + std::to_string(i), pedited, spot.spotMethod, spotEdited.spotMethod); assignFromKeyfile(keyFile, "Locallab", "ShapeMethod_" + std::to_string(i), pedited, spot.shapeMethod, spotEdited.shapeMethod); assignFromKeyfile(keyFile, "Locallab", "SensiExclu_" + std::to_string(i), pedited, spot.sensiexclu, spotEdited.sensiexclu); + assignFromKeyfile(keyFile, "Locallab", "StructExclu_" + std::to_string(i), pedited, spot.structexclu, spotEdited.structexclu); assignFromKeyfile(keyFile, "Locallab", "Struc_" + std::to_string(i), pedited, spot.struc, spotEdited.struc); assignFromKeyfile(keyFile, "Locallab", "LocX_" + std::to_string(i), pedited, spot.locX, spotEdited.locX); assignFromKeyfile(keyFile, "Locallab", "LocXL_" + std::to_string(i), pedited, spot.locXL, spotEdited.locXL); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 0c8eefbc1..892560582 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -942,6 +942,7 @@ struct LocallabParams { Glib::ustring shape; // ELI, RECT Glib::ustring spotMethod; // norm, exc int sensiexclu; + int structexclu; int struc; Glib::ustring shapeMethod; // IND, SYM, INDSL, SYMSL int locX; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index a8d4c46e2..0e1a0ba8d 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -647,7 +647,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, // EvLocallabEnaColorMask LUMINANCECURVE, // EvLocallabEnaExpMask LUMINANCECURVE, // Evlocallabblurcolde - LUMINANCECURVE // Evlocallabinversex + LUMINANCECURVE, // Evlocallabinversex + LUMINANCECURVE // Evlocallabstructexclu }; diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index f6f9d8154..d6de673a4 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -46,6 +46,8 @@ ControlSpotPanel::ControlSpotPanel(): qualityMethod_(Gtk::manage(new MyComboBoxText())), sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))), + structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))), + struc_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRES"), 1, 12, 1, 4))), locX_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH"), 0, 2250, 1, 250))), locXL_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH_L"), 0, 2250, 1, 250))), @@ -165,7 +167,9 @@ ControlSpotPanel::ControlSpotPanel(): ToolParamBlock* const excluBox = Gtk::manage(new ToolParamBlock()); sensiexclu_->set_tooltip_text(M("TP_LOCALLAB_SENSIEXCLU_TOOLTIP")); sensiexclu_->setAdjusterListener(this); + structexclu_->setAdjusterListener(this); excluBox->pack_start(*sensiexclu_); + excluBox->pack_start(*structexclu_); // excluBox->pack_start(*struc_); // Uncomment this line to use the struc_ adjuster excluFrame->add(*excluBox); pack_start(*excluFrame); @@ -417,6 +421,7 @@ void ControlSpotPanel::load_ControlSpot_param() shape_->set_active(row[spots_.shape]); spotMethod_->set_active(row[spots_.spotMethod]); sensiexclu_->setValue(static_cast(row[spots_.sensiexclu])); + structexclu_->setValue(static_cast(row[spots_.structexclu])); struc_->setValue(static_cast(row[spots_.struc])); shapeMethod_->set_active(row[spots_.shapeMethod]); locX_->setValue(static_cast(row[spots_.locX])); @@ -705,6 +710,14 @@ void ControlSpotPanel::adjusterChanged(Adjuster* a, double newval) } } + if (a == structexclu_) { + row[spots_.structexclu] = (int) structexclu_->getValue(); + + if (listener) { + listener->panelChanged(Evlocallabstructexlu, structexclu_->getTextValue()); + } + } + if (a == struc_) { row[spots_.struc] = (int) struc_->getValue(); @@ -840,6 +853,7 @@ void ControlSpotPanel::disableParamlistener(bool cond) shapeconn_.block(cond); spotMethodconn_.block(cond); sensiexclu_->block(cond); + structexclu_->block(cond); struc_->block(cond); shapeMethodconn_.block(cond); locX_->block(cond); @@ -862,6 +876,7 @@ void ControlSpotPanel::setParamEditable(bool cond) shape_->set_sensitive(cond); spotMethod_->set_sensitive(cond); sensiexclu_->set_sensitive(cond); + structexclu_->set_sensitive(cond); struc_->set_sensitive(cond); shapeMethod_->set_sensitive(cond); locX_->set_sensitive(cond); @@ -1537,6 +1552,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(int id) r->shape = row[spots_.shape]; r->spotMethod = row[spots_.spotMethod]; r->sensiexclu = row[spots_.sensiexclu]; + r->structexclu = row[spots_.structexclu]; r->struc = row[spots_.struc]; r->shapeMethod = row[spots_.shapeMethod]; r->locX = row[spots_.locX]; @@ -1655,6 +1671,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot) row[spots_.shape] = newSpot->shape; row[spots_.spotMethod] = newSpot->spotMethod; row[spots_.sensiexclu] = newSpot->sensiexclu; + row[spots_.structexclu] = newSpot->structexclu; row[spots_.struc] = newSpot->struc; row[spots_.shapeMethod] = newSpot->shapeMethod; row[spots_.locX] = newSpot->locX; @@ -1696,6 +1713,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot) row[spots_.shape] = spot->shape; row[spots_.spotMethod] = spot->spotMethod; row[spots_.sensiexclu] = spot->sensiexclu; + row[spots_.structexclu] = spot->structexclu; row[spots_.struc] = spot->struc; row[spots_.shapeMethod] = spot->shapeMethod; row[spots_.locX] = spot->locX; @@ -1783,6 +1801,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates() se->shape = shape_->get_active_text() != M("GENERAL_UNCHANGED"); se->spotMethod = spotMethod_->get_active_text() != M("GENERAL_UNCHANGED"); se->sensiexclu = sensiexclu_->getEditedState(); + se->structexclu = structexclu_->getEditedState(); se->struc = struc_->getEditedState(); se->shapeMethod = shapeMethod_->get_active_text() != M("GENERAL_UNCHANGED"); se->locX = locX_->getEditedState(); @@ -1839,6 +1858,7 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) } sensiexclu_->setEditedState(se->sensiexclu ? Edited : UnEdited); + structexclu_->setEditedState(se->structexclu ? Edited : UnEdited); struc_->setEditedState(se->struc ? Edited : UnEdited); if (!se->shapeMethod) { @@ -1889,6 +1909,7 @@ void ControlSpotPanel::setDefaults(const ProcParams * defParams, const ParamsEdi } sensiexclu_->setDefault((double)defSpot->sensiexclu); + structexclu_->setDefault((double)defSpot->structexclu); struc_->setDefault((double)defSpot->struc); locX_->setDefault((double)defSpot->locX); locXL_->setDefault((double)defSpot->locXL); @@ -1904,6 +1925,7 @@ void ControlSpotPanel::setDefaults(const ProcParams * defParams, const ParamsEdi // Set default edited states for adjusters if (!pedited) { sensiexclu_->setDefaultEditedState(Irrelevant); + structexclu_->setDefaultEditedState(Irrelevant); struc_->setDefaultEditedState(Irrelevant); locX_->setDefaultEditedState(Irrelevant); locXL_->setDefaultEditedState(Irrelevant); @@ -1923,6 +1945,7 @@ void ControlSpotPanel::setDefaults(const ProcParams * defParams, const ParamsEdi } sensiexclu_->setDefaultEditedState(defSpotState->sensiexclu ? Edited : UnEdited); + structexclu_->setDefaultEditedState(defSpotState->structexclu ? Edited : UnEdited); struc_->setDefaultEditedState(defSpotState->struc ? Edited : UnEdited); locX_->setDefaultEditedState(defSpotState->locX ? Edited : UnEdited); locXL_->setDefaultEditedState(defSpotState->locXL ? Edited : UnEdited); @@ -1943,6 +1966,7 @@ void ControlSpotPanel::setBatchMode(bool batchMode) // Set batch mode for adjusters sensiexclu_->showEditedCB(); + structexclu_->showEditedCB(); struc_->showEditedCB(); locX_->showEditedCB(); locXL_->showEditedCB(); @@ -1975,6 +1999,7 @@ ControlSpotPanel::ControlSpots::ControlSpots() add(shape); add(spotMethod); add(sensiexclu); + add(structexclu); add(struc); add(shapeMethod); add(locX); diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 4a278c221..f52bd27aa 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -48,6 +48,7 @@ public: int shape; // 0 = Ellipse, 1 = Rectangle int spotMethod; // 0 = Normal, 1 = Excluding int sensiexclu; + int structexclu; int struc; int shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders) int locX; @@ -74,6 +75,7 @@ public: bool shape; bool spotMethod; bool sensiexclu; + bool structexclu; bool struc; bool shapeMethod; bool locX; @@ -258,6 +260,7 @@ private: Gtk::TreeModelColumn shape; // 0 = Ellipse, 1 = Rectangle Gtk::TreeModelColumn spotMethod; // 0 = Normal, 1 = Excluding Gtk::TreeModelColumn sensiexclu; + Gtk::TreeModelColumn structexclu; Gtk::TreeModelColumn struc; Gtk::TreeModelColumn shapeMethod; // 0 = Independent (mouse), 1 = Symmetrical (mouse), 2 = Independent (mouse + sliders), 3 = Symmetrical (mouse + sliders) Gtk::TreeModelColumn locX; @@ -314,6 +317,7 @@ private: sigc::connection qualityMethodconn_; Adjuster* const sensiexclu_; + Adjuster* const structexclu_; Adjuster* const struc_; Adjuster* const locX_; Adjuster* const locXL_; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index ebc2c2f56..a1a401156 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -1111,6 +1111,7 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited) } r->sensiexclu = pp->locallab.spots.at(i).sensiexclu; + r->structexclu = pp->locallab.spots.at(i).structexclu; r->struc = pp->locallab.spots.at(i).struc; if (pp->locallab.spots.at(i).shapeMethod == "IND") { @@ -1212,6 +1213,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } r->sensiexclu = newSpot->sensiexclu; + r->structexclu = newSpot->structexclu; r->struc = newSpot->struc; if (newSpot->shapeMethod == "IND") { @@ -1398,6 +1400,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } r->sensiexclu = newSpot->sensiexclu; + r->structexclu = newSpot->structexclu; r->struc = newSpot->struc; if (newSpot->shapeMethod == "IND") { @@ -1486,6 +1489,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) } pp->locallab.spots.at(pp->locallab.selspot).sensiexclu = r->sensiexclu; + pp->locallab.spots.at(pp->locallab.selspot).structexclu = r->structexclu; pp->locallab.spots.at(pp->locallab.selspot).struc = r->struc; if (r->shapeMethod == 0) { @@ -1671,6 +1675,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pe->locallab.spots.at(pp->locallab.selspot).shape = pe->locallab.spots.at(pp->locallab.selspot).shape || se->shape; pe->locallab.spots.at(pp->locallab.selspot).spotMethod = pe->locallab.spots.at(pp->locallab.selspot).spotMethod || se->spotMethod; pe->locallab.spots.at(pp->locallab.selspot).sensiexclu = pe->locallab.spots.at(pp->locallab.selspot).sensiexclu || se->sensiexclu; + pe->locallab.spots.at(pp->locallab.selspot).structexclu = pe->locallab.spots.at(pp->locallab.selspot).structexclu || se->structexclu; pe->locallab.spots.at(pp->locallab.selspot).struc = pe->locallab.spots.at(pp->locallab.selspot).struc || se->struc; pe->locallab.spots.at(pp->locallab.selspot).shapeMethod = pe->locallab.spots.at(pp->locallab.selspot).shapeMethod || se->shapeMethod; pe->locallab.spots.at(pp->locallab.selspot).locX = pe->locallab.spots.at(pp->locallab.selspot).locX || se->locX; @@ -1819,6 +1824,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited) pedited->locallab.spots.at(pp->locallab.selspot).shape = pedited->locallab.spots.at(pp->locallab.selspot).shape || se->shape; pedited->locallab.spots.at(pp->locallab.selspot).spotMethod = pedited->locallab.spots.at(pp->locallab.selspot).spotMethod || se->spotMethod; pedited->locallab.spots.at(pp->locallab.selspot).sensiexclu = pedited->locallab.spots.at(pp->locallab.selspot).sensiexclu || se->sensiexclu; + pedited->locallab.spots.at(pp->locallab.selspot).structexclu = pedited->locallab.spots.at(pp->locallab.selspot).structexclu || se->structexclu; pedited->locallab.spots.at(pp->locallab.selspot).struc = pedited->locallab.spots.at(pp->locallab.selspot).struc || se->struc; pedited->locallab.spots.at(pp->locallab.selspot).shapeMethod = pedited->locallab.spots.at(pp->locallab.selspot).shapeMethod || se->shapeMethod; pedited->locallab.spots.at(pp->locallab.selspot).locX = pedited->locallab.spots.at(pp->locallab.selspot).locX || se->locX; @@ -3863,6 +3869,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con se->shape = spotState->shape; se->spotMethod = spotState->spotMethod; se->sensiexclu = spotState->sensiexclu; + se->structexclu = spotState->structexclu; se->struc = spotState->struc; se->shapeMethod = spotState->shapeMethod; se->locX = spotState->locX; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 70bfe534a..143e0bc6c 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -928,6 +928,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).shape = locallab.spots.at(j).shape && pSpot.shape == otherSpot.shape; locallab.spots.at(j).spotMethod = locallab.spots.at(j).spotMethod && pSpot.spotMethod == otherSpot.spotMethod; locallab.spots.at(j).sensiexclu = locallab.spots.at(j).sensiexclu && pSpot.sensiexclu == otherSpot.sensiexclu; + locallab.spots.at(j).structexclu = locallab.spots.at(j).structexclu && pSpot.structexclu == otherSpot.structexclu; locallab.spots.at(j).struc = locallab.spots.at(j).struc && pSpot.struc == otherSpot.struc; locallab.spots.at(j).shapeMethod = locallab.spots.at(j).shapeMethod && pSpot.shapeMethod == otherSpot.shapeMethod; locallab.spots.at(j).locX = locallab.spots.at(j).locX && pSpot.locX == otherSpot.locX; @@ -2506,6 +2507,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng toEdit.locallab.spots.at(i).sensiexclu = mods.locallab.spots.at(i).sensiexclu; } + if (locallab.spots.at(i).structexclu) { + toEdit.locallab.spots.at(i).structexclu = mods.locallab.spots.at(i).structexclu; + } + if (locallab.spots.at(i).struc) { toEdit.locallab.spots.at(i).struc = mods.locallab.spots.at(i).struc; } @@ -3935,6 +3940,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : shape(v), spotMethod(v), sensiexclu(v), + structexclu(v), struc(v), shapeMethod(v), locX(v), @@ -4075,6 +4081,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) shape = v; spotMethod = v; sensiexclu = v; + structexclu = v; struc = v; shapeMethod = v; locX = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 4b3d2d6ef..3a94afdb6 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -467,6 +467,7 @@ public: bool shape; bool spotMethod; bool sensiexclu; + bool structexclu; bool struc; bool shapeMethod; bool locX;