Added mask common scope and blend

This commit is contained in:
Desmis 2020-06-21 12:33:15 +02:00
parent 0884203966
commit 5ac22b6564
9 changed files with 91 additions and 15 deletions

View File

@ -1165,6 +1165,9 @@ HISTORY_MSG_924;Local - Tool complexity mode
HISTORY_MSG_925;Local - Scope color tools
HISTORY_MSG_926;Local - Show mask type
HISTORY_MSG_927;Local - Shadow mask
HISTORY_MSG_928;Local - Common color mask
HISTORY_MSG_929;Local - Mask common scope
HISTORY_MSG_930;Local - Mask Common blend
HISTORY_MSG_CAT02PRESET;Cat02 automatic preset
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
@ -2554,7 +2557,9 @@ TP_LOCALLAB_LUMADARKEST;Darkest
TP_LOCALLAB_LUMASK;Luminance Background Mask
TP_LOCALLAB_LUMASK_TOOLTIP;Adjust the gray of the mask background in Show Mask (Mask and modifications)
TP_LOCALLAB_LUMAWHITESEST;Whiteest
TP_LOCALLAB_LUMONLY;Luminance only
TP_LOCALLAB_LUMONLY;Luminance only
TP_LOCALLAB_MASKCOM;Common Color Mask
TP_LOCALLAB_MASKCOM_TOOLTIP;These masks works as all tools, they take into account scope color.\nThey are different from others masks which complete a tool (Color and Light, Exposure...)
TP_LOCALLAB_MASFRAME;Mask and Merge
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 curves contrast , levels contrasts, and mask blur, structure(if enabled tool) are used.\nDisabled in Inverse
TP_LOCALLAB_MASK2;Contrast curve mask
@ -2819,6 +2824,7 @@ TP_LOCALLAB_SHARP_TOOLNAME;Sharpening - 8
TP_LOCALLAB_LC_TOOLNAME;Local Constrast & Wavelet (Defects) - 7
TP_LOCALLAB_CBDL_TOOLNAME;CBDL (Defects) - 2
TP_LOCALLAB_LOG_TOOLNAME;Encoding log - 0
TP_LOCALLAB_MASKCOM_TOOLNAME;Common Color Mask - 13
TP_LOCALLAB_WAMASKCOL;Ψ Mask Wavelet level
TP_LOCALLAB_WARM;Warm - Cool & Color artifacts
TP_LOCALLAB_WARM_TOOLTIP;This slider use Ciecam algorithm and acts as White Balance, it can warm or cool the area selected.\nIt can also in some cases reduce color artifacts.

View File

@ -951,6 +951,8 @@ enum ProcEventCode {
EvlocallabshowmasktypMethod = 925,
Evlocallabshadmaskblsha = 926,
EvLocenamask = 927,
Evlocallabsensimask = 928,
Evlocallabblendmask = 929,
NUMOFEVENTS
};

View File

@ -3735,7 +3735,9 @@ LocallabParams::LocallabSpot::LocallabSpot() :
anglog(0.0),
// mask
visimask(false),
expmask(false)
expmask(false),
sensimask(60),
blendmask(0)
{
}
@ -4209,8 +4211,10 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& anglog == other.anglog
// mask
&& visimask == other.visimask
&& expmask == other.expmask;
&& expmask == other.expmask
&& sensimask == other.sensimask
&& blendmask == other.blendmask;
}
bool LocallabParams::LocallabSpot::operator !=(const LocallabSpot& other) const
@ -5707,6 +5711,8 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
//mask
if ((!pedited || spot_edited->visimask) && spot.visimask) {
saveToKeyfile(!pedited || spot_edited->expmask, "Locallab", "Expmask_" + index_str, spot.expmask, keyFile);
saveToKeyfile(!pedited || spot_edited->sensimask, "Locallab", "Sensimask_" + index_str, spot.sensimask, keyFile);
saveToKeyfile(!pedited || spot_edited->blendmask, "Locallab", "Blendmaskmask_" + index_str, spot.blendmask, keyFile);
}
}
}
@ -7423,6 +7429,8 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Anglog_" + index_str, pedited, spot.anglog, spotEdited.anglog);
// mask
spot.visimask = assignFromKeyfile(keyFile, "Locallab", "Expmask_" + index_str, pedited, spot.expmask, spotEdited.expmask);
assignFromKeyfile(keyFile, "Locallab", "Sensimask_" + index_str, pedited, spot.sensimask, spotEdited.sensimask);
assignFromKeyfile(keyFile, "Locallab", "Blendmaskmask_" + index_str, pedited, spot.blendmask, spotEdited.blendmask);
if (spot.visimask) {
spotEdited.visimask = true;

View File

@ -1424,6 +1424,8 @@ struct LocallabParams {
// mask
bool visimask;
bool expmask;
int sensimask;
int blendmask;
LocallabSpot();

View File

@ -951,10 +951,12 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, // Evlocallabblwh
LUMINANCECURVE, // EvlocallabcomplexityWithRefresh
M_VOID, // EvlocallabcomplexityWithoutRefresh
LUMINANCECURVE, // EvLocallabSpotcolorscope
LUMINANCECURVE, //EvlocallabshowmasktypMethod
LUMINANCECURVE, // EvLocallabSpotcolorscope
LUMINANCECURVE, //EvlocallabshowmasktypMethod
LUMINANCECURVE, // Evlocallabshadmaskblsha
LUMINANCECURVE //EvLocenamask
LUMINANCECURVE, // EvLocenamask
LUMINANCECURVE, //Evlocallabsensimask
LUMINANCECURVE //Evlocallabblendmask
};

View File

@ -1203,6 +1203,9 @@ class LocallabMask:
public LocallabTool
{
private:
Adjuster* const sensimask;
Adjuster* const blendmask;
/*
Gtk::ToggleButton* const autocompute;
Gtk::Frame* const logPFrame;

View File

@ -4727,18 +4727,31 @@ void LocallabLog::updateLogGUI()
/* ==== LocallabMask ==== */
LocallabMask::LocallabMask():
LocallabTool(this, M("TP_LOCALLAB_MASK_TOOLNAME"), M("TP_LOCALLAB_MASK"), false, false)
LocallabTool(this, M("TP_LOCALLAB_MASKCOM_TOOLNAME"), M("TP_LOCALLAB_MASKCOM"), false, false),
sensimask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSI"), 0, 100, 1, 60))),
blendmask(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0)))
{
// Parameter Mask encoding specific widgets
// Parameter Mask common specific widgets
sensimask->setAdjusterListener(this);
blendmask->setAdjusterListener(this);
pack_start(*sensimask, Gtk::PACK_SHRINK, 0);
pack_start(*blendmask, Gtk::PACK_SHRINK, 0);
}
void LocallabMask::updateAdviceTooltips(const bool showTooltips)
{
if (showTooltips) {
exp->set_tooltip_text(M("TP_LOCALLAB_MASK_TOOLTIP"));
exp->set_tooltip_text(M("TP_LOCALLAB_MASKCOM_TOOLTIP"));
sensimask->set_tooltip_text(M("TP_LOCALLAB_SENSI_TOOLTIP"));
blendmask->set_tooltip_text(M("TP_LOCALLAB_BLENDMASK_TOOLTIP"));
} else {
exp->set_tooltip_text(M(""));
sensimask->set_tooltip_text(M(""));
blendmask->set_tooltip_text(M(""));
}
}
@ -4769,6 +4782,10 @@ void LocallabMask::read(const rtengine::procparams::ProcParams* pp, const Params
exp->set_visible(spot.visimask);
exp->setEnabled(spot.expmask);
sensimask->setValue(spot.sensimask);
blendmask->setValue(spot.blendmask);
}
@ -4790,6 +4807,9 @@ void LocallabMask::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped
spot.expmask = exp->getEnabled();
spot.visimask = exp->get_visible();
spot.sensimask = sensimask->getIntValue();
spot.blendmask = blendmask->getIntValue();
}
@ -4804,6 +4824,9 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams
const LocallabParams::LocallabSpot& defSpot = defParams->locallab.spots.at(index);
// Set default value for adjuster widgets
sensimask->setDefault((double)defSpot.sensimask);
blendmask->setDefault((double)defSpot.blendmask);
}
// Note: No need to manage pedited as batch mode is deactivated for Locallab
@ -4812,6 +4835,22 @@ void LocallabMask::setDefaults(const rtengine::procparams::ProcParams* defParams
void LocallabMask::adjusterChanged(Adjuster* a, double newval)
{
if (isLocActivated && exp->getEnabled()) {
if (a == sensimask) {
if (listener) {
listener->panelChanged(Evlocallabsensimask,
sensimask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == blendmask) {
if (listener) {
listener->panelChanged(Evlocallabblendmask,
blendmask->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
}
}

View File

@ -1480,7 +1480,8 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
//mask
locallab.spots.at(j).visimask = locallab.spots.at(j).visimask && pSpot.visimask == otherSpot.visimask;
locallab.spots.at(j).expmask = locallab.spots.at(j).expmask && pSpot.expmask == otherSpot.expmask;
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;
}
}
@ -4791,10 +4792,18 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).visimask = mods.locallab.spots.at(i).visimask;
}
if (locallab.spots.at(i).explog) {
if (locallab.spots.at(i).expmask) {
toEdit.locallab.spots.at(i).expmask = mods.locallab.spots.at(i).expmask;
}
if (locallab.spots.at(i).sensimask) {
toEdit.locallab.spots.at(i).sensimask = mods.locallab.spots.at(i).sensimask;
}
if (locallab.spots.at(i).blendmask) {
toEdit.locallab.spots.at(i).blendmask = mods.locallab.spots.at(i).blendmask;
}
}
if (pcvignette.enabled) {
@ -6366,7 +6375,9 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
anglog(v),
// mask
visimask(v),
expmask(v)
expmask(v),
sensimask(v),
blendmask(v)
{
}
@ -6831,7 +6842,8 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
// mask
visimask = v;
expmask = v;
sensimask = v;
blendmask = v;
}
bool CaptureSharpeningParamsEdited::isUnchanged() const

View File

@ -838,6 +838,8 @@ public:
//mask
bool visimask;
bool expmask;
bool sensimask;
bool blendmask;
LocallabSpotEdited(bool v);