Added common mask blur mask

This commit is contained in:
Desmis 2020-06-22 17:59:58 +02:00
parent 0fe20b52d6
commit bc740affe8
9 changed files with 77 additions and 8 deletions

View File

@ -1181,6 +1181,8 @@ 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_945;Local - Mask Common Blur radius
HISTORY_MSG_946;Local - Mask Common contrast threshold
HISTORY_MSG_CAT02PRESET;Cat02 automatic preset
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction

View File

@ -967,6 +967,8 @@ enum ProcEventCode {
Evlocallabstrumaskmask = 941,
EvlocallabHHhmask_shape = 942,
EvLocallabfftmask = 943,
Evlocallabblurmask = 944,
Evlocallabcontmask = 945,
NUMOFEVENTS
};

View File

@ -3741,6 +3741,8 @@ LocallabParams::LocallabSpot::LocallabSpot() :
blendmask(0),
enamask(false),
fftmask(true),
blurmask(0.2),
contmask(0.),
CCmask_curve{
static_cast<double>(FCT_MinMaxCPoints),
0.0,
@ -4287,6 +4289,8 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& blendmask == other.blendmask
&& enamask == other.enamask
&& fftmask == other.fftmask
&& blurmask == other.blurmask
&& contmask == other.contmask
&& CCmask_curve == other.CCmask_curve
&& LLmask_curve == other.LLmask_curve
&& HHmask_curve == other.HHmask_curve
@ -5800,6 +5804,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
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->blurmask, "Locallab", "Blurmask_" + index_str, spot.blurmask, keyFile);
saveToKeyfile(!pedited || spot_edited->contmask, "Locallab", "Contmask_" + index_str, spot.contmask, 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);
@ -7532,6 +7538,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
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", "Blurmask_" + index_str, pedited, spot.blurmask, spotEdited.blurmask);
assignFromKeyfile(keyFile, "Locallab", "Contmask_" + index_str, pedited, spot.contmask, spotEdited.contmask);
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

@ -1429,6 +1429,8 @@ struct LocallabParams {
int blendmask;
bool enamask;
bool fftmask;
double blurmask;
double contmask;
std::vector<double> CCmask_curve;
std::vector<double> LLmask_curve;
std::vector<double> HHmask_curve;

View File

@ -970,7 +970,9 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, // EvLocallabtoolmask
LUMINANCECURVE, // Evlocallabstrumaskmask
LUMINANCECURVE, // EvlocallabHHhmask_shape
LUMINANCECURVE // EvLocallabfftmask
LUMINANCECURVE, // EvLocallabfftmask
LUMINANCECURVE, // Evlocallabblurmask
LUMINANCECURVE // Evlocallabcontmask
};

View File

@ -1217,6 +1217,8 @@ private:
Gtk::CheckButton* const toolmask;
Gtk::Frame* const blurFrame;
Gtk::CheckButton* const fftmask;
Adjuster* const contmask;
Adjuster* const blurmask;
Adjuster* const radmask;
Adjuster* const lapmask;

View File

