Capture sharpening: removed gamma
This commit is contained in:
@@ -543,7 +543,9 @@ BENCHFUN
|
||||
array2D<float> tmpIThr(fullTileSize, fullTileSize);
|
||||
array2D<float> tmpThr(fullTileSize, fullTileSize);
|
||||
array2D<float> lumThr(fullTileSize, fullTileSize);
|
||||
#pragma omp for schedule(dynamic,2) collapse(2)
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for schedule(dynamic,2) collapse(2)
|
||||
#endif
|
||||
for (int i = border; i < H - border; i+= tileSize) {
|
||||
for(int j = border; j < W - border; j+= tileSize) {
|
||||
const bool endOfCol = (i + tileSize + border) >= H;
|
||||
@@ -754,14 +756,13 @@ BENCHFUN
|
||||
array2D<float>& L = Lbuffer ? *Lbuffer : red;
|
||||
array2D<float>& YOld = YOldbuffer ? * YOldbuffer : green;
|
||||
array2D<float>& YNew = YNewbuffer ? * YNewbuffer : blue;
|
||||
const float gamma = sharpeningParams.gamma;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for schedule(dynamic, 16)
|
||||
#endif
|
||||
for (int i = 0; i < H; ++i) {
|
||||
Color::RGB2L(redVals[i], greenVals[i], blueVals[i], L[i], xyz_rgb, W);
|
||||
Color::RGB2Y(redVals[i], greenVals[i], blueVals[i], YOld[i], YNew[i], gamma, W);
|
||||
Color::RGB2Y(redVals[i], greenVals[i], blueVals[i], YOld[i], YNew[i], W);
|
||||
}
|
||||
if (plistener) {
|
||||
plistener->setProgress(0.1);
|
||||
@@ -784,9 +785,8 @@ BENCHFUN
|
||||
for (int i = 0; i < H; ++i) {
|
||||
int j = 0;
|
||||
#ifdef __SSE2__
|
||||
const vfloat gammav = F2V(gamma);
|
||||
for (; j < W - 3; j += 4) {
|
||||
const vfloat factor = pow_F(vmaxf(LVFU(YNew[i][j]), ZEROV) / vmaxf(LVFU(YOld[i][j]), F2V(0.00001f)), gammav);
|
||||
const vfloat factor = vmaxf(LVFU(YNew[i][j]), ZEROV) / vmaxf(LVFU(YOld[i][j]), F2V(0.00001f));
|
||||
STVFU(red[i][j], LVFU(redVals[i][j]) * factor);
|
||||
STVFU(green[i][j], LVFU(greenVals[i][j]) * factor);
|
||||
STVFU(blue[i][j], LVFU(blueVals[i][j]) * factor);
|
||||
@@ -794,7 +794,7 @@ BENCHFUN
|
||||
|
||||
#endif
|
||||
for (; j < W; ++j) {
|
||||
const float factor = pow_F(std::max(YNew[i][j], 0.f) / std::max(YOld[i][j], 0.00001f), gamma);
|
||||
const float factor = std::max(YNew[i][j], 0.f) / std::max(YOld[i][j], 0.00001f);
|
||||
red[i][j] = redVals[i][j] * factor;
|
||||
green[i][j] = greenVals[i][j] * factor;
|
||||
blue[i][j] = blueVals[i][j] * factor;
|
||||
|
||||
@@ -1808,11 +1808,9 @@ public:
|
||||
return (hr);
|
||||
}
|
||||
|
||||
static inline void RGB2Y(const float* R, const float* G, const float* B, float* Y1, float * Y2, float gamma, int W) {
|
||||
gamma = 1.f / gamma;
|
||||
static inline void RGB2Y(const float* R, const float* G, const float* B, float* Y1, float * Y2, int W) {
|
||||
int i = 0;
|
||||
#ifdef __SSE2__
|
||||
const vfloat gammav = F2V(gamma);
|
||||
const vfloat c1v = F2V(0.2627f);
|
||||
const vfloat c2v = F2V(0.6780f);
|
||||
const vfloat c3v = F2V(0.0593f);
|
||||
@@ -1820,7 +1818,7 @@ public:
|
||||
const vfloat Rv = vmaxf(LVFU(R[i]), ZEROV);
|
||||
const vfloat Gv = vmaxf(LVFU(G[i]), ZEROV);
|
||||
const vfloat Bv = vmaxf(LVFU(B[i]), ZEROV);
|
||||
vfloat yv = pow_F(c1v * Rv + c2v * Gv + c3v * Bv, gammav);
|
||||
vfloat yv = c1v * Rv + c2v * Gv + c3v * Bv;
|
||||
STVFU(Y1[i], yv);
|
||||
STVFU(Y2[i], yv);
|
||||
}
|
||||
@@ -1829,7 +1827,7 @@ public:
|
||||
const float r = std::max(R[i], 0.f);
|
||||
const float g = std::max(G[i], 0.f);
|
||||
const float b = std::max(B[i], 0.f);
|
||||
Y1[i] = Y2[i] = pow_F(0.2627f * r + 0.6780f * g + 0.0593f * b, gamma);
|
||||
Y1[i] = Y2[i] = 0.2627f * r + 0.6780f * g + 0.0593f * b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1159,7 +1159,6 @@ CaptureSharpeningParams::CaptureSharpeningParams() :
|
||||
autoContrast(true),
|
||||
autoRadius(true),
|
||||
contrast(10.0),
|
||||
gamma(1.00),
|
||||
deconvradius(0.75),
|
||||
deconvradiusOffset(0.0),
|
||||
deconviter(20)
|
||||
@@ -1171,7 +1170,6 @@ bool CaptureSharpeningParams::operator ==(const CaptureSharpeningParams& other)
|
||||
return
|
||||
enabled == other.enabled
|
||||
&& contrast == other.contrast
|
||||
&& gamma == other.gamma
|
||||
&& autoContrast == other.autoContrast
|
||||
&& autoRadius == other.autoRadius
|
||||
&& deconvradius == other.deconvradius
|
||||
@@ -3383,7 +3381,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.contrast, "PostDemosaicSharpening", "Contrast", pdsharpening.contrast, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.autoContrast, "PostDemosaicSharpening", "AutoContrast", pdsharpening.autoContrast, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.autoRadius, "PostDemosaicSharpening", "AutoRadius", pdsharpening.autoRadius, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.gamma, "PostDemosaicSharpening", "DeconvGamma", pdsharpening.gamma, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.deconvradius, "PostDemosaicSharpening", "DeconvRadius", pdsharpening.deconvradius, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.deconvradiusOffset, "PostDemosaicSharpening", "DeconvRadiusOffset", pdsharpening.deconvradiusOffset, keyFile);
|
||||
saveToKeyfile(!pedited || pedited->pdsharpening.deconviter, "PostDemosaicSharpening", "DeconvIterations", pdsharpening.deconviter, keyFile);
|
||||
@@ -4473,8 +4470,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "Contrast", pedited, pdsharpening.contrast, pedited->pdsharpening.contrast);
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "AutoContrast", pedited, pdsharpening.autoContrast, pedited->pdsharpening.autoContrast);
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "AutoRadius", pedited, pdsharpening.autoRadius, pedited->pdsharpening.autoRadius);
|
||||
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "DeconvGamma", pedited, pdsharpening.gamma, pedited->pdsharpening.gamma);
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "DeconvRadius", pedited, pdsharpening.deconvradius, pedited->pdsharpening.deconvradius);
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "DeconvRadiusOffset", pedited, pdsharpening.deconvradiusOffset, pedited->pdsharpening.deconvradiusOffset);
|
||||
assignFromKeyfile(keyFile, "PostDemosaicSharpening", "DeconvIterations", pedited, pdsharpening.deconviter, pedited->pdsharpening.deconviter);
|
||||
|
||||
@@ -548,7 +548,6 @@ struct CaptureSharpeningParams {
|
||||
bool autoContrast;
|
||||
bool autoRadius;
|
||||
double contrast;
|
||||
double gamma;
|
||||
double deconvradius;
|
||||
double deconvradiusOffset;
|
||||
int deconviter;
|
||||
|
||||
@@ -157,7 +157,7 @@ void BatchToolPanelCoordinator::initSession ()
|
||||
cacorrection->setAdjusterBehavior (false);
|
||||
sharpening->setAdjusterBehavior (false, false, false, false, false, false, false);
|
||||
prsharpening->setAdjusterBehavior (false, false, false, false, false, false, false);
|
||||
pdSharpening->setAdjusterBehavior (false, false, false, false);
|
||||
pdSharpening->setAdjusterBehavior (false, false, false);
|
||||
sharpenEdge->setAdjusterBehavior (false, false);
|
||||
sharpenMicro->setAdjusterBehavior (false, false, false);
|
||||
epd->setAdjusterBehavior (false, false, false, false, false);
|
||||
|
||||
@@ -169,7 +169,6 @@ void ParamsEdited::set(bool v)
|
||||
pdsharpening.contrast = v;
|
||||
pdsharpening.autoContrast = v;
|
||||
pdsharpening.autoRadius = v;
|
||||
pdsharpening.gamma = v;
|
||||
pdsharpening.deconvradius = v;
|
||||
pdsharpening.deconvradiusOffset = v;
|
||||
pdsharpening.deconviter = v;
|
||||
@@ -756,7 +755,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
||||
pdsharpening.contrast = pdsharpening.contrast && p.pdsharpening.contrast == other.pdsharpening.contrast;
|
||||
pdsharpening.autoContrast = pdsharpening.autoContrast && p.pdsharpening.autoContrast == other.pdsharpening.autoContrast;
|
||||
pdsharpening.autoRadius = pdsharpening.autoRadius && p.pdsharpening.autoRadius == other.pdsharpening.autoRadius;
|
||||
pdsharpening.gamma = pdsharpening.gamma && p.pdsharpening.gamma == other.pdsharpening.gamma;
|
||||
pdsharpening.deconvradius = pdsharpening.deconvradius && p.pdsharpening.deconvradius == other.pdsharpening.deconvradius;
|
||||
pdsharpening.deconvradiusOffset = pdsharpening.deconvradiusOffset && p.pdsharpening.deconvradiusOffset == other.pdsharpening.deconvradiusOffset;
|
||||
pdsharpening.deconviter = pdsharpening.deconviter && p.pdsharpening.deconviter == other.pdsharpening.deconviter;
|
||||
@@ -1742,10 +1740,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
||||
toEdit.pdsharpening.autoRadius = mods.pdsharpening.autoRadius;
|
||||
}
|
||||
|
||||
if (pdsharpening.gamma) {
|
||||
toEdit.pdsharpening.gamma = dontforceSet && options.baBehav[ADDSET_SHARP_GAMMA] ? toEdit.pdsharpening.gamma + mods.pdsharpening.gamma : mods.pdsharpening.gamma;
|
||||
}
|
||||
|
||||
if (pdsharpening.deconvradius) {
|
||||
toEdit.pdsharpening.deconvradius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.pdsharpening.deconvradius + mods.pdsharpening.deconvradius : mods.pdsharpening.deconvradius;
|
||||
}
|
||||
@@ -3307,5 +3301,5 @@ bool FilmNegativeParamsEdited::isUnchanged() const
|
||||
|
||||
bool CaptureSharpeningParamsEdited::isUnchanged() const
|
||||
{
|
||||
return enabled && contrast && autoContrast && autoRadius && gamma && deconvradius && deconvradiusOffset && deconviter;
|
||||
return enabled && contrast && autoContrast && autoRadius && deconvradius && deconvradiusOffset && deconviter;
|
||||
}
|
||||
@@ -215,7 +215,6 @@ struct CaptureSharpeningParamsEdited {
|
||||
bool contrast;
|
||||
bool autoContrast;
|
||||
bool autoRadius;
|
||||
bool gamma;
|
||||
bool deconvradius;
|
||||
bool deconvradiusOffset;
|
||||
bool deconviter;
|
||||
|
||||
@@ -37,7 +37,6 @@ PdSharpening::PdSharpening() :
|
||||
{
|
||||
auto m = ProcEventMapper::getInstance();
|
||||
EvPdShrContrast = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_CONTRAST");
|
||||
EvPdSharpenGamma = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_GAMMA");
|
||||
EvPdShrDRadius = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_RADIUS");
|
||||
EvPdShrDRadiusOffset = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_RADIUS_BOOST");
|
||||
EvPdShrDIterations = m->newEvent(CAPTURESHARPEN, "HISTORY_MSG_PDSHARPEN_ITERATIONS");
|
||||
@@ -57,17 +56,14 @@ PdSharpening::PdSharpening() :
|
||||
pack_start(*hb);
|
||||
|
||||
Gtk::VBox* rld = Gtk::manage(new Gtk::VBox());
|
||||
gamma = Gtk::manage(new Adjuster(M("TP_SHARPENING_GAMMA"), 0.5, 6.0, 0.05, 1.00));
|
||||
dradius = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS"), 0.4, 1.15, 0.01, 0.75));
|
||||
dradius->addAutoButton();
|
||||
dradius->setAutoValue(true);
|
||||
dradiusOffset = Gtk::manage(new Adjuster(M("TP_SHARPENING_RADIUS_BOOST"), -0.5, 0.5, 0.01, 0.0));
|
||||
diter = Gtk::manage(new Adjuster(M("TP_SHARPENING_RLD_ITERATIONS"), 1, 100, 1, 20));
|
||||
rld->pack_start(*gamma);
|
||||
rld->pack_start(*dradius);
|
||||
rld->pack_start(*dradiusOffset);
|
||||
rld->pack_start(*diter);
|
||||
gamma->show();
|
||||
dradius->show();
|
||||
dradiusOffset->show();
|
||||
diter->show();
|
||||
@@ -76,13 +72,11 @@ PdSharpening::PdSharpening() :
|
||||
|
||||
dradius->setAdjusterListener(this);
|
||||
dradiusOffset->setAdjusterListener(this);
|
||||
gamma->setAdjusterListener(this);
|
||||
diter->setAdjusterListener(this);
|
||||
|
||||
contrast->delay = std::max(contrast->delay, options.adjusterMaxDelay);
|
||||
dradius->delay = std::max(dradius->delay, options.adjusterMaxDelay);
|
||||
dradiusOffset->delay = std::max(dradiusOffset->delay, options.adjusterMaxDelay);
|
||||
gamma->delay = std::max(gamma->delay, options.adjusterMaxDelay);
|
||||
diter->delay = std::max(diter->delay, options.adjusterMaxDelay);
|
||||
}
|
||||
|
||||
@@ -101,7 +95,6 @@ void PdSharpening::read(const ProcParams* pp, const ParamsEdited* pedited)
|
||||
contrast->setEditedState(pedited->pdsharpening.contrast ? Edited : UnEdited);
|
||||
contrast->setAutoInconsistent(multiImage && !pedited->pdsharpening.autoContrast);
|
||||
dradius->setAutoInconsistent(multiImage && !pedited->pdsharpening.autoRadius);
|
||||
gamma->setEditedState(pedited->pdsharpening.gamma ? Edited : UnEdited);
|
||||
dradius->setEditedState(pedited->pdsharpening.deconvradius ? Edited : UnEdited);
|
||||
dradiusOffset->setEditedState(pedited->pdsharpening.deconvradiusOffset ? Edited : UnEdited);
|
||||
diter->setEditedState(pedited->pdsharpening.deconviter ? Edited : UnEdited);
|
||||
@@ -113,7 +106,6 @@ void PdSharpening::read(const ProcParams* pp, const ParamsEdited* pedited)
|
||||
|
||||
contrast->setValue(pp->pdsharpening.contrast);
|
||||
contrast->setAutoValue(pp->pdsharpening.autoContrast);
|
||||
gamma->setValue(pp->pdsharpening.gamma);
|
||||
dradius->setValue(pp->pdsharpening.deconvradius);
|
||||
dradius->setAutoValue(pp->pdsharpening.autoRadius);
|
||||
dradiusOffset->setValue(pp->pdsharpening.deconvradiusOffset);
|
||||
@@ -130,7 +122,6 @@ void PdSharpening::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
pp->pdsharpening.contrast = contrast->getValue();
|
||||
pp->pdsharpening.autoContrast = contrast->getAutoValue();
|
||||
pp->pdsharpening.enabled = getEnabled();
|
||||
pp->pdsharpening.gamma = gamma->getValue();
|
||||
pp->pdsharpening.deconvradius = dradius->getValue();
|
||||
pp->pdsharpening.autoRadius = dradius->getAutoValue();
|
||||
pp->pdsharpening.deconvradiusOffset = dradiusOffset->getValue();
|
||||
@@ -139,7 +130,6 @@ void PdSharpening::write(ProcParams* pp, ParamsEdited* pedited)
|
||||
if (pedited) {
|
||||
pedited->pdsharpening.contrast = contrast->getEditedState();
|
||||
pedited->pdsharpening.autoContrast = !contrast->getAutoInconsistent();
|
||||
pedited->pdsharpening.gamma = gamma->getEditedState();
|
||||
pedited->pdsharpening.deconvradius = dradius->getEditedState();
|
||||
pedited->pdsharpening.autoRadius = !dradius->getAutoInconsistent();
|
||||
pedited->pdsharpening.deconvradiusOffset = dradiusOffset->getEditedState();
|
||||
@@ -152,20 +142,17 @@ void PdSharpening::setDefaults(const ProcParams* defParams, const ParamsEdited*
|
||||
{
|
||||
|
||||
contrast->setDefault(defParams->pdsharpening.contrast);
|
||||
gamma->setDefault(defParams->pdsharpening.gamma);
|
||||
dradius->setDefault(defParams->pdsharpening.deconvradius);
|
||||
dradiusOffset->setDefault(defParams->pdsharpening.deconvradiusOffset);
|
||||
diter->setDefault(defParams->pdsharpening.deconviter);
|
||||
|
||||
if (pedited) {
|
||||
contrast->setDefaultEditedState(pedited->pdsharpening.contrast ? Edited : UnEdited);
|
||||
gamma->setDefaultEditedState(pedited->pdsharpening.gamma ? Edited : UnEdited);
|
||||
dradius->setDefaultEditedState(pedited->pdsharpening.deconvradius ? Edited : UnEdited);
|
||||
dradiusOffset->setDefaultEditedState(pedited->pdsharpening.deconvradiusOffset ? Edited : UnEdited);
|
||||
diter->setDefaultEditedState(pedited->pdsharpening.deconviter ? Edited : UnEdited);
|
||||
} else {
|
||||
contrast->setDefaultEditedState(Irrelevant);
|
||||
gamma->setDefaultEditedState(Irrelevant);
|
||||
dradius->setDefaultEditedState(Irrelevant);
|
||||
dradiusOffset->setDefaultEditedState(Irrelevant);
|
||||
diter->setDefaultEditedState(Irrelevant);
|
||||
@@ -178,7 +165,7 @@ void PdSharpening::adjusterChanged(Adjuster* a, double newval)
|
||||
|
||||
Glib::ustring costr;
|
||||
|
||||
if (a == gamma || a == dradius || a == dradiusOffset) {
|
||||
if (a == dradius || a == dradiusOffset) {
|
||||
costr = Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
||||
} else {
|
||||
costr = Glib::ustring::format((int)a->getValue());
|
||||
@@ -186,8 +173,6 @@ void PdSharpening::adjusterChanged(Adjuster* a, double newval)
|
||||
|
||||
if (a == contrast) {
|
||||
listener->panelChanged(EvPdShrContrast, costr);
|
||||
} else if (a == gamma) {
|
||||
listener->panelChanged(EvPdSharpenGamma, costr);
|
||||
} else if (a == dradius) {
|
||||
listener->panelChanged(EvPdShrDRadius, costr);
|
||||
} else if (a == dradiusOffset) {
|
||||
@@ -217,17 +202,15 @@ void PdSharpening::setBatchMode(bool batchMode)
|
||||
ToolPanel::setBatchMode(batchMode);
|
||||
|
||||
contrast->showEditedCB();
|
||||
gamma->showEditedCB();
|
||||
dradius->showEditedCB();
|
||||
dradiusOffset->showEditedCB();
|
||||
diter->showEditedCB();
|
||||
}
|
||||
|
||||
void PdSharpening::setAdjusterBehavior(bool contrastadd, bool gammaadd, bool radiusadd, bool iteradd)
|
||||
void PdSharpening::setAdjusterBehavior(bool contrastadd, bool radiusadd, bool iteradd)
|
||||
{
|
||||
|
||||
contrast->setAddMode(contrastadd);
|
||||
gamma->setAddMode(gammaadd);
|
||||
dradius->setAddMode(radiusadd);
|
||||
dradiusOffset->setAddMode(radiusadd);
|
||||
diter->setAddMode(iteradd);
|
||||
@@ -237,7 +220,6 @@ void PdSharpening::trimValues(rtengine::procparams::ProcParams* pp)
|
||||
{
|
||||
|
||||
contrast->trimValue(pp->pdsharpening.contrast);
|
||||
gamma->trimValue(pp->pdsharpening.gamma);
|
||||
dradius->trimValue(pp->pdsharpening.deconvradius);
|
||||
dradiusOffset->trimValue(pp->pdsharpening.deconvradiusOffset);
|
||||
diter->trimValue(pp->pdsharpening.deconviter);
|
||||
@@ -271,47 +253,25 @@ void PdSharpening::autoRadiusChanged(double autoRadius)
|
||||
|
||||
void PdSharpening::adjusterAutoToggled(Adjuster* a, bool newval)
|
||||
{
|
||||
if (a == contrast) {
|
||||
if (multiImage) {
|
||||
if (contrast->getAutoInconsistent()) {
|
||||
contrast->setAutoInconsistent(false);
|
||||
contrast->setAutoValue(false);
|
||||
} else if (lastAutoContrast) {
|
||||
contrast->setAutoInconsistent(true);
|
||||
}
|
||||
|
||||
lastAutoContrast = contrast->getAutoValue();
|
||||
if (multiImage) {
|
||||
if (a->getAutoInconsistent()) {
|
||||
a->setAutoInconsistent(false);
|
||||
a->setAutoValue(false);
|
||||
} else if (lastAutoRadius) {
|
||||
a->setAutoInconsistent(true);
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
if (contrast->getAutoInconsistent()) {
|
||||
listener->panelChanged(EvPdShrAutoContrast, M("GENERAL_UNCHANGED"));
|
||||
} else if (contrast->getAutoValue()) {
|
||||
listener->panelChanged(EvPdShrAutoContrast, M("GENERAL_ENABLED"));
|
||||
} else {
|
||||
listener->panelChanged(EvPdShrAutoContrast, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
} else { // must be dradius
|
||||
if (multiImage) {
|
||||
if (dradius->getAutoInconsistent()) {
|
||||
dradius->setAutoInconsistent(false);
|
||||
dradius->setAutoValue(false);
|
||||
} else if (lastAutoRadius) {
|
||||
dradius->setAutoInconsistent(true);
|
||||
}
|
||||
(a == contrast ? lastAutoContrast : lastAutoRadius) = a->getAutoValue();
|
||||
}
|
||||
|
||||
lastAutoRadius = dradius->getAutoValue();
|
||||
}
|
||||
|
||||
if (listener) {
|
||||
if (dradius->getAutoInconsistent()) {
|
||||
listener->panelChanged(EvPdShrAutoRadius, M("GENERAL_UNCHANGED"));
|
||||
} else if (dradius->getAutoValue()) {
|
||||
listener->panelChanged(EvPdShrAutoRadius, M("GENERAL_ENABLED"));
|
||||
} else {
|
||||
listener->panelChanged(EvPdShrAutoRadius, M("GENERAL_DISABLED"));
|
||||
}
|
||||
if (listener) {
|
||||
const auto event = (a == contrast ? EvPdShrAutoContrast : EvPdShrAutoRadius);
|
||||
if (a->getAutoInconsistent()) {
|
||||
listener->panelChanged(event, M("GENERAL_UNCHANGED"));
|
||||
} else if (a->getAutoValue()) {
|
||||
listener->panelChanged(event, M("GENERAL_ENABLED"));
|
||||
} else {
|
||||
listener->panelChanged(event, M("GENERAL_DISABLED"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ class PdSharpening final : public ToolParamBlock, public AdjusterListener, publi
|
||||
|
||||
protected:
|
||||
Adjuster* contrast;
|
||||
Adjuster* gamma;
|
||||
Adjuster* dradius;
|
||||
Adjuster* dradiusOffset;
|
||||
Adjuster* diter;
|
||||
@@ -36,7 +35,6 @@ protected:
|
||||
rtengine::ProcEvent EvPdShrContrast;
|
||||
rtengine::ProcEvent EvPdShrDRadius;
|
||||
rtengine::ProcEvent EvPdShrDRadiusOffset;
|
||||
rtengine::ProcEvent EvPdSharpenGamma;
|
||||
rtengine::ProcEvent EvPdShrDIterations;
|
||||
rtengine::ProcEvent EvPdShrAutoContrast;
|
||||
rtengine::ProcEvent EvPdShrAutoRadius;
|
||||
@@ -59,6 +57,6 @@ public:
|
||||
void autoContrastChanged (double autoContrast) override;
|
||||
void autoRadiusChanged (double autoRadius) override;
|
||||
|
||||
void setAdjusterBehavior (bool contrastadd, bool gammaadd, bool radiusadd, bool iteradds);
|
||||
void setAdjusterBehavior (bool contrastadd, bool radiusadd, bool iteradds);
|
||||
void trimValues (rtengine::procparams::ProcParams* pp) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user