From e234bb92785f2425c79e0d182c8e4451bd933f55 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 23 Sep 2015 11:23:30 +0200 Subject: [PATCH] Batch processing GUI --- rtgui/addsetids.h | 18 ++++++++++-------- rtgui/batchtoolpanelcoord.cc | 25 ++++++++++++++++--------- rtgui/options.cc | 16 +++++++++------- rtgui/paramsedited.cc | 25 +++++++++---------------- rtgui/preferences.cc | 16 +++++++++------- rtgui/retinex.cc | 5 +++-- rtgui/retinex.h | 2 +- 7 files changed, 57 insertions(+), 50 deletions(-) diff --git a/rtgui/addsetids.h b/rtgui/addsetids.h index 5d94ef71f..5db492db3 100644 --- a/rtgui/addsetids.h +++ b/rtgui/addsetids.h @@ -107,15 +107,17 @@ #define ADDSET_WA_EDGEDETECTTHR2 99 #define ADDSET_WA_TMRS 100 #define ADDSET_WA_GAMMA 101 -#define ADDSET_DH_STR 102 -#define ADDSET_DH_SCAL 103 -#define ADDSET_DH_NEIGH 104 -#define ADDSET_DH_LIMD 105 -#define ADDSET_DH_GAIN 106 -#define ADDSET_DH_OFFS 107 -#define ADDSET_DH_VART 108 +#define ADDSET_RETI_STR 102 +#define ADDSET_RETI_SCAL 103 +#define ADDSET_RETI_NEIGH 104 +#define ADDSET_RETI_LIMD 105 +#define ADDSET_RETI_GAIN 106 +#define ADDSET_RETI_OFFS 107 +#define ADDSET_RETI_VART 108 +#define ADDSET_RETI_GAM 109 +#define ADDSET_RETI_SLO 110 // When adding items, make sure to update ADDSET_PARAM_NUM -#define ADDSET_PARAM_NUM 109 // THIS IS USED AS A DELIMITER!! +#define ADDSET_PARAM_NUM 111 // THIS IS USED AS A DELIMITER!! #endif diff --git a/rtgui/batchtoolpanelcoord.cc b/rtgui/batchtoolpanelcoord.cc index 2486f7ea9..fa057e205 100644 --- a/rtgui/batchtoolpanelcoord.cc +++ b/rtgui/batchtoolpanelcoord.cc @@ -167,7 +167,7 @@ void BatchToolPanelCoordinator::initSession () blackwhite->setAdjusterBehavior (false, false); colortoning->setAdjusterBehavior (false, false, false, false, false); filmSimulation->setAdjusterBehavior(false); - retinex->setAdjusterBehavior (false, false, false, false, false, false, false); + retinex->setAdjusterBehavior (false, false, false, false, false, false, false, false, false); shadowshighlights->setAdjusterBehavior (false, false, false); dirpyrequalizer->setAdjusterBehavior (false, false, false); @@ -204,7 +204,7 @@ void BatchToolPanelCoordinator::initSession () // colortoning->setAdjusterBehavior (options.baBehav[ADDSET_COLORTONING_SPLIT], options.baBehav[ADDSET_COLORTONING_SATTHRESHOLD], options.baBehav[ADDSET_COLORTONING_SATOPACITY], options.baBehav[ADDSET_COLORTONING_STRPROTECT], options.baBehav[ADDSET_COLORTONING_BALANCE]); colortoning->setAdjusterBehavior (options.baBehav[ADDSET_COLORTONING_SPLIT], options.baBehav[ADDSET_COLORTONING_SATTHRESHOLD], options.baBehav[ADDSET_COLORTONING_SATOPACITY], options.baBehav[ADDSET_COLORTONING_STRENGTH], options.baBehav[ADDSET_COLORTONING_BALANCE]); filmSimulation->setAdjusterBehavior(options.baBehav[ADDSET_FILMSIMULATION_STRENGTH]); - retinex->setAdjusterBehavior (options.baBehav[ADDSET_DH_STR], options.baBehav[ADDSET_DH_SCAL], options.baBehav[ADDSET_DH_NEIGH], options.baBehav[ADDSET_DH_LIMD], options.baBehav[ADDSET_DH_GAIN], options.baBehav[ADDSET_DH_OFFS], options.baBehav[ADDSET_DH_VART]); + retinex->setAdjusterBehavior (options.baBehav[ADDSET_RETI_STR], options.baBehav[ADDSET_RETI_SCAL], options.baBehav[ADDSET_RETI_NEIGH], options.baBehav[ADDSET_RETI_LIMD], options.baBehav[ADDSET_RETI_GAIN], options.baBehav[ADDSET_RETI_OFFS], options.baBehav[ADDSET_RETI_VART], options.baBehav[ADDSET_RETI_GAM], options.baBehav[ADDSET_RETI_SLO]); chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER] ); blackwhite->setAdjusterBehavior (options.baBehav[ADDSET_BLACKWHITE_HUES], options.baBehav[ADDSET_BLACKWHITE_GAMMA]); @@ -578,35 +578,42 @@ void BatchToolPanelCoordinator::initSession () pparams.wavelet.gamma = 0; } - if (options.baBehav[ADDSET_DH_STR]) { + if (options.baBehav[ADDSET_RETI_STR]) { pparams.retinex.str = 0; } - if (options.baBehav[ADDSET_DH_SCAL]) { + if (options.baBehav[ADDSET_RETI_SCAL]) { pparams.retinex.scal = 0; } - if (options.baBehav[ADDSET_DH_NEIGH]) { + if (options.baBehav[ADDSET_RETI_NEIGH]) { pparams.retinex.neigh = 0; } - if (options.baBehav[ADDSET_DH_LIMD]) { + if (options.baBehav[ADDSET_RETI_LIMD]) { pparams.retinex.limd = 0; } - if (options.baBehav[ADDSET_DH_GAIN]) { + if (options.baBehav[ADDSET_RETI_GAIN]) { pparams.retinex.gain = 0; } - if (options.baBehav[ADDSET_DH_OFFS]) { + if (options.baBehav[ADDSET_RETI_OFFS]) { pparams.retinex.offs = 0; } - if (options.baBehav[ADDSET_DH_VART]) { + if (options.baBehav[ADDSET_RETI_VART]) { pparams.retinex.vart = 0; } + if (options.baBehav[ADDSET_RETI_GAM]) { + pparams.retinex.gam = 0; + } + if (options.baBehav[ADDSET_RETI_SLO]) { + pparams.retinex.slope = 0; + } + if (options.baBehav[ADDSET_DIRPYRDN_LUMA]) { pparams.dirpyrDenoise.luma = 0; } diff --git a/rtgui/options.cc b/rtgui/options.cc index 600f9ed68..7b6858e13 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -598,13 +598,15 @@ void Options::setDefaults () 0, //ADDSET_WA_EDGEDETECTTHR2 0, //ADDSET_WA_TMRS 0, //ADDSET_WA_GAMMA - 0, //ADDSET_DH_STR - 0, //ADDSET_DH_SCAL - 0, //ADDSET_DH_NEIGH - 0, //ADDSET_DH_LIMD - 0, //ADDSET_DH_GAIN - 0, //ADDSET_DH_OFFS - 0, //ADDSET_DH_VART + 0, //ADDSET_RETI_STR + 0, //ADDSET_RETI_SCAL + 0, //ADDSET_RETI_NEIGH + 0, //ADDSET_RETI_LIMD + 0, //ADDSET_RETI_GAIN + 0, //ADDSET_RETI_OFFS + 0, //ADDSET_RETI_VART + 0, //ADDSET_RETI_GAM + 0, //ADDSET_RETI_SLO }; baBehav = std::vector (babehav, babehav + ADDSET_PARAM_NUM); diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index 58064b970..2cd5acb4a 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -1059,19 +1059,19 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten } if (retinex.gam) { - toEdit.retinex.gam = mods.retinex.gam; + toEdit.retinex.gam = dontforceSet && options.baBehav[ADDSET_RETI_GAM] ? toEdit.retinex.gam + mods.retinex.gam : mods.retinex.gam; } if (retinex.slope) { - toEdit.retinex.slope = mods.retinex.slope; + toEdit.retinex.slope = dontforceSet && options.baBehav[ADDSET_RETI_SLO] ? toEdit.retinex.slope + mods.retinex.slope : mods.retinex.slope; } if (retinex.str) { - toEdit.retinex.str = dontforceSet && options.baBehav[ADDSET_DH_STR] ? toEdit.retinex.str + mods.retinex.str : mods.retinex.str; + toEdit.retinex.str = dontforceSet && options.baBehav[ADDSET_RETI_STR] ? toEdit.retinex.str + mods.retinex.str : mods.retinex.str; } if (retinex.scal) { - toEdit.retinex.scal = dontforceSet && options.baBehav[ADDSET_DH_SCAL] ? toEdit.retinex.scal + mods.retinex.scal : mods.retinex.scal; + toEdit.retinex.scal = dontforceSet && options.baBehav[ADDSET_RETI_SCAL] ? toEdit.retinex.scal + mods.retinex.scal : mods.retinex.scal; } if (retinex.medianmap) { @@ -1079,23 +1079,23 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten } if (retinex.neigh) { - toEdit.retinex.neigh = dontforceSet && options.baBehav[ADDSET_DH_NEIGH] ? toEdit.retinex.neigh + mods.retinex.neigh : mods.retinex.neigh; + toEdit.retinex.neigh = dontforceSet && options.baBehav[ADDSET_RETI_NEIGH] ? toEdit.retinex.neigh + mods.retinex.neigh : mods.retinex.neigh; } if (retinex.limd) { - toEdit.retinex.limd = dontforceSet && options.baBehav[ADDSET_DH_LIMD] ? toEdit.retinex.limd + mods.retinex.limd : mods.retinex.limd; + toEdit.retinex.limd = dontforceSet && options.baBehav[ADDSET_RETI_LIMD] ? toEdit.retinex.limd + mods.retinex.limd : mods.retinex.limd; } if (retinex.gain) { - toEdit.retinex.gain = dontforceSet && options.baBehav[ADDSET_DH_GAIN] ? toEdit.retinex.gain + mods.retinex.gain : mods.retinex.gain; + toEdit.retinex.gain = dontforceSet && options.baBehav[ADDSET_RETI_GAIN] ? toEdit.retinex.gain + mods.retinex.gain : mods.retinex.gain; } if (retinex.offs) { - toEdit.retinex.offs = dontforceSet && options.baBehav[ADDSET_DH_OFFS] ? toEdit.retinex.offs + mods.retinex.offs : mods.retinex.offs; + toEdit.retinex.offs = dontforceSet && options.baBehav[ADDSET_RETI_OFFS] ? toEdit.retinex.offs + mods.retinex.offs : mods.retinex.offs; } if (retinex.vart) { - toEdit.retinex.vart = dontforceSet && options.baBehav[ADDSET_DH_VART] ? toEdit.retinex.vart + mods.retinex.vart : mods.retinex.vart; + toEdit.retinex.vart = dontforceSet && options.baBehav[ADDSET_RETI_VART] ? toEdit.retinex.vart + mods.retinex.vart : mods.retinex.vart; } if (labCurve.lcurve) { @@ -1130,17 +1130,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten toEdit.labCurve.lccurve = mods.labCurve.lccurve; } -// if (labCurve.retinexMethod) { -// toEdit.labCurve.retinexMethod = mods.labCurve.retinexMethod; -// } if (labCurve.clcurve) { toEdit.labCurve.clcurve = mods.labCurve.clcurve; } -// if (labCurve.cdcurve) { -// toEdit.labCurve.cdcurve = mods.labCurve.cdcurve; - // } - if (labCurve.brightness) { toEdit.labCurve.brightness = dontforceSet && options.baBehav[ADDSET_LC_BRIGHTNESS] ? toEdit.labCurve.brightness + mods.labCurve.brightness : mods.labCurve.brightness; } diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 47a641634..be3bf3566 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -172,13 +172,15 @@ Gtk::Widget* Preferences::getBatchProcPanel () mi = behModel->append (); mi->set_value (behavColumns.label, M("TP_RETINEX_LABEL")); - appendBehavList (mi, M("TP_RETINEX_STRENGTH"), ADDSET_DH_STR, false); - appendBehavList (mi, M("TP_RETINEX_NEIGH"), ADDSET_DH_NEIGH, false); - appendBehavList (mi, M("TP_RETINEX_SCAL"), ADDSET_DH_SCAL, false); - appendBehavList (mi, M("TP_RETINEX_GAIN"), ADDSET_DH_GAIN, false); - appendBehavList (mi, M("TP_RETINEX_OFFS"), ADDSET_DH_OFFS, false); - appendBehavList (mi, M("TP_RETINEX_LIMD"), ADDSET_DH_LIMD, false); - appendBehavList (mi, M("TP_RETINEX_VART"), ADDSET_DH_VART, false); + appendBehavList (mi, M("TP_RETINEX_STRENGTH"), ADDSET_RETI_STR, false); + appendBehavList (mi, M("TP_RETINEX_NEIGHBOR"), ADDSET_RETI_NEIGH, false); + appendBehavList (mi, M("TP_RETINEX_GAMMA"), ADDSET_RETI_GAM, false); + appendBehavList (mi, M("TP_RETINEX_SLOPE"), ADDSET_RETI_SLO, false); + appendBehavList (mi, M("TP_RETINEX_SCALES"), ADDSET_RETI_SCAL, false); + appendBehavList (mi, M("TP_RETINEX_GAIN"), ADDSET_RETI_GAIN, false); + appendBehavList (mi, M("TP_RETINEX_OFFSET"), ADDSET_RETI_OFFS, false); + appendBehavList (mi, M("TP_RETINEX_THRESHOLD"), ADDSET_RETI_LIMD, false); + appendBehavList (mi, M("TP_RETINEX_VARIANCE"), ADDSET_RETI_VART, false); mi = behModel->append (); mi->set_value (behavColumns.label, M("TP_SHADOWSHLIGHTS_LABEL")); diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc index 1a848a037..df9ff6ada 100644 --- a/rtgui/retinex.cc +++ b/rtgui/retinex.cc @@ -658,9 +658,8 @@ void Retinex::setDefaults (const ProcParams* defParams, const ParamsEdited* pedi } } -void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool scalAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd) +void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool scalAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd) { - str->setAddMode(strAdd); neigh->setAddMode(neighAdd); scal->setAddMode(scalAdd); @@ -668,6 +667,8 @@ void Retinex::setAdjusterBehavior (bool strAdd, bool neighAdd, bool scalAdd, boo gain->setAddMode(gainAdd); offs->setAddMode(offsAdd); vart->setAddMode(vartAdd); + gam->setAddMode(gamAdd); + slope->setAddMode(slopeAdd); } diff --git a/rtgui/retinex.h b/rtgui/retinex.h index a563fa271..4e8d2f05e 100644 --- a/rtgui/retinex.h +++ b/rtgui/retinex.h @@ -88,7 +88,7 @@ public: void ColorSpaceUpdateUI(); void writeOptions (std::vector &tpOpen); void updateToolState (std::vector &tpOpen); - void setAdjusterBehavior (bool strAdd, bool neighAdd, bool scalAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd); + void setAdjusterBehavior (bool strAdd, bool neighAdd, bool scalAdd, bool limdAdd, bool gainAdd, bool offsAdd, bool vartAdd, bool gamAdd, bool slopeAdd); void updateCurveBackgroundHistogram (LUTu & histToneCurve, LUTu & histLCurve, LUTu & histCCurve,/* LUTu & histCLurve, LUTu & histLLCurve,*/ LUTu & histLCAM, LUTu & histCCAM, LUTu & histRed, LUTu & histGreen, LUTu & histBlue, LUTu & histLuma, LUTu & histLRETI); private: