removed local contrast inside the S/H tool (remapped to the new local contrast tool)
See #4247
This commit is contained in:
parent
48ecbd169d
commit
156cb762ec
@ -3107,8 +3107,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
}
|
||||
|
||||
bool processSH = params->sh.enabled && shmap && (params->sh.highlights > 0 || params->sh.shadows > 0);
|
||||
bool processLCE = params->sh.enabled && shmap && params->sh.localcontrast > 0;
|
||||
double lceamount = params->sh.localcontrast / 200.0;
|
||||
|
||||
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working);
|
||||
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working);
|
||||
@ -3497,7 +3495,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
}
|
||||
}
|
||||
|
||||
if (processSH || processLCE) {
|
||||
if (processSH) {
|
||||
for (int i = istart, ti = 0; i < tH; i++, ti++) {
|
||||
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
|
||||
|
||||
@ -3516,19 +3514,12 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer
|
||||
}
|
||||
}
|
||||
|
||||
if (processLCE) {
|
||||
double sub = lceamount * (mapval - factor * (r * lumimul[0] + g * lumimul[1] + b * lumimul[2]));
|
||||
rtemp[ti * TS + tj] = factor * r - sub;
|
||||
gtemp[ti * TS + tj] = factor * g - sub;
|
||||
btemp[ti * TS + tj] = factor * b - sub;
|
||||
} else {
|
||||
rtemp[ti * TS + tj] = factor * r;
|
||||
gtemp[ti * TS + tj] = factor * g;
|
||||
btemp[ti * TS + tj] = factor * b;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = istart, ti = 0; i < tH; i++, ti++) {
|
||||
for (int j = jstart, tj = 0; j < tW; j++, tj++) {
|
||||
|
@ -1492,7 +1492,6 @@ SHParams::SHParams() :
|
||||
htonalwidth(80),
|
||||
shadows(0),
|
||||
stonalwidth(80),
|
||||
localcontrast(0),
|
||||
radius(40)
|
||||
{
|
||||
}
|
||||
@ -1506,7 +1505,6 @@ bool SHParams::operator ==(const SHParams& other) const
|
||||
&& htonalwidth == other.htonalwidth
|
||||
&& shadows == other.shadows
|
||||
&& stonalwidth == other.stonalwidth
|
||||
&& localcontrast == other.localcontrast
|
||||
&& radius == other.radius;
|
||||
}
|
||||
|
||||
@ -3043,7 +3041,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
||||
saveToKeyfile(!pedited || pedited->sh.htonalwidth, "Shadows & Highlights", "HighlightTonalWidth", sh.htonalwidth, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->sh.shadows, "Shadows & Highlights", "Shadows", sh.shadows, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->sh.stonalwidth, "Shadows & Highlights", "ShadowTonalWidth", sh.stonalwidth, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->sh.localcontrast, "Shadows & Highlights", "LocalContrast", sh.localcontrast, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->sh.radius, "Shadows & Highlights", "Radius", sh.radius, keyFile);
|
||||
|
||||
// Crop
|
||||
@ -3934,8 +3931,22 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
||||
assignFromKeyfile(keyFile, "Shadows & Highlights", "HighlightTonalWidth", pedited, sh.htonalwidth, pedited->sh.htonalwidth);
|
||||
assignFromKeyfile(keyFile, "Shadows & Highlights", "Shadows", pedited, sh.shadows, pedited->sh.shadows);
|
||||
assignFromKeyfile(keyFile, "Shadows & Highlights", "ShadowTonalWidth", pedited, sh.stonalwidth, pedited->sh.stonalwidth);
|
||||
assignFromKeyfile(keyFile, "Shadows & Highlights", "LocalContrast", pedited, sh.localcontrast, pedited->sh.localcontrast);
|
||||
assignFromKeyfile(keyFile, "Shadows & Highlights", "Radius", pedited, sh.radius, pedited->sh.radius);
|
||||
if (keyFile.has_key("Shadows & Highlights", "LocalContrast") && ppVersion < 329) {
|
||||
int lc = keyFile.get_integer("Shadows & Highlights", "LocalContrast");
|
||||
localContrast.amount = float(lc) / (sh.hq ? 500.0 : 30.);
|
||||
if (pedited) {
|
||||
pedited->localContrast.amount = true;
|
||||
}
|
||||
localContrast.enabled = sh.enabled;
|
||||
if (pedited) {
|
||||
pedited->localContrast.enabled = true;
|
||||
}
|
||||
localContrast.radius = sh.radius;
|
||||
if (pedited) {
|
||||
pedited->localContrast.radius = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (keyFile.has_group ("Crop")) {
|
||||
|
@ -738,7 +738,6 @@ struct SHParams {
|
||||
int htonalwidth;
|
||||
int shadows;
|
||||
int stonalwidth;
|
||||
int localcontrast;
|
||||
int radius;
|
||||
|
||||
SHParams();
|
||||
|
@ -11,7 +11,7 @@ enum {
|
||||
ADDSET_TC_CONTRAST,
|
||||
ADDSET_SH_HIGHLIGHTS,
|
||||
ADDSET_SH_SHADOWS,
|
||||
ADDSET_SH_LOCALCONTRAST,
|
||||
ADDSET_SH_LOCALCONTRAST, // not used anymore
|
||||
ADDSET_LC_BRIGHTNESS,
|
||||
ADDSET_LC_CONTRAST,
|
||||
ADDSET_SHARP_AMOUNT,
|
||||
|
@ -160,7 +160,7 @@ void BatchToolPanelCoordinator::initSession ()
|
||||
filmSimulation->setAdjusterBehavior(false);
|
||||
retinex->setAdjusterBehavior (false, false, false, false, false, false, false);
|
||||
|
||||
shadowshighlights->setAdjusterBehavior (false, false, false);
|
||||
shadowshighlights->setAdjusterBehavior (false, false);
|
||||
dirpyrequalizer->setAdjusterBehavior (false, false, false);
|
||||
wavelet->setAdjusterBehavior (false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
|
||||
dirpyrdenoise->setAdjusterBehavior (false, false, false, false, false, false, false);
|
||||
@ -205,7 +205,7 @@ void BatchToolPanelCoordinator::initSession ()
|
||||
|
||||
chmixer->setAdjusterBehavior (options.baBehav[ADDSET_CHMIXER] );
|
||||
blackwhite->setAdjusterBehavior (options.baBehav[ADDSET_BLACKWHITE_HUES], options.baBehav[ADDSET_BLACKWHITE_GAMMA]);
|
||||
shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS], options.baBehav[ADDSET_SH_LOCALCONTRAST]);
|
||||
shadowshighlights->setAdjusterBehavior (options.baBehav[ADDSET_SH_HIGHLIGHTS], options.baBehav[ADDSET_SH_SHADOWS]);
|
||||
dirpyrequalizer->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYREQ], options.baBehav[ADDSET_DIRPYREQ_THRESHOLD], options.baBehav[ADDSET_DIRPYREQ_SKINPROTECT]);
|
||||
wavelet->setAdjusterBehavior (options.baBehav[ADDSET_WA], options.baBehav[ADDSET_WA_THRESHOLD], options.baBehav[ADDSET_WA_THRESHOLD2], options.baBehav[ADDSET_WA_THRES], options.baBehav[ADDSET_WA_CHRO], options.baBehav[ADDSET_WA_CHROMA], options.baBehav[ADDSET_WA_CONTRAST], options.baBehav[ADDSET_WA_SKINPROTECT], options.baBehav[ADDSET_WA_RESCHRO], options.baBehav[ADDSET_WA_TMRS], options.baBehav[ADDSET_WA_RESCON], options.baBehav[ADDSET_WA_RESCONH], options.baBehav[ADDSET_WA_THRR], options.baBehav[ADDSET_WA_THRRH], options.baBehav[ADDSET_WA_SKYPROTECT], options.baBehav[ADDSET_WA_EDGRAD], options.baBehav[ADDSET_WA_EDGVAL], options.baBehav[ADDSET_WA_STRENGTH], options.baBehav[ADDSET_WA_GAMMA], options.baBehav[ADDSET_WA_EDGEDETECT], options.baBehav[ADDSET_WA_EDGEDETECTTHR], options.baBehav[ADDSET_WA_EDGEDETECTTHR2]);
|
||||
dirpyrdenoise->setAdjusterBehavior (options.baBehav[ADDSET_DIRPYRDN_LUMA], options.baBehav[ADDSET_DIRPYRDN_LUMDET], options.baBehav[ADDSET_DIRPYRDN_CHROMA], options.baBehav[ADDSET_DIRPYRDN_CHROMARED], options.baBehav[ADDSET_DIRPYRDN_CHROMABLUE], options.baBehav[ADDSET_DIRPYRDN_GAMMA], options.baBehav[ADDSET_DIRPYRDN_PASSES]);
|
||||
@ -227,7 +227,6 @@ void BatchToolPanelCoordinator::initSession ()
|
||||
if (options.baBehav[ADDSET_TC_SATURATION]) { pparams.toneCurve.saturation = 0;}
|
||||
if (options.baBehav[ADDSET_SH_HIGHLIGHTS]) { pparams.sh.highlights = 0; }
|
||||
if (options.baBehav[ADDSET_SH_SHADOWS]) { pparams.sh.shadows = 0; }
|
||||
if (options.baBehav[ADDSET_SH_LOCALCONTRAST]) { pparams.sh.localcontrast = 0; }
|
||||
if (options.baBehav[ADDSET_LC_BRIGHTNESS]) { pparams.labCurve.brightness = 0; }
|
||||
if (options.baBehav[ADDSET_LC_CONTRAST]) { pparams.labCurve.contrast = 0; }
|
||||
if (options.baBehav[ADDSET_LC_CHROMATICITY]) { pparams.labCurve.chromaticity = 0; }
|
||||
|
@ -281,7 +281,6 @@ void ParamsEdited::set (bool v)
|
||||
sh.htonalwidth = v;
|
||||
sh.shadows = v;
|
||||
sh.stonalwidth = v;
|
||||
sh.localcontrast = v;
|
||||
sh.radius = v;
|
||||
crop.enabled = v;
|
||||
crop.x = v;
|
||||
@ -838,7 +837,6 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
|
||||
sh.htonalwidth = sh.htonalwidth && p.sh.htonalwidth == other.sh.htonalwidth;
|
||||
sh.shadows = sh.shadows && p.sh.shadows == other.sh.shadows;
|
||||
sh.stonalwidth = sh.stonalwidth && p.sh.stonalwidth == other.sh.stonalwidth;
|
||||
sh.localcontrast = sh.localcontrast && p.sh.localcontrast == other.sh.localcontrast;
|
||||
sh.radius = sh.radius && p.sh.radius == other.sh.radius;
|
||||
crop.enabled = crop.enabled && p.crop.enabled == other.crop.enabled;
|
||||
crop.x = crop.x && p.crop.x == other.crop.x;
|
||||
@ -2065,10 +2063,6 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
|
||||
toEdit.sh.stonalwidth = mods.sh.stonalwidth;
|
||||
}
|
||||
|
||||
if (sh.localcontrast) {
|
||||
toEdit.sh.localcontrast = dontforceSet && options.baBehav[ADDSET_SH_LOCALCONTRAST] ? toEdit.sh.localcontrast + mods.sh.localcontrast : mods.sh.localcontrast;
|
||||
}
|
||||
|
||||
if (sh.radius) {
|
||||
toEdit.sh.radius = mods.sh.radius;
|
||||
}
|
||||
|
@ -395,7 +395,6 @@ public:
|
||||
bool htonalwidth;
|
||||
bool shadows;
|
||||
bool stonalwidth;
|
||||
bool localcontrast;
|
||||
bool radius;
|
||||
};
|
||||
|
||||
|
@ -223,7 +223,6 @@ Gtk::Widget* Preferences::getBatchProcPanel ()
|
||||
mi->set_value (behavColumns.label, M ("TP_SHADOWSHLIGHTS_LABEL"));
|
||||
appendBehavList (mi, M ("TP_SHADOWSHLIGHTS_HIGHLIGHTS"), ADDSET_SH_HIGHLIGHTS, false);
|
||||
appendBehavList (mi, M ("TP_SHADOWSHLIGHTS_SHADOWS"), ADDSET_SH_SHADOWS, false);
|
||||
appendBehavList (mi, M ("TP_SHADOWSHLIGHTS_LOCALCONTR"), ADDSET_SH_LOCALCONTRAST, false);
|
||||
|
||||
mi = behModel->append ();
|
||||
mi->set_value (behavColumns.label, M ("TP_LABCURVE_LABEL"));
|
||||
|
@ -44,9 +44,6 @@ ShadowsHighlights::ShadowsHighlights () : FoldableToolPanel(this, "shadowshighli
|
||||
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
lcontrast = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_LOCALCONTR"), 0, 100, 1, 0));
|
||||
pack_start (*lcontrast);
|
||||
|
||||
pack_start (*Gtk::manage (new Gtk::HSeparator()));
|
||||
|
||||
radius = Gtk::manage (new Adjuster (M("TP_SHADOWSHLIGHTS_RADIUS"), 5, 100, 1, 30));
|
||||
@ -57,7 +54,6 @@ ShadowsHighlights::ShadowsHighlights () : FoldableToolPanel(this, "shadowshighli
|
||||
h_tonalwidth->setAdjusterListener (this);
|
||||
shadows->setAdjusterListener (this);
|
||||
s_tonalwidth->setAdjusterListener (this);
|
||||
lcontrast->setAdjusterListener (this);
|
||||
|
||||
show_all_children ();
|
||||
}
|
||||
@ -69,7 +65,6 @@ void ShadowsHighlights::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
|
||||
if (pedited) {
|
||||
radius->setEditedState (pedited->sh.radius ? Edited : UnEdited);
|
||||
lcontrast->setEditedState (pedited->sh.localcontrast ? Edited : UnEdited);
|
||||
highlights->setEditedState (pedited->sh.highlights ? Edited : UnEdited);
|
||||
h_tonalwidth->setEditedState (pedited->sh.htonalwidth ? Edited : UnEdited);
|
||||
shadows->setEditedState (pedited->sh.shadows ? Edited : UnEdited);
|
||||
@ -87,7 +82,6 @@ void ShadowsHighlights::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
lastHQ = pp->sh.hq;
|
||||
|
||||
radius->setValue (pp->sh.radius);
|
||||
lcontrast->setValue (pp->sh.localcontrast);
|
||||
highlights->setValue (pp->sh.highlights);
|
||||
h_tonalwidth->setValue (pp->sh.htonalwidth);
|
||||
shadows->setValue (pp->sh.shadows);
|
||||
@ -100,7 +94,6 @@ void ShadowsHighlights::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
{
|
||||
|
||||
pp->sh.radius = (int)radius->getValue ();
|
||||
pp->sh.localcontrast = (int)lcontrast->getValue ();
|
||||
pp->sh.highlights = (int)highlights->getValue ();
|
||||
pp->sh.htonalwidth = (int)h_tonalwidth->getValue ();
|
||||
pp->sh.shadows = (int)shadows->getValue ();
|
||||
@ -110,7 +103,6 @@ void ShadowsHighlights::write (ProcParams* pp, ParamsEdited* pedited)
|
||||
|
||||
if (pedited) {
|
||||
pedited->sh.radius = radius->getEditedState ();
|
||||
pedited->sh.localcontrast = lcontrast->getEditedState ();
|
||||
pedited->sh.highlights = highlights->getEditedState ();
|
||||
pedited->sh.htonalwidth = h_tonalwidth->getEditedState ();
|
||||
pedited->sh.shadows = shadows->getEditedState ();
|
||||
@ -124,7 +116,6 @@ void ShadowsHighlights::setDefaults (const ProcParams* defParams, const ParamsEd
|
||||
{
|
||||
|
||||
radius->setDefault (defParams->sh.radius);
|
||||
lcontrast->setDefault (defParams->sh.localcontrast);
|
||||
highlights->setDefault (defParams->sh.highlights);
|
||||
h_tonalwidth->setDefault (defParams->sh.htonalwidth);
|
||||
shadows->setDefault (defParams->sh.shadows);
|
||||
@ -132,14 +123,12 @@ void ShadowsHighlights::setDefaults (const ProcParams* defParams, const ParamsEd
|
||||
|
||||
if (pedited) {
|
||||
radius->setDefaultEditedState (pedited->sh.radius ? Edited : UnEdited);
|
||||
lcontrast->setDefaultEditedState (pedited->sh.localcontrast ? Edited : UnEdited);
|
||||
highlights->setDefaultEditedState (pedited->sh.highlights ? Edited : UnEdited);
|
||||
h_tonalwidth->setDefaultEditedState (pedited->sh.htonalwidth ? Edited : UnEdited);
|
||||
shadows->setDefaultEditedState (pedited->sh.shadows ? Edited : UnEdited);
|
||||
s_tonalwidth->setDefaultEditedState (pedited->sh.stonalwidth ? Edited : UnEdited);
|
||||
} else {
|
||||
radius->setDefaultEditedState (Irrelevant);
|
||||
lcontrast->setDefaultEditedState (Irrelevant);
|
||||
highlights->setDefaultEditedState (Irrelevant);
|
||||
h_tonalwidth->setDefaultEditedState (Irrelevant);
|
||||
shadows->setDefaultEditedState (Irrelevant);
|
||||
@ -164,8 +153,6 @@ void ShadowsHighlights::adjusterChanged (Adjuster* a, double newval)
|
||||
listener->panelChanged (EvSHSHTonalW, costr);
|
||||
} else if (a == radius) {
|
||||
listener->panelChanged (EvSHRadius, costr);
|
||||
} else if (a == lcontrast) {
|
||||
listener->panelChanged (EvSHLContrast, costr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -214,19 +201,17 @@ void ShadowsHighlights::setBatchMode (bool batchMode)
|
||||
|
||||
ToolPanel::setBatchMode (batchMode);
|
||||
radius->showEditedCB ();
|
||||
lcontrast->showEditedCB ();
|
||||
highlights->showEditedCB ();
|
||||
h_tonalwidth->showEditedCB ();
|
||||
shadows->showEditedCB ();
|
||||
s_tonalwidth->showEditedCB ();
|
||||
}
|
||||
|
||||
void ShadowsHighlights::setAdjusterBehavior (bool hadd, bool sadd, bool lcadd)
|
||||
void ShadowsHighlights::setAdjusterBehavior (bool hadd, bool sadd)
|
||||
{
|
||||
|
||||
highlights->setAddMode(hadd);
|
||||
shadows->setAddMode(sadd);
|
||||
lcontrast->setAddMode(lcadd);
|
||||
}
|
||||
|
||||
void ShadowsHighlights::trimValues (rtengine::procparams::ProcParams* pp)
|
||||
@ -234,5 +219,4 @@ void ShadowsHighlights::trimValues (rtengine::procparams::ProcParams* pp)
|
||||
|
||||
highlights->trimValue(pp->sh.highlights);
|
||||
shadows->trimValue(pp->sh.shadows);
|
||||
lcontrast->trimValue(pp->sh.localcontrast);
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ protected:
|
||||
Adjuster* h_tonalwidth;
|
||||
Adjuster* shadows;
|
||||
Adjuster* s_tonalwidth;
|
||||
Adjuster* lcontrast;
|
||||
Adjuster* radius;
|
||||
Gtk::CheckButton* hq;
|
||||
bool lastHQ;
|
||||
@ -50,7 +49,7 @@ public:
|
||||
void enabledChanged ();
|
||||
void hqChanged ();
|
||||
|
||||
void setAdjusterBehavior (bool hadd, bool sadd, bool lcadd);
|
||||
void setAdjusterBehavior (bool hadd, bool sadd);
|
||||
void trimValues (rtengine::procparams::ProcParams* pp);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user