Added checkbox to frame compression dynamic wavelet

This commit is contained in:
Desmis 2019-12-29 10:16:31 +01:00
parent faf849ef3f
commit 353a081bd0
11 changed files with 68 additions and 11 deletions

View File

@ -1103,6 +1103,7 @@ HISTORY_MSG_862;Local - Contrast Sigma luminance
HISTORY_MSG_863;Local - Contrast Merge Original
HISTORY_MSG_864;Local - Contrast Detail
HISTORY_MSG_865;Local - Contrast Anchor
HISTORY_MSG_866;Local - Contrast Curve Compression
HISTORY_MSG_867;Local - Contrast Amount residual
HISTORY_MSG_868;Local - balance ΔE C-H
HISTORY_MSG_869;Local - denoise curve luminance
@ -1119,6 +1120,7 @@ HISTORY_MSG_880;Local - LC Chroma blur levels
HISTORY_MSG_881;Local - Contrast Offset Luminance
HISTORY_MSG_882;Local - Contrast Blur
HISTORY_MSG_883;Local - Contrast By Levels
HISTORY_MSG_884;Local - Contrast Dynamic Range
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction

View File

@ -321,7 +321,7 @@ public:
const LocwavCurve & loclevwavCurve, bool & loclevwavutili, bool wavcurvelev,
const LocwavCurve & locconwavCurve, bool & locconwavutili, bool wavcurvecon,
const LocwavCurve & loccompwavCurve, bool & loccompwavutili, bool wavcurvecomp,
float sigm, float offs,int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena);
float sigm, float offs,int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena);
void wavcont(wavelet_decomposition &wdspot, float ****templevel, int level_bl, int maxlvl,
const LocwavCurve & loclevwavCurve, bool & loclevwavutili,

View File

@ -4079,7 +4079,7 @@ void ImProcFunctions::maskcalccol(int call, bool invmask, bool pde, int bfw, int
bool wavcurvecon = false;
bool loccompwavutili = false;
bool wavcurvecomp = false;
wavcontrast4(bufmaskblurcol->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false, false);
wavcontrast4(bufmaskblurcol->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, bfw, bfh, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurvecolwav, lmasutilicolwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false, false, false);
}
@ -7114,7 +7114,7 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float ** tmpa, float ** tmpb, f
const LocwavCurve & locwavCurve, bool & locwavutili, const LocwavCurve & loclevwavCurve, bool & loclevwavutili, bool wavcurvelev,
const LocwavCurve & locconwavCurve, bool & locconwavutili, bool wavcurvecon,
const LocwavCurve & loccompwavCurve, bool & loccompwavutili, bool wavcurvecomp,
float sigm, float offs, int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena)
float sigm, float offs, int & maxlvl, float fatdet, float fatanch, float chromalev, float chromablu, bool blurlc, bool blurena, bool levelena, bool comprena)
{
wavelet_decomposition *wdspot = new wavelet_decomposition(tmp[0], bfw, bfh, maxlvl, 1, sk, numThreads, 6);
@ -7282,8 +7282,8 @@ void ImProcFunctions::wavcontrast4(float ** tmp, float ** tmpa, float ** tmpb, f
if (wavcurvelev && radlevblur > 0.f && blurena) {
wavcont(*wdspot, templevel, level_bl, maxlvl, loclevwavCurve, loclevwavutili, loccompwavCurve, loccompwavutili, radlevblur, 1, fatParams, 1.f);
}
if (wavcurvecomp) {
if (wavcurvecomp && comprena) {
wavcont(*wdspot, templevel, level_bl, maxlvl, loclevwavCurve, loclevwavutili, loccompwavCurve, loccompwavutili, radlevblur, 2, fatParams, 1.f);
}
@ -9542,7 +9542,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
bool wavcurvecon = false;
bool loccompwavutili = false;
bool wavcurvecomp = false;
wavcontrast4(bufmaskblurbl->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false, false);
wavcontrast4(bufmaskblurbl->L, nullptr, nullptr, contrast, 0.f, 0.f, 0.f, GW, GH, level_bl, level_hl, level_br, level_hr, sk, numThreads, loclmasCurveblwav, lmasutiliblwav, dummy, loclevwavutili, wavcurvelev, dummy, locconwavutili, wavcurvecon, dummy, loccompwavutili, wavcurvecomp, 1.f, 1.f, maxlvl, 0.f, 0.f, 1.f, 1.f, false, false, false, false);
}
int shado = params->locallab.spots.at(sp).shadmaskbl;
@ -11478,8 +11478,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
const float chrobl = params->locallab.spots.at(sp).chromablu;
const bool blurena = params->locallab.spots.at(sp).wavblur;
const bool levelena = params->locallab.spots.at(sp).wavcont;
const bool comprena = params->locallab.spots.at(sp).wavcomp;
wavcontrast4(tmp1->L, tmp1->a, tmp1->b, contrast, fatres, radblur, radlevblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, loclevwavCurve, loclevwavutili, wavcurvelev, locconwavCurve, locconwavutili, wavcurvecon, loccompwavCurve, loccompwavutili, wavcurvecomp, sigma, offs, maxlvl, fatdet, fatanch, chrol, chrobl, blurlc, blurena, levelena);
wavcontrast4(tmp1->L, tmp1->a, tmp1->b, contrast, fatres, radblur, radlevblur, tmp1->W, tmp1->H, level_bl, level_hl, level_br, level_hr, sk, numThreads, locwavCurve, locwavutili, loclevwavCurve, loclevwavutili, wavcurvelev, locconwavCurve, locconwavutili, wavcurvecon, loccompwavCurve, loccompwavutili, wavcurvecomp, sigma, offs, maxlvl, fatdet, fatanch, chrol, chrobl, blurlc, blurena, levelena, comprena);
const float satur = params->locallab.spots.at(sp).residchro;

View File

@ -909,6 +909,7 @@ enum ProcEventCode {
Evlocallaboffset = 880,
Evlocallabwavblur = 881,
Evlocallabwavcont = 882,
Evlocallabwavcomp = 883,
NUMOFEVENTS
};

View File

@ -2741,6 +2741,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
blurlc(true),
wavblur(false),
wavcont(false),
wavcomp(false),
origlc(false),
localcontMethod("loc"),
locwavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.5, 0.35, 0.35, 1., 0.5, 0.35, 0.35},
@ -3151,6 +3152,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& blurlc == other.blurlc
&& wavblur == other.wavblur
&& wavcont == other.wavcont
&& wavcomp == other.wavcomp
&& origlc == other.origlc
&& localcontMethod == other.localcontMethod
&& locwavcurve == other.locwavcurve
@ -4540,6 +4542,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).blurlc, "Locallab", "Blurlc_" + std::to_string(i), spot.blurlc, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavblur, "Locallab", "Wavblur_" + std::to_string(i), spot.wavblur, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavcont, "Locallab", "Wavcont_" + std::to_string(i), spot.wavcont, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).wavcomp, "Locallab", "Wavcomp_" + std::to_string(i), spot.wavcomp, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).origlc, "Locallab", "Origlc_" + std::to_string(i), spot.origlc, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).localcontMethod, "Locallab", "localcontMethod_" + std::to_string(i), spot.localcontMethod, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).locwavcurve, "Locallab", "LocwavCurve_" + std::to_string(i), spot.locwavcurve, keyFile);
@ -6080,6 +6083,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Blurlc_" + std::to_string(i), pedited, spot.blurlc, spotEdited.blurlc);
assignFromKeyfile(keyFile, "Locallab", "Wavblur_" + std::to_string(i), pedited, spot.wavblur, spotEdited.wavblur);
assignFromKeyfile(keyFile, "Locallab", "Wavcont_" + std::to_string(i), pedited, spot.wavcont, spotEdited.wavcont);
assignFromKeyfile(keyFile, "Locallab", "Wavcomp_" + std::to_string(i), pedited, spot.wavcomp, spotEdited.wavcomp);
assignFromKeyfile(keyFile, "Locallab", "Origlc_" + std::to_string(i), pedited, spot.origlc, spotEdited.origlc);
assignFromKeyfile(keyFile, "Locallab", "localcontMethod_" + std::to_string(i), pedited, spot.localcontMethod, spotEdited.localcontMethod);
assignFromKeyfile(keyFile, "Locallab", "LocwavCurve_" + std::to_string(i), pedited, spot.locwavcurve, spotEdited.locwavcurve);

View File

@ -1284,6 +1284,7 @@ struct LocallabParams {
bool blurlc;
bool wavblur;
bool wavcont;
bool wavcomp;
bool origlc;
Glib::ustring localcontMethod;
std::vector<double> locwavcurve;

View File

@ -912,7 +912,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, //Evlocallabchromablu
LUMINANCECURVE, //Evlocallaboffset
LUMINANCECURVE, //Evlocallabwavblur
LUMINANCECURVE //Evlocallabwavcont
LUMINANCECURVE, //Evlocallabwavcont
LUMINANCECURVE //Evlocallabwavcomp
};

View File

@ -689,6 +689,7 @@ origlc(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ORIGLC")))),
enalcMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))),
wavblur(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_BLURLEVELFRA")))),
wavcont(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_CONTFRA")))),
wavcomp(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_COMPFRA")))),
//CBDL
enacbMask(Gtk::manage(new Gtk::CheckButton(M("TP_LOCALLAB_ENABLE_MASK")))),
//encoding log
@ -2837,6 +2838,7 @@ pe(nullptr)
blurlcConn = blurlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::blurlcChanged));
wavblurConn = wavblur->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavblurChanged));
wavcontConn = wavcont->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavcontChanged));
wavcompConn = wavcomp->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::wavcompChanged));
origlcConn = origlc->signal_toggled().connect(sigc::mem_fun(*this, &Locallab::origlcChanged));
csThreshold->setAdjusterListener(this);
@ -2984,7 +2986,12 @@ pe(nullptr)
Gtk::HSeparator* const separatorcomp = Gtk::manage(new Gtk::HSeparator());
compFrame->set_label_align(0.025, 0.5);
ToolParamBlock* const compBox = Gtk::manage(new ToolParamBlock());
Gtk::VBox *compBox = Gtk::manage ( new Gtk::VBox());
compBox->set_spacing(2);
wavcomp->set_active (true);
compFrame->set_label_widget(*wavcomp);
// ToolParamBlock* const compBox = Gtk::manage(new ToolParamBlock());
compBox->pack_start(*fatdet);
compBox->pack_start(*fatanch);
compBox->pack_start(*LocalcurveEditorwavcomp, Gtk::PACK_SHRINK, 4);
@ -5303,6 +5310,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pp->locallab.spots.at(pp->locallab.selspot).blurlc = blurlc->get_active();
pp->locallab.spots.at(pp->locallab.selspot).wavblur = wavblur->get_active();
pp->locallab.spots.at(pp->locallab.selspot).wavcont = wavcont->get_active();
pp->locallab.spots.at(pp->locallab.selspot).wavcomp = wavcomp->get_active();
pp->locallab.spots.at(pp->locallab.selspot).origlc = origlc->get_active();
pp->locallab.spots.at(pp->locallab.selspot).locwavcurve = wavshape->getCurve();
pp->locallab.spots.at(pp->locallab.selspot).csthreshold = csThreshold->getValue<int>();
@ -5716,6 +5724,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pe->locallab.spots.at(pp->locallab.selspot).blurlc = pe->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).wavblur = pe->locallab.spots.at(pp->locallab.selspot).wavblur || !wavblur->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).wavcont = pe->locallab.spots.at(pp->locallab.selspot).wavcont || !wavcont->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).wavcomp = pe->locallab.spots.at(pp->locallab.selspot).wavcomp || !wavcomp->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).origlc = pe->locallab.spots.at(pp->locallab.selspot).origlc || !origlc->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).localcontMethod = pe->locallab.spots.at(pp->locallab.selspot).localcontMethod || localcontMethod->get_active_text() != M("GENERAL_UNCHANGED");
pe->locallab.spots.at(pp->locallab.selspot).locwavcurve = pe->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged();
@ -6128,6 +6137,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pedited->locallab.spots.at(pp->locallab.selspot).blurlc = pedited->locallab.spots.at(pp->locallab.selspot).blurlc || !blurlc->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).wavblur = pedited->locallab.spots.at(pp->locallab.selspot).wavblur || !wavblur->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).wavcont = pedited->locallab.spots.at(pp->locallab.selspot).wavcont || !wavcont->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).wavcomp = pedited->locallab.spots.at(pp->locallab.selspot).wavcomp || !wavcomp->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).origlc = pedited->locallab.spots.at(pp->locallab.selspot).origlc || !origlc->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).locwavcurve || !wavshape->isUnChanged();
pedited->locallab.spots.at(pp->locallab.selspot).loclevwavcurve = pedited->locallab.spots.at(pp->locallab.selspot).loclevwavcurve || !wavshapelev->isUnChanged();
@ -8343,6 +8353,29 @@ void Locallab::wavcontChanged()
}
}
void Locallab::wavcompChanged()
{
if (multiImage) {
if (wavcomp->get_inconsistent()) {
wavcomp->set_inconsistent(false);
wavcompConn.block(true);
wavcomp->set_active(false);
wavcompConn.block(false);
}
}
if (getEnabled() && expcontrast->getEnabled()) {
if (listener) {
if (wavcomp->get_active()) {
listener->panelChanged(Evlocallabwavcomp, M("GENERAL_ENABLED"));
} else {
listener->panelChanged(Evlocallabwavcomp, M("GENERAL_DISABLED"));
}
}
}
}
void Locallab::origlcChanged()
{
@ -11353,6 +11386,7 @@ void Locallab::enableListener()
blurlcConn.block(false);
wavblurConn.block(false);
wavcontConn.block(false);
wavcompConn.block(false);
origlcConn.block(false);
showmasklcMethodConn.block(false);
enalcMaskConn.block(false);
@ -11453,6 +11487,7 @@ void Locallab::disableListener()
blurlcConn.block(true);
wavblurConn.block(true);
wavcontConn.block(true);
wavcompConn.block(true);
origlcConn.block(true);
showmasklcMethodConn.block(true);
enalcMaskConn.block(true);
@ -12127,6 +12162,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
blurlc->set_active(pp->locallab.spots.at(index).blurlc);
wavblur->set_active(pp->locallab.spots.at(index).wavblur);
wavcont->set_active(pp->locallab.spots.at(index).wavcont);
wavcomp->set_active(pp->locallab.spots.at(index).wavcomp);
origlc->set_active(pp->locallab.spots.at(index).origlc);
csThreshold->setValue<int>(pp->locallab.spots.at(index).csthreshold);
@ -12644,6 +12680,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
blurlc->set_inconsistent(multiImage && !spotState->blurlc);
wavblur->set_inconsistent(multiImage && !spotState->wavblur);
wavcont->set_inconsistent(multiImage && !spotState->wavcont);
wavcomp->set_inconsistent(multiImage && !spotState->wavcomp);
origlc->set_inconsistent(multiImage && !spotState->origlc);
wavshape->setUnChanged(!spotState->locwavcurve);
wavshapelev->setUnChanged(!spotState->loclevwavcurve);

View File

@ -494,8 +494,9 @@ private:
sigc::connection wavblurConn;
Gtk::CheckButton* const wavcont;
sigc::connection wavcontConn;
Gtk::CheckButton* const wavcomp;
sigc::connection wavcompConn;
//CBDL
Gtk::CheckButton* const enacbMask;
sigc::connection enacbMaskConn;
@ -703,6 +704,7 @@ private:
void enalcMaskChanged();
void wavblurChanged();
void wavcontChanged();
void wavcompChanged();
//CBDL
void enacbMaskChanged();
// ComboBox event functions

View File

@ -1277,6 +1277,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).blurlc = locallab.spots.at(j).blurlc && pSpot.blurlc == otherSpot.blurlc;
locallab.spots.at(j).wavblur = locallab.spots.at(j).wavblur && pSpot.wavblur == otherSpot.wavblur;
locallab.spots.at(j).wavcont = locallab.spots.at(j).wavcont && pSpot.wavcont == otherSpot.wavcont;
locallab.spots.at(j).wavcomp = locallab.spots.at(j).wavcomp && pSpot.wavcomp == otherSpot.wavcomp;
locallab.spots.at(j).origlc = locallab.spots.at(j).origlc && pSpot.origlc == otherSpot.origlc;
locallab.spots.at(j).localcontMethod = locallab.spots.at(j).localcontMethod && pSpot.localcontMethod == otherSpot.localcontMethod;
locallab.spots.at(j).locwavcurve = locallab.spots.at(j).locwavcurve && pSpot.locwavcurve == otherSpot.locwavcurve;
@ -4087,6 +4088,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).wavcont = mods.locallab.spots.at(i).wavcont;
}
if (locallab.spots.at(i).wavcomp) {
toEdit.locallab.spots.at(i).wavcomp = mods.locallab.spots.at(i).wavcomp;
}
if (locallab.spots.at(i).origlc) {
toEdit.locallab.spots.at(i).origlc = mods.locallab.spots.at(i).origlc;
}
@ -5636,6 +5641,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
blurlc(v),
wavblur(v),
wavcont(v),
wavcomp(v),
origlc(v),
localcontMethod(v),
locwavcurve(v),
@ -6036,6 +6042,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
blurlc = v;
wavblur = v;
wavcont = v;
wavcomp = v;
origlc = v;
localcontMethod = v;
locwavcurve = v;

View File

@ -710,6 +710,7 @@ public:
bool blurlc;
bool wavblur;
bool wavcont;
bool wavcomp;
bool origlc;
bool localcontMethod;
bool locwavcurve;