Change sharp behavior
This commit is contained in:
parent
3e0b2be942
commit
8a8fba500b
@ -251,14 +251,8 @@ void ImProcFunctions::deconvsharpeningloc (float** luminance, float** tmp, int W
|
|||||||
if (amo < 1) {
|
if (amo < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
JaggedArray<float> tmpI(W, H);
|
||||||
|
|
||||||
float *tmpI[H] ALIGNED16;
|
|
||||||
|
|
||||||
tmpI[0] = new float[W * H];
|
|
||||||
|
|
||||||
for (int i = 1; i < H; i++) {
|
|
||||||
tmpI[i] = tmpI[i - 1] + W;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < H; i++) {
|
for (int i = 0; i < H; i++) {
|
||||||
for (int j = 0; j < W; j++) {
|
for (int j = 0; j < W; j++) {
|
||||||
@ -271,8 +265,12 @@ void ImProcFunctions::deconvsharpeningloc (float** luminance, float** tmp, int W
|
|||||||
float contras = contrast / 100.f;
|
float contras = contrast / 100.f;
|
||||||
buildBlendMask(luminance, blend, W, H, contras, 1.f);
|
buildBlendMask(luminance, blend, W, H, contras, 1.f);
|
||||||
JaggedArray<float> blur(W, H);
|
JaggedArray<float> blur(W, H);
|
||||||
|
|
||||||
|
JaggedArray<float>* blurbuffer = nullptr;
|
||||||
|
|
||||||
if (blurrad >= 0.25) {
|
if (blurrad >= 0.25) {
|
||||||
|
blurbuffer = new JaggedArray<float>(W, H);
|
||||||
|
JaggedArray<float> &blur = *blurbuffer;
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel
|
#pragma omp parallel
|
||||||
#endif
|
#endif
|
||||||
@ -340,8 +338,8 @@ void ImProcFunctions::deconvsharpeningloc (float** luminance, float** tmp, int W
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // end parallel
|
} // end parallel
|
||||||
|
delete blurbuffer;
|
||||||
|
|
||||||
delete [] tmpI[0];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,11 +894,11 @@ class LocallabSharp:
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Adjuster* const sharcontrast;
|
Adjuster* const sharcontrast;
|
||||||
Adjuster* const sharradius;
|
Adjuster* const sharblur;
|
||||||
Adjuster* const sharamount;
|
Adjuster* const sharamount;
|
||||||
Adjuster* const shardamping;
|
Adjuster* const shardamping;
|
||||||
Adjuster* const shariter;
|
Adjuster* const shariter;
|
||||||
Adjuster* const sharblur;
|
Adjuster* const sharradius;
|
||||||
Adjuster* const sensisha;
|
Adjuster* const sensisha;
|
||||||
Gtk::CheckButton* const inverssha;
|
Gtk::CheckButton* const inverssha;
|
||||||
MyComboBoxText* const showmasksharMethod;
|
MyComboBoxText* const showmasksharMethod;
|
||||||
|
@ -1741,11 +1741,11 @@ LocallabSharp::LocallabSharp():
|
|||||||
|
|
||||||
// Sharpening specific widgets
|
// Sharpening specific widgets
|
||||||
sharcontrast(Gtk::manage(new Adjuster(M("TP_SHARPENING_CONTRAST"), 0, 200, 1, 20))),
|
sharcontrast(Gtk::manage(new Adjuster(M("TP_SHARPENING_CONTRAST"), 0, 200, 1, 20))),
|
||||||
sharradius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARRADIUS"), 0.4, 2.5, 0.01, 0.75))),
|
sharblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARBLUR"), 0.2, 2.0, 0.05, 0.2))),
|
||||||
sharamount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARAMOUNT"), 0, 100, 1, 100))),
|
sharamount(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARAMOUNT"), 0, 100, 1, 100))),
|
||||||
shardamping(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARDAMPING"), 0, 100, 1, 0))),
|
shardamping(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARDAMPING"), 0, 100, 1, 0))),
|
||||||
shariter(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARITER"), 5, 100, 1, 30))),
|
shariter(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARITER"), 5, 100, 1, 30))),
|
||||||
sharblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARBLUR"), 0.2, 2.0, 0.05, 0.2))),
|
sharradius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SHARRADIUS"), 0.4, 2.5, 0.01, 0.75))),
|
||||||
sensisha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 40))),
|
sensisha(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 40))),
|
||||||
inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))),
|
inverssha(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVERS")))),
|
||||||
showmasksharMethod(Gtk::manage(new MyComboBoxText()))
|
showmasksharMethod(Gtk::manage(new MyComboBoxText()))
|
||||||
@ -1776,11 +1776,11 @@ LocallabSharp::LocallabSharp():
|
|||||||
|
|
||||||
// Add Sharpening specific widgets to GUI
|
// Add Sharpening specific widgets to GUI
|
||||||
pack_start(*sharcontrast);
|
pack_start(*sharcontrast);
|
||||||
|
pack_start(*sharblur);
|
||||||
pack_start(*sharradius);
|
pack_start(*sharradius);
|
||||||
pack_start(*sharamount);
|
pack_start(*sharamount);
|
||||||
pack_start(*shardamping);
|
pack_start(*shardamping);
|
||||||
pack_start(*shariter);
|
pack_start(*shariter);
|
||||||
pack_start(*sharblur);
|
|
||||||
pack_start(*sensisha);
|
pack_start(*sensisha);
|
||||||
pack_start(*inverssha);
|
pack_start(*inverssha);
|
||||||
Gtk::Frame* const sharFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME")));
|
Gtk::Frame* const sharFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_SHARFRAME")));
|
||||||
@ -1995,6 +1995,7 @@ void LocallabSharp::convertParamToNormal()
|
|||||||
shardamping->setValue((double)defSpot.shardamping);
|
shardamping->setValue((double)defSpot.shardamping);
|
||||||
shariter->setValue((double)defSpot.shariter);
|
shariter->setValue((double)defSpot.shariter);
|
||||||
sharblur->setValue(defSpot.sharblur);
|
sharblur->setValue(defSpot.sharblur);
|
||||||
|
sharamount->setValue(defSpot.sharamount);
|
||||||
|
|
||||||
// Enable all listeners
|
// Enable all listeners
|
||||||
enableListener();
|
enableListener();
|
||||||
@ -2007,11 +2008,15 @@ void LocallabSharp::updateGUIToMode(const modeType new_type)
|
|||||||
shardamping->hide();
|
shardamping->hide();
|
||||||
shariter->hide();
|
shariter->hide();
|
||||||
sharblur->hide();
|
sharblur->hide();
|
||||||
|
sharcontrast->hide();
|
||||||
|
sharamount->hide();
|
||||||
} else {
|
} else {
|
||||||
// Advanced widgets are shown in Expert mode
|
// Advanced widgets are shown in Expert mode
|
||||||
shardamping->show();
|
shardamping->show();
|
||||||
shariter->show();
|
shariter->show();
|
||||||
sharblur->show();
|
sharblur->hide();
|
||||||
|
sharcontrast->hide();
|
||||||
|
sharamount->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user