First quick&dirty version of flat region blur, #5075
This commit is contained in:
parent
033b021b9b
commit
5162484517
@ -774,6 +774,7 @@ HISTORY_MSG_RAWCACORR_AUTOIT;Raw CA Correction - Iterations
|
|||||||
HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift
|
HISTORY_MSG_RAWCACORR_COLORSHIFT;Raw CA Correction - Avoid color shift
|
||||||
HISTORY_MSG_RAW_BORDER;Raw border
|
HISTORY_MSG_RAW_BORDER;Raw border
|
||||||
HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling
|
HISTORY_MSG_RESIZE_ALLOWUPSCALING;Resize - Allow upscaling
|
||||||
|
HISTORY_MSG_SHARPENING_BLUR;Sharpening - Blur radius
|
||||||
HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold
|
HISTORY_MSG_SHARPENING_CONTRAST;Sharpening - Contrast threshold
|
||||||
HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace
|
HISTORY_MSG_SH_COLORSPACE;S/H - Colorspace
|
||||||
HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light
|
HISTORY_MSG_SOFTLIGHT_ENABLED;Soft light
|
||||||
@ -2034,6 +2035,7 @@ TP_SHARPENEDGE_LABEL;Edges
|
|||||||
TP_SHARPENEDGE_PASSES;Iterations
|
TP_SHARPENEDGE_PASSES;Iterations
|
||||||
TP_SHARPENEDGE_THREE;Luminance only
|
TP_SHARPENEDGE_THREE;Luminance only
|
||||||
TP_SHARPENING_AMOUNT;Amount
|
TP_SHARPENING_AMOUNT;Amount
|
||||||
|
TP_SHARPENING_BLUR;Blur radius
|
||||||
TP_SHARPENING_CONTRAST;Contrast threshold
|
TP_SHARPENING_CONTRAST;Contrast threshold
|
||||||
TP_SHARPENING_EDRADIUS;Radius
|
TP_SHARPENING_EDRADIUS;Radius
|
||||||
TP_SHARPENING_EDTOLERANCE;Edge tolerance
|
TP_SHARPENING_EDTOLERANCE;Edge tolerance
|
||||||
|
@ -159,7 +159,7 @@ extern const Settings* settings;
|
|||||||
|
|
||||||
void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, int W, int H, const SharpeningParams &sharpenParam)
|
void ImProcFunctions::deconvsharpening (float** luminance, float** tmp, int W, int H, const SharpeningParams &sharpenParam)
|
||||||
{
|
{
|
||||||
if (sharpenParam.deconvamount < 1) {
|
if (sharpenParam.deconvamount == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BENCHFUN
|
BENCHFUN
|
||||||
@ -178,7 +178,14 @@ BENCHFUN
|
|||||||
JaggedArray<float> blend(W, H);
|
JaggedArray<float> blend(W, H);
|
||||||
float contrast = sharpenParam.contrast / 100.f;
|
float contrast = sharpenParam.contrast / 100.f;
|
||||||
buildBlendMask(luminance, blend, W, H, contrast, sharpenParam.deconvamount / 100.f);
|
buildBlendMask(luminance, blend, W, H, contrast, sharpenParam.deconvamount / 100.f);
|
||||||
|
JaggedArray<float> blur(W, H);
|
||||||
|
|
||||||
|
if(sharpenParam.blurradius > 0) {
|
||||||
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
gaussianBlur(tmpI, blur, W, H, sharpenParam.blurradius);
|
||||||
|
}
|
||||||
|
}
|
||||||
const float damping = sharpenParam.deconvdamping / 5.0;
|
const float damping = sharpenParam.deconvdamping / 5.0;
|
||||||
const bool needdamp = sharpenParam.deconvdamping > 0;
|
const bool needdamp = sharpenParam.deconvdamping > 0;
|
||||||
const double sigma = sharpenParam.deconvradius / scale;
|
const double sigma = sharpenParam.deconvradius / scale;
|
||||||
@ -208,6 +215,17 @@ BENCHFUN
|
|||||||
luminance[i][j] = intp(blend[i][j], max(tmpI[i][j], 0.0f), luminance[i][j]);
|
luminance[i][j] = intp(blend[i][j], max(tmpI[i][j], 0.0f), luminance[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sharpenParam.blurradius > 0) {
|
||||||
|
#ifdef _OPENMP
|
||||||
|
#pragma omp for
|
||||||
|
#endif
|
||||||
|
for (int i = 0; i < H; ++i) {
|
||||||
|
for (int j = 0; j < W; ++j) {
|
||||||
|
luminance[i][j] = intp(blend[i][j], luminance[i][j], max(blur[i][j], 0.0f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} // end parallel
|
} // end parallel
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +242,7 @@ void ImProcFunctions::sharpening (LabImage* lab, const SharpeningParams &sharpen
|
|||||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||||
JaggedArray<float> blend(W, H);
|
JaggedArray<float> blend(W, H);
|
||||||
float contrast = sharpenParam.contrast / 100.f;
|
float contrast = sharpenParam.contrast / 100.f;
|
||||||
buildBlendMask(lab->L, blend, W, H, contrast, sharpenParam.method == "rld" ? sharpenParam.deconvamount / 100.f : 1.f);
|
buildBlendMask(lab->L, blend, W, H, contrast, sharpenParam.method == "rld" ? 1.f : 1.f);
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
#endif
|
#endif
|
||||||
@ -256,6 +274,15 @@ BENCHFUN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JaggedArray<float> blur(W, H);
|
||||||
|
|
||||||
|
if(sharpenParam.blurradius > 0) {
|
||||||
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
gaussianBlur(lab->L, blur, W, H, sharpenParam.blurradius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||||
JaggedArray<float> blend(W, H);
|
JaggedArray<float> blend(W, H);
|
||||||
float contrast = sharpenParam.contrast / 100.f;
|
float contrast = sharpenParam.contrast / 100.f;
|
||||||
@ -322,6 +349,17 @@ BENCHFUN
|
|||||||
|
|
||||||
delete [] b3;
|
delete [] b3;
|
||||||
}
|
}
|
||||||
|
if(sharpenParam.blurradius > 0) {
|
||||||
|
#ifdef _OPENMP
|
||||||
|
#pragma omp parallel for
|
||||||
|
#endif
|
||||||
|
for (int i = 0; i < H; ++i) {
|
||||||
|
for (int j = 0; j < W; ++j) {
|
||||||
|
lab->L[i][j] = intp(blend[i][j], lab->L[i][j], max(blur[i][j], 0.0f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// To the extent possible under law, Manuel Llorens <manuelllorens@gmail.com>
|
// To the extent possible under law, Manuel Llorens <manuelllorens@gmail.com>
|
||||||
|
@ -1079,6 +1079,7 @@ void ColorToningParams::getCurves(ColorGradientCurve& colorCurveLUT, OpacityCurv
|
|||||||
SharpeningParams::SharpeningParams() :
|
SharpeningParams::SharpeningParams() :
|
||||||
enabled(false),
|
enabled(false),
|
||||||
contrast(20.0),
|
contrast(20.0),
|
||||||
|
blurradius(0.2),
|
||||||
radius(0.5),
|
radius(0.5),
|
||||||
amount(200),
|
amount(200),
|
||||||
threshold(20, 80, 2000, 1200, false),
|
threshold(20, 80, 2000, 1200, false),
|
||||||
@ -1100,6 +1101,7 @@ bool SharpeningParams::operator ==(const SharpeningParams& other) const
|
|||||||
return
|
return
|
||||||
enabled == other.enabled
|
enabled == other.enabled
|
||||||
&& contrast == other.contrast
|
&& contrast == other.contrast
|
||||||
|
&& blurradius == other.blurradius
|
||||||
&& radius == other.radius
|
&& radius == other.radius
|
||||||
&& amount == other.amount
|
&& amount == other.amount
|
||||||
&& threshold == other.threshold
|
&& threshold == other.threshold
|
||||||
@ -3022,6 +3024,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
|
|||||||
saveToKeyfile(!pedited || pedited->sharpening.contrast, "Sharpening", "Contrast", sharpening.contrast, keyFile);
|
saveToKeyfile(!pedited || pedited->sharpening.contrast, "Sharpening", "Contrast", sharpening.contrast, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->sharpening.method, "Sharpening", "Method", sharpening.method, keyFile);
|
saveToKeyfile(!pedited || pedited->sharpening.method, "Sharpening", "Method", sharpening.method, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->sharpening.radius, "Sharpening", "Radius", sharpening.radius, keyFile);
|
saveToKeyfile(!pedited || pedited->sharpening.radius, "Sharpening", "Radius", sharpening.radius, keyFile);
|
||||||
|
saveToKeyfile(!pedited || pedited->sharpening.blurradius, "Sharpening", "BlurRadius", sharpening.blurradius, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->sharpening.amount, "Sharpening", "Amount", sharpening.amount, keyFile);
|
saveToKeyfile(!pedited || pedited->sharpening.amount, "Sharpening", "Amount", sharpening.amount, keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->sharpening.threshold, "Sharpening", "Threshold", sharpening.threshold.toVector(), keyFile);
|
saveToKeyfile(!pedited || pedited->sharpening.threshold, "Sharpening", "Threshold", sharpening.threshold.toVector(), keyFile);
|
||||||
saveToKeyfile(!pedited || pedited->sharpening.edgesonly, "Sharpening", "OnlyEdges", sharpening.edgesonly, keyFile);
|
saveToKeyfile(!pedited || pedited->sharpening.edgesonly, "Sharpening", "OnlyEdges", sharpening.edgesonly, keyFile);
|
||||||
@ -3908,6 +3911,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assignFromKeyfile(keyFile, "Sharpening", "Radius", pedited, sharpening.radius, pedited->sharpening.radius);
|
assignFromKeyfile(keyFile, "Sharpening", "Radius", pedited, sharpening.radius, pedited->sharpening.radius);
|
||||||
|
assignFromKeyfile(keyFile, "Sharpening", "BlurRadius", pedited, sharpening.blurradius, pedited->sharpening.blurradius);
|
||||||
assignFromKeyfile(keyFile, "Sharpening", "Amount", pedited, sharpening.amount, pedited->sharpening.amount);
|
assignFromKeyfile(keyFile, "Sharpening", "Amount", pedited, sharpening.amount, pedited->sharpening.amount);
|
||||||
|
|
||||||
if (keyFile.has_key("Sharpening", "Threshold")) {
|
if (keyFile.has_key("Sharpening", "Threshold")) {
|
||||||
|
@ -493,6 +493,7 @@ struct ColorToningParams {
|
|||||||
struct SharpeningParams {
|
struct SharpeningParams {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
double contrast;
|
double contrast;
|
||||||
|
double blurradius;
|
||||||
double radius;
|
double radius;
|
||||||
int amount;
|
int amount;
|
||||||
Threshold<int> threshold;
|
Threshold<int> threshold;
|
||||||
|
@ -147,6 +147,7 @@ void ParamsEdited::set(bool v)
|
|||||||
sharpening.enabled = v;
|
sharpening.enabled = v;
|
||||||
sharpening.contrast = v;
|
sharpening.contrast = v;
|
||||||
sharpening.radius = v;
|
sharpening.radius = v;
|
||||||
|
sharpening.blurradius = v;
|
||||||
sharpening.amount = v;
|
sharpening.amount = v;
|
||||||
sharpening.threshold = v;
|
sharpening.threshold = v;
|
||||||
sharpening.edgesonly = v;
|
sharpening.edgesonly = v;
|
||||||
@ -719,6 +720,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
|
|||||||
sharpening.enabled = sharpening.enabled && p.sharpening.enabled == other.sharpening.enabled;
|
sharpening.enabled = sharpening.enabled && p.sharpening.enabled == other.sharpening.enabled;
|
||||||
sharpening.contrast = sharpening.contrast && p.sharpening.contrast == other.sharpening.contrast;
|
sharpening.contrast = sharpening.contrast && p.sharpening.contrast == other.sharpening.contrast;
|
||||||
sharpening.radius = sharpening.radius && p.sharpening.radius == other.sharpening.radius;
|
sharpening.radius = sharpening.radius && p.sharpening.radius == other.sharpening.radius;
|
||||||
|
sharpening.blurradius = sharpening.blurradius && p.sharpening.blurradius == other.sharpening.blurradius;
|
||||||
sharpening.amount = sharpening.amount && p.sharpening.amount == other.sharpening.amount;
|
sharpening.amount = sharpening.amount && p.sharpening.amount == other.sharpening.amount;
|
||||||
sharpening.threshold = sharpening.threshold && p.sharpening.threshold == other.sharpening.threshold;
|
sharpening.threshold = sharpening.threshold && p.sharpening.threshold == other.sharpening.threshold;
|
||||||
sharpening.edgesonly = sharpening.edgesonly && p.sharpening.edgesonly == other.sharpening.edgesonly;
|
sharpening.edgesonly = sharpening.edgesonly && p.sharpening.edgesonly == other.sharpening.edgesonly;
|
||||||
@ -1639,6 +1641,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
|
|||||||
toEdit.sharpening.radius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.radius + mods.sharpening.radius : mods.sharpening.radius;
|
toEdit.sharpening.radius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.radius + mods.sharpening.radius : mods.sharpening.radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sharpening.blurradius) {
|
||||||
|
toEdit.sharpening.blurradius = dontforceSet && options.baBehav[ADDSET_SHARP_RADIUS] ? toEdit.sharpening.blurradius + mods.sharpening.blurradius : mods.sharpening.blurradius;
|
||||||
|
}
|
||||||
|
|
||||||
if (sharpening.amount) {
|
if (sharpening.amount) {
|
||||||
toEdit.sharpening.amount = dontforceSet && options.baBehav[ADDSET_SHARP_AMOUNT] ? toEdit.sharpening.amount + mods.sharpening.amount : mods.sharpening.amount;
|
toEdit.sharpening.amount = dontforceSet && options.baBehav[ADDSET_SHARP_AMOUNT] ? toEdit.sharpening.amount + mods.sharpening.amount : mods.sharpening.amount;
|
||||||
}
|
}
|
||||||
|
@ -209,6 +209,7 @@ class SharpeningParamsEdited
|
|||||||
public:
|
public:
|
||||||
bool enabled;
|
bool enabled;
|
||||||
bool contrast;
|
bool contrast;
|
||||||
|
bool blurradius;
|
||||||
bool radius;
|
bool radius;
|
||||||
bool amount;
|
bool amount;
|
||||||
bool threshold;
|
bool threshold;
|
||||||
|
@ -27,6 +27,7 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI
|
|||||||
{
|
{
|
||||||
auto m = ProcEventMapper::getInstance();
|
auto m = ProcEventMapper::getInstance();
|
||||||
EvSharpenContrast = m->newEvent(SHARPENING, "HISTORY_MSG_SHARPENING_CONTRAST");
|
EvSharpenContrast = m->newEvent(SHARPENING, "HISTORY_MSG_SHARPENING_CONTRAST");
|
||||||
|
EvSharpenBlur = m->newEvent(SHARPENING, "HISTORY_MSG_SHARPENING_BLUR");
|
||||||
|
|
||||||
Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());
|
Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());
|
||||||
hb->show ();
|
hb->show ();
|
||||||
@ -34,6 +35,10 @@ Sharpening::Sharpening () : FoldableToolPanel(this, "sharpening", M("TP_SHARPENI
|
|||||||
contrast->setAdjusterListener (this);
|
contrast->setAdjusterListener (this);
|
||||||
pack_start(*contrast);
|
pack_start(*contrast);
|
||||||
contrast->show();
|
contrast->show();
|
||||||
|
blur = Gtk::manage(new Adjuster (M("TP_SHARPENING_BLUR"), 0.2, 2.0, 0.05, 0.2));
|
||||||
|
blur->setAdjusterListener (this);
|
||||||
|
pack_start(*blur);
|
||||||
|
blur->show();
|
||||||
|
|
||||||
Gtk::Label* ml = Gtk::manage (new Gtk::Label (M("TP_SHARPENING_METHOD") + ":"));
|
Gtk::Label* ml = Gtk::manage (new Gtk::Label (M("TP_SHARPENING_METHOD") + ":"));
|
||||||
ml->show ();
|
ml->show ();
|
||||||
@ -152,7 +157,8 @@ void Sharpening::read (const ProcParams* pp, const ParamsEdited* pedited)
|
|||||||
disableListener ();
|
disableListener ();
|
||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
contrast->setEditedState (pedited->sharpening.contrast ? Edited : UnEdited);
|
contrast->setEditedState (pedited->sharpening.contrast ? Edited : UnEdited);
|
||||||
|
blur->setEditedState (pedited->sharpening.blurradius ? Edited : UnEdited);
|
||||||
amount->setEditedState (pedited->sharpening.amount ? Edited : UnEdited);
|
amount->setEditedState (pedited->sharpening.amount ? Edited : UnEdited);
|
||||||
radius->setEditedState (pedited->sharpening.radius ? Edited : UnEdited);
|
radius->setEditedState (pedited->sharpening.radius ? Edited : UnEdited);
|
||||||
threshold->setEditedState (pedited->sharpening.threshold ? Edited : UnEdited);
|
threshold->setEditedState (pedited->sharpening.threshold ? Edited : UnEdited);
|
||||||
@ -182,6 +188,7 @@ void Sharpening::read (const ProcParams* pp, const ParamsEdited* pedited)
|
|||||||
lastHaloControl = pp->sharpening.halocontrol;
|
lastHaloControl = pp->sharpening.halocontrol;
|
||||||
|
|
||||||
contrast->setValue (pp->sharpening.contrast);
|
contrast->setValue (pp->sharpening.contrast);
|
||||||
|
blur->setValue (pp->sharpening.blurradius);
|
||||||
amount->setValue (pp->sharpening.amount);
|
amount->setValue (pp->sharpening.amount);
|
||||||
radius->setValue (pp->sharpening.radius);
|
radius->setValue (pp->sharpening.radius);
|
||||||
threshold->setValue<int>(pp->sharpening.threshold);
|
threshold->setValue<int>(pp->sharpening.threshold);
|
||||||
@ -224,6 +231,7 @@ void Sharpening::write (ProcParams* pp, ParamsEdited* pedited)
|
|||||||
{
|
{
|
||||||
|
|
||||||
pp->sharpening.contrast = contrast->getValue ();
|
pp->sharpening.contrast = contrast->getValue ();
|
||||||
|
pp->sharpening.blurradius = blur->getValue ();
|
||||||
pp->sharpening.amount = (int)amount->getValue();
|
pp->sharpening.amount = (int)amount->getValue();
|
||||||
pp->sharpening.enabled = getEnabled ();
|
pp->sharpening.enabled = getEnabled ();
|
||||||
pp->sharpening.radius = radius->getValue ();
|
pp->sharpening.radius = radius->getValue ();
|
||||||
@ -246,6 +254,7 @@ void Sharpening::write (ProcParams* pp, ParamsEdited* pedited)
|
|||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
pedited->sharpening.contrast = contrast->getEditedState ();
|
pedited->sharpening.contrast = contrast->getEditedState ();
|
||||||
|
pedited->sharpening.blurradius = blur->getEditedState ();
|
||||||
pedited->sharpening.amount = amount->getEditedState ();
|
pedited->sharpening.amount = amount->getEditedState ();
|
||||||
pedited->sharpening.radius = radius->getEditedState ();
|
pedited->sharpening.radius = radius->getEditedState ();
|
||||||
pedited->sharpening.threshold = threshold->getEditedState ();
|
pedited->sharpening.threshold = threshold->getEditedState ();
|
||||||
@ -266,6 +275,7 @@ void Sharpening::write (ProcParams* pp, ParamsEdited* pedited)
|
|||||||
void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited)
|
void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
contrast->setDefault (defParams->sharpening.contrast);
|
contrast->setDefault (defParams->sharpening.contrast);
|
||||||
|
blur->setDefault (defParams->sharpening.blurradius);
|
||||||
amount->setDefault (defParams->sharpening.amount);
|
amount->setDefault (defParams->sharpening.amount);
|
||||||
radius->setDefault (defParams->sharpening.radius);
|
radius->setDefault (defParams->sharpening.radius);
|
||||||
threshold->setDefault<int> (defParams->sharpening.threshold);
|
threshold->setDefault<int> (defParams->sharpening.threshold);
|
||||||
@ -279,6 +289,7 @@ void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* p
|
|||||||
|
|
||||||
if (pedited) {
|
if (pedited) {
|
||||||
contrast->setDefaultEditedState (pedited->sharpening.contrast ? Edited : UnEdited);
|
contrast->setDefaultEditedState (pedited->sharpening.contrast ? Edited : UnEdited);
|
||||||
|
blur->setDefaultEditedState (pedited->sharpening.blurradius ? Edited : UnEdited);
|
||||||
amount->setDefaultEditedState (pedited->sharpening.amount ? Edited : UnEdited);
|
amount->setDefaultEditedState (pedited->sharpening.amount ? Edited : UnEdited);
|
||||||
radius->setDefaultEditedState (pedited->sharpening.radius ? Edited : UnEdited);
|
radius->setDefaultEditedState (pedited->sharpening.radius ? Edited : UnEdited);
|
||||||
threshold->setDefaultEditedState (pedited->sharpening.threshold ? Edited : UnEdited);
|
threshold->setDefaultEditedState (pedited->sharpening.threshold ? Edited : UnEdited);
|
||||||
@ -291,6 +302,7 @@ void Sharpening::setDefaults (const ProcParams* defParams, const ParamsEdited* p
|
|||||||
ddamping->setDefaultEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited);
|
ddamping->setDefaultEditedState (pedited->sharpening.deconvdamping ? Edited : UnEdited);
|
||||||
} else {
|
} else {
|
||||||
contrast->setDefaultEditedState (Irrelevant);
|
contrast->setDefaultEditedState (Irrelevant);
|
||||||
|
blur->setDefaultEditedState (Irrelevant);
|
||||||
amount->setDefaultEditedState (Irrelevant);
|
amount->setDefaultEditedState (Irrelevant);
|
||||||
radius->setDefaultEditedState (Irrelevant);
|
radius->setDefaultEditedState (Irrelevant);
|
||||||
threshold->setDefaultEditedState (Irrelevant);
|
threshold->setDefaultEditedState (Irrelevant);
|
||||||
@ -310,7 +322,7 @@ void Sharpening::adjusterChanged(Adjuster* a, double newval)
|
|||||||
|
|
||||||
Glib::ustring costr;
|
Glib::ustring costr;
|
||||||
|
|
||||||
if (a == radius || a == dradius) {
|
if (a == radius || a == dradius || a == blur) {
|
||||||
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
costr = Glib::ustring::format (std::setw(3), std::fixed, std::setprecision(2), a->getValue());
|
||||||
} else if (a == eradius) {
|
} else if (a == eradius) {
|
||||||
costr = Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue());
|
costr = Glib::ustring::format (std::setw(2), std::fixed, std::setprecision(1), a->getValue());
|
||||||
@ -324,6 +336,8 @@ void Sharpening::adjusterChanged(Adjuster* a, double newval)
|
|||||||
listener->panelChanged (EvShrAmount, costr);
|
listener->panelChanged (EvShrAmount, costr);
|
||||||
} else if (a == radius) {
|
} else if (a == radius) {
|
||||||
listener->panelChanged (EvShrRadius, costr);
|
listener->panelChanged (EvShrRadius, costr);
|
||||||
|
} else if (a == blur) {
|
||||||
|
listener->panelChanged (EvSharpenBlur, costr);
|
||||||
} else if (a == eradius) {
|
} else if (a == eradius) {
|
||||||
listener->panelChanged (EvShrEdgeRadius, costr);
|
listener->panelChanged (EvShrEdgeRadius, costr);
|
||||||
} else if (a == etolerance) {
|
} else if (a == etolerance) {
|
||||||
@ -487,6 +501,7 @@ void Sharpening::setBatchMode (bool batchMode)
|
|||||||
pack_start (*rld);
|
pack_start (*rld);
|
||||||
|
|
||||||
contrast->showEditedCB ();
|
contrast->showEditedCB ();
|
||||||
|
blur->showEditedCB ();
|
||||||
radius->showEditedCB ();
|
radius->showEditedCB ();
|
||||||
amount->showEditedCB ();
|
amount->showEditedCB ();
|
||||||
threshold->showEditedCB ();
|
threshold->showEditedCB ();
|
||||||
@ -518,6 +533,7 @@ void Sharpening::setAdjusterBehavior (bool contrastadd, bool radiusadd, bool amo
|
|||||||
void Sharpening::trimValues (rtengine::procparams::ProcParams* pp)
|
void Sharpening::trimValues (rtengine::procparams::ProcParams* pp)
|
||||||
{
|
{
|
||||||
contrast->trimValue(pp->sharpening.contrast);
|
contrast->trimValue(pp->sharpening.contrast);
|
||||||
|
blur->trimValue(pp->sharpening.blurradius);
|
||||||
radius->trimValue(pp->sharpening.radius);
|
radius->trimValue(pp->sharpening.radius);
|
||||||
dradius->trimValue(pp->sharpening.deconvradius);
|
dradius->trimValue(pp->sharpening.deconvradius);
|
||||||
amount->trimValue(pp->sharpening.amount);
|
amount->trimValue(pp->sharpening.amount);
|
||||||
|
@ -29,6 +29,7 @@ class Sharpening : public ToolParamBlock, public ThresholdAdjusterListener, publ
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Adjuster* contrast;
|
Adjuster* contrast;
|
||||||
|
Adjuster* blur;
|
||||||
MyComboBoxText* method;
|
MyComboBoxText* method;
|
||||||
Adjuster* dradius;
|
Adjuster* dradius;
|
||||||
Adjuster* damount;
|
Adjuster* damount;
|
||||||
@ -55,6 +56,7 @@ protected:
|
|||||||
sigc::connection hcConn;
|
sigc::connection hcConn;
|
||||||
|
|
||||||
rtengine::ProcEvent EvSharpenContrast;
|
rtengine::ProcEvent EvSharpenContrast;
|
||||||
|
rtengine::ProcEvent EvSharpenBlur;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Sharpening ();
|
Sharpening ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user