Enable inverse with tone equalizer

This commit is contained in:
Desmis 2019-10-23 07:51:06 +02:00
parent 9dd3d002a4
commit a5298d3434
2 changed files with 160 additions and 73 deletions

View File

@ -1154,49 +1154,50 @@ void tone_eq(array2D<float> &R, array2D<float> &G, array2D<float> &B, const stru
float c = process_pixel(y); float c = process_pixel(y);
lut[i] = c; lut[i] = c;
} }
/*
#ifdef __SSE2__
vfloat vfactors[12];
vfloat vcenters[12];
for (int i = 0; i < 12; ++i) { /*
vfactors[i] = F2V(factors[i]); #ifdef __SSE2__
vcenters[i] = F2V(centers[i]); vfloat vfactors[12];
} vfloat vcenters[12];
const auto vgauss = for (int i = 0; i < 12; ++i) {
[](vfloat b, vfloat x) -> vfloat { vfactors[i] = F2V(factors[i]);
static const vfloat fourv = F2V(4.f); vcenters[i] = F2V(centers[i]);
return xexpf((-SQR(x - b) / fourv));
};
vfloat zerov = F2V(0.f);
vfloat vw_sum = F2V(w_sum);
const vfloat noisev = F2V(-18.f);
const vfloat xlog2v = F2V(xlogf(2.f));
const auto vprocess_pixel =
[&](vfloat y) -> vfloat {
const vfloat luma = vmaxf(xlogf(vmaxf(y, zerov)) / xlog2v, noisev);
vfloat correction = zerov;
for (int c = 0; c < 12; ++c)
{
correction += vgauss(vcenters[c], luma) * vfactors[c];
} }
correction /= vw_sum; const auto vgauss =
[](vfloat b, vfloat x) -> vfloat {
static const vfloat fourv = F2V(4.f);
return xexpf((-SQR(x - b) / fourv));
};
return correction; vfloat zerov = F2V(0.f);
}; vfloat vw_sum = F2V(w_sum);
const vfloat noisev = F2V(-18.f);
const vfloat xlog2v = F2V(xlogf(2.f));
const auto vprocess_pixel =
[&](vfloat y) -> vfloat {
const vfloat luma = vmaxf(xlogf(vmaxf(y, zerov)) / xlog2v, noisev);
vfloat correction = zerov;
for (int c = 0; c < 12; ++c)
{
correction += vgauss(vcenters[c], luma) * vfactors[c];
}
correction /= vw_sum;
return correction;
};
// vfloat v1 = F2V(1.f); // vfloat v1 = F2V(1.f);
// vfloat v65535 = F2V(65535.f); // vfloat v65535 = F2V(65535.f);
#endif // __SSE2__ #endif // __SSE2__
*/ */
#ifdef _OPENMP #ifdef _OPENMP
# pragma omp parallel for if (multithread) # pragma omp parallel for if (multithread)
@ -1204,8 +1205,9 @@ void tone_eq(array2D<float> &R, array2D<float> &G, array2D<float> &B, const stru
for (int y = 0; y < H; ++y) { for (int y = 0; y < H; ++y) {
int x = 0; int x = 0;
/* /*
#ifdef __SSE2__ #ifdef __SSE2__
for (; x < W - 3; x += 4) { for (; x < W - 3; x += 4) {
vfloat cY = LVFU(Y[y][x]); vfloat cY = LVFU(Y[y][x]);
@ -1223,8 +1225,8 @@ void tone_eq(array2D<float> &R, array2D<float> &G, array2D<float> &B, const stru
STVF(B[y][x], LVF(B[y][x]) * corr); STVF(B[y][x], LVF(B[y][x]) * corr);
} }
#endif // __SSE2__ #endif // __SSE2__
*/ */
for (; x < W; ++x) { for (; x < W; ++x) {
float cY = Y[y][x]; float cY = Y[y][x];
float corr = cY > 1.f ? process_pixel(cY) : lut[cY * 65535.f]; float corr = cY > 1.f ? process_pixel(cY) : lut[cY * 65535.f];
@ -1233,6 +1235,7 @@ void tone_eq(array2D<float> &R, array2D<float> &G, array2D<float> &B, const stru
B[y][x] *= corr; B[y][x] *= corr;
} }
} }
printf("OK 18\n"); printf("OK 18\n");
} }
@ -4518,9 +4521,59 @@ void ImProcFunctions::InverseColorLight_Local(int sp, int senstype, struct loca
} }
} }
ImProcFunctions::shadowsHighlights(temp, lp.hsena, 1, lp.highlihs, lp.shadowhs, lp.radiushs, sk, lp.hltonalhs, lp.shtonalhs); if (params->locallab.spots.at(sp).shMethod == "std") {
ImProcFunctions::shadowsHighlights(temp, lp.hsena, 1, lp.highlihs, lp.shadowhs, lp.radiushs, sk, lp.hltonalhs, lp.shtonalhs);
}
if (params->locallab.spots.at(sp).shMethod == "tone") {
int GH = transformed->H;
int GW = transformed->W;
// printf("OK 1 invers \n");
array2D<float> Rtemp;
Rtemp(GW, GH);
array2D<float> Gtemp;
Gtemp(GW, GH);
array2D<float> Btemp;
Btemp(GW, GH);
double scal = (double)(sk);
Imagefloat *tmpImage = nullptr;
tmpImage = new Imagefloat(GW, GH);
lab2rgb(*temp, *tmpImage, params->icm.workingProfile);
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16)
#endif
for (int y = 0; y < GH ; y++) {
for (int x = 0; x < GW; x++) {
Rtemp[y][x] = LIM01(tmpImage->r(y, x) / 65536.f);
Gtemp[y][x] = LIM01(tmpImage->g(y, x) / 65536.f);
Btemp[y][x] = LIM01(tmpImage->b(y, x) / 65536.f);
}
}
tone_eq(Rtemp, Gtemp, Btemp, lp, params->icm.workingProfile, scal, multiThread);
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16)
#endif
for (int y = 0; y < GH ; y++) {
for (int x = 0; x < GW; x++) {
tmpImage->r(y, x) = 65536.f * Rtemp[y][x];
tmpImage->g(y, x) = 65536.f * Gtemp[y][x];
tmpImage->b(y, x) = 65536.f * Btemp[y][x];
}
}
rgb2lab(*tmpImage, *temp, params->icm.workingProfile);
delete tmpImage;
}
} }
if (senstype == 1) { //exposure if (senstype == 1) { //exposure
temp = new LabImage(GW, GH); temp = new LabImage(GW, GH);
#ifdef _OPENMP #ifdef _OPENMP
@ -8728,7 +8781,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
Gtemp(bfw, bfh); Gtemp(bfw, bfh);
array2D<float> Btemp; array2D<float> Btemp;
Btemp(bfw, bfh); Btemp(bfw, bfh);
double scal = (double) (sk); double scal = (double)(sk);
Imagefloat *tmpImage = nullptr; Imagefloat *tmpImage = nullptr;
tmpImage = new Imagefloat(bfw, bfh); tmpImage = new Imagefloat(bfw, bfh);
lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile); lab2rgb(*bufexpfin, *tmpImage, params->icm.workingProfile);

View File

@ -429,7 +429,7 @@ Locallab::Locallab():
//Local contrast //Local contrast
localcontMethod(Gtk::manage(new MyComboBoxText())), localcontMethod(Gtk::manage(new MyComboBoxText())),
csThreshold(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLD"), 0, 9, 0, 0, 5, 5, 0, false))), csThreshold(Gtk::manage(new ThresholdAdjuster(M("TP_LOCALLAB_CSTHRESHOLD"), 0, 9, 0, 0, 5, 5, 0, false))),
//CBDL //CBDL
showmaskcbMethod(Gtk::manage(new MyComboBoxText())), showmaskcbMethod(Gtk::manage(new MyComboBoxText())),
// ThresholdAdjuster widgets // ThresholdAdjuster widgets
@ -487,6 +487,7 @@ Locallab::Locallab():
setExpandAlignProperties(expmaskcol, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmaskcol, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmaskcol->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcol)); expmaskcol->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcol));
expmaskcol->setLevel(2); expmaskcol->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmaskcol->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmaskcol->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -524,7 +525,7 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
radmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskcol->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
// chromaskcol->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // chromaskcol->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP"));
} }
qualitycurveMethod->append(M("TP_LOCALLAB_CURVNONE")); qualitycurveMethod->append(M("TP_LOCALLAB_CURVNONE"));
@ -810,6 +811,7 @@ Locallab::Locallab():
setExpandAlignProperties(expmaskexp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmaskexp, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmaskexp->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskexp)); expmaskexp->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskexp));
expmaskexp->setLevel(2); expmaskexp->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmaskexp->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmaskexp->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -862,7 +864,7 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
radmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
lapmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskexp->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
// chromaskexp->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // chromaskexp->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP"));
} }
curveEditorG->setCurveListener(this); curveEditorG->setCurveListener(this);
@ -1048,14 +1050,16 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP")); expMethod->set_tooltip_text(M("TP_LOCALLAB_EXPMETHOD_TOOLTIP"));
} }
/*
ctboxshmethod = Gtk::manage(new Gtk::HBox()); /*
Gtk::Label* const labelshmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_NOISEMETH") + ":")); ctboxshmethod = Gtk::manage(new Gtk::HBox());
ctboxshmethod->pack_start(*labelshmethod, Gtk::PACK_SHRINK, 4); Gtk::Label* const labelshmethod = Gtk::manage(new Gtk::Label(M("TP_LOCALLAB_NOISEMETH") + ":"));
*/ ctboxshmethod->pack_start(*labelshmethod, Gtk::PACK_SHRINK, 4);
*/
setExpandAlignProperties(expmasksh, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmasksh, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmasksh->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmasksh)); expmasksh->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmasksh));
expmasksh->setLevel(2); expmasksh->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmasksh->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -1066,7 +1070,7 @@ Locallab::Locallab():
if (i == 0) { if (i == 0) {
ss += Glib::ustring::compose(" (%1)", M("TP_LOCALLAB_LUMADARKEST")); ss += Glib::ustring::compose(" (%1)", M("TP_LOCALLAB_LUMADARKEST"));
} else if (i == 5) { } else if (i == 4) {
ss += Glib::ustring::compose(" (%1)", M("TP_LOCALLAB_LUMAWHITESEST")); ss += Glib::ustring::compose(" (%1)", M("TP_LOCALLAB_LUMAWHITESEST"));
} }
@ -1178,9 +1182,11 @@ Locallab::Locallab():
ToolParamBlock* const shadhighBox = Gtk::manage(new ToolParamBlock()); ToolParamBlock* const shadhighBox = Gtk::manage(new ToolParamBlock());
shadhighBox->pack_start(*shMethod); shadhighBox->pack_start(*shMethod);
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
shadhighBox->pack_start(*multipliersh[i]); shadhighBox->pack_start(*multipliersh[i]);
} }
shadhighBox->pack_start(*detailSH); shadhighBox->pack_start(*detailSH);
shadhighBox->pack_start(*highlights); shadhighBox->pack_start(*highlights);
shadhighBox->pack_start(*h_tonalwidth); shadhighBox->pack_start(*h_tonalwidth);
@ -1348,6 +1354,7 @@ Locallab::Locallab():
setExpandAlignProperties(expmasktm, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmasktm, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmasktm->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmasktm)); expmasktm->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmasktm));
expmasktm->setLevel(2); expmasktm->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmasktm->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmasktm->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -1453,7 +1460,7 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
radmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
lapmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmasktm->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
// chromasktm->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // chromasktm->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP"));
} }
@ -1522,6 +1529,7 @@ Locallab::Locallab():
setExpandAlignProperties(expmaskreti, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmaskreti, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmaskreti->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskreti)); expmaskreti->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskreti));
expmaskreti->setLevel(2); expmaskreti->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmaskreti->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmaskreti->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -1697,7 +1705,7 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
radmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
lapmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskreti->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
// chromaskreti->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // chromaskreti->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP"));
} }
@ -1935,6 +1943,7 @@ Locallab::Locallab():
setExpandAlignProperties(expmaskcb, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmaskcb, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmaskcb->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcb)); expmaskcb->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskcb));
expmaskcb->setLevel(2); expmaskcb->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmaskcb->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmaskcb->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -2048,7 +2057,7 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
radmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
lapmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskcb->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
// chromaskcb->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // chromaskcb->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP"));
} }
@ -2150,6 +2159,7 @@ Locallab::Locallab():
setExpandAlignProperties(expmaskbl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); setExpandAlignProperties(expmaskbl, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START);
expmaskbl->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskbl)); expmaskbl->signal_button_release_event().connect_notify(sigc::bind(sigc::mem_fun(this, &Locallab::foldAllButMe), expmaskbl));
expmaskbl->setLevel(2); expmaskbl->setLevel(2);
if (showtooltip) { if (showtooltip) {
expmaskbl->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP")); expmaskbl->set_tooltip_markup(M("TP_LOCALLAB_MASK_TOOLTIP"));
} }
@ -2241,7 +2251,7 @@ Locallab::Locallab():
if (showtooltip) { if (showtooltip) {
radmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); radmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP")); lapmaskbl->set_tooltip_text(M("TP_LOCALLAB_LAPRAD_TOOLTIP"));
// chromaskbl->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP")); // chromaskbl->set_tooltip_text(M("TP_LOCALLAB_CHROMASK_TOOLTIP"));
} }
medMethod->append(M("TP_DIRPYRDENOISE_TYPE_3X3")); medMethod->append(M("TP_DIRPYRDENOISE_TYPE_3X3"));
@ -3442,11 +3452,13 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pp->locallab.spots.at(pp->locallab.selspot).lapmaskSH = lapmaskSH->getValue(); pp->locallab.spots.at(pp->locallab.selspot).lapmaskSH = lapmaskSH->getValue();
pp->locallab.spots.at(pp->locallab.selspot).detailSH = detailSH->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).detailSH = detailSH->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = LmaskSHshape->getCurve(); pp->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = LmaskSHshape->getCurve();
if (shMethod->get_active_row_number() == 0) { if (shMethod->get_active_row_number() == 0) {
pp->locallab.spots.at(pp->locallab.selspot).shMethod = "std"; pp->locallab.spots.at(pp->locallab.selspot).shMethod = "std";
} else if (shMethod->get_active_row_number() == 1) { } else if (shMethod->get_active_row_number() == 1) {
pp->locallab.spots.at(pp->locallab.selspot).shMethod = "tone"; pp->locallab.spots.at(pp->locallab.selspot).shMethod = "tone";
} }
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
pp->locallab.spots.at(pp->locallab.selspot).multsh[i] = multipliersh[i]->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).multsh[i] = multipliersh[i]->getIntValue();
} }
@ -3797,9 +3809,11 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pe->locallab.spots.at(pp->locallab.selspot).detailSH = pe->locallab.spots.at(pp->locallab.selspot).detailSH || detailSH->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).detailSH = pe->locallab.spots.at(pp->locallab.selspot).detailSH || detailSH->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve || !LmaskSHshape->isUnChanged(); pe->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = pe->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve || !LmaskSHshape->isUnChanged();
pe->locallab.spots.at(pp->locallab.selspot).shMethod = pe->locallab.spots.at(pp->locallab.selspot).shMethod || shMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).shMethod = pe->locallab.spots.at(pp->locallab.selspot).shMethod || shMethod->get_active_text() != M("GENERAL_UNCHANGED");
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
pe->locallab.spots.at(pp->locallab.selspot).multsh[i] = pe->locallab.spots.at(pp->locallab.selspot).multsh[i] || multipliersh[i]->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).multsh[i] = pe->locallab.spots.at(pp->locallab.selspot).multsh[i] || multipliersh[i]->getEditedState();
} }
// Vibrance // Vibrance
pe->locallab.spots.at(pp->locallab.selspot).expvibrance = pe->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); pe->locallab.spots.at(pp->locallab.selspot).expvibrance = pe->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent();
pe->locallab.spots.at(pp->locallab.selspot).saturated = pe->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).saturated = pe->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState();
@ -4104,9 +4118,11 @@ void Locallab::write(ProcParams* pp, ParamsEdited* pedited)
pedited->locallab.spots.at(pp->locallab.selspot).detailSH = pedited->locallab.spots.at(pp->locallab.selspot).detailSH || detailSH->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).detailSH = pedited->locallab.spots.at(pp->locallab.selspot).detailSH || detailSH->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve || !LmaskSHshape->isUnChanged(); pedited->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve = pedited->locallab.spots.at(pp->locallab.selspot).LmaskSHcurve || !LmaskSHshape->isUnChanged();
pedited->locallab.spots.at(pp->locallab.selspot).shMethod = pedited->locallab.spots.at(pp->locallab.selspot).shMethod || shMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).shMethod = pedited->locallab.spots.at(pp->locallab.selspot).shMethod || shMethod->get_active_text() != M("GENERAL_UNCHANGED");
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
pedited->locallab.spots.at(pp->locallab.selspot).multsh[i] = pedited->locallab.spots.at(pp->locallab.selspot).multsh[i] || multipliersh[i]->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).multsh[i] = pedited->locallab.spots.at(pp->locallab.selspot).multsh[i] || multipliersh[i]->getEditedState();
} }
// Vibrance // Vibrance
pedited->locallab.spots.at(pp->locallab.selspot).expvibrance = pedited->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent(); pedited->locallab.spots.at(pp->locallab.selspot).expvibrance = pedited->locallab.spots.at(pp->locallab.selspot).expvibrance || !expvibrance->get_inconsistent();
pedited->locallab.spots.at(pp->locallab.selspot).saturated = pedited->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).saturated = pedited->locallab.spots.at(pp->locallab.selspot).saturated || saturated->getEditedState();
@ -4980,6 +4996,7 @@ void Locallab::shMethodChanged()
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->hide(); multipliersh[i]->hide();
} }
detailSH->hide(); detailSH->hide();
highlights->show(); highlights->show();
h_tonalwidth->show(); h_tonalwidth->show();
@ -4991,6 +5008,7 @@ void Locallab::shMethodChanged()
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->show(); multipliersh[i]->show();
} }
detailSH->show(); detailSH->show();
highlights->hide(); highlights->hide();
h_tonalwidth->hide(); h_tonalwidth->hide();
@ -5682,7 +5700,7 @@ void Locallab::inversshChanged()
blurSHde->show(); blurSHde->show();
showmaskSHMethod->hide(); showmaskSHMethod->hide();
showmaskSHMethodinv->show(); showmaskSHMethodinv->show();
shMethod->set_active(0); // shMethod->set_active(0);
} else { } else {
// printf("Pas Inv SH\n"); // printf("Pas Inv SH\n");
@ -6104,9 +6122,11 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
slomaskSH->setDefault(defSpot->slomaskSH); slomaskSH->setDefault(defSpot->slomaskSH);
lapmaskSH->setDefault(defSpot->lapmaskSH); lapmaskSH->setDefault(defSpot->lapmaskSH);
detailSH->setDefault(defSpot->detailSH); detailSH->setDefault(defSpot->detailSH);
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->setDefault(defSpot->multsh[i]); multipliersh[i]->setDefault(defSpot->multsh[i]);
} }
// Vibrance // Vibrance
saturated->setDefault((double)defSpot->saturated); saturated->setDefault((double)defSpot->saturated);
pastels->setDefault((double)defSpot->pastels); pastels->setDefault((double)defSpot->pastels);
@ -6289,9 +6309,11 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
slomaskSH->setDefaultEditedState(Irrelevant); slomaskSH->setDefaultEditedState(Irrelevant);
lapmaskSH->setDefaultEditedState(Irrelevant); lapmaskSH->setDefaultEditedState(Irrelevant);
detailSH->setDefaultEditedState(Irrelevant); detailSH->setDefaultEditedState(Irrelevant);
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->setDefaultEditedState(Irrelevant); multipliersh[i]->setDefaultEditedState(Irrelevant);
} }
// Vibrance // Vibrance
saturated->setDefaultEditedState(Irrelevant); saturated->setDefaultEditedState(Irrelevant);
pastels->setDefaultEditedState(Irrelevant); pastels->setDefaultEditedState(Irrelevant);
@ -6478,9 +6500,11 @@ void Locallab::setDefaults(const ProcParams * defParams, const ParamsEdited * pe
slomaskSH->setDefaultEditedState(defSpotState->slomaskSH ? Edited : UnEdited); slomaskSH->setDefaultEditedState(defSpotState->slomaskSH ? Edited : UnEdited);
lapmaskSH->setDefaultEditedState(defSpotState->lapmaskSH ? Edited : UnEdited); lapmaskSH->setDefaultEditedState(defSpotState->lapmaskSH ? Edited : UnEdited);
detailSH->setDefaultEditedState(defSpotState->detailSH ? Edited : UnEdited); detailSH->setDefaultEditedState(defSpotState->detailSH ? Edited : UnEdited);
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->setDefaultEditedState(defSpotState->multsh[i] ? Edited : UnEdited); multipliersh[i]->setDefaultEditedState(defSpotState->multsh[i] ? Edited : UnEdited);
} }
// Vibrance // Vibrance
saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited); saturated->setDefaultEditedState(defSpotState->saturated ? Edited : UnEdited);
pastels->setDefaultEditedState(defSpotState->pastels ? Edited : UnEdited); pastels->setDefaultEditedState(defSpotState->pastels ? Edited : UnEdited);
@ -7803,9 +7827,11 @@ void Locallab::setBatchMode(bool batchMode)
slomaskSH->showEditedCB(); slomaskSH->showEditedCB();
lapmaskSH->showEditedCB(); lapmaskSH->showEditedCB();
detailSH->showEditedCB(); detailSH->showEditedCB();
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->showEditedCB(); multipliersh[i]->showEditedCB();
} }
// Vibrance // Vibrance
saturated->showEditedCB(); saturated->showEditedCB();
pastels->showEditedCB(); pastels->showEditedCB();
@ -8393,11 +8419,13 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
lapmaskSH->setValue(pp->locallab.spots.at(index).lapmaskSH); lapmaskSH->setValue(pp->locallab.spots.at(index).lapmaskSH);
detailSH->setValue(pp->locallab.spots.at(index).detailSH); detailSH->setValue(pp->locallab.spots.at(index).detailSH);
LmaskSHshape->setCurve(pp->locallab.spots.at(index).LmaskSHcurve); LmaskSHshape->setCurve(pp->locallab.spots.at(index).LmaskSHcurve);
if (pp->locallab.spots.at(index).shMethod == "std") { if (pp->locallab.spots.at(index).shMethod == "std") {
shMethod->set_active(0); shMethod->set_active(0);
} else if (pp->locallab.spots.at(index).shMethod == "tone") { } else if (pp->locallab.spots.at(index).shMethod == "tone") {
shMethod->set_active(1); shMethod->set_active(1);
} }
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->setValue(pp->locallab.spots.at(index).multsh[i]); multipliersh[i]->setValue(pp->locallab.spots.at(index).multsh[i]);
} }
@ -8778,9 +8806,11 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
lapmaskSH->setEditedState(spotState->lapmaskSH ? Edited : UnEdited); lapmaskSH->setEditedState(spotState->lapmaskSH ? Edited : UnEdited);
detailSH->setEditedState(spotState->detailSH ? Edited : UnEdited); detailSH->setEditedState(spotState->detailSH ? Edited : UnEdited);
LmaskSHshape->setUnChanged(!spotState->LmaskSHcurve); LmaskSHshape->setUnChanged(!spotState->LmaskSHcurve);
if (!spotState->shMethod) { if (!spotState->shMethod) {
shMethod->set_active_text(M("GENERAL_UNCHANGED")); shMethod->set_active_text(M("GENERAL_UNCHANGED"));
} }
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->setEditedState(spotState->multsh[i] ? Edited : UnEdited); multipliersh[i]->setEditedState(spotState->multsh[i] ? Edited : UnEdited);
} }
@ -9122,12 +9152,13 @@ void Locallab::updateSpecificGUIState()
expmasksh->show(); expmasksh->show();
showmaskSHMethodinv->show(); showmaskSHMethodinv->show();
showmaskSHMethod->hide(); showmaskSHMethod->hide();
shMethod->set_active(0); // shMethod->set_active(0);
if (shMethod->get_active_row_number() == 0) { if (shMethod->get_active_row_number() == 0) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->hide(); multipliersh[i]->hide();
} }
detailSH->hide(); detailSH->hide();
highlights->show(); highlights->show();
h_tonalwidth->show(); h_tonalwidth->show();
@ -9136,9 +9167,10 @@ void Locallab::updateSpecificGUIState()
sh_radius->show(); sh_radius->show();
} else if (shMethod->get_active_row_number() == 1) { } else if (shMethod->get_active_row_number() == 1) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->hide(); multipliersh[i]->show();
} }
detailSH->hide();
detailSH->show();
highlights->hide(); highlights->hide();
h_tonalwidth->hide(); h_tonalwidth->hide();
shadows->hide(); shadows->hide();
@ -9208,6 +9240,7 @@ void Locallab::updateSpecificGUIState()
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->hide(); multipliersh[i]->hide();
} }
detailSH->hide(); detailSH->hide();
highlights->show(); highlights->show();
h_tonalwidth->show(); h_tonalwidth->show();
@ -9218,6 +9251,7 @@ void Locallab::updateSpecificGUIState()
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
multipliersh[i]->show(); multipliersh[i]->show();
} }
detailSH->show(); detailSH->show();
highlights->hide(); highlights->hide();
h_tonalwidth->hide(); h_tonalwidth->hide();