@ -4744,6 +4744,8 @@ LocallabMask::LocallabMask():
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")))),
contmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTCOL"), 0., 200., 0.5, 0.))),
blurmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCOL"), 0.2, 100., 0.5, 0.2))),
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.))),
@ -4793,6 +4795,9 @@ LocallabMask::LocallabMask():
blurFrame->set_label_align(0.025, 0.5);
fftmaskConn = fftmask->signal_toggled().connect(sigc::mem_fun(*this, &LocallabMask::fftmaskChanged));
contmask->setAdjusterListener(this);
blurmask->setAdjusterListener(this);
radmask->setAdjusterListener(this);
lapmask->setAdjusterListener(this);
@ -4826,6 +4831,8 @@ LocallabMask::LocallabMask():
ToolParamBlock* const blurmBox = Gtk::manage(new ToolParamBlock());
blurmBox->pack_start(*fftmask, Gtk::PACK_SHRINK, 0);
blurmBox->pack_start(*contmask);
blurmBox->pack_start(*blurmask);
blurFrame->add(*blurmBox);
maskmaskBox->pack_start(*blurFrame, Gtk::PACK_SHRINK, 0);
@ -4951,7 +4958,9 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params
sensimask->setValue(spot.sensimask);
contmask->setValue(spot.contmask);
updatemaskGUI3();
blurmask->setValue(spot.blurmask);
blendmask->setValue(spot.blendmask);
enamask->set_active(spot.enamask);
@ -5008,6 +5017,8 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped
spot.slopmask = slopmask->getValue();
spot.HHhmask_curve = HHhmask_shape->getCurve();
spot.fftmask = fftmask->get_active();
spot.contmask = contmask->getValue();
spot.blurmask = blurmask->getValue();
}
@ -5049,6 +5060,8 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams
lapmask->setDefault(defSpot.lapmask);
slopmask->setDefault(defSpot.slopmask);
HHhmask_shape->setCurve(defSpot.HHhmask_curve);
contmask->setDefault(defSpot.contmask);
blurmask->setDefault(defSpot.blurmask);
}
@ -5064,6 +5077,8 @@ void LocallabMask::updateGUIToMode(const modeType new_type)
slopmask->hide();
struFrame->hide();
blurFrame->hide();
mask_HCurveEditorG->hide();
} else {
// Advanced widgets are shown in Expert mode
lapmask->show();
@ -5071,6 +5086,8 @@ void LocallabMask::updateGUIToMode(const modeType new_type)
slopmask->show();
struFrame->show();
blurFrame->show();
mask_HCurveEditorG->show();
}
}
@ -5088,6 +5105,9 @@ void LocallabMask::convertParamToNormal()
strumaskmask->setValue(defSpot.strumaskmask);
toolmask->set_active(defSpot.toolmask);
fftmask->set_active(defSpot.fftmask);
blurmask->setValue(defSpot.blurmask);
contmask->setValue(defSpot.contmask);
HHhmask_shape->setCurve(defSpot.HHhmask_curve);
// Enable all listeners
enableListener();
@ -5095,17 +5115,17 @@ void LocallabMask::convertParamToNormal()
}
void LocallabMask::updatemaskGUI3()
{ /*
const double temp = blurcol->getValue();
{
const double temp = blurmask->getValue();
if (fftColorMask->get_active()) {
blurcol->setLimits(0.2, 1000., 0.5, 0.2);
if (fftmask->get_active()) {
blurmask->setLimits(0.2, 1000., 0.5, 0.2);
} else {
blurcol->setLimits(0.2, 100., 0.5, 0.2);
blurmask->setLimits(0.2, 100., 0.5, 0.2);
}
blurcol->setValue(temp);
*/
blurmask->setValue(temp);
}
@ -5183,6 +5203,21 @@ void LocallabMask::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == contmask) {
if (listener) {
listener->panelChanged(Evlocallabcontmask,
contmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == blurmask) {
if (listener) {
listener->panelChanged(Evlocallabblurmask,
blurmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == blendmask) {
if (listener) {
listener->panelChanged(Evlocallabblendmask,

View File

@ -1485,6 +1485,8 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
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).blurmask = locallab.spots.at(j).blurmask && pSpot.blurmask == otherSpot.blurmask;
locallab.spots.at(j).contmask = locallab.spots.at(j).contmask && pSpot.contmask == otherSpot.contmask;
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;
@ -4830,6 +4832,14 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).fftmask = mods.locallab.spots.at(i).fftmask;
}
if (locallab.spots.at(i).blurmask) {
toEdit.locallab.spots.at(i).blurmask = mods.locallab.spots.at(i).blurmask;
}
if (locallab.spots.at(i).contmask) {
toEdit.locallab.spots.at(i).contmask = mods.locallab.spots.at(i).contmask;
}
if (locallab.spots.at(i).CCmask_curve) {
toEdit.locallab.spots.at(i).CCmask_curve = mods.locallab.spots.at(i).CCmask_curve;
}
@ -6451,6 +6461,8 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
blendmask(v),
enamask(v),
fftmask(v),
blurmask(v),
contmask(v),
CCmask_curve(v),
LLmask_curve(v),
HHmask_curve(v),
@ -6931,6 +6943,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
blendmask = v;
enamask = v;
fftmask = v;
blurmask = v;
contmask = v;
CCmask_curve = v;
LLmask_curve = v;
HHmask_curve = v;

View File

@ -843,6 +843,8 @@ public:
bool blendmask;
bool enamask;
bool fftmask;
bool blurmask;
bool contmask;
bool CCmask_curve;
bool LLmask_curve;
bool HHmask_curve;