From b0bba7881a0f175df954b0aa04ba317d136d394e Mon Sep 17 00:00:00 2001 From: Desmis Date: Sat, 1 Feb 2020 13:07:41 +0100 Subject: [PATCH] Added edge performance daubechies wavelet in settings --- rtdata/languages/default | 2 ++ rtengine/iplocallab.cc | 58 ++++++++++++++++++++++-------------- rtengine/procevents.h | 2 ++ rtengine/procparams.cc | 4 +++ rtengine/procparams.h | 1 + rtengine/refreshmap.cc | 3 +- rtgui/controlspotpanel.cc | 62 +++++++++++++++++++++++++++++++++++++++ rtgui/controlspotpanel.h | 8 ++++- rtgui/locallab.cc | 53 ++++++++++++++++++++++++++++++++- rtgui/paramsedited.cc | 8 +++++ rtgui/paramsedited.h | 1 + 11 files changed, 177 insertions(+), 25 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 6bd26397d..80fb87cf4 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1144,6 +1144,7 @@ HISTORY_MSG_906;Local - Contrast Wavelet ES sensitivity HISTORY_MSG_907;Local - Contrast Wavelet ES amplification HISTORY_MSG_908;Local - Contrast Wavelet ES neighboring HISTORY_MSG_909;Local - Contrast Wavelet ES show +HISTORY_MSG_910;Local - Wavelet Edge performance HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction @@ -3030,6 +3031,7 @@ TP_WAVELET_CURVEEDITOR_HH;HH TP_WAVELET_CURVEEDITOR_HH_TOOLTIP;Modifies the residual image's hue as a function of hue. TP_WAVELET_DALL;All directions TP_WAVELET_DAUB;Edge performance +TP_WAVELET_DAUBLOCAL;Wavelet Edge performance TP_WAVELET_DAUB2;D2 - low TP_WAVELET_DAUB4;D4 - standard TP_WAVELET_DAUB6;D6 - standard plus diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index 94c10d6aa..773946f4d 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -444,6 +444,7 @@ struct local_params { bool wavgradl; bool edgwena; bool lip3; + int daubLen; }; @@ -757,6 +758,20 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.neiwmet = 1; } + + if(locallab.spots.at(sp).wavMethod == "D2") { + lp.daubLen = 4; + } else if(locallab.spots.at(sp).wavMethod == "D4") { + lp.daubLen = 6; + } else if(locallab.spots.at(sp).wavMethod == "D6") { + lp.daubLen = 8; + } else if(locallab.spots.at(sp).wavMethod == "D10") { + lp.daubLen = 12; + } else if(locallab.spots.at(sp).wavMethod == "D14"){ + lp.daubLen = 16; + } + + lp.edgwena = locallab.spots.at(sp).wavedg; lp.opacol = 0.01f * locallab.spots.at(sp).opacol; @@ -7486,7 +7501,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float const LocwavCurve & locedgwavCurve, bool & locedgwavutili, float sigm, float offs, int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena, bool compreena, float compress, float thres) { - wavelet_decomposition *wdspot = new wavelet_decomposition(tmp[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); + wavelet_decomposition *wdspot = new wavelet_decomposition(tmp[0], bfw, bfh, maxlvl, 1, sk, numThreads, lp.daubLen); //first decomposition for compress dynamic range positive values and other process if (wdspot->memoryAllocationFailed) { @@ -8243,7 +8258,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float delete wdspot; if (wavcurvecon && (chromalev != 1.f) && levelena) { // a and b if need ) {//contrast by levels for chroma a and b - wdspota = new wavelet_decomposition(tmpa[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); + wdspota = new wavelet_decomposition(tmpa[0], bfw, bfh, maxlvl, 1, sk, numThreads, lp.daubLen); if (wdspota->memoryAllocationFailed) { return; @@ -8253,7 +8268,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float wdspota->reconstruct(tmpa[0], 1.f); delete wdspota; - wdspotb = new wavelet_decomposition(tmpb[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); + wdspotb = new wavelet_decomposition(tmpb[0], bfw, bfh, maxlvl, 1, sk, numThreads, lp.daubLen); if (wdspotb->memoryAllocationFailed) { return; @@ -8268,7 +8283,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float if (wavcurvelev && radlevblur > 0.f && blurena) {//chroma blur if need if (!blurlc) { // a - wdspota = new wavelet_decomposition(tmpa[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); + wdspota = new wavelet_decomposition(tmpa[0], bfw, bfh, maxlvl, 1, sk, numThreads, lp.daubLen); if (wdspota->memoryAllocationFailed) { return; @@ -8322,7 +8337,7 @@ void ImProcFunctions::wavcontrast4(struct local_params& lp, float ** tmp, float //b - wdspotb = new wavelet_decomposition(tmpb[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6); + wdspotb = new wavelet_decomposition(tmpb[0], bfw, bfh, maxlvl, 1, sk, numThreads, lp.daubLen); if (wdspotb->memoryAllocationFailed) { return; @@ -8704,14 +8719,14 @@ void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, f tmp1.b[ir][jr] = original->b[ir][jr]; } - int DaubLen = 6; + // int DaubLen = 6; int levwavL = levred; int skip = 1; - wavelet_decomposition Ldecomp(tmp1.L[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition adecomp(tmp1.a[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition bdecomp(tmp1.b[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, DaubLen); + wavelet_decomposition Ldecomp(tmp1.L[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, lp.daubLen); + wavelet_decomposition adecomp(tmp1.a[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, lp.daubLen); + wavelet_decomposition bdecomp(tmp1.b[0], tmp1.W, tmp1.H, levwavL, 1, skip, numThreads, lp.daubLen); float madL[8][3]; int edge = 2; @@ -9266,14 +9281,13 @@ void ImProcFunctions::DeNoise(int call, int del, float * slidL, float * slida, f } - int DaubLen = 6; + // int DaubLen = 6; int levwavL = levred; int skip = 1; - wavelet_decomposition Ldecomp(bufwv.L[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition adecomp(bufwv.a[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); - wavelet_decomposition bdecomp(bufwv.b[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, DaubLen); - + wavelet_decomposition Ldecomp(bufwv.L[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, lp.daubLen); + wavelet_decomposition adecomp(bufwv.a[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, lp.daubLen); + wavelet_decomposition bdecomp(bufwv.b[0], bufwv.W, bufwv.H, levwavL, 1, skip, numThreads, lp.daubLen); float madL[8][3]; int edge = 2; @@ -9824,7 +9838,7 @@ void rgbtone(float & maxval, float & medval, float & minval, LUTf & lutToneCurve medval = minval + ((maxval - minval) * (medvalold - minvalold) / (maxvalold - minvalold)); } -void clarimerge(float &mL, float &mC, bool &exec, LabImage *tmpresid, int wavelet_level, int sk, bool numThreads) +void clarimerge(struct local_params& lp, float &mL, float &mC, bool &exec, LabImage *tmpresid, int wavelet_level, int sk, bool numThreads) { if (mL != 0.f && mC == 0.f) { mC = 0.0001f; @@ -9842,7 +9856,7 @@ void clarimerge(float &mL, float &mC, bool &exec, LabImage *tmpresid, int wavele if (mL != 0.f) { - wavelet_decomposition *wdspotresid = new wavelet_decomposition(tmpresid->L[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, 6); + wavelet_decomposition *wdspotresid = new wavelet_decomposition(tmpresid->L[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, lp.daubLen); if (wdspotresid->memoryAllocationFailed) { return; @@ -9879,7 +9893,7 @@ void clarimerge(float &mL, float &mC, bool &exec, LabImage *tmpresid, int wavele if (mC != 0.f) { - wavelet_decomposition *wdspotresida = new wavelet_decomposition(tmpresid->a[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, 6); + wavelet_decomposition *wdspotresida = new wavelet_decomposition(tmpresid->a[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, lp.daubLen); if (wdspotresida->memoryAllocationFailed) { return; @@ -9915,7 +9929,7 @@ void clarimerge(float &mL, float &mC, bool &exec, LabImage *tmpresid, int wavele if (mC != 0.f) { - wavelet_decomposition *wdspotresidb = new wavelet_decomposition(tmpresid->b[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, 6); + wavelet_decomposition *wdspotresidb = new wavelet_decomposition(tmpresid->b[0], tmpresid->W, tmpresid->H, wavelet_level, 1, sk, numThreads, lp.daubLen); if (wdspotresidb->memoryAllocationFailed) { return; @@ -12345,7 +12359,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o bool origlc = params->locallab.spots.at(sp).origlc; if (origlc) {//merge only with original - clarimerge(mL, mC, exec, tmpresid.get(), wavelet_level, sk, numThreads); + clarimerge(lp, mL, mC, exec, tmpresid.get(), wavelet_level, sk, numThreads); } int maxlvl = wavelet_level; @@ -12378,7 +12392,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (satur != 0.f || radblur > 0.f) {//blur residual a and satur - wavelet_decomposition *wdspota = new wavelet_decomposition(tmp1->a[0], tmp1->W, tmp1->H, wavelet_level, 1, sk, numThreads, 6); + wavelet_decomposition *wdspota = new wavelet_decomposition(tmp1->a[0], tmp1->W, tmp1->H, wavelet_level, 1, sk, numThreads, lp.daubLen); if (wdspota->memoryAllocationFailed) { return; @@ -12432,7 +12446,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o wdspota->reconstruct(tmp1->a[0], 1.f); delete wdspota; - wavelet_decomposition *wdspotb = new wavelet_decomposition(tmp1->b[0], tmp1->W, tmp1->H, wavelet_level, 1, sk, numThreads, 6); + wavelet_decomposition *wdspotb = new wavelet_decomposition(tmp1->b[0], tmp1->W, tmp1->H, wavelet_level, 1, sk, numThreads, lp.daubLen); if (wdspotb->memoryAllocationFailed) { return; @@ -12505,7 +12519,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o } } - clarimerge(mL, mC, exec, tmpresid.get(), wavelet_level, sk, numThreads); + clarimerge(lp, mL, mC, exec, tmpresid.get(), wavelet_level, sk, numThreads); } float thr = 0.001f; diff --git a/rtengine/procevents.h b/rtengine/procevents.h index 65d0518d3..7db518524 100644 --- a/rtengine/procevents.h +++ b/rtengine/procevents.h @@ -935,6 +935,8 @@ enum ProcEventCode { Evlocallabbasew = 906, EvlocallablocalneiMethod = 907, Evlocallabwaveshow = 908, + EvLocallabSpotwavMethod = 909, + NUMOFEVENTS }; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f663fc775..9b57d10ad 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2419,6 +2419,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : isvisible(true), shape("ELI"), spotMethod("norm"), + wavMethod("D4"), // mergeMethod("none"), sensiexclu(12), structexclu(0), @@ -2858,6 +2859,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const && isvisible == other.isvisible && shape == other.shape && spotMethod == other.spotMethod + && wavMethod == other.wavMethod // && mergeMethod == other.mergeMethod && sensiexclu == other.sensiexclu && structexclu == other.structexclu @@ -4279,6 +4281,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo saveToKeyfile(!pedited || pedited->locallab.spots.at(i).isvisible, "Locallab", "Isvisible_" + std::to_string(i), spot.isvisible, keyFile); 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).wavMethod, "Locallab", "WavMethod_" + std::to_string(i), spot.wavMethod, keyFile); // saveToKeyfile(!pedited || pedited->locallab.spots.at(i).mergeMethod, "Locallab", "MergeMethod_" + std::to_string(i), spot.mergeMethod, 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); @@ -5814,6 +5817,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Locallab", "Isvisible_" + std::to_string(i), pedited, spot.isvisible, spotEdited.isvisible); assignFromKeyfile(keyFile, "Locallab", "Shape_" + std::to_string(i), pedited, spot.shape, spotEdited.shape); assignFromKeyfile(keyFile, "Locallab", "SpotMethod_" + std::to_string(i), pedited, spot.spotMethod, spotEdited.spotMethod); + assignFromKeyfile(keyFile, "Locallab", "wavMethod_" + std::to_string(i), pedited, spot.wavMethod, spotEdited.wavMethod); // assignFromKeyfile(keyFile, "Locallab", "MergeMethod_" + std::to_string(i), pedited, spot.mergeMethod, spotEdited.mergeMethod); 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); diff --git a/rtengine/procparams.h b/rtengine/procparams.h index 105a876ed..815c8c18b 100644 --- a/rtengine/procparams.h +++ b/rtengine/procparams.h @@ -962,6 +962,7 @@ struct LocallabParams { bool isvisible; Glib::ustring shape; // ELI, RECT Glib::ustring spotMethod; // norm, exc + Glib::ustring wavMethod; // Glib::ustring mergeMethod; // none, short, orig int sensiexclu; int structexclu; diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc index 2ca7daae4..aae18e0e1 100644 --- a/rtengine/refreshmap.cc +++ b/rtengine/refreshmap.cc @@ -938,7 +938,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = { LUMINANCECURVE, //Evlocallabedgw LUMINANCECURVE, //Evlocallabbasew LUMINANCECURVE, //EvlocallablocalneiMethod - LUMINANCECURVE //Evlocallabwaveshow + LUMINANCECURVE, //Evlocallabwaveshow + LUMINANCECURVE // EvLocallabSpotwavMethod }; diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 5ec975fc2..163ecbbf5 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -52,6 +52,7 @@ ControlSpotPanel::ControlSpotPanel(): shapeMethod_(Gtk::manage(new MyComboBoxText())), qualityMethod_(Gtk::manage(new MyComboBoxText())), complexMethod_(Gtk::manage(new MyComboBoxText())), + wavMethod_(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))), @@ -297,6 +298,30 @@ ControlSpotPanel::ControlSpotPanel(): *this, &ControlSpotPanel::complexMethodChanged)); ctboxcomplexmethod->pack_start(*complexMethod_); + + Gtk::HBox* const ctboxwavmethod = Gtk::manage(new Gtk::HBox()); + Gtk::Label* const labelwavmethod = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DAUBLOCAL") + ":")); + ctboxwavmethod->pack_start(*labelwavmethod, Gtk::PACK_SHRINK, 4); + + if (showtooltip) { + ctboxwavmethod->set_tooltip_markup(M("TP_LOCALLAB_WAVMETHOD_TOOLTIP")); + } + + + + wavMethod_->append(M("TP_WAVELET_DAUB2")); + wavMethod_->append(M("TP_WAVELET_DAUB4")); + wavMethod_->append(M("TP_WAVELET_DAUB6")); + wavMethod_->append(M("TP_WAVELET_DAUB10")); + wavMethod_->append(M("TP_WAVELET_DAUB14")); + wavMethod_->set_active(1); + wavMethodconn_ = wavMethod_->signal_changed().connect( + sigc::mem_fun( + *this, &ControlSpotPanel::wavMethodChanged)); + ctboxwavmethod->pack_start(*wavMethod_); +// pack_start(*ctboxwavmethod); + + Gtk::Frame* const transitFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TRANSIT"))); transitFrame->set_label_align(0.025, 0.5); @@ -467,6 +492,7 @@ ControlSpotPanel::ControlSpotPanel(): if (showtooltip) { complexMethod_->set_tooltip_markup(M("TP_LOCALLAB_COMPLEX_TOOLTIP")); } + pack_start(*ctboxwavmethod); show_all(); @@ -786,6 +812,7 @@ void ControlSpotPanel::load_ControlSpot_param() deltae_->set_active(row[spots_.deltae]); shortc_->set_active(row[spots_.shortc]); savrest_->set_active(row[spots_.savrest]); + wavMethod_->set_active(row[spots_.wavMethod]); } void ControlSpotPanel::controlspotChanged() @@ -981,6 +1008,29 @@ void ControlSpotPanel::qualityMethodChanged() } } +void ControlSpotPanel::wavMethodChanged() +{ + // printf("qualityMethodChanged\n"); + + // Get selected control spot + const auto s = treeview_->get_selection(); + + if (!s->count_selected_rows()) { + return; + } + + const auto iter = s->get_selected(); + Gtk::TreeModel::Row row = *iter; + + row[spots_.wavMethod] = wavMethod_->get_active_row_number(); + + // Raise event + if (listener) { + listener->panelChanged(EvLocallabSpotwavMethod, wavMethod_->get_active_text()); + } +} + + void ControlSpotPanel::complexMethodChanged() { // printf("qualityMethodChanged\n"); @@ -1564,6 +1614,7 @@ void ControlSpotPanel::disableParamlistener(bool cond) deltaeConn_.block(cond); shortcConn_.block(cond); savrestConn_.block(cond); + wavMethodconn_.block(cond); } void ControlSpotPanel::setParamEditable(bool cond) @@ -1603,6 +1654,7 @@ void ControlSpotPanel::setParamEditable(bool cond) deltae_->set_sensitive(cond); shortc_->set_sensitive(cond); savrest_->set_sensitive(cond); + wavMethod_->set_sensitive(cond); } void ControlSpotPanel::addControlSpotCurve(Gtk::TreeModel::Row& row) @@ -2250,6 +2302,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int id) r->deltae = row[spots_.deltae]; r->shortc = row[spots_.shortc]; r->savrest = row[spots_.savrest]; + r->wavMethod = row[spots_.wavMethod]; return r; } @@ -2388,6 +2441,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot) row[spots_.deltae] = newSpot->deltae; row[spots_.shortc] = newSpot->shortc; row[spots_.savrest] = newSpot->savrest; + row[spots_.wavMethod] = newSpot->wavMethod; updateParamVisibility(); disableParamlistener(false); @@ -2445,6 +2499,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot) row[spots_.deltae] = spot->deltae; row[spots_.shortc] = spot->shortc; row[spots_.savrest] = spot->savrest; + row[spots_.wavMethod] = spot->wavMethod; updateControlSpotCurve(row); updateParamVisibility(); @@ -2548,6 +2603,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates() se->deltae = !deltae_->get_inconsistent(); se->shortc = !shortc_->get_inconsistent(); se->savrest = !savrest_->get_inconsistent(); + se->wavMethod = wavMethod_->get_active_text() != M("GENERAL_UNCHANGED"); return se; } @@ -2590,6 +2646,10 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se) spotMethod_->set_active_text(M("GENERAL_UNCHANGED")); } + if (!se->wavMethod) { + wavMethod_->set_active_text(M("GENERAL_UNCHANGED")); + } + /* if (!se->mergeMethod) { mergeMethod_->set_active_text(M("GENERAL_UNCHANGED")); @@ -2774,6 +2834,7 @@ void ControlSpotPanel::setBatchMode(bool batchMode) shapeMethod_->append(M("GENERAL_UNCHANGED")); qualityMethod_->append(M("GENERAL_UNCHANGED")); complexMethod_->append(M("GENERAL_UNCHANGED")); + wavMethod_->append(M("GENERAL_UNCHANGED")); } //----------------------------------------------------------------------------- @@ -2819,6 +2880,7 @@ ControlSpotPanel::ControlSpots::ControlSpots() add(deltae); add(shortc); add(savrest); + add(wavMethod); // add(mergeMethod); } diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h index 895504357..3e32e2409 100644 --- a/rtgui/controlspotpanel.h +++ b/rtgui/controlspotpanel.h @@ -77,6 +77,7 @@ public: bool shortc; bool savrest; int complexMethod; // 0 = Simple, 1 = Moderate, 2 = all + int wavMethod; }; @@ -120,6 +121,7 @@ public: bool shortc; bool savrest; bool complexMethod; + bool wavMethod; }; /** @@ -279,7 +281,8 @@ private: // void mergeMethodChanged(); void qualityMethodChanged(); void complexMethodChanged(); - + void wavMethodChanged(); + void updateParamVisibility(); void adjusterChanged(Adjuster* a, double newval); void adjusterAutoToggled(Adjuster* a, bool newval); @@ -352,6 +355,7 @@ private: Gtk::TreeModelColumn shortc; Gtk::TreeModelColumn savrest; Gtk::TreeModelColumn complexMethod; // 0 = Simple, 1 = mod, 2 = all + Gtk::TreeModelColumn wavMethod; }; class RenameDialog: @@ -400,6 +404,8 @@ private: sigc::connection qualityMethodconn_; MyComboBoxText* const complexMethod_; sigc::connection complexMethodconn_; + MyComboBoxText* const wavMethod_; + sigc::connection wavMethodconn_; Adjuster* const sensiexclu_; Adjuster* const structexclu_; diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index a4daa196e..bca8bfff5 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -4484,7 +4484,19 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit r->shape = 1; } - if (pp->locallab.spots.at(i).spotMethod == "norm") { + if (pp->locallab.spots.at(i).wavMethod == "D2") { + r->wavMethod = 0; + } else if (pp->locallab.spots.at(i).wavMethod == "D4") { + r->wavMethod = 1; + } else if (pp->locallab.spots.at(i).wavMethod == "D6") { + r->wavMethod = 2; + } else if (pp->locallab.spots.at(i).wavMethod == "D10") { + r->wavMethod = 3; + } else if (pp->locallab.spots.at(i).wavMethod == "D14") { + r->wavMethod = 4; + } + + if (pp->locallab.spots.at(i).wavMethod == "norm") { r->spotMethod = 0; } else { r->spotMethod = 1; @@ -4645,6 +4657,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited r->shapeMethod = 3; } + if (newSpot->wavMethod == "D2") { + r->wavMethod = 0; + } else if (newSpot->wavMethod == "D4") { + r->wavMethod = 1; + } else if (newSpot->wavMethod == "D6") { + r->wavMethod = 2; + } else if (newSpot->wavMethod == "D10") { + r->wavMethod = 3; + } else if (newSpot->wavMethod == "D14") { + r->wavMethod = 4; + } + // Calculate spot size and center position according to preview area if (provider && !batchMode) { provider->getImageSize(imW, imH); @@ -4889,6 +4913,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited r->shapeMethod = 0; } + if (newSpot->wavMethod == "D2") { + r->wavMethod = 0; + } else if (newSpot->wavMethod == "D4") { + r->wavMethod = 1; + } else if (newSpot->wavMethod == "D6") { + r->wavMethod = 2; + } else if (newSpot->wavMethod == "D10") { + r->wavMethod = 3; + } else if (newSpot->wavMethod == "D14") { + r->wavMethod = 4; + } + // Calculate spot size and center position according to preview area if (provider && !batchMode) { provider->getImageSize(imW, imH); @@ -5051,6 +5087,18 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "SYMSL"; } + if (r->wavMethod == 0) { + pp->locallab.spots.at(pp->locallab.selspot).wavMethod = "D2"; + } else if (r->wavMethod == 1) { + pp->locallab.spots.at(pp->locallab.selspot).wavMethod = "D4"; + } else if (r->wavMethod == 2) { + pp->locallab.spots.at(pp->locallab.selspot).wavMethod = "D6"; + } else if (r->wavMethod == 3) { + pp->locallab.spots.at(pp->locallab.selspot).wavMethod = "D10"; + } else if (r->wavMethod == 4) { + pp->locallab.spots.at(pp->locallab.selspot).wavMethod = "D14"; + } + pp->locallab.spots.at(pp->locallab.selspot).locX = r->locX; pp->locallab.spots.at(pp->locallab.selspot).locXL = r->locXL; pp->locallab.spots.at(pp->locallab.selspot).locY = r->locY; @@ -5685,6 +5733,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pe->locallab.spots.at(pp->locallab.selspot).isvisible = pe->locallab.spots.at(pp->locallab.selspot).isvisible || se->isvisible; 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).wavMethod = pe->locallab.spots.at(pp->locallab.selspot).wavMethod || se->wavMethod; // pe->locallab.spots.at(pp->locallab.selspot).mergeMethod = pe->locallab.spots.at(pp->locallab.selspot).mergeMethod || se->mergeMethod; 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; @@ -6121,6 +6170,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited pedited->locallab.spots.at(pp->locallab.selspot).isvisible = pedited->locallab.spots.at(pp->locallab.selspot).isvisible || se->isvisible; 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).wavMethod = pedited->locallab.spots.at(pp->locallab.selspot).wavMethod || se->wavMethod; // pedited->locallab.spots.at(pp->locallab.selspot).mergeMethod = pedited->locallab.spots.at(pp->locallab.selspot).mergeMethod || se->mergeMethod; 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; @@ -13101,6 +13151,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con se->isvisible = spotState->isvisible; se->shape = spotState->shape; se->spotMethod = spotState->spotMethod; + se->wavMethod = spotState->wavMethod; // se->mergeMethod = spotState->mergeMethod; se->sensiexclu = spotState->sensiexclu; se->structexclu = spotState->structexclu; diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 38d28fdaf..507767674 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -956,6 +956,7 @@ void ParamsEdited::initFrom(const std::vector& locallab.spots.at(j).isvisible = locallab.spots.at(j).isvisible && pSpot.isvisible == otherSpot.isvisible; 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).wavMethod = locallab.spots.at(j).wavMethod && pSpot.wavMethod == otherSpot.wavMethod; // locallab.spots.at(j).mergeMethod = locallab.spots.at(j).mergeMethod && pSpot.mergeMethod == otherSpot.mergeMethod; 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; @@ -2858,6 +2859,11 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng if (locallab.spots.at(i).spotMethod) { toEdit.locallab.spots.at(i).spotMethod = mods.locallab.spots.at(i).spotMethod; } + + if (locallab.spots.at(i).wavMethod) { + toEdit.locallab.spots.at(i).wavMethod = mods.locallab.spots.at(i).wavMethod; + } + /* if (locallab.spots.at(i).mergeMethod) { toEdit.locallab.spots.at(i).mergeMethod = mods.locallab.spots.at(i).mergeMethod; @@ -5440,6 +5446,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) : isvisible(v), shape(v), spotMethod(v), + wavMethod(v), // mergeMethod(v), sensiexclu(v), structexclu(v), @@ -5862,6 +5869,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v) isvisible = v; shape = v; spotMethod = v; + wavMethod = v; // mergeMethod = v; sensiexclu = v; structexclu = v; diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h index 2f4e766b9..2f8eea083 100644 --- a/rtgui/paramsedited.h +++ b/rtgui/paramsedited.h @@ -389,6 +389,7 @@ public: bool isvisible; bool shape; bool spotMethod; + bool wavMethod; // bool mergeMethod; bool sensiexclu; bool structexclu;