Change checkbox short circuit to method

This commit is contained in:
Desmis 2019-11-01 11:02:47 +01:00
parent d84b9ec0f9
commit 0de7b5bacf
12 changed files with 150 additions and 17 deletions

View File

@ -1034,6 +1034,7 @@ HISTORY_MSG_793;Local - SH TRC gamma
HISTORY_MSG_794;Local - SH TRC slope HISTORY_MSG_794;Local - SH TRC slope
HISTORY_MSG_795;Local - Mask save restore image HISTORY_MSG_795;Local - Mask save restore image
HISTORY_MSG_796;Local - Recursive references HISTORY_MSG_796;Local - Recursive references
HISTORY_MSG_797;Local - Merge and Masks method
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction
@ -2149,7 +2150,11 @@ TP_LOCALLAB_LMASK_LEVEL_TOOLTIP;Give priority to action on midtones and high lig
TP_LOCALLAB_SAVREST;Save - Restore Current Image TP_LOCALLAB_SAVREST;Save - Restore Current Image
TP_LOCALLAB_SCOPEMASK;Scope Mask DeltaE Image TP_LOCALLAB_SCOPEMASK;Scope Mask DeltaE Image
TP_LOCALLAB_SCOPEMASK_TOOLTIP;Enabled if Mask DeltaE Image is enabled.\nLow values avoid retouching selected area TP_LOCALLAB_SCOPEMASK_TOOLTIP;Enabled if Mask DeltaE Image is enabled.\nLow values avoid retouching selected area
TP_LOCALLAB_MASFRAME;Mask TP_LOCALLAB_MASFRAME;Mask and Merge
TP_LOCALLAB_MERGETYPE;Merge image and mask
TP_LOCALLAB_MERGENONE;None
TP_LOCALLAB_MERGEONE;Short Curves 'L' Mask
TP_LOCALLAB_MERGETWO;Original
TP_LOCALLAB_MASFRAME_TOOLTIP;For all masks.\nTake into account deltaE image to avoid retouching the selection area when sliders gamma mask, slope mask, chroma mask and contrast curves and levels contrasts curves are used.\nDisabled in Inverse TP_LOCALLAB_MASFRAME_TOOLTIP;For all masks.\nTake into account deltaE image to avoid retouching the selection area when sliders gamma mask, slope mask, chroma mask and contrast curves and levels contrasts curves are used.\nDisabled in Inverse
TP_LOCALLAB_WAMASKCOL;Mask Wavelet level TP_LOCALLAB_WAMASKCOL;Mask Wavelet level
TP_LOCALLAB_CSTHRESHOLDBLUR;Mask Wavelet level TP_LOCALLAB_CSTHRESHOLDBLUR;Mask Wavelet level

View File

@ -194,7 +194,7 @@ public:
bool multiThread, bool enaMask, bool showmaske, bool deltaE, bool modmask, bool zero, bool modif, float chrom, float rad, float lap, float gamma, float slope, float blendm, int shado, float amountcd, float anchorcd, bool multiThread, bool enaMask, bool showmaske, bool deltaE, bool modmask, bool zero, bool modif, float chrom, float rad, float lap, float gamma, float slope, float blendm, int shado, float amountcd, float anchorcd,
LUTf & lmasklocalcurve, bool & localmaskutili, LUTf & lmasklocalcurve, bool & localmaskutili,
const LocwavCurve & loclmasCurvecolwav, bool & lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr, const LocwavCurve & loclmasCurvecolwav, bool & lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr,
bool shortcu, bool delt, const float hueref, const float chromaref, const float lumaref, int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope); float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope);
void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref, void deltaEforMask(float **rdE, int bfw, int bfh, LabImage* bufcolorig, const float hueref, const float chromaref, const float lumaref,

View File

@ -341,6 +341,7 @@ struct local_params {
double expcomp; double expcomp;
float expchroma; float expchroma;
int excmet; int excmet;
int mergemet;
int war; int war;
float adjch; float adjch;
int shapmet; int shapmet;
@ -584,6 +585,14 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall
lp.excmet = 1; lp.excmet = 1;
} }
if (locallab.spots.at(sp).mergeMethod == "none") {
lp.mergemet = 0;
} else if (locallab.spots.at(sp).mergeMethod == "short") {
lp.mergemet = 1;
} else if (locallab.spots.at(sp).mergeMethod == "orig") {
lp.mergemet = 2;
}
if (locallab.spots.at(sp).shape == "ELI") { if (locallab.spots.at(sp).shape == "ELI") {
lp.shapmet = 0; lp.shapmet = 0;
} else if (locallab.spots.at(sp).shape == "RECT") { } else if (locallab.spots.at(sp).shape == "RECT") {
@ -3140,7 +3149,7 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int
bool multiThread, bool enaMask, bool showmaske, bool deltaE, bool modmask, bool zero, bool modif, float chrom, float rad, float lap, float gamma, float slope, float blendm, int shado, float amountcd, float anchorcd, bool multiThread, bool enaMask, bool showmaske, bool deltaE, bool modmask, bool zero, bool modif, float chrom, float rad, float lap, float gamma, float slope, float blendm, int shado, float amountcd, float anchorcd,
LUTf & lmasklocalcurve, bool & localmaskutili, LUTf & lmasklocalcurve, bool & localmaskutili,
const LocwavCurve & loclmasCurvecolwav, bool & lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr, const LocwavCurve & loclmasCurvecolwav, bool & lmasutilicolwav, int level_bl, int level_hl, int level_br, int level_hr,
bool shortcu, bool delt, const float hueref, const float chromaref, const float lumaref, int shortcu, bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope
) )
{ {
@ -3238,7 +3247,7 @@ void ImProcFunctions::maskcalccol(bool invmask, bool pde, int bfw, int bfh, int
bufmaskblurcol->a[ir][jr] = CLIPC(kmaskC + kmaskH); bufmaskblurcol->a[ir][jr] = CLIPC(kmaskC + kmaskH);
bufmaskblurcol->b[ir][jr] = CLIPC(kmaskC + kmaskH); bufmaskblurcol->b[ir][jr] = CLIPC(kmaskC + kmaskH);
if (shortcu) { //short circuit all L curve if (shortcu == 1) { //short circuit all L curve
bufmaskblurcol->L[ir][jr] = 32768.f - bufcolorig->L[ir][jr]; bufmaskblurcol->L[ir][jr] = 32768.f - bufcolorig->L[ir][jr];
} }
@ -8250,7 +8259,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
bool lmasutilicolwav = false; bool lmasutilicolwav = false;
float amountcd = 0.f; float amountcd = 0.f;
float anchorcd = 50.f; float anchorcd = 50.f;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, loctemp.get(), bufmaskorigcb.get(), originalmaskcb.get(), original, inv, lp, maskcalccol(false, pde, bfw, bfh, xstart, ystart, sk, cx, cy, loctemp.get(), bufmaskorigcb.get(), originalmaskcb.get(), original, inv, lp,
locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, multiThread, locccmascbCurve, lcmascbutili, locllmascbCurve, llmascbutili, lochhmascbCurve, lhmascbutili, multiThread,
@ -8541,7 +8550,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
float blendm = lp.blendmatm; float blendm = lp.blendmatm;
float lap = params->locallab.spots.at(sp).lapmasktm; float lap = params->locallab.spots.at(sp).lapmasktm;
float pde = params->locallab.spots.at(sp).laplac; float pde = params->locallab.spots.at(sp).laplac;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet;// params->locallab.spots.at(sp).shortc;
int lumask = params->locallab.spots.at(sp).lumask; int lumask = params->locallab.spots.at(sp).lumask;
if (!params->locallab.spots.at(sp).enatmMaskaft) { if (!params->locallab.spots.at(sp).enatmMaskaft) {
@ -8588,7 +8597,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
bool lmasutilicolwav = false; bool lmasutilicolwav = false;
bool delt = params->locallab.spots.at(sp).deltae; bool delt = params->locallab.spots.at(sp).deltae;
int sco = params->locallab.spots.at(sp).scopemask; int sco = params->locallab.spots.at(sp).scopemask;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
int lumask = params->locallab.spots.at(sp).lumask; int lumask = params->locallab.spots.at(sp).lumask;
const int limscope = 80; const int limscope = 80;
@ -8790,7 +8799,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
bool lmasutilicolwav = false; bool lmasutilicolwav = false;
bool delt = params->locallab.spots.at(sp).deltae; bool delt = params->locallab.spots.at(sp).deltae;
int sco = params->locallab.spots.at(sp).scopemask; int sco = params->locallab.spots.at(sp).scopemask;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
const int limscope = 80; const int limscope = 80;
const float mindE = 2.f + MINSCOPE * sco * lp.thr; const float mindE = 2.f + MINSCOPE * sco * lp.thr;
@ -8940,9 +8949,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
// bool delt = params->locallab.spots.at(sp).deltae; // bool delt = params->locallab.spots.at(sp).deltae;
bool delt = false; bool delt = false;
int sco = params->locallab.spots.at(sp).scopemask; int sco = params->locallab.spots.at(sp).scopemask;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; params->locallab.spots.at(sp).shortc;
const int limscope = 80; const int limscope = 80;//
const float mindE = 2.f + MINSCOPE * sco * lp.thr; const float mindE = 2.f + MINSCOPE * sco * lp.thr;
const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr); const float maxdE = 5.f + MAXSCOPE * sco * (1 + 0.1f * lp.thr);
const float mindElim = 2.f + MINSCOPE * limscope * lp.thr; const float mindElim = 2.f + MINSCOPE * limscope * lp.thr;
@ -11014,7 +11023,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
bool delt = params->locallab.spots.at(sp).deltae; bool delt = params->locallab.spots.at(sp).deltae;
int sco = params->locallab.spots.at(sp).scopemask; int sco = params->locallab.spots.at(sp).scopemask;
int shado = 0; int shado = 0;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
const int limscope = 80; const int limscope = 80;
const float mindE = 2.f + MINSCOPE * sco * lp.thr; const float mindE = 2.f + MINSCOPE * sco * lp.thr;
@ -11304,7 +11313,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
bool delt = false; bool delt = false;
int sco = params->locallab.spots.at(sp).scopemask; int sco = params->locallab.spots.at(sp).scopemask;
int shado = 0; int shado = 0;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
int lumask = params->locallab.spots.at(sp).lumask; int lumask = params->locallab.spots.at(sp).lumask;
const int limscope = 80; const int limscope = 80;
@ -11575,7 +11584,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
int level_hl = params->locallab.spots.at(sp).csthresholdcol.getTopLeft(); int level_hl = params->locallab.spots.at(sp).csthresholdcol.getTopLeft();
int level_br = params->locallab.spots.at(sp).csthresholdcol.getBottomRight(); int level_br = params->locallab.spots.at(sp).csthresholdcol.getBottomRight();
int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight(); int level_hr = params->locallab.spots.at(sp).csthresholdcol.getTopRight();
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
int lumask = params->locallab.spots.at(sp).lumask; int lumask = params->locallab.spots.at(sp).lumask;
const int limscope = 80; const int limscope = 80;
@ -11804,7 +11813,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
// bool delt = params->locallab.spots.at(sp).deltae; // bool delt = params->locallab.spots.at(sp).deltae;
bool delt = false; bool delt = false;
int sco = params->locallab.spots.at(sp).scopemask; int sco = params->locallab.spots.at(sp).scopemask;
bool shortcu = params->locallab.spots.at(sp).shortc; int shortcu = lp.mergemet; //params->locallab.spots.at(sp).shortc;
int lumask = params->locallab.spots.at(sp).lumask; int lumask = params->locallab.spots.at(sp).lumask;
const int limscope = 80; const int limscope = 80;

View File

@ -823,6 +823,7 @@ enum ProcEventCode {
EvlocallabsloSH = 793, EvlocallabsloSH = 793,
Evlocallabsavrest = 794, Evlocallabsavrest = 794,
Evlocallabrecurs = 795, Evlocallabrecurs = 795,
EvLocallabSpotmergeMethod = 796,
NUMOFEVENTS NUMOFEVENTS
}; };

View File

@ -2413,6 +2413,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
isvisible(true), isvisible(true),
shape("ELI"), shape("ELI"),
spotMethod("norm"), spotMethod("norm"),
mergeMethod("none"),
sensiexclu(12), sensiexclu(12),
structexclu(0), structexclu(0),
struc(4.0), struc(4.0),
@ -2722,6 +2723,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& isvisible == other.isvisible && isvisible == other.isvisible
&& shape == other.shape && shape == other.shape
&& spotMethod == other.spotMethod && spotMethod == other.spotMethod
&& mergeMethod == other.mergeMethod
&& sensiexclu == other.sensiexclu && sensiexclu == other.sensiexclu
&& structexclu == other.structexclu && structexclu == other.structexclu
&& struc == other.struc && struc == other.struc
@ -4026,6 +4028,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).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).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).spotMethod, "Locallab", "SpotMethod_" + std::to_string(i), spot.spotMethod, 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).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).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).struc, "Locallab", "Struc_" + std::to_string(i), spot.struc, keyFile);
@ -5438,6 +5441,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", "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", "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", "SpotMethod_" + std::to_string(i), pedited, spot.spotMethod, spotEdited.spotMethod);
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", "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", "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", "StructExclu_" + std::to_string(i), pedited, spot.structexclu, spotEdited.structexclu);

View File

@ -960,6 +960,7 @@ struct LocallabParams {
bool isvisible; bool isvisible;
Glib::ustring shape; // ELI, RECT Glib::ustring shape; // ELI, RECT
Glib::ustring spotMethod; // norm, exc Glib::ustring spotMethod; // norm, exc
Glib::ustring mergeMethod; // none, short, orig
int sensiexclu; int sensiexclu;
int structexclu; int structexclu;
double struc; double struc;

View File

@ -822,7 +822,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, //EvlocallabgamSH LUMINANCECURVE, //EvlocallabgamSH
LUMINANCECURVE, //EvlocallabsloSH LUMINANCECURVE, //EvlocallabsloSH
LUMINANCECURVE, //Evlocallabsavrest LUMINANCECURVE, //Evlocallabsavrest
LUMINANCECURVE //Evlocallabrecurs LUMINANCECURVE, //Evlocallabrecurs
LUMINANCECURVE // EvLocallabSpotmergeMethod
}; };
namespace rtengine namespace rtengine

View File

@ -50,6 +50,7 @@ ControlSpotPanel::ControlSpotPanel():
spotMethod_(Gtk::manage(new MyComboBoxText())), spotMethod_(Gtk::manage(new MyComboBoxText())),
shapeMethod_(Gtk::manage(new MyComboBoxText())), shapeMethod_(Gtk::manage(new MyComboBoxText())),
qualityMethod_(Gtk::manage(new MyComboBoxText())), qualityMethod_(Gtk::manage(new MyComboBoxText())),
mergeMethod_(Gtk::manage(new MyComboBoxText())),
sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))), 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))), structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
@ -181,7 +182,7 @@ ControlSpotPanel::ControlSpotPanel():
sigc::mem_fun( sigc::mem_fun(
*this, &ControlSpotPanel::spotMethodChanged)); *this, &ControlSpotPanel::spotMethodChanged));
ctboxspotmethod->pack_start(*spotMethod_); ctboxspotmethod->pack_start(*spotMethod_);
pack_start(*ctboxspotmethod); // pack_start(*ctboxspotmethod);
excluFrame->set_label_align(0.025, 0.5); excluFrame->set_label_align(0.025, 0.5);
if(showtooltip) excluFrame->set_tooltip_text(M("TP_LOCALLAB_EXCLUF_TOOLTIP")); if(showtooltip) excluFrame->set_tooltip_text(M("TP_LOCALLAB_EXCLUF_TOOLTIP"));
@ -280,6 +281,21 @@ ControlSpotPanel::ControlSpotPanel():
balan_->setAdjusterListener(this); balan_->setAdjusterListener(this);
artifFrame->add(*artifBox); artifFrame->add(*artifBox);
pack_start(*artifFrame); pack_start(*artifFrame);
Gtk::HBox* const ctboxmergemethod = Gtk::manage(new Gtk::HBox());
Gtk::Label* const labelmergemethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MERGETYPE") + ":"));
ctboxmergemethod->pack_start(*labelmergemethod, Gtk::PACK_SHRINK, 4);
if(showtooltip) ctboxmergemethod->set_tooltip_markup(M("TP_LOCALLAB_MERGETYPE_TOOLTIP"));
mergeMethod_->append(M("TP_LOCALLAB_MERGENONE"));
mergeMethod_->append(M("TP_LOCALLAB_MERGEONE"));
mergeMethod_->append(M("TP_LOCALLAB_MERGETWO"));
mergeMethod_->set_active(0);
mergeMethodconn_ = mergeMethod_->signal_changed().connect(
sigc::mem_fun(
*this, &ControlSpotPanel::mergeMethodChanged));
ctboxmergemethod->pack_start(*mergeMethod_);
// pack_start(*ctboxmergemethod);
avoidConn_ = avoid_->signal_toggled().connect( avoidConn_ = avoid_->signal_toggled().connect(
sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged)); sigc::mem_fun(*this, &ControlSpotPanel::avoidChanged));
@ -304,7 +320,9 @@ ControlSpotPanel::ControlSpotPanel():
sigc::mem_fun(*this, &ControlSpotPanel::savrestChanged)); sigc::mem_fun(*this, &ControlSpotPanel::savrestChanged));
maskBox->pack_start(*deltae_); maskBox->pack_start(*deltae_);
maskBox->pack_start(*scopemask_); maskBox->pack_start(*scopemask_);
maskBox->pack_start(*shortc_); // maskBox->pack_start(*shortc_);
maskBox->pack_start(*ctboxmergemethod);
maskBox->pack_start(*lumask_); maskBox->pack_start(*lumask_);
// maskBox->pack_start(*savrest_); // maskBox->pack_start(*savrest_);
maskFrame->add(*maskBox); maskFrame->add(*maskBox);
@ -594,6 +612,7 @@ void ControlSpotPanel::load_ControlSpot_param()
// Load param in selected control spot // Load param in selected control spot
shape_->set_active(row[spots_.shape]); shape_->set_active(row[spots_.shape]);
spotMethod_->set_active(row[spots_.spotMethod]); spotMethod_->set_active(row[spots_.spotMethod]);
mergeMethod_->set_active(row[spots_.mergeMethod]);
sensiexclu_->setValue((double)row[spots_.sensiexclu]); sensiexclu_->setValue((double)row[spots_.sensiexclu]);
structexclu_->setValue((double)row[spots_.structexclu]); structexclu_->setValue((double)row[spots_.structexclu]);
struc_->setValue((double)row[spots_.struc]); struc_->setValue((double)row[spots_.struc]);
@ -691,6 +710,38 @@ void ControlSpotPanel::spotMethodChanged()
} }
} }
void ControlSpotPanel::mergeMethodChanged()
{
// printf("mergeMethodChanged\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_.mergeMethod] = mergeMethod_->get_active_row_number();
/*
// Update Control Spot GUI according to spotMethod_ combobox state (to be compliant with updateParamVisibility function)
if (multiImage && mergeMethod_->get_active_text() == M("GENERAL_UNCHANGED")) {
excluFrame->show();
} else if (spotMethod_->get_active_row_number() == 0) { // Normal case
excluFrame->hide();
} else { // Excluding case
excluFrame->show();
}
*/
// Raise event
if (listener) {
listener->panelChanged(EvLocallabSpotmergeMethod, mergeMethod_->get_active_text());
}
}
void ControlSpotPanel::shapeMethodChanged() void ControlSpotPanel::shapeMethodChanged()
{ {
// printf("shapeMethodChanged\n"); // printf("shapeMethodChanged\n");
@ -1289,6 +1340,7 @@ void ControlSpotPanel::disableParamlistener(bool cond)
buttonvisibilityconn_.block(cond); buttonvisibilityconn_.block(cond);
shapeconn_.block(cond); shapeconn_.block(cond);
spotMethodconn_.block(cond); spotMethodconn_.block(cond);
mergeMethodconn_.block(cond);
sensiexclu_->block(cond); sensiexclu_->block(cond);
structexclu_->block(cond); structexclu_->block(cond);
struc_->block(cond); struc_->block(cond);
@ -1323,6 +1375,7 @@ void ControlSpotPanel::setParamEditable(bool cond)
shape_->set_sensitive(cond); shape_->set_sensitive(cond);
spotMethod_->set_sensitive(cond); spotMethod_->set_sensitive(cond);
mergeMethod_->set_sensitive(cond);
sensiexclu_->set_sensitive(cond); sensiexclu_->set_sensitive(cond);
structexclu_->set_sensitive(cond); structexclu_->set_sensitive(cond);
struc_->set_sensitive(cond); struc_->set_sensitive(cond);
@ -1963,6 +2016,7 @@ ControlSpotPanel::SpotRow* ControlSpotPanel::getSpot(const int id)
r->isvisible = row[spots_.isvisible]; r->isvisible = row[spots_.isvisible];
r->shape = row[spots_.shape]; r->shape = row[spots_.shape];
r->spotMethod = row[spots_.spotMethod]; r->spotMethod = row[spots_.spotMethod];
r->mergeMethod = row[spots_.mergeMethod];
r->sensiexclu = row[spots_.sensiexclu]; r->sensiexclu = row[spots_.sensiexclu];
r->structexclu = row[spots_.structexclu]; r->structexclu = row[spots_.structexclu];
r->struc = row[spots_.struc]; r->struc = row[spots_.struc];
@ -2096,6 +2150,7 @@ void ControlSpotPanel::addControlSpot(SpotRow* newSpot)
row[spots_.curveid] = 0; // No associated curve row[spots_.curveid] = 0; // No associated curve
row[spots_.shape] = newSpot->shape; row[spots_.shape] = newSpot->shape;
row[spots_.spotMethod] = newSpot->spotMethod; row[spots_.spotMethod] = newSpot->spotMethod;
row[spots_.mergeMethod] = newSpot->mergeMethod;
row[spots_.sensiexclu] = newSpot->sensiexclu; row[spots_.sensiexclu] = newSpot->sensiexclu;
row[spots_.structexclu] = newSpot->structexclu; row[spots_.structexclu] = newSpot->structexclu;
row[spots_.struc] = newSpot->struc; row[spots_.struc] = newSpot->struc;
@ -2148,6 +2203,7 @@ int ControlSpotPanel::updateControlSpot(SpotRow* spot)
row[spots_.isvisible] = spot->isvisible; row[spots_.isvisible] = spot->isvisible;
row[spots_.shape] = spot->shape; row[spots_.shape] = spot->shape;
row[spots_.spotMethod] = spot->spotMethod; row[spots_.spotMethod] = spot->spotMethod;
row[spots_.mergeMethod] = spot->mergeMethod;
row[spots_.sensiexclu] = spot->sensiexclu; row[spots_.sensiexclu] = spot->sensiexclu;
row[spots_.structexclu] = spot->structexclu; row[spots_.structexclu] = spot->structexclu;
row[spots_.struc] = spot->struc; row[spots_.struc] = spot->struc;
@ -2246,6 +2302,7 @@ ControlSpotPanel::SpotEdited* ControlSpotPanel::getEditedStates()
se->shape = shape_->get_active_text() != M("GENERAL_UNCHANGED"); se->shape = shape_->get_active_text() != M("GENERAL_UNCHANGED");
se->spotMethod = spotMethod_->get_active_text() != M("GENERAL_UNCHANGED"); se->spotMethod = spotMethod_->get_active_text() != M("GENERAL_UNCHANGED");
se->mergeMethod = mergeMethod_->get_active_text() != M("GENERAL_UNCHANGED");
se->sensiexclu = sensiexclu_->getEditedState(); se->sensiexclu = sensiexclu_->getEditedState();
se->structexclu = structexclu_->getEditedState(); se->structexclu = structexclu_->getEditedState();
se->struc = struc_->getEditedState(); se->struc = struc_->getEditedState();
@ -2314,6 +2371,10 @@ void ControlSpotPanel::setEditedStates(SpotEdited* se)
spotMethod_->set_active_text(M("GENERAL_UNCHANGED")); spotMethod_->set_active_text(M("GENERAL_UNCHANGED"));
} }
if (!se->mergeMethod) {
mergeMethod_->set_active_text(M("GENERAL_UNCHANGED"));
}
sensiexclu_->setEditedState(se->sensiexclu ? Edited : UnEdited); sensiexclu_->setEditedState(se->sensiexclu ? Edited : UnEdited);
structexclu_->setEditedState(se->structexclu ? Edited : UnEdited); structexclu_->setEditedState(se->structexclu ? Edited : UnEdited);
struc_->setEditedState(se->struc ? Edited : UnEdited); struc_->setEditedState(se->struc ? Edited : UnEdited);
@ -2470,6 +2531,7 @@ void ControlSpotPanel::setBatchMode(bool batchMode)
// Set batch mode for comboBoxText // Set batch mode for comboBoxText
shape_->append(M("GENERAL_UNCHANGED")); shape_->append(M("GENERAL_UNCHANGED"));
spotMethod_->append(M("GENERAL_UNCHANGED")); spotMethod_->append(M("GENERAL_UNCHANGED"));
mergeMethod_->append(M("GENERAL_UNCHANGED"));
shapeMethod_->append(M("GENERAL_UNCHANGED")); shapeMethod_->append(M("GENERAL_UNCHANGED"));
qualityMethod_->append(M("GENERAL_UNCHANGED")); qualityMethod_->append(M("GENERAL_UNCHANGED"));
} }
@ -2513,6 +2575,7 @@ ControlSpotPanel::ControlSpots::ControlSpots()
add(deltae); add(deltae);
add(shortc); add(shortc);
add(savrest); add(savrest);
add(mergeMethod);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -73,6 +73,7 @@ public:
bool deltae; bool deltae;
bool shortc; bool shortc;
bool savrest; bool savrest;
int mergeMethod; // 0 = None, 1 = short circuit, 2 = original
}; };
/** /**
@ -111,6 +112,7 @@ public:
bool deltae; bool deltae;
bool shortc; bool shortc;
bool savrest; bool savrest;
bool mergeMethod;
}; };
/** /**
@ -267,6 +269,7 @@ private:
void shapeChanged(); void shapeChanged();
void spotMethodChanged(); void spotMethodChanged();
void shapeMethodChanged(); void shapeMethodChanged();
void mergeMethodChanged();
void qualityMethodChanged(); void qualityMethodChanged();
void updateParamVisibility(); void updateParamVisibility();
void adjusterChanged(Adjuster* a, double newval); void adjusterChanged(Adjuster* a, double newval);
@ -336,6 +339,7 @@ private:
Gtk::TreeModelColumn<bool> deltae; Gtk::TreeModelColumn<bool> deltae;
Gtk::TreeModelColumn<bool> shortc; Gtk::TreeModelColumn<bool> shortc;
Gtk::TreeModelColumn<bool> savrest; Gtk::TreeModelColumn<bool> savrest;
Gtk::TreeModelColumn<int> mergeMethod; // 0 = None, 1 = short cir, 2 = original
}; };
class RenameDialog: class RenameDialog:
@ -382,6 +386,8 @@ private:
sigc::connection shapeMethodconn_; sigc::connection shapeMethodconn_;
MyComboBoxText* const qualityMethod_; MyComboBoxText* const qualityMethod_;
sigc::connection qualityMethodconn_; sigc::connection qualityMethodconn_;
MyComboBoxText* const mergeMethod_;
sigc::connection mergeMethodconn_;
Adjuster* const sensiexclu_; Adjuster* const sensiexclu_;
Adjuster* const structexclu_; Adjuster* const structexclu_;

View File

@ -2847,6 +2847,14 @@ void Locallab::read(const ProcParams* pp, const ParamsEdited* pedited)
r->spotMethod = 1; r->spotMethod = 1;
} }
if (pp->locallab.spots.at(i).mergeMethod == "none") {
r->mergeMethod = 0;
} else if (pp->locallab.spots.at(i).mergeMethod == "short") {
r->mergeMethod = 1;
} else if (pp->locallab.spots.at(i).mergeMethod == "orig") {
r->mergeMethod = 2;
}
r->sensiexclu = pp->locallab.spots.at(i).sensiexclu; r->sensiexclu = pp->locallab.spots.at(i).sensiexclu;
r->structexclu = pp->locallab.spots.at(i).structexclu; r->structexclu = pp->locallab.spots.at(i).structexclu;
r->struc = pp->locallab.spots.at(i).struc; r->struc = pp->locallab.spots.at(i).struc;
@ -2962,6 +2970,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
r->spotMethod = 1; r->spotMethod = 1;
} }
if (newSpot->mergeMethod == "none") {
r->mergeMethod = 0;
} else if (newSpot->mergeMethod == "short") {
r->mergeMethod = 1;
} else if (newSpot->mergeMethod == "orig") {
r->mergeMethod = 2;
}
r->sensiexclu = newSpot->sensiexclu; r->sensiexclu = newSpot->sensiexclu;
r->structexclu = newSpot->structexclu; r->structexclu = newSpot->structexclu;
r->struc = newSpot->struc; r->struc = newSpot->struc;
@ -3185,6 +3201,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
r->spotMethod = 1; r->spotMethod = 1;
} }
if (newSpot->mergeMethod == "none") {
r->mergeMethod = 0;
} else if (newSpot->mergeMethod == "short") {
r->mergeMethod = 1;
} else if (newSpot->mergeMethod == "orig") {
r->mergeMethod = 2;
}
r->sensiexclu = newSpot->sensiexclu; r->sensiexclu = newSpot->sensiexclu;
r->structexclu = newSpot->structexclu; r->structexclu = newSpot->structexclu;
r->struc = newSpot->struc; r->struc = newSpot->struc;
@ -3325,6 +3349,14 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "exc"; pp->locallab.spots.at(pp->locallab.selspot).spotMethod = "exc";
} }
if (r->mergeMethod == 0) {
pp->locallab.spots.at(pp->locallab.selspot).mergeMethod = "none";
} else if (r->mergeMethod == 1) {
pp->locallab.spots.at(pp->locallab.selspot).mergeMethod = "short";
} else if (r->mergeMethod == 2) {
pp->locallab.spots.at(pp->locallab.selspot).mergeMethod = "orig";
}
pp->locallab.spots.at(pp->locallab.selspot).sensiexclu = r->sensiexclu; 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).structexclu = r->structexclu;
pp->locallab.spots.at(pp->locallab.selspot).struc = r->struc; pp->locallab.spots.at(pp->locallab.selspot).struc = r->struc;
@ -3743,6 +3775,7 @@ void Locallab::write(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).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).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).spotMethod = pe->locallab.spots.at(pp->locallab.selspot).spotMethod || se->spotMethod;
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).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).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).struc = pe->locallab.spots.at(pp->locallab.selspot).struc || se->struc;
@ -4061,6 +4094,7 @@ void Locallab::write(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).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).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).spotMethod = pedited->locallab.spots.at(pp->locallab.selspot).spotMethod || se->spotMethod;
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).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).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).struc = pedited->locallab.spots.at(pp->locallab.selspot).struc || se->struc;
@ -8788,6 +8822,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
se->isvisible = spotState->isvisible; se->isvisible = spotState->isvisible;
se->shape = spotState->shape; se->shape = spotState->shape;
se->spotMethod = spotState->spotMethod; se->spotMethod = spotState->spotMethod;
se->mergeMethod = spotState->mergeMethod;
se->sensiexclu = spotState->sensiexclu; se->sensiexclu = spotState->sensiexclu;
se->structexclu = spotState->structexclu; se->structexclu = spotState->structexclu;
se->struc = spotState->struc; se->struc = spotState->struc;

View File

@ -954,6 +954,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).isvisible = locallab.spots.at(j).isvisible && pSpot.isvisible == otherSpot.isvisible; 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).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).spotMethod = locallab.spots.at(j).spotMethod && pSpot.spotMethod == otherSpot.spotMethod;
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).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).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).struc = locallab.spots.at(j).struc && pSpot.struc == otherSpot.struc;
@ -2735,6 +2736,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).spotMethod = mods.locallab.spots.at(i).spotMethod; toEdit.locallab.spots.at(i).spotMethod = mods.locallab.spots.at(i).spotMethod;
} }
if (locallab.spots.at(i).mergeMethod) {
toEdit.locallab.spots.at(i).mergeMethod = mods.locallab.spots.at(i).mergeMethod;
}
if (locallab.spots.at(i).sensiexclu) { if (locallab.spots.at(i).sensiexclu) {
toEdit.locallab.spots.at(i).sensiexclu = mods.locallab.spots.at(i).sensiexclu; toEdit.locallab.spots.at(i).sensiexclu = mods.locallab.spots.at(i).sensiexclu;
} }
@ -4861,6 +4866,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
isvisible(v), isvisible(v),
shape(v), shape(v),
spotMethod(v), spotMethod(v),
mergeMethod(v),
sensiexclu(v), sensiexclu(v),
structexclu(v), structexclu(v),
struc(v), struc(v),
@ -5167,6 +5173,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
isvisible = v; isvisible = v;
shape = v; shape = v;
spotMethod = v; spotMethod = v;
mergeMethod = v;
sensiexclu = v; sensiexclu = v;
structexclu = v; structexclu = v;
struc = v; struc = v;

View File

@ -372,6 +372,7 @@ public:
bool isvisible; bool isvisible;
bool shape; bool shape;
bool spotMethod; bool spotMethod;
bool mergeMethod;
bool sensiexclu; bool sensiexclu;
bool structexclu; bool structexclu;
bool struc; bool struc;