Re-enabled showmask clarity and sharp-mask

This commit is contained in:
Desmis
2019-06-14 07:28:37 +02:00
parent 941e0bd26c
commit f2666dc464
3 changed files with 30 additions and 61 deletions

View File

@@ -1102,6 +1102,14 @@ void Crop::update(int todo)
mL0 = mL = mC0 = mC = 0.f;
}
float indic = 1.f;
if(WaveParams.showmask){
mL0 = mC0 = -1.f;
indic = -1.f;
mL = fabs(mL);
mC = fabs(mC);
}
#ifdef _OPENMP
#pragma omp parallel for
@@ -1109,9 +1117,9 @@ void Crop::update(int todo)
for (int x = 0; x < labnCrop->H; x++)
for (int y = 0; y < labnCrop->W; y++) {
labnCrop->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) - mL * labnCrop->L[x][y];
labnCrop->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * labnCrop->a[x][y];
labnCrop->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * labnCrop->b[x][y];
labnCrop->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) - mL * indic * labnCrop->L[x][y];
labnCrop->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * indic * labnCrop->a[x][y];
labnCrop->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * indic * labnCrop->b[x][y];
}
delete unshar;

View File

@@ -967,17 +967,23 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
} else {
mL0 = mL = mC0 = mC = 0.f;
}
float indic = 1.f;
if(WaveParams.showmask){
mL0 = mC0 = -1.f;
indic = -1.f;
mL = fabs(mL);
mC = fabs(mC);
}
#ifdef _OPENMP
#pragma omp parallel for
#endif
for (int x = 0; x < pH; x++)
for (int y = 0; y < pW; y++) {
nprevl->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) - mL * nprevl->L[x][y];
nprevl->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * nprevl->a[x][y];
nprevl->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * nprevl->b[x][y];
nprevl->L[x][y] = (1.f + mL0) * (unshar->L[x][y]) - mL * indic * nprevl->L[x][y];
nprevl->a[x][y] = (1.f + mC0) * (unshar->a[x][y]) - mC * indic * nprevl->a[x][y];
nprevl->b[x][y] = (1.f + mC0) * (unshar->b[x][y]) - mC * indic * nprevl->b[x][y];
}
delete unshar;

View File

@@ -501,7 +501,7 @@ Wavelet::Wavelet() :
clariBox->pack_start(*mergeL);
clariBox->pack_start(*mergeC);
clariBox->pack_start(*softrad);
// clariBox->pack_start(*showmask);
clariBox->pack_start(*showmask);
// Edge Sharpness
ToolParamBlock* const edgBox = Gtk::manage(new ToolParamBlock());
@@ -3064,46 +3064,6 @@ void Wavelet::avoidToggled()
void Wavelet::showmaskToggled()
{
if (ushamethod->get_active_row_number() == 1 && showmask->get_active()) {
Backmethod->set_active(2);
CLmethod->set_active(2);
Lmethod->set_active(6);
Lmethod->set_sensitive(true);
Dirmethod->set_sensitive(true);
Dirmethod->set_active(3);
expclari->setEnabled(false);
} else if (ushamethod->get_active_row_number() == 0 && showmask->get_active()) {
Backmethod->set_active(0);
CLmethod->set_active(1);
Lmethod->set_active(2);
Dirmethod->set_active(3);
Lmethod->set_sensitive(true);
Dirmethod->set_sensitive(true);
expclari->setEnabled(false);
}
if (ushamethod->get_active_row_number() == 1 && !showmask->get_active()) {
Backmethod->set_active(2);
CLmethod->set_active(2);
Lmethod->set_active(6);
Lmethod->set_sensitive(true);
Dirmethod->set_sensitive(true);
Dirmethod->set_active(3);
expclari->setEnabled(true);
} else if (ushamethod->get_active_row_number() == 0 && !showmask->get_active()) {
Backmethod->set_active(0);
CLmethod->set_active(1);
Lmethod->set_active(2);
Dirmethod->set_active(3);
Lmethod->set_sensitive(true);
Dirmethod->set_sensitive(true);
expclari->setEnabled(true);
}
if (multiImage) {
if (showmask->get_inconsistent()) {
showmask->set_inconsistent(false);
@@ -3306,7 +3266,6 @@ void Wavelet::enableToggled(MyExpander *expander)
event = EvWavenafin;
} else if (expander == expclari) {
if (expclari->getEnabled() == false) {
if (! showmask->get_active()) {
Backmethod->set_active(1);
CLmethod->set_active(3);
Lmethod->set_active(3);
@@ -3315,11 +3274,7 @@ void Wavelet::enableToggled(MyExpander *expander)
Dirmethod->set_sensitive(false);
CLmethod->set_sensitive(true);
Backmethod->set_sensitive(true);
}
} else {
if (showmask->get_active()) {
showmask->set_active(false);
}
if (ushamethod->get_active_row_number() == 1) {
Backmethod->set_active(2);