Clean and format code
This commit is contained in:
parent
4fa494da55
commit
f53b1b4580
@ -1472,6 +1472,7 @@ void ImProcFunctions::log_encode(Imagefloat *rgb, struct local_params & lp, floa
|
||||
float &b = rgb->b(y, x);
|
||||
float t = Y[y][x];
|
||||
float t2;
|
||||
|
||||
if (t > noise && (t2 = norm(r, g, b)) > noise) {
|
||||
float c = apply(t, false);
|
||||
float f = c / t;
|
||||
@ -4406,11 +4407,13 @@ void ImProcFunctions::InverseSharp_Local(float **loctemp, const float hueref, co
|
||||
case 0: { // outside selection and outside transition zone => full effect, no transition
|
||||
float difL = loctemp[y][x] - original->L[y][x];
|
||||
transformed->L[y][x] = CLIP(original->L[y][x] + difL * reducdE);
|
||||
if(sharshow) {
|
||||
|
||||
if (sharshow) {
|
||||
transformed->a[y][x] = 0.f;
|
||||
transformed->b[y][x] = ampli * 5.f * difL * reducdE;
|
||||
} else if(previewshar) {
|
||||
} else if (previewshar) {
|
||||
float difbdisp = reducview * 10000.f * lp.colorde;
|
||||
|
||||
if (transformed->L[y][x] < darklim) { //enhance dark luminance as user can see!
|
||||
float dark = transformed->L[y][x];
|
||||
transformed->L[y][x] = dark * aadark + bbdark;
|
||||
@ -4436,11 +4439,13 @@ void ImProcFunctions::InverseSharp_Local(float **loctemp, const float hueref, co
|
||||
difL *= factorx;
|
||||
|
||||
transformed->L[y][x] = CLIP(original->L[y][x] + difL * reducdE);
|
||||
if(sharshow) {
|
||||
|
||||
if (sharshow) {
|
||||
transformed->a[y][x] = 0.f;
|
||||
transformed->b[y][x] = ampli * 5.f * difL * reducdE;
|
||||
} else if(previewshar) {
|
||||
} else if (previewshar) {
|
||||
float difbdisp = reducview * 10000.f * lp.colorde;
|
||||
|
||||
if (transformed->L[y][x] < darklim) { //enhance dark luminance as user can see!
|
||||
float dark = transformed->L[y][x];
|
||||
transformed->L[y][x] = dark * aadark + bbdark;
|
||||
@ -4580,11 +4585,13 @@ void ImProcFunctions::Sharp_Local(int call, float **loctemp, int senstype, const
|
||||
}
|
||||
|
||||
transformed->L[y][x] = CLIP(original->L[y][x] + difL * reducdE);
|
||||
if(sharshow) {
|
||||
|
||||
if (sharshow) {
|
||||
transformed->a[y][x] = 0.f;
|
||||
transformed->b[y][x] = ampli * 5.f * difL * reducdE;
|
||||
} else if(previewshar) {
|
||||
} else if (previewshar) {
|
||||
float difbdisp = reducview * 10000.f * lp.colorde;
|
||||
|
||||
if (transformed->L[y][x] < darklim) { //enhance dark luminance as user can see!
|
||||
float dark = transformed->L[y][x];
|
||||
transformed->L[y][x] = dark * aadark + bbdark;
|
||||
@ -6604,7 +6611,7 @@ void ImProcFunctions::transit_shapedetect2(int call, int senstype, const LabImag
|
||||
difb = factorx * realstrbdE;
|
||||
float maxdifab = max(fabs(difa), fabs(difb));
|
||||
|
||||
if(origshow) {//original Retinex
|
||||
if (origshow) { //original Retinex
|
||||
transformed->a[y + ystart][x + xstart] = 0.f;
|
||||
transformed->b[y + ystart][x + xstart] = ampli * 8.f * diflc * reducdE;
|
||||
|
||||
@ -11648,15 +11655,16 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
|
||||
|
||||
for (int y = 0; y < bfhr; y++) {
|
||||
for (int x = 0; x < bfwr; x++) {
|
||||
// datain[y * bfwr + x] = temp->L[y][x] - bufexpfin->L[y][x];
|
||||
datain[y * bfwr + x] = bufexpfin->L[y][x];
|
||||
}
|
||||
}
|
||||
|
||||
int showorig = lp.showmasksoftmet;
|
||||
if(lp.showmasksoftmet >= 5) {
|
||||
|
||||
if (lp.showmasksoftmet >= 5) {
|
||||
showorig = 0;
|
||||
}
|
||||
//ImProcFunctions::retinex_pde(datain, dataout, bfwr, bfhr, 8.f * lp.strng, 1.f, dE, lp.showmasksoftmet, 1, 1);
|
||||
|
||||
ImProcFunctions::retinex_pde(datain, dataout, bfwr, bfhr, 8.f * lp.strng, 1.f, dE, showorig, 1, 1);
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for schedule(dynamic,16)
|
||||
@ -12167,7 +12175,6 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
|
||||
|
||||
|
||||
transit_shapedetect2(call, 10, bufgb.get(), tmp1.get(), originalmasklc.get(), hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk);
|
||||
// transit_shapedetect(10, tmp1.get(), nullptr, bufchro, false, hueref, chromaref, lumaref, sobelref, 0.f, nullptr, lp, original, transformed, cx, cy, sk);
|
||||
tmp1.reset();
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ static double blurSlider2radius(double sval)
|
||||
if (radius > MAXRAD) {
|
||||
radius = MAXRAD;
|
||||
}
|
||||
|
||||
return radius;
|
||||
}
|
||||
|
||||
@ -1699,6 +1700,7 @@ pe(nullptr)
|
||||
if (complexsoft < 2) {
|
||||
exposeBox->pack_start(*blurexpde);
|
||||
}
|
||||
|
||||
exposeBox->pack_start(*exptoolexp);
|
||||
|
||||
|
||||
@ -1919,7 +1921,7 @@ pe(nullptr)
|
||||
ToolParamBlock* const gradSHBox = Gtk::manage(new ToolParamBlock());
|
||||
gradSHBox->pack_start(*strSH);
|
||||
gradSHBox->pack_start(*angSH);
|
||||
// gradSHFrame->add(*gradSHBox);
|
||||
// gradSHFrame->add(*gradSHBox);
|
||||
|
||||
setExpandAlignProperties(expgradsh, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
|
||||
expgradsh->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expgradsh));
|
||||
@ -1928,7 +1930,7 @@ pe(nullptr)
|
||||
expgradsh->add(*gradSHBox, false);
|
||||
|
||||
shadhighBox->pack_start(*detailSH);
|
||||
// shadhighBox->pack_start(*gamFrame);
|
||||
// shadhighBox->pack_start(*gamFrame);
|
||||
|
||||
if (complexsoft < 2) {
|
||||
// shadhighBox->pack_start(*gamFrame);
|
||||
@ -1945,6 +1947,7 @@ pe(nullptr)
|
||||
if (complexsoft < 2) {
|
||||
shadhighBox->pack_start(*blurSHde);
|
||||
}
|
||||
|
||||
shadhighBox->pack_start(*gamFrame);
|
||||
|
||||
// shadhighBox->pack_start(*gradSHFrame);
|
||||
@ -2863,6 +2866,7 @@ pe(nullptr)
|
||||
enablecontrastConn = expcontrast->signal_enabled_toggled().connect(sigc::bind(sigc::mem_fun(this, &Locallab::enableToggled), expcontrast));
|
||||
fftwlcConn = fftwlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::fftwlcChanged));
|
||||
csThreshold->setAdjusterListener(this);
|
||||
|
||||
if (showtooltip) {
|
||||
expcontrast->set_tooltip_text(M("TP_LOCALLAB_EXPCONTRAST_TOOLTIP"));
|
||||
}
|
||||
@ -2890,8 +2894,8 @@ pe(nullptr)
|
||||
|
||||
LocalcurveEditorwav->setCurveListener(this);
|
||||
std::vector<GradientMilestone> botMilestones;
|
||||
botMilestones.push_back( GradientMilestone(0., 0., 0., 0.) );
|
||||
botMilestones.push_back( GradientMilestone(1., 1., 1., 1.) );
|
||||
botMilestones.push_back(GradientMilestone(0., 0., 0., 0.));
|
||||
botMilestones.push_back(GradientMilestone(1., 1., 1., 1.));
|
||||
|
||||
wavshape->setIdentityValue(0.);
|
||||
wavshape->setResetCurve(FlatCurveType(defSpot.locwavcurve.at(0)), defSpot.locwavcurve);
|
||||
@ -2945,6 +2949,7 @@ pe(nullptr)
|
||||
// wavshapecompre->setTooltip(M("TP_LOCALLAB_COMPRESS_TOOLTIP"));
|
||||
// wavshapecomp->setTooltip(M("TP_LOCALLAB_COMPRESS_TOOLTIP"));
|
||||
}
|
||||
|
||||
if (showtooltip) {
|
||||
llshape->setTooltip(M("TP_LOCALLAB_CURVEEDITOR_LL_TOOLTIP"));
|
||||
}
|
||||
@ -3016,7 +3021,7 @@ pe(nullptr)
|
||||
clariFrame->add(*clariBox);
|
||||
|
||||
gradwavFrame->set_label_align(0.025, 0.5);
|
||||
wavgradl->set_active (false);
|
||||
wavgradl->set_active(false);
|
||||
gradwavFrame->set_label_widget(*wavgradl);
|
||||
ToolParamBlock* const gradwavBox = Gtk::manage(new ToolParamBlock());
|
||||
gradwavBox->pack_start(*strwav);
|
||||
@ -3026,10 +3031,10 @@ pe(nullptr)
|
||||
Gtk::HSeparator* const separatorblu = Gtk::manage(new Gtk::HSeparator());
|
||||
|
||||
blurlevelFrame->set_label_align(0.025, 0.5);
|
||||
Gtk::VBox *blurlevcontBox = Gtk::manage ( new Gtk::VBox());
|
||||
Gtk::VBox *blurlevcontBox = Gtk::manage(new Gtk::VBox());
|
||||
blurlevcontBox->set_spacing(2);
|
||||
|
||||
wavblur->set_active (true);
|
||||
wavblur->set_active(true);
|
||||
blurlevelFrame->set_label_widget(*wavblur);
|
||||
|
||||
// ToolParamBlock* const blurlevcontBox = Gtk::manage(new ToolParamBlock());
|
||||
@ -3044,9 +3049,9 @@ pe(nullptr)
|
||||
|
||||
contFrame->set_label_align(0.025, 0.5);
|
||||
// ToolParamBlock* const contlevBox = Gtk::manage(new ToolParamBlock());
|
||||
Gtk::VBox *contlevBox = Gtk::manage ( new Gtk::VBox());
|
||||
Gtk::VBox *contlevBox = Gtk::manage(new Gtk::VBox());
|
||||
contlevBox->set_spacing(2);
|
||||
wavcont->set_active (true);
|
||||
wavcont->set_active(true);
|
||||
contFrame->set_label_widget(*wavcont);
|
||||
|
||||
contlevBox->pack_start(*sigma);
|
||||
@ -3058,15 +3063,15 @@ pe(nullptr)
|
||||
Gtk::HSeparator* const separatorcomp = Gtk::manage(new Gtk::HSeparator());
|
||||
|
||||
compFrame->set_label_align(0.025, 0.5);
|
||||
Gtk::VBox *compBox = Gtk::manage ( new Gtk::VBox());
|
||||
Gtk::VBox *compBox = Gtk::manage(new Gtk::VBox());
|
||||
compBox->set_spacing(2);
|
||||
wavcomp->set_active (false);
|
||||
wavcomp->set_active(false);
|
||||
compFrame->set_label_widget(*wavcomp);
|
||||
|
||||
compreFrame->set_label_align(0.025, 0.5);
|
||||
Gtk::VBox *compreBox = Gtk::manage ( new Gtk::VBox());
|
||||
Gtk::VBox *compreBox = Gtk::manage(new Gtk::VBox());
|
||||
compreBox->set_spacing(2);
|
||||
wavcompre->set_active (false);
|
||||
wavcompre->set_active(false);
|
||||
compreFrame->set_label_widget(*wavcompre);
|
||||
compreBox->pack_start(*LocalcurveEditorwavcompre, Gtk::PACK_SHRINK, 4);
|
||||
compreBox->pack_start(*threswav);
|
||||
@ -3100,12 +3105,15 @@ pe(nullptr)
|
||||
blurcontBox->pack_start(*gradwavFrame);
|
||||
blurcontBox->pack_start(*contFrame);
|
||||
blurcontBox->pack_start(*compreFrame);
|
||||
|
||||
if (complexsoft < 2) {
|
||||
blurcontBox->pack_start(*compFrame);
|
||||
}
|
||||
|
||||
blurcontBox->pack_start(*blurlevelFrame);
|
||||
|
||||
expcontrastpyr->add(*blurcontBox, false);
|
||||
|
||||
if (showtooltip) {
|
||||
fatdet->set_tooltip_text(M("TP_LOCALLAB_COMPFRAME_TOOLTIP"));
|
||||
}
|
||||
@ -3146,6 +3154,7 @@ pe(nullptr)
|
||||
if (complexsoft < 2) {
|
||||
contrastBox->pack_start(*fftwlc);
|
||||
}
|
||||
|
||||
masklcCurveEditorG->setCurveListener(this);
|
||||
CCmasklcshape->setIdentityValue(0.);
|
||||
CCmasklcshape->setResetCurve(FlatCurveType(defSpot.CCmasklccurve.at(0)), defSpot.CCmasklccurve);
|
||||
@ -4407,6 +4416,7 @@ void Locallab::read(const rtengine::procparams::ProcParams* pp, const ParamsEdit
|
||||
r->colorde = pp->locallab.spots.at(i).colorde;
|
||||
r->transitweak = pp->locallab.spots.at(i).transitweak;
|
||||
r->transitgrad = pp->locallab.spots.at(i).transitgrad;
|
||||
|
||||
if (complexsoft == 2) {
|
||||
r->transitweak = 1;
|
||||
r->transitgrad = 0;
|
||||
@ -4496,6 +4506,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
||||
r->sensiexclu = newSpot->sensiexclu;
|
||||
r->structexclu = newSpot->structexclu;
|
||||
r->struc = newSpot->struc;
|
||||
|
||||
if (complexsoft == 2) {
|
||||
r->shapeMethod = 0;
|
||||
}
|
||||
@ -4560,10 +4571,12 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
||||
r->colorde = newSpot->colorde;
|
||||
r->transitweak = newSpot->transitweak;
|
||||
r->transitgrad = newSpot->transitgrad;
|
||||
|
||||
if (complexsoft == 2) {
|
||||
r->transitweak = 1;
|
||||
r->transitgrad = 0;
|
||||
}
|
||||
|
||||
r->scopemask = newSpot->scopemask;
|
||||
r->lumask = newSpot->lumask;
|
||||
r->avoid = newSpot->avoid;
|
||||
@ -4747,6 +4760,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
||||
} else {
|
||||
r->shapeMethod = 3;
|
||||
}
|
||||
|
||||
if (complexsoft == 2) {
|
||||
r->shapeMethod = 0;
|
||||
}
|
||||
@ -4801,6 +4815,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
||||
r->colorde = newSpot->colorde;
|
||||
r->transitweak = newSpot->transitweak;
|
||||
r->transitgrad = newSpot->transitgrad;
|
||||
|
||||
if (complexsoft == 2) {
|
||||
r->transitweak = 1;
|
||||
r->transitgrad = 0;
|
||||
@ -4896,10 +4911,12 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
||||
pp->locallab.spots.at(pp->locallab.selspot).sensiexclu = r->sensiexclu;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).structexclu = r->structexclu;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).struc = r->struc;
|
||||
|
||||
if (complexsoft == 2) {
|
||||
pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "IND";
|
||||
r->shapeMethod = 0;
|
||||
}
|
||||
|
||||
if (r->shapeMethod == 0) {
|
||||
pp->locallab.spots.at(pp->locallab.selspot).shapeMethod = "IND";
|
||||
} else if (r->shapeMethod == 1) {
|
||||
@ -4941,6 +4958,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
|
||||
pp->locallab.spots.at(pp->locallab.selspot).colorde = r->colorde;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).transitweak = r->transitweak;
|
||||
pp->locallab.spots.at(pp->locallab.selspot).transitgrad = r->transitgrad;
|
||||
|
||||
if (complexsoft == 2) {
|
||||
r->transitweak = 1;
|
||||
r->transitgrad = 0;
|
||||
@ -6818,6 +6836,7 @@ void Locallab::curveChanged(CurveEditor* ce)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//denoise
|
||||
if (getEnabled() && expdenoi->getEnabled()) {
|
||||
|
||||
@ -7928,13 +7947,13 @@ void Locallab::fftwblChanged()
|
||||
{
|
||||
// printf("fftwblChanged\n");
|
||||
double temp = radius->getValue();
|
||||
/*
|
||||
/*
|
||||
if (fftwbl->get_active()) {
|
||||
radius->setLimits(1.5, 1000., 0.5, 1.5);
|
||||
} else {
|
||||
radius->setLimits(1.5, 100., 0.5, 1.5);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
radius->setValue(temp);
|
||||
|
||||
if (multiImage) {
|
||||
@ -8249,6 +8268,7 @@ void Locallab::inversexChanged()
|
||||
expMethod->show();
|
||||
exnoiseMethod->show();
|
||||
expgradexp->show();
|
||||
|
||||
if (expMethod->get_active_row_number() == 0) {
|
||||
pdeFrame->hide();
|
||||
softradiusexp->show();
|
||||
@ -12330,20 +12350,22 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
lapmaskbl->setValue(0);
|
||||
LLmaskblshapewav->reset();
|
||||
}
|
||||
/*
|
||||
|
||||
/*
|
||||
if (fftwbl->get_active()) {
|
||||
radius->setLimits(1.5, 1000., 0.5, 1.5);
|
||||
} else {
|
||||
radius->setLimits(1.5, 100., 0.5, 1.5);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
radius->setValue(pp->locallab.spots.at(index).radius);
|
||||
/*
|
||||
|
||||
/*
|
||||
if (complexsoft == 2) {
|
||||
radius->setLimits(1.5, 100., 0.5, 1.5);
|
||||
radius->setValue(pp->locallab.spots.at(index).radius);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
if (complexsoft == 2) {
|
||||
fftwbl->set_active(false);
|
||||
}
|
||||
@ -12559,13 +12581,14 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
LLmaskcbshape->setCurve(pp->locallab.spots.at(index).LLmaskcbcurve);
|
||||
HHmaskcbshape->setCurve(pp->locallab.spots.at(index).HHmaskcbcurve);
|
||||
Lmaskcbshape->setCurve(pp->locallab.spots.at(index).Lmaskcbcurve);
|
||||
/*
|
||||
|
||||
/*
|
||||
if (complexsoft == 2) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
multiplier[i]->setValue(1.0);
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
if (complexsoft > 0) {
|
||||
lapmaskcb->setValue(0);
|
||||
}
|
||||
@ -12586,7 +12609,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
sensiden->setValue(pp->locallab.spots.at(index).sensiden);
|
||||
detailthr->setValue(pp->locallab.spots.at(index).detailthr);
|
||||
wavshapeden->setCurve(pp->locallab.spots.at(index).locwavcurveden);
|
||||
/*
|
||||
/*
|
||||
if (complexsoft == 2) {
|
||||
noiselumf->setValue(0);
|
||||
noiselumf0->setValue(0);
|
||||
@ -12596,7 +12619,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
|
||||
noisechroc->setValue(0);
|
||||
bilateral->setValue(0);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
//log encoding
|
||||
explog->setEnabled(pp->locallab.spots.at(index).explog);
|
||||
autocompute->set_active(pp->locallab.spots.at(index).autocompute);
|
||||
@ -13217,7 +13240,7 @@ void Locallab::updateSpecificGUIState()
|
||||
} else if (merMethod->get_active_row_number() == 3) {
|
||||
conthrcol->show();
|
||||
// structcol->set_sensitive(false);
|
||||
// sensi->set_sensitive(false);
|
||||
// sensi->set_sensitive(false);
|
||||
sensi->set_sensitive(true);
|
||||
// blurcolde->set_sensitive(false);
|
||||
// blurcol->set_sensitive(false);
|
||||
@ -13352,10 +13375,11 @@ void Locallab::updateSpecificGUIState()
|
||||
for (int i = 0; i < 5; i++) {
|
||||
multipliersh[i]->hide();
|
||||
}
|
||||
|
||||
expgradsh->hide();
|
||||
|
||||
detailSH->hide();
|
||||
// gamFrame->hide();
|
||||
// gamFrame->hide();
|
||||
highlights->show();
|
||||
h_tonalwidth->show();
|
||||
shadows->show();
|
||||
|
Loading…
x
Reference in New Issue
Block a user