Local adjustments - denoise improvments (#6705)

* Init improvment LA denoise

* First display luma chroma residual noise

* Clean code denoise iplocallab.cc

* Change windows.yml with old version january 2023

* Clean code - change calculation denoise - GUI

* Improve labels tooltip denoise

* Clean code

* Change tooltip

* Set auto denoise - main - chroma auto to 50%  when LA denoise is used

* Change GUI denoise with expanders

* Change labels

* Change reference remianing noise in percentage

* Change tooltip and labels

* Change values in preview remaining noise

* Clean comment code - chnage tooltips

* Change windows.yml and appimage.yml publish_pre_dev labels

* Update windows.yml

* Restore windows.yml

* Restore windows.yml and clean code

* Revert change Noise Reduction link with Local denoise

* Revert all changes on Noise-reduction linked with Local adjustments
This commit is contained in:
Desmis
2023-06-05 06:40:57 +02:00
committed by GitHub
parent 6a11c59b79
commit be2d5ce11f
15 changed files with 445 additions and 347 deletions

View File

@@ -6477,8 +6477,17 @@ LocallabBlur::LocallabBlur():
activlum(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ACTIV")))),
expdenoise(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI_EXP")))),
quamethod(Gtk::manage(new MyComboBoxText())),
expdenoisenl(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_NLFRA")))),
expdenoiselum(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOIWAVLUM")))),
expdenoisech(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOIWAVCH")))),
LocalcurveEditorwavden(new CurveEditorGroup(options.lastlocalCurvesDir, M("TP_LOCALLAB_WAVDEN"))),
wavshapeden(static_cast<FlatCurveEditor*>(LocalcurveEditorwavden->addCurve(CT_Flat, "", nullptr, false, false))),
// lCLabels(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_LCLABELS")))),
lCLabels(Gtk::manage(new Gtk::Label("-----------------"))),
lumLabels(Gtk::manage(new Gtk::Label("---"))),
lum46Labels(Gtk::manage(new Gtk::Label("---"))),
chroLabels(Gtk::manage(new Gtk::Label("---"))),
chro46Labels(Gtk::manage(new Gtk::Label("---"))),
expdenoise1(Gtk::manage(new MyExpander(false, M("TP_LOCALLAB_DENOI1_EXP")))),
maskusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUSABLE")))),
maskunusable(Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_MASKUNUSABLE")))),
@@ -6514,7 +6523,7 @@ LocallabBlur::LocallabBlur():
decayd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_MASKDDECAY"), 0.5, 4., 0.1, 2.))),
invmaskd(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))),
invmask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_INVMASK")))),
nlFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_NLFRA")))),
prevFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LCLABELS")))),
nlstr(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLLUM"), 0, 100, 1, 0))),
nldet(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLDET"), 0, 100, 1, 50))),
nlpat(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NLPAT"), 1, 5, 1, 2))),
@@ -6640,12 +6649,23 @@ LocallabBlur::LocallabBlur():
Gtk::Label* const quaLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_DENQUA") + ":"));
quaHBox->pack_start(*quaLabel, Gtk::PACK_SHRINK, 4);
quaHBox->pack_start(*quamethod);
setExpandAlignProperties(expdenoisenl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
setExpandAlignProperties(expdenoiselum, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
setExpandAlignProperties(expdenoisech, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
LocalcurveEditorwavden->setCurveListener(this);
wavshapeden->setIdentityValue(0.);
wavshapeden->setResetCurve(FlatCurveType(defSpot.locwavcurveden.at(0)), defSpot.locwavcurveden);
setExpandAlignProperties(lCLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(lumLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(lum46Labels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(chroLabels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
setExpandAlignProperties(chro46Labels, true, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_START);
LocalcurveEditorwavden->curveListComplete();
setExpandAlignProperties(expdenoise1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
@@ -6701,7 +6721,7 @@ LocallabBlur::LocallabBlur():
decayd->setAdjusterListener(this);
bilateral->setAdjusterListener(this);
nlFrame->set_label_align(0.025, 0.5);
prevFrame->set_label_align(0.025, 0.5);
nlstr->setAdjusterListener(this);
nldet->setAdjusterListener(this);
@@ -6838,15 +6858,39 @@ LocallabBlur::LocallabBlur():
Gtk::Frame* const wavFrame = Gtk::manage(new Gtk::Frame());
ToolParamBlock* const wavBox = Gtk::manage(new ToolParamBlock());
wavBox->pack_start(*quaHBox);
wavBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
wavBox->pack_start(*sensiden);
wavBox->pack_start(*reparden);
ToolParamBlock* const prevBox = Gtk::manage(new ToolParamBlock());
prevBox->pack_start(*lumLabels);
prevBox->pack_start(*lum46Labels);
prevBox->pack_start(*lCLabels);
prevBox->pack_start(*chroLabels);
prevBox->pack_start(*chro46Labels);
prevFrame->add(*prevBox);
wavBox->pack_start(*prevFrame);
ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock());
nlbox->pack_start(*nlstr);
nlbox->pack_start(*nldet);
nlbox->pack_start(*nlgam);
nlbox->pack_start(*nlpat);
nlbox->pack_start(*nlrad);
expdenoisenl->add(*nlbox);
wavBox->pack_start(*expdenoisenl);
// wavBox->pack_start(*noiselumf0);
// wavBox->pack_start(*noiselumf);
// wavBox->pack_start(*noiselumf2);
// wavBox->pack_start(*noiselumc);//unused here, but used for normalize_mean_dt
wavBox->pack_start(*noiselumdetail);
wavBox->pack_start(*noiselequal);
wavBox->pack_start(*noisegam);
wavBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4);
ToolParamBlock* const wchBox = Gtk::manage(new ToolParamBlock());
wchBox->pack_start(*LocalcurveEditorwavden, Gtk::PACK_SHRINK, 4); // Padding is mandatory to correct behavior of curve editor
wchBox->pack_start(*noiselumdetail);
wchBox->pack_start(*noiselequal);
wchBox->pack_start(*noisegam);
wchBox->pack_start(*LocalcurveEditorwavhue, Gtk::PACK_SHRINK, 4);
ToolParamBlock* const wavBox1 = Gtk::manage(new ToolParamBlock());
wavBox1->pack_start(*maskusable, Gtk::PACK_SHRINK, 0);
wavBox1->pack_start(*maskunusable, Gtk::PACK_SHRINK, 0);
@@ -6854,28 +6898,24 @@ LocallabBlur::LocallabBlur():
wavBox1->pack_start(*levelthrlow, Gtk::PACK_SHRINK, 0);
wavBox1->pack_start(*levelthr, Gtk::PACK_SHRINK, 0);
expdenoise1->add(*wavBox1, false);
wavBox->pack_start(*expdenoise1);
wchBox->pack_start(*expdenoise1);
expdenoiselum->add(*wchBox);
wavBox->pack_start(*expdenoiselum);
ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock());
chBox->pack_start(*noisechrof);
chBox->pack_start(*noisechroc);
chBox->pack_start(*noisechrodetail);
chBox->pack_start(*adjblur);
expdenoisech->add(*chBox);
wavBox->pack_start(*expdenoisech);
ToolParamBlock* const detailBox = Gtk::manage(new ToolParamBlock());
detailBox->pack_start(*detailthr);
detailBox->pack_start(*usemask, Gtk::PACK_SHRINK, 0);
detailFrame->add(*detailBox);
wavBox->pack_start(*detailFrame);
denoisebox->pack_start(*sensiden);
denoisebox->pack_start(*reparden);
ToolParamBlock* const nlbox = Gtk::manage(new ToolParamBlock());
nlbox->pack_start(*nlstr);
nlbox->pack_start(*nldet);
nlbox->pack_start(*nlgam);
nlbox->pack_start(*nlpat);
nlbox->pack_start(*nlrad);
nlFrame->add(*nlbox);
wavBox->pack_start(*nlFrame);
wavBox->pack_start(*noisechrof);
wavBox->pack_start(*noisechroc);
wavBox->pack_start(*noisechrodetail);
wavBox->pack_start(*adjblur);
wavFrame->add(*wavBox);
denoisebox->pack_start(*wavFrame);
@@ -6978,6 +7018,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
expdenoise1->set_tooltip_markup(M("TP_LOCALLAB_MASKLC_TOOLTIP"));
expdenoise2->set_tooltip_markup(M("TP_LOCALLAB_MASKGF_TOOLTIP"));
expdenoise3->set_tooltip_markup(M("TP_LOCALLAB_MASKDE_TOOLTIP"));
expdenoisenl->set_tooltip_markup(M("TP_LOCALLAB_NLFRAME_TOOLTIP"));
invmask->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP"));
invmaskd->set_tooltip_text(M("TP_LOCALLAB_MASKDEINV_TOOLTIP"));
LocalcurveEditorwavden->setTooltip(M("TP_LOCALLAB_WASDEN_TOOLTIP"));
@@ -6990,7 +7031,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
detailthr->set_tooltip_text(M("TP_LOCALLAB_DENOITHR_TOOLTIP"));
adjblur->set_tooltip_text(M("TP_LOCALLAB_DENOIEQUALCHRO_TOOLTIP"));
bilateral->set_tooltip_text(M("TP_LOCALLAB_DENOIBILAT_TOOLTIP"));
nlFrame->set_tooltip_text(M("TP_LOCALLAB_NLFRAME_TOOLTIP"));
prevFrame->set_tooltip_text(M("TP_LOCALLAB_LCLABELS_TOOLTIP"));
nlstr->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP"));
nldet->set_tooltip_text(M("TP_LOCALLAB_NLDENOISE_TOOLTIP"));
nlpat->set_tooltip_text(M("TP_LOCALLAB_NLDENOISENLPAT_TOOLTIP"));
@@ -7025,6 +7066,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
higthresd->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRESD_TOOLTIP"));
higthres->set_tooltip_text(M("TP_LOCALLAB_MASKHIGTHRES_TOOLTIP"));
decayd->set_tooltip_text(M("TP_LOCALLAB_MASKDECAY_TOOLTIP"));
lCLabels->set_tooltip_text(M("TP_LOCALLAB_LCLABELS_TOOLTIP"));
} else {
expblnoise->set_tooltip_markup("");
@@ -7057,7 +7099,7 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
detailthr->set_tooltip_text("");
adjblur->set_tooltip_text("");
bilateral->set_tooltip_text("");
nlFrame->set_tooltip_text("");
prevFrame->set_tooltip_text("");
nlstr->set_tooltip_text("");
nldet->set_tooltip_text("");
nlpat->set_tooltip_text("");
@@ -7094,6 +7136,8 @@ void LocallabBlur::updateAdviceTooltips(const bool showTooltips)
higthres->set_tooltip_text("");
// midthresd->set_tooltip_text("");
decayd->set_tooltip_text("");
lCLabels->set_tooltip_text("");
expdenoisenl->set_tooltip_markup("");
}
}
@@ -7138,7 +7182,36 @@ void LocallabBlur::neutral_pressed ()
}
void LocallabBlur::updatedenlc(const double highres, const double nres, const double highres46, const double nres46, const double Lhighres, const double Lnres, const double Lhighres46, const double Lnres46)
{
idle_register.add(
[this, highres, nres, highres46, nres46, Lhighres, Lnres, Lhighres46, Lnres46]() -> bool {
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
lumLabels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_LUMLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), Lnres),
Glib::ustring::format(std::fixed, std::setprecision(0), Lhighres))
);
lum46Labels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_LUM46LABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), Lnres46 ),
Glib::ustring::format(std::fixed, std::setprecision(0), Lhighres46))
);
chroLabels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_CHROLABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), nres),
Glib::ustring::format(std::fixed, std::setprecision(0), highres))
);
chro46Labels->set_text(
Glib::ustring::compose(M("TP_LOCALLAB_CHRO46LABEL"),
Glib::ustring::format(std::fixed, std::setprecision(0), nres46),
Glib::ustring::format(std::fixed, std::setprecision(0), highres46))
);
return false;
}
);
}
void LocallabBlur::setDefaultExpanderVisibility()
{
expblnoise->set_expanded(false);
@@ -7147,6 +7220,9 @@ void LocallabBlur::setDefaultExpanderVisibility()
expdenoise2->set_expanded(false);
expdenoise3->set_expanded(false);
expmaskbl->set_expanded(false);
expdenoisenl->set_expanded(false);
expdenoiselum->set_expanded(false);
expdenoisech->set_expanded(false);
}
void LocallabBlur::disableListener()