Added mask common fft checkbutton

This commit is contained in:
Desmis 2020-06-22 17:18:39 +02:00
parent cc6e837e75
commit 0fe20b52d6
9 changed files with 78 additions and 5 deletions

View File

@ -1180,6 +1180,7 @@ HISTORY_MSG_940;Local - Mask Common curve LC(H)
HISTORY_MSG_941;Local - Mask Common structure as tool
HISTORY_MSG_942;Local - Mask Common structure strength
HISTORY_MSG_943;Local - Mask Common H(H) curve
HISTORY_MSG_944;Local - Mask Common FFT
HISTORY_MSG_CAT02PRESET;Cat02 automatic preset
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction

View File

@ -966,6 +966,7 @@ enum ProcEventCode {
EvLocallabtoolmask = 940,
Evlocallabstrumaskmask = 941,
EvlocallabHHhmask_shape = 942,
EvLocallabfftmask = 943,
NUMOFEVENTS
};

View File

@ -3740,6 +3740,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
sensimask(60),
blendmask(0),
enamask(false),
fftmask(true),
CCmask_curve{
static_cast<double>(FCT_MinMaxCPoints),
0.0,
@ -4285,6 +4286,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& sensimask == other.sensimask
&& blendmask == other.blendmask
&& enamask == other.enamask
&& fftmask == other.fftmask
&& CCmask_curve == other.CCmask_curve
&& LLmask_curve == other.LLmask_curve
&& HHmask_curve == other.HHmask_curve
@ -5797,6 +5799,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->sensimask, "Locallab", "Sensimask_" + index_str, spot.sensimask, keyFile);
saveToKeyfile(!pedited || spot_edited->blendmask, "Locallab", "Blendmaskmask_" + index_str, spot.blendmask, keyFile);
saveToKeyfile(!pedited || spot_edited->enamask, "Locallab", "Enamask_" + index_str, spot.enamask, keyFile);
saveToKeyfile(!pedited || spot_edited->fftmask, "Locallab", "Fftmask_" + index_str, spot.fftmask, keyFile);
saveToKeyfile(!pedited || spot_edited->CCmask_curve, "Locallab", "CCmask_Curve_" + index_str, spot.CCmask_curve, keyFile);
saveToKeyfile(!pedited || spot_edited->LLmask_curve, "Locallab", "LLmask_Curve_" + index_str, spot.LLmask_curve, keyFile);
saveToKeyfile(!pedited || spot_edited->HHmask_curve, "Locallab", "HHmask_Curve_" + index_str, spot.HHmask_curve, keyFile);
@ -7528,6 +7531,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Sensimask_" + index_str, pedited, spot.sensimask, spotEdited.sensimask);
assignFromKeyfile(keyFile, "Locallab", "Blendmaskmask_" + index_str, pedited, spot.blendmask, spotEdited.blendmask);
assignFromKeyfile(keyFile, "Locallab", "Enamask_" + index_str, pedited, spot.enamask, spotEdited.enamask);
assignFromKeyfile(keyFile, "Locallab", "Fftmask_" + index_str, pedited, spot.fftmask, spotEdited.fftmask);
assignFromKeyfile(keyFile, "Locallab", "CCmask_Curve_" + index_str, pedited, spot.CCmask_curve, spotEdited.CCmask_curve);
assignFromKeyfile(keyFile, "Locallab", "LLmask_Curve_" + index_str, pedited, spot.LLmask_curve, spotEdited.LLmask_curve);
assignFromKeyfile(keyFile, "Locallab", "HHmask_Curve_" + index_str, pedited, spot.HHmask_curve, spotEdited.HHmask_curve);

View File

@ -1428,6 +1428,7 @@ struct LocallabParams {
int sensimask;
int blendmask;
bool enamask;
bool fftmask;
std::vector<double> CCmask_curve;
std::vector<double> LLmask_curve;
std::vector<double> HHmask_curve;

View File

@ -969,7 +969,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, // EvlocallabHHmask_shape
LUMINANCECURVE, // EvLocallabtoolmask
LUMINANCECURVE, // Evlocallabstrumaskmask
LUMINANCECURVE //EvlocallabHHhmask_shape
LUMINANCECURVE, // EvlocallabHHhmask_shape
LUMINANCECURVE // EvLocallabfftmask
};

View File

@ -1215,6 +1215,8 @@ private:
Gtk::Frame* const struFrame;
Adjuster* const strumaskmask;
Gtk::CheckButton* const toolmask;
Gtk::Frame* const blurFrame;
Gtk::CheckButton* const fftmask;
Adjuster* const radmask;
Adjuster* const lapmask;
@ -1224,7 +1226,7 @@ private:
CurveEditorGroup* const mask_HCurveEditorG;
FlatCurveEditor* const HHhmask_shape;
sigc::connection showmaskMethodConn, enamaskConn, toolmaskConn;
sigc::connection showmaskMethodConn, enamaskConn, toolmaskConn, fftmaskConn;
public:
LocallabMask();
@ -1253,6 +1255,8 @@ private:
void toolmaskChanged();
void convertParamToNormal() override;
void updateGUIToMode(const modeType new_type) override;
void fftmaskChanged();
void updatemaskGUI3();
/*
void autocomputeToggled();

View File

@ -4742,7 +4742,9 @@ LocallabMask::LocallabMask():
struFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABSTRUM")))),
strumaskmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUMASKCOL"), 0., 200., 0.1, 0.))),
toolmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_TOOLCOL")))),
blurFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABBLURM")))),
fftmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_FFTCOL_MASK")))),
radmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADMASKCOL"), -10.0, 1000.0, 0.1, 0.))),
lapmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LAPMASKCOL"), 0.0, 100.0, 0.1, 0.))),
chromask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))),
@ -4788,6 +4790,9 @@ LocallabMask::LocallabMask():
strumaskmask->setAdjusterListener(this);
toolmaskConn = toolmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::toolmaskChanged));
blurFrame->set_label_align(0.025, 0.5);
fftmaskConn = fftmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::fftmaskChanged));
radmask->setAdjusterListener(this);
lapmask->setAdjusterListener(this);
@ -4819,6 +4824,11 @@ LocallabMask::LocallabMask():
struFrame->add(*strumBox);
maskmaskBox->pack_start(*struFrame, Gtk::PACK_SHRINK, 0);
ToolParamBlock* const blurmBox = Gtk::manage(new ToolParamBlock());
blurmBox->pack_start(*fftmask, Gtk::PACK_SHRINK, 0);
blurFrame->add(*blurmBox);
maskmaskBox->pack_start(*blurFrame, Gtk::PACK_SHRINK, 0);
Gtk::Frame* const toolmaskFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_TOOLMASK")));
toolmaskFrame->set_label_align(0.025, 0.5);
ToolParamBlock* const toolmaskBox = Gtk::manage(new ToolParamBlock());
@ -4894,6 +4904,7 @@ void LocallabMask::disableListener()
showmaskMethodConn.block(true);
enamaskConn.block(true);
toolmaskConn.block(true);
fftmaskConn.block(true);
}
@ -4903,6 +4914,7 @@ void LocallabMask::enableListener()
showmaskMethodConn.block(false);
enamaskConn.block(false);
toolmaskConn.block(false);
fftmaskConn.block(false);
}
@ -4936,9 +4948,11 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params
exp->set_visible(spot.visimask);
exp->setEnabled(spot.expmask);
complexity->set_active(spot.complexmask);
sensimask->setValue(spot.sensimask);
updatemaskGUI3();
blendmask->setValue(spot.blendmask);
enamask->set_active(spot.enamask);
CCmask_shape->setCurve(spot.CCmask_curve);
@ -4952,6 +4966,7 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params
gammask->setValue(spot.gammask);
slopmask->setValue(spot.slopmask);
HHhmask_shape->setCurve(spot.HHhmask_curve);
fftmask->set_active(spot.fftmask);
}
@ -4992,6 +5007,7 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped
spot.gammask = gammask->getValue();
spot.slopmask = slopmask->getValue();
spot.HHhmask_curve = HHhmask_shape->getCurve();
spot.fftmask = fftmask->get_active();
}
@ -5047,12 +5063,14 @@ void LocallabMask::updateGUIToMode(const modeType new_type)
gammask->hide();
slopmask->hide();
struFrame->hide();
blurFrame->hide();
} else {
// Advanced widgets are shown in Expert mode
lapmask->show();
gammask->show();
slopmask->show();
struFrame->show();
blurFrame->show();
}
}
@ -5069,12 +5087,47 @@ void LocallabMask::convertParamToNormal()
slopmask->setValue(defSpot.slopmask);
strumaskmask->setValue(defSpot.strumaskmask);
toolmask->set_active(defSpot.toolmask);
fftmask->set_active(defSpot.fftmask);
// Enable all listeners
enableListener();
}
void LocallabMask::updatemaskGUI3()
{ /*
const double temp = blurcol->getValue();
if (fftColorMask->get_active()) {
blurcol->setLimits(0.2, 1000., 0.5, 0.2);
} else {
blurcol->setLimits(0.2, 100., 0.5, 0.2);
}
blurcol->setValue(temp);
*/
}
void LocallabMask::fftmaskChanged()
{
updatemaskGUI3(); // Update GUI according to fftmask button state
if (isLocActivated && exp->getEnabled()) {
if (listener) {
if (fftmask->get_active()) {
listener->panelChanged(EvLocallabfftmask,
M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")");
} else {
listener->panelChanged(EvLocallabfftmask,
M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")");
}
}
}
}
void LocallabMask::curveChanged(CurveEditor* ce)
{
if (isLocActivated && exp->getEnabled()) {

View File

@ -1484,6 +1484,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).sensimask = locallab.spots.at(j).sensimask && pSpot.sensimask == otherSpot.sensimask;
locallab.spots.at(j).blendmask = locallab.spots.at(j).blendmask && pSpot.blendmask == otherSpot.blendmask;
locallab.spots.at(j).enamask = locallab.spots.at(j).enamask && pSpot.enamask == otherSpot.enamask;
locallab.spots.at(j).fftmask = locallab.spots.at(j).fftmask && pSpot.fftmask == otherSpot.fftmask;
locallab.spots.at(j).CCmask_curve = locallab.spots.at(j).CCmask_curve && pSpot.CCmask_curve == otherSpot.CCmask_curve;
locallab.spots.at(j).LLmask_curve = locallab.spots.at(j).LLmask_curve && pSpot.LLmask_curve == otherSpot.LLmask_curve;
locallab.spots.at(j).HHmask_curve = locallab.spots.at(j).HHmask_curve && pSpot.HHmask_curve == otherSpot.HHmask_curve;
@ -4825,6 +4826,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).enamask = mods.locallab.spots.at(i).enamask;
}
if (locallab.spots.at(i).fftmask) {
toEdit.locallab.spots.at(i).fftmask = mods.locallab.spots.at(i).fftmask;
}
if (locallab.spots.at(i).CCmask_curve) {
toEdit.locallab.spots.at(i).CCmask_curve = mods.locallab.spots.at(i).CCmask_curve;
}
@ -6445,6 +6450,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
sensimask(v),
blendmask(v),
enamask(v),
fftmask(v),
CCmask_curve(v),
LLmask_curve(v),
HHmask_curve(v),
@ -6924,6 +6930,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
sensimask = v;
blendmask = v;
enamask = v;
fftmask = v;
CCmask_curve = v;
LLmask_curve = v;
HHmask_curve = v;

View File

@ -842,6 +842,7 @@ public:
bool sensimask;
bool blendmask;
bool enamask;
bool fftmask;
bool CCmask_curve;
bool LLmask_curve;
bool HHmask_curve;