added simple local contrast tool

Borrowed from G'MIC
This commit is contained in:
Alberto Griggio
2017-12-19 01:03:52 +01:00
parent d1d91869c8
commit b8777b3d87
16 changed files with 414 additions and 1 deletions

View File

@@ -98,6 +98,11 @@ void ParamsEdited::set (bool v)
labCurve.avoidcolorshift = v;
labCurve.rstprotection = v;
labCurve.lcredsk = v;
localContrast.enabled = v;
localContrast.radius = v;
localContrast.amount = v;
localContrast.darkness = v;
localContrast.lightness = v;
rgbCurves.enabled = v;
rgbCurves.lumamode = v;
rgbCurves.rcurve = v;
@@ -643,6 +648,13 @@ void ParamsEdited::initFrom (const std::vector<rtengine::procparams::ProcParams>
labCurve.avoidcolorshift = labCurve.avoidcolorshift && p.labCurve.avoidcolorshift == other.labCurve.avoidcolorshift;
labCurve.rstprotection = labCurve.rstprotection && p.labCurve.rstprotection == other.labCurve.rstprotection;
labCurve.lcredsk = labCurve.lcredsk && p.labCurve.lcredsk == other.labCurve.lcredsk;
localContrast.enabled = localContrast.enabled && p.localContrast.enabled == other.localContrast.enabled;
localContrast.radius = localContrast.radius && p.localContrast.radius == other.localContrast.radius;
localContrast.amount = localContrast.amount && p.localContrast.amount == other.localContrast.amount;
localContrast.darkness = localContrast.darkness && p.localContrast.darkness == other.localContrast.darkness;
localContrast.lightness = localContrast.lightness && p.localContrast.lightness == other.localContrast.lightness;
rgbCurves.enabled = rgbCurves.enabled && p.rgbCurves.enabled == other.rgbCurves.enabled;
rgbCurves.lumamode = rgbCurves.lumamode && p.rgbCurves.lumamode == other.rgbCurves.lumamode;
rgbCurves.rcurve = rgbCurves.rcurve && p.rgbCurves.rcurve == other.rgbCurves.rcurve;
@@ -1370,6 +1382,22 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.labCurve.lcredsk = mods.labCurve.lcredsk;
}
if (localContrast.enabled) {
toEdit.localContrast.enabled = mods.localContrast.enabled;
}
if (localContrast.radius) {
toEdit.localContrast.radius = mods.localContrast.radius;
}
if (localContrast.amount) {
toEdit.localContrast.amount = mods.localContrast.amount;
}
if (localContrast.darkness) {
toEdit.localContrast.darkness = mods.localContrast.darkness;
}
if (localContrast.lightness) {
toEdit.localContrast.lightness = mods.localContrast.lightness;
}
if (rgbCurves.enabled) {
toEdit.rgbCurves.enabled = mods.rgbCurves.enabled;
}