add simplify inverse exposure

This commit is contained in:
Desmis
2019-02-07 13:56:51 +01:00
parent 7c5edb536d
commit 313a468776
11 changed files with 245 additions and 68 deletions

View File

@@ -152,6 +152,7 @@ Locallab::Locallab():
enaColorMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))),
// Exposure
enaExpMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))),
inversex(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))),
// Vibrance
protectSkins(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_PROTECTSKINS")))),
avoidColorShift(Gtk::manage(new Gtk::CheckButton(M("TP_VIBRANCE_AVOIDCOLORSHIFT")))),
@@ -188,6 +189,7 @@ Locallab::Locallab():
transLabels(Gtk::manage (new Gtk::Label ("---"))),
transLabels2(Gtk::manage (new Gtk::Label ("---"))),
maskcolFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW")))),
maskexpFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW")))),
// Others
defparams(nullptr),
@@ -390,6 +392,7 @@ Locallab::Locallab():
sensiex->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP"));
sensiex->setAdjusterListener(this);
inversexConn = inversex->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::inversexChanged));
structexp->setAdjusterListener(this);
@@ -456,7 +459,8 @@ Locallab::Locallab():
exposeBox->pack_start(*structexp);
exposeBox->pack_start(*blurexpde);
exposeBox->pack_start(*curveEditorG, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
Gtk::Frame* const maskexpFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW")));
exposeBox->pack_start(*inversex);
// Gtk::Frame* const maskexpFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHOW")));
maskexpFrame->set_label_align(0.025, 0.5);
ToolParamBlock* const maskexpBox = Gtk::manage(new ToolParamBlock());
maskexpBox->pack_start(*transLabels2, Gtk::PACK_SHRINK, 4);
@@ -1546,6 +1550,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pp->locallab.spots.at(pp->locallab.selspot).structexp = structexp->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).blurexpde = blurexpde->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).excurve = shapeexpos->getCurve();
pp->locallab.spots.at(pp->locallab.selspot).inversex = inversex->get_active();
pp->locallab.spots.at(pp->locallab.selspot).enaExpMask = enaExpMask->get_active();
pp->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = LLmaskexpshape->getCurve();
pp->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = CCmaskexpshape->getCurve();
@@ -1706,6 +1711,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pe->locallab.spots.at(pp->locallab.selspot).structexp = pe->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).blurexpde = pe->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).excurve = pe->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged();
pe->locallab.spots.at(pp->locallab.selspot).inversex = pe->locallab.spots.at(pp->locallab.selspot).inversex || !inversex->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).enaExpMask = pe->locallab.spots.at(pp->locallab.selspot).enaExpMask || !enaExpMask->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged();
pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pe->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged();
@@ -1853,6 +1859,7 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pedited->locallab.spots.at(pp->locallab.selspot).structexp = pedited->locallab.spots.at(pp->locallab.selspot).structexp || structexp->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).blurexpde = pedited->locallab.spots.at(pp->locallab.selspot).blurexpde || blurexpde->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).excurve = pedited->locallab.spots.at(pp->locallab.selspot).excurve || !shapeexpos->isUnChanged();
pedited->locallab.spots.at(pp->locallab.selspot).inversex = pedited->locallab.spots.at(pp->locallab.selspot).inversex || !inversex->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).enaExpMask = pedited->locallab.spots.at(pp->locallab.selspot).enaExpMask || !enaExpMask->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).CCmaskexpcurve || !CCmaskexpshape->isUnChanged();
pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve = pedited->locallab.spots.at(pp->locallab.selspot).LLmaskexpcurve || !LLmaskexpshape->isUnChanged();
@@ -2337,6 +2344,58 @@ void Locallab::inversChanged()
}
}
void Locallab::inversexChanged()
{
// printf("inversChanged\n");
if (multiImage) {
if (inversex->get_inconsistent()) {
inversex->set_inconsistent(false);
inversexConn.block(true);
inversex->set_active(false);
inversexConn.block(false);
}
}
// Update Color & Light GUI according to invers button state (to be compliant with updateSpecificGUIState function)
if (multiImage && inversex->get_inconsistent()) {
sensiex->show();
curveEditorG->show();
maskexpFrame->show();
structexp->show();
blurexpde->show();
showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
} else if (inversex->get_active()) {
sensiex->show();
curveEditorG->hide();
maskexpFrame->hide();
structexp->hide();
blurexpde->hide();
} else {
sensiex->show();
curveEditorG->show();
maskexpFrame->show();
structexp->show();
blurexpde->show();
if (batchMode) {
showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
}
}
if (getEnabled() && expexpose->getEnabled()) {
if (listener) {
if (inversex->get_active()) {
listener->panelChanged(Evlocallabinversex, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(Evlocallabinversex, M("GENERAL_DISABLED"));
}
}
}
}
void Locallab::curvactivChanged()
{
// printf("curvactivChanged\n");
@@ -3533,6 +3592,7 @@ void Locallab::enableListener()
enaColorMaskConn.block(false);
// Exposure
enableexposeConn.block(false);
inversexConn.block(false);
showmaskexpMethodConn.block(false);
enaExpMaskConn.block(false);
// Vibrance
@@ -3580,6 +3640,7 @@ void Locallab::disableListener()
enaColorMaskConn.block(true);
// Exposure
enableexposeConn.block(true);
inversexConn.block(true);
showmaskexpMethodConn.block(true);
enaExpMaskConn.block(true);
// Vibrance
@@ -3658,6 +3719,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
structexp->setValue(pp->locallab.spots.at(index).structexp);
blurexpde->setValue(pp->locallab.spots.at(index).blurexpde);
shapeexpos->setCurve(pp->locallab.spots.at(index).excurve);
inversex->set_active(pp->locallab.spots.at(index).inversex);
enaExpMask->set_active(pp->locallab.spots.at(index).enaExpMask);
CCmaskexpshape->setCurve(pp->locallab.spots.at(index).CCmaskexpcurve);
LLmaskexpshape->setCurve(pp->locallab.spots.at(index).LLmaskexpcurve);
@@ -3845,6 +3907,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
structexp->setEditedState(spotState->structexp ? Edited : UnEdited);
blurexpde->setEditedState(spotState->blurexpde ? Edited : UnEdited);
shapeexpos->setUnChanged(!spotState->excurve);
inversex->set_inconsistent(multiImage && !spotState->inversex);
enaExpMask->set_inconsistent(multiImage && !spotState->enaExpMask);
CCmaskexpshape->setUnChanged(!spotState->CCmaskexpcurve);
LLmaskexpshape->setUnChanged(!spotState->LLmaskexpcurve);
@@ -3993,6 +4056,32 @@ void Locallab::updateSpecificGUIState()
}
// Update Exposure GUI according to black adjuster state (to be compliant with adjusterChanged function)
if (multiImage && inversex->get_inconsistent()) {
sensiex->show();
curveEditorG->show();
maskexpFrame->show();
structexp->show();
blurexpde->show();
showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
} else if (inversex->get_active()) {
sensiex->show();
curveEditorG->hide();
maskexpFrame->hide();
structexp->hide();
blurexpde->hide();
} else {
sensiex->show();
curveEditorG->show();
maskexpFrame->show();
structexp->show();
blurexpde->show();
if (batchMode) {
showmaskexpMethod->hide(); // Being able to change Color & Light mask visibility is useless in batch mode
}
}
if (multiImage && black->getEditedState() != Edited) {
shcompr->set_sensitive(true);
} else {

View File

@@ -171,6 +171,8 @@ private:
// Exposure
Gtk::CheckButton* const enaExpMask;
sigc::connection enaExpMaskConn;
Gtk::CheckButton* const inversex;
sigc::connection inversexConn;
// Vibrance
Gtk::CheckButton* const protectSkins;
Gtk::CheckButton* const avoidColorShift;
@@ -218,6 +220,7 @@ private:
Gtk::Label* transLabels;
Gtk::Label* transLabels2;
Gtk::Frame* maskcolFrame;
Gtk::Frame* maskexpFrame;
// Others
/**
@@ -247,6 +250,7 @@ private:
void enaColorMaskChanged();
// Exposure
void enaExpMaskChanged();
void inversexChanged();
// Vibrance
void protectskins_toggled();
void avoidcolorshift_toggled();

View File

@@ -973,6 +973,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).structexp = locallab.spots.at(j).structexp && pSpot.structexp == otherSpot.structexp;
locallab.spots.at(j).blurexpde = locallab.spots.at(j).blurexpde && pSpot.blurexpde == otherSpot.blurexpde;
locallab.spots.at(j).excurve = locallab.spots.at(j).excurve && pSpot.excurve == otherSpot.excurve;
locallab.spots.at(j).inversex = locallab.spots.at(j).inversex && pSpot.invers == otherSpot.inversex;
locallab.spots.at(j).enaExpMask = locallab.spots.at(j).enaExpMask && pSpot.enaExpMask == otherSpot.enaExpMask;
locallab.spots.at(j).CCmaskexpcurve = locallab.spots.at(j).CCmaskexpcurve && pSpot.CCmaskexpcurve == otherSpot.CCmaskexpcurve;
locallab.spots.at(j).LLmaskexpcurve = locallab.spots.at(j).LLmaskexpcurve && pSpot.LLmaskexpcurve == otherSpot.LLmaskexpcurve;
@@ -2679,6 +2680,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).excurve = mods.locallab.spots.at(i).excurve;
}
if (locallab.spots.at(i).inversex) {
toEdit.locallab.spots.at(i).inversex = mods.locallab.spots.at(i).inversex;
}
if (locallab.spots.at(i).enaExpMask) {
toEdit.locallab.spots.at(i).enaExpMask = mods.locallab.spots.at(i).enaExpMask;
}
@@ -3975,6 +3980,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
structexp(v),
blurexpde(v),
excurve(v),
inversex(v),
enaExpMask(v),
CCmaskexpcurve(v),
LLmaskexpcurve(v),
@@ -4114,6 +4120,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
structexp = v;
blurexpde = v;
excurve = v;
inversex = v;
enaExpMask = v;
CCmaskexpcurve = v;
LLmaskexpcurve = v;

View File

@@ -512,6 +512,7 @@ public:
bool structexp;
bool blurexpde;
bool excurve;
bool inversex;
bool enaExpMask;
bool CCmaskexpcurve;
bool LLmaskexpcurve;