Wavelet levels - choice complexity standard - advanced (#5869)

* Added in option edghi edglo limrad

* Hide choice edgesharpness slider curve

* First normal expert

* Second normal expert

* Changes in normal expert contrast chroma residual

* Change label complexity wavelet

* French + hide sigmafin standard

* Added tooltip complexty wavelet
This commit is contained in:
Desmis
2020-08-02 15:52:01 +02:00
committed by GitHub
parent 0933a48253
commit e0d3353d72
11 changed files with 231 additions and 20 deletions

View File

@@ -158,6 +158,7 @@ Wavelet::Wavelet() :
HSmethod(Gtk::manage(new MyComboBoxText())),
CLmethod(Gtk::manage(new MyComboBoxText())),
Backmethod(Gtk::manage(new MyComboBoxText())),
complexmethod(Gtk::manage(new MyComboBoxText())),
Tilesmethod(Gtk::manage(new MyComboBoxText())),
daubcoeffmethod(Gtk::manage(new MyComboBoxText())),
Dirmethod(Gtk::manage(new MyComboBoxText())),
@@ -190,7 +191,10 @@ Wavelet::Wavelet() :
expclari(Gtk::manage(new MyExpander(true, M("TP_WAVELET_CLARI")))),
expbl(Gtk::manage(new MyExpander(true, M("TP_WAVELET_BL")))),
neutrHBox(Gtk::manage(new Gtk::HBox())),
usharpHBox(Gtk::manage(new Gtk::HBox()))
usharpHBox(Gtk::manage(new Gtk::HBox())),
ctboxch(Gtk::manage(new Gtk::HBox())),
ctboxBA(Gtk::manage(new Gtk::VBox()))
{
CurveListener::setMulti(true);
auto m = ProcEventMapper::getInstance();
@@ -227,6 +231,7 @@ Wavelet::Wavelet() :
EvWavrangeab = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_RANGEAB");
EvWavprotab = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_PROTAB");
EvWavlevelshc = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_LEVELSHC");
EvWavcomplexmet = m->newEvent(DIRPYREQUALIZER, "HISTORY_MSG_COMPLEX");
labgrid = Gtk::manage(new LabGrid(EvWavLabGridValue, M("TP_WAVELET_LABGRID_VALUES")));
@@ -269,6 +274,16 @@ Wavelet::Wavelet() :
thres->set_tooltip_text(M("TP_WAVELET_LEVELS_TOOLTIP"));
thres->setAdjusterListener(this);
complexmethod->append(M("TP_WAVELET_COMPNORMAL"));
complexmethod->append(M("TP_WAVELET_COMPEXPERT"));
complexmethodconn = complexmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::complexmethodChanged));
complexmethod->set_tooltip_text(M("TP_WAVELET_COMPLEX_TOOLTIP"));
Gtk::HBox* const complexHBox = Gtk::manage(new Gtk::HBox());
Gtk::Label* const complexLabel = Gtk::manage(new Gtk::Label(M("TP_WAVELET_COMPLEXLAB") + ":"));
complexHBox->pack_start(*complexLabel, Gtk::PACK_SHRINK, 4);
complexHBox->pack_start(*complexmethod);
Tilesmethod->append(M("TP_WAVELET_TILESFULL"));
Tilesmethod->append(M("TP_WAVELET_TILESBIG"));
// Tilesmethod->append(M("TP_WAVELET_TILESLIT"));
@@ -335,6 +350,7 @@ Wavelet::Wavelet() :
levdirSubHBox->pack_start(*Lmethod);
levdirSubHBox->pack_start(*Dirmethod, Gtk::PACK_EXPAND_WIDGET, 2); // same, but 2 not 4?
settingsBox->pack_start(*complexHBox);
settingsBox->pack_start(*strength);
settingsBox->pack_start(*thres);
settingsBox->pack_start(*tilesizeHBox);
@@ -452,7 +468,7 @@ Wavelet::Wavelet() :
ToolParamBlock* const chBox = Gtk::manage(new ToolParamBlock());
Gtk::Label* const labmch = Gtk::manage(new Gtk::Label(M("TP_WAVELET_CHTYPE") + ":"));
Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox());
// Gtk::HBox* const ctboxch = Gtk::manage(new Gtk::HBox());
ctboxch->pack_start(*labmch, Gtk::PACK_SHRINK, 1);
CHmethod->append(M("TP_WAVELET_CH1"));
@@ -674,7 +690,7 @@ Wavelet::Wavelet() :
EDmethod->append(M("TP_WAVELET_EDCU"));
EDmethodconn = EDmethod->signal_changed().connect(sigc::mem_fun(*this, &Wavelet::EDmethodChanged));
ctboxED->pack_start(*EDmethod);
edgBox->pack_start(*ctboxED);
// edgBox->pack_start(*ctboxED);
edgcont->setAdjusterListener(this);
edgcont->setBgGradient(milestones2);
@@ -838,7 +854,7 @@ Wavelet::Wavelet() :
thrH->setAdjusterListener(this);
radius->setAdjusterListener(this);
radius->hide();
// radius->hide();
shFrame->set_label_align(0.025, 0.5);
ToolParamBlock* const shBox = Gtk::manage(new ToolParamBlock());
@@ -1007,7 +1023,7 @@ Wavelet::Wavelet() :
resBox->pack_start(*neutrHBox);
// Final Touchup
Gtk::VBox* const ctboxBA = Gtk::manage(new Gtk::VBox());
// Gtk::VBox* const ctboxBA = Gtk::manage(new Gtk::VBox());
ctboxBA->set_spacing(2);
@@ -1236,6 +1252,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
CLmethodconn.block(true);
Backmethodconn.block(true);
Tilesmethodconn.block(true);
complexmethodconn.block(true);
daubcoeffmethodconn.block(true);
Dirmethodconn.block(true);
CHmethodconn.block(true);
@@ -1357,6 +1374,12 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
} else if (pp->wavelet.CLmethod == "all") {
CLmethod->set_active(3);
}
if (pp->wavelet.complexmethod == "normal") {
complexmethod->set_active(0);
} else if (pp->wavelet.complexmethod == "expert") {
complexmethod->set_active(1);
}
//Tilesmethod->set_active (2);
if (pp->wavelet.Tilesmethod == "full") {
@@ -1558,6 +1581,11 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
Backmethod->set_active_text(M("GENERAL_UNCHANGED"));
}
if (!pedited->wavelet.complexmethod) {
complexmethod->set_active_text(M("GENERAL_UNCHANGED"));
}
if (!pedited->wavelet.Tilesmethod) {
Tilesmethod->set_active_text(M("GENERAL_UNCHANGED"));
}
@@ -1774,6 +1802,15 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
} else {
sup->hide();
}
if (complexmethod->get_active_row_number() == 0) {
updateGUIToMode(0);
convertParamToNormal();
} else {
updateGUIToMode(1);
}
}
/*****************************************************************************************************
@@ -1786,6 +1823,7 @@ void Wavelet::read(const ProcParams* pp, const ParamsEdited* pedited)
CLmethodconn.block(false);
Backmethodconn.block(false);
Tilesmethodconn.block(false);
complexmethodconn.block(false);
daubcoeffmethodconn.block(false);
CHmethodconn.block(false);
CHSLmethodconn.block(false);
@@ -1965,6 +2003,7 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited)
pedited->wavelet.CLmethod = CLmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wavelet.Backmethod = Backmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wavelet.Tilesmethod = Tilesmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wavelet.complexmethod = complexmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wavelet.daubcoeffmethod = daubcoeffmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wavelet.CHmethod = CHmethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->wavelet.CHSLmethod = CHSLmethod->get_active_text() != M("GENERAL_UNCHANGED");
@@ -2168,6 +2207,12 @@ void Wavelet::write(ProcParams* pp, ParamsEdited* pedited)
// pp->wavelet.Tilesmethod = "lit";
}
if (complexmethod->get_active_row_number() == 0) {
pp->wavelet.complexmethod = "normal";
} else if (complexmethod->get_active_row_number() == 1) {
pp->wavelet.complexmethod = "expert";
}
if (daubcoeffmethod->get_active_row_number() == 0) {
pp->wavelet.daubcoeffmethod = "2_";
} else if (daubcoeffmethod->get_active_row_number() == 1) {
@@ -2835,6 +2880,110 @@ void Wavelet::ushamethodChanged()
}
void Wavelet::convertParamToNormal()
{
const WaveletParams def_params;
disableListener();
//contrast
offset->setValue(def_params.offset);
sigma->setValue(def_params.sigma);
lowthr->setValue(def_params.lowthr);
//chroma
expchroma->setEnabled(def_params.expchroma);
sigmacol->setValue(def_params.sigmacol);
CHmethod->set_active(2);
//denoise
chromfi->setValue(def_params.chromfi);
chromco->setValue(def_params.chromco);
//toning
exptoning->setEnabled(def_params.exptoning);
//gamut
median->set_active(def_params.median);
avoid->set_active(def_params.avoid);
hueskin->setValue(def_params.hueskin);
skinprotect->setValue(def_params.skinprotect);
//blur
expbl->setEnabled(def_params.expbl);
//edge sharpness
lipst->set_active(def_params.lipst);
lipstUpdateUI();
edgesensi->setValue(def_params.edgesensi);
edgeampli->setValue(def_params.edgeampli);
NPmethod->set_active(0);
//resid
// oldsh->set_active(true);
radius->setValue(def_params.radius);
resblur->setValue(def_params.resblur);
resblurc->setValue(def_params.resblurc);
cbenab->set_active(false);
//final touchup
BAmethod->set_active(0);
enableListener();
sigmafin->setValue(def_params.sigmafin);
// Update GUI based on converted widget parameters:
}
void Wavelet::updateGUIToMode(int mode)
{
if(mode ==0) {
offset->hide();
sigma->hide();
lowthr->hide();
ctboxch->hide();
sigmacol->hide();
expgamut->hide();
exptoning->hide();
chroFrame->hide();
expbl->hide();
lipst->hide();
dirFrame->hide();
oldsh->hide();
radius->hide();
blurFrame->hide();
cbenab->hide();
sigmafin->hide();
} else {
offset->show();
sigma->show();
lowthr->show();
ctboxch->show();
sigmacol->show();
expgamut->show();
exptoning->show();
chroFrame->show();
expbl->show();
lipst->show();
dirFrame->show();
oldsh->hide();
radius->show();
blurFrame->show();
cbenab->show();
sigmafin->show();
}
}
void Wavelet::complexmethodChanged()
{
if (complexmethod->get_active_row_number() == 0) {
updateGUIToMode(0);
convertParamToNormal();
} else {
updateGUIToMode(1);
}
if (listener && (multiImage || getEnabled())) {
listener->panelChanged(EvWavcomplexmet, complexmethod->get_active_text());
}
}
void Wavelet::TilesmethodChanged()
{
//TilesmethodUpdateUI();
@@ -2916,6 +3065,7 @@ void Wavelet::setBatchMode(bool batchMode)
CLmethod->append(M("GENERAL_UNCHANGED"));
Backmethod->append(M("GENERAL_UNCHANGED"));
Tilesmethod->append(M("GENERAL_UNCHANGED"));
complexmethod->append(M("GENERAL_UNCHANGED"));
daubcoeffmethod->append(M("GENERAL_UNCHANGED"));
CHmethod->append(M("GENERAL_UNCHANGED"));
Medgreinf->append(M("GENERAL_UNCHANGED"));