Improvment to smooth blur

This commit is contained in:
Desmis 2020-02-04 08:22:26 +01:00
parent 75d95735fa
commit f7aa9a4d32
12 changed files with 133 additions and 26 deletions

View File

@ -1146,6 +1146,7 @@ HISTORY_MSG_908;Local - Contrast Wavelet ES neighboring
HISTORY_MSG_909;Local - Contrast Wavelet ES show HISTORY_MSG_909;Local - Contrast Wavelet ES show
HISTORY_MSG_910;Local - Wavelet Edge performance HISTORY_MSG_910;Local - Wavelet Edge performance
HISTORY_MSG_911;Local - Blur Chroma Luma HISTORY_MSG_911;Local - Blur Chroma Luma
HISTORY_MSG_912;Local - Blur Guide filter strength
HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors HISTORY_MSG_CLAMPOOG;Clip out-of-gamut colors
HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction HISTORY_MSG_COLORTONING_LABGRID_VALUE;CT - Color correction
HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction HISTORY_MSG_COLORTONING_LABREGION_AB;CT - Color correction
@ -2616,6 +2617,7 @@ TP_LOCALLAB_SPECIAL;Special use of RGB curves
TP_LOCALLAB_SPOTNAME;Control Spot # TP_LOCALLAB_SPOTNAME;Control Spot #
TP_LOCALLAB_STD;Standard TP_LOCALLAB_STD;Standard
TP_LOCALLAB_STR;Strength TP_LOCALLAB_STR;Strength
TP_LOCALLAB_STRBL;Strength
TP_LOCALLAB_STREN;Compression Strength TP_LOCALLAB_STREN;Compression Strength
TP_LOCALLAB_STRENG;Strength TP_LOCALLAB_STRENG;Strength
TP_LOCALLAB_STRENGR;Strength TP_LOCALLAB_STRENGR;Strength

View File

@ -28,20 +28,32 @@
* available at https://arxiv.org/abs/1505.00996 * available at https://arxiv.org/abs/1505.00996
*/ */
#include "boxblur.h"
#include "guidedfilter.h" #include "guidedfilter.h"
#include "imagefloat.h" #include "boxblur.h"
#include "rescale.h"
#include "sleef.h" #include "sleef.h"
#include "rescale.h"
#include "imagefloat.h"
#define BENCHMARK namespace rtengine {
#include "StopWatch.h"
namespace rtengine #if 0
{ # define DEBUG_DUMP(arr) \
do { \
Imagefloat im(arr.width(), arr.height()); \
const char *out = "/tmp/" #arr ".tif"; \
for (int y = 0; y < im.getHeight(); ++y) { \
for (int x = 0; x < im.getWidth(); ++x) { \
im.r(y, x) = im.g(y, x) = im.b(y, x) = arr[y][x] * 65535.f; \
} \
} \
im.saveTIFF(out, 16); \
} while (false)
#else
# define DEBUG_DUMP(arr)
#endif
namespace
{ namespace {
int calculate_subsampling(int w, int h, int r) int calculate_subsampling(int w, int h, int r)
{ {
@ -64,6 +76,7 @@ int calculate_subsampling(int w, int h, int r)
} // namespace } // namespace
void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling) void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2D<float> &dst, int r, float epsilon, bool multithread, int subsampling)
{ {
@ -77,12 +90,7 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
enum Op { MUL, DIVEPSILON, ADD, SUB, ADDMUL, SUBMUL }; enum Op { MUL, DIVEPSILON, ADD, SUB, ADDMUL, SUBMUL };
const auto apply = const auto apply =
#ifdef _OPENMP [=](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
[multithread, epsilon](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
#else
// removed multithread to fix clang warning on msys2 clang builds, which don't support OpenMp
[epsilon](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
#endif
{ {
const int w = res.width(); const int w = res.width();
const int h = res.height(); const int h = res.height();
@ -155,6 +163,7 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
[multithread](array2D<float> &d, array2D<float> &s, int rad) -> void [multithread](array2D<float> &d, array2D<float> &s, int rad) -> void
{ {
rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1); rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1);
// boxblur(s, d, rad, s.width(), s.height(), multithread);
boxblur(static_cast<float**>(s), static_cast<float**>(d), rad, s.width(), s.height(), multithread); boxblur(static_cast<float**>(s), static_cast<float**>(d), rad, s.width(), s.height(), multithread);
}; };
@ -164,39 +173,54 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
f_subsample(I1, I); f_subsample(I1, I);
f_subsample(p1, p); f_subsample(p1, p);
DEBUG_DUMP(I);
DEBUG_DUMP(p);
DEBUG_DUMP(I1);
DEBUG_DUMP(p1);
float r1 = float(r) / subsampling; float r1 = float(r) / subsampling;
array2D<float> meanI(w, h); array2D<float> meanI(w, h);
f_mean(meanI, I1, r1); f_mean(meanI, I1, r1);
DEBUG_DUMP(meanI);
array2D<float> meanp(w, h); array2D<float> meanp(w, h);
f_mean(meanp, p1, r1); f_mean(meanp, p1, r1);
DEBUG_DUMP(meanp);
array2D<float> &corrIp = p1; array2D<float> &corrIp = p1;
apply(MUL, corrIp, I1, p1); apply(MUL, corrIp, I1, p1);
f_mean(corrIp, corrIp, r1); f_mean(corrIp, corrIp, r1);
DEBUG_DUMP(corrIp);
array2D<float> &corrI = I1; array2D<float> &corrI = I1;
apply(MUL, corrI, I1, I1); apply(MUL, corrI, I1, I1);
f_mean(corrI, corrI, r1); f_mean(corrI, corrI, r1);
DEBUG_DUMP(corrI);
array2D<float> &varI = corrI; array2D<float> &varI = corrI;
apply(SUBMUL, varI, meanI, meanI, corrI); apply(SUBMUL, varI, meanI, meanI, corrI);
DEBUG_DUMP(varI);
array2D<float> &covIp = corrIp; array2D<float> &covIp = corrIp;
apply(SUBMUL, covIp, meanI, meanp, corrIp); apply(SUBMUL, covIp, meanI, meanp, corrIp);
DEBUG_DUMP(covIp);
array2D<float> &a = varI; array2D<float> &a = varI;
apply(DIVEPSILON, a, covIp, varI); apply(DIVEPSILON, a, covIp, varI);
DEBUG_DUMP(a);
array2D<float> &b = covIp; array2D<float> &b = covIp;
apply(SUBMUL, b, a, meanI, meanp); apply(SUBMUL, b, a, meanI, meanp);
DEBUG_DUMP(b);
array2D<float> &meana = a; array2D<float> &meana = a;
f_mean(meana, a, r1); f_mean(meana, a, r1);
DEBUG_DUMP(meana);
array2D<float> &meanb = b; array2D<float> &meanb = b;
f_mean(meanb, b, r1); f_mean(meanb, b, r1);
DEBUG_DUMP(meanb);
// speedup by heckflosse67 // speedup by heckflosse67
const int Ws = meana.width(); const int Ws = meana.width();
@ -218,7 +242,7 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
} }
void guidedFilterLog(float base, array2D<float> &chan, int r, float eps, bool multithread, int subsampling) void guidedFilterLog(const array2D<float> &guide, float base, array2D<float> &chan, int r, float eps, bool multithread, int subsampling)
{ {
#ifdef _OPENMP #ifdef _OPENMP
# pragma omp parallel for if (multithread) # pragma omp parallel for if (multithread)
@ -229,7 +253,7 @@ void guidedFilterLog(float base, array2D<float> &chan, int r, float eps, bool mu
} }
} }
guidedFilter(chan, chan, chan, r, eps, multithread, subsampling); guidedFilter(guide, chan, chan, r, eps, multithread, subsampling);
#ifdef _OPENMP #ifdef _OPENMP
# pragma omp parallel for if (multithread) # pragma omp parallel for if (multithread)
@ -242,4 +266,13 @@ void guidedFilterLog(float base, array2D<float> &chan, int r, float eps, bool mu
} }
void guidedFilterLog(float base, array2D<float> &chan, int r, float eps, bool multithread, int subsampling)
{
guidedFilterLog(chan, base, chan, r, eps, multithread, subsampling);
}
} // namespace rtengine } // namespace rtengine

View File

@ -30,4 +30,6 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
void guidedFilterLog(float base, array2D<float> &chan, int r, float eps, bool multithread, int subsampling=0); void guidedFilterLog(float base, array2D<float> &chan, int r, float eps, bool multithread, int subsampling=0);
void guidedFilterLog(const array2D<float> &guide, float base, array2D<float> &chan, int r, float eps, bool multithread, int subsampling=0);
} // namespace rtengine } // namespace rtengine

View File

@ -303,6 +303,7 @@ struct local_params {
double stren; double stren;
int it; int it;
int guidb; int guidb;
float strbl;
float epsb; float epsb;
float trans; float trans;
float feath; float feath;
@ -1094,6 +1095,8 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall
lp.fftbl = fftbl; lp.fftbl = fftbl;
lp.it = itera; lp.it = itera;
lp.guidb = guidbl; lp.guidb = guidbl;
lp.strbl = 0.01f * (float) locallab.spots.at(sp).strbl;
lp.epsb = epsbl; lp.epsb = epsbl;
lp.struexp = structexpo; lp.struexp = structexpo;
lp.blurexp = blurexpo; lp.blurexp = blurexpo;
@ -10893,6 +10896,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
array2D<float> rr(bfw, bfh); array2D<float> rr(bfw, bfh);
array2D<float> gg(bfw, bfh); array2D<float> gg(bfw, bfh);
array2D<float> bb(bfw, bfh); array2D<float> bb(bfw, bfh);
array2D<float> guide(bfw, bfh);
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16) #pragma omp parallel for schedule(dynamic,16)
#endif #endif
@ -10900,22 +10906,28 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
for (int y = 0; y < bfh ; y++) { for (int y = 0; y < bfh ; y++) {
for (int x = 0; x < bfw; x++) { for (int x = 0; x < bfw; x++) {
LL[y][x] = tmp1->L[y][x]; LL[y][x] = tmp1->L[y][x];
float ll = LL[y][x];
guide[y][x] = xlin2log(max(ll, 0.f), 10.f);
rr[y][x] = tmpImage->r(y, x); rr[y][x] = tmpImage->r(y, x);
gg[y][x] = tmpImage->g(y, x); gg[y][x] = tmpImage->g(y, x);
bb[y][x] = tmpImage->b(y, x); bb[y][x] = tmpImage->b(y, x);
} }
} }
array2D<float> iR(bfw, bfh, rr, 0);
array2D<float> iG(bfw, bfh, gg, 0);
array2D<float> iB(bfw, bfh, bb, 0);
array2D<float> iL(bfw, bfh, LL, 0);
int r = max(int(lp.guidb / sk), 1); int r = max(int(lp.guidb / sk), 1);
const float epsil = 0.001f * std::pow(2, - lp.epsb); const float epsil = 0.001f * std::pow(2, - lp.epsb);
if (lp.chromet == 0) { if (lp.chromet == 0) {
rtengine::guidedFilterLog(10.f, LL, r, epsil, multiThread); rtengine::guidedFilterLog(guide, 10.f, LL, r, epsil, multiThread);
} else if (lp.chromet == 1) { } else if (lp.chromet == 1) {
rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); rtengine::guidedFilterLog(guide, 10.f, rr, r, epsil, multiThread);
rtengine::guidedFilterLog(10.f, bb, r, epsil, multiThread); rtengine::guidedFilterLog(guide, 10.f, bb, r, epsil, multiThread);
} else if (lp.chromet == 2) { } else if (lp.chromet == 2) {
rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread); rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread);
rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread);
@ -10928,6 +10940,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
for (int y = 0; y < bfh ; y++) { for (int y = 0; y < bfh ; y++) {
for (int x = 0; x < bfw; x++) { for (int x = 0; x < bfw; x++) {
rr[y][x] = intp(lp.strbl, rr[y][x] , iR[y][x]);
gg[y][x] = intp(lp.strbl, gg[y][x] , iG[y][x]);
bb[y][x] = intp(lp.strbl, bb[y][x] , iB[y][x]);
tmpImage->r(y, x) = rr[y][x]; tmpImage->r(y, x) = rr[y][x];
tmpImage->g(y, x) = gg[y][x]; tmpImage->g(y, x) = gg[y][x];
tmpImage->b(y, x) = bb[y][x]; tmpImage->b(y, x) = bb[y][x];
@ -10944,6 +10959,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
for (int y = 0; y < bfh ; y++) { for (int y = 0; y < bfh ; y++) {
for (int x = 0; x < bfw; x++) { for (int x = 0; x < bfw; x++) {
LL[y][x] = intp(lp.strbl, LL[y][x] , iL[y][x]);
tmp1->L[y][x] = LL[y][x]; tmp1->L[y][x] = LL[y][x];
} }
} }
@ -10975,6 +10991,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
array2D<float> rr(GW, GH); array2D<float> rr(GW, GH);
array2D<float> gg(GW, GH); array2D<float> gg(GW, GH);
array2D<float> bb(GW, GH); array2D<float> bb(GW, GH);
array2D<float> guide(GW, GH);
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16) #pragma omp parallel for schedule(dynamic,16)
#endif #endif
@ -10982,6 +11000,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
for (int y = 0; y < GH ; y++) { for (int y = 0; y < GH ; y++) {
for (int x = 0; x < GW; x++) { for (int x = 0; x < GW; x++) {
LL[y][x] = tmp1->L[y][x]; LL[y][x] = tmp1->L[y][x];
float ll = LL[y][x];
guide[y][x] = xlin2log(max(ll, 0.f), 10.f);
rr[y][x] = tmpImage->r(y, x); rr[y][x] = tmpImage->r(y, x);
gg[y][x] = tmpImage->g(y, x); gg[y][x] = tmpImage->g(y, x);
bb[y][x] = tmpImage->b(y, x); bb[y][x] = tmpImage->b(y, x);
@ -10989,15 +11009,20 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
} }
} }
array2D<float> iR(GW, GH, rr, 0);
array2D<float> iG(GW, GH, gg, 0);
array2D<float> iB(GW, GH, bb, 0);
array2D<float> iL(GW, GH, LL, 0);
int r = max(int(lp.guidb / sk), 1); int r = max(int(lp.guidb / sk), 1);
const float epsil = 0.001f * std::pow(2, - lp.epsb); const float epsil = 0.001f * std::pow(2, - lp.epsb);
if (lp.chromet == 0) { if (lp.chromet == 0) {
rtengine::guidedFilterLog(10.f, LL, r, epsil, multiThread); rtengine::guidedFilterLog(guide, 10.f, LL, r, epsil, multiThread);
} else if (lp.chromet == 1) { } else if (lp.chromet == 1) {
rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); rtengine::guidedFilterLog(guide, 10.f, rr, r, epsil, multiThread);
rtengine::guidedFilterLog(10.f, bb, r, epsil, multiThread); rtengine::guidedFilterLog(guide, 10.f, bb, r, epsil, multiThread);
} else if (lp.chromet == 2) { } else if (lp.chromet == 2) {
rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread); rtengine::guidedFilterLog(10.f, gg, r, epsil, multiThread);
rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread); rtengine::guidedFilterLog(10.f, rr, r, epsil, multiThread);
@ -11010,6 +11035,9 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
for (int y = 0; y < GH ; y++) { for (int y = 0; y < GH ; y++) {
for (int x = 0; x < GW; x++) { for (int x = 0; x < GW; x++) {
rr[y][x] = intp(lp.strbl, rr[y][x] , iR[y][x]);
gg[y][x] = intp(lp.strbl, gg[y][x] , iG[y][x]);
bb[y][x] = intp(lp.strbl, bb[y][x] , iB[y][x]);
tmpImage->r(y, x) = rr[y][x]; tmpImage->r(y, x) = rr[y][x];
tmpImage->g(y, x) = gg[y][x]; tmpImage->g(y, x) = gg[y][x];
tmpImage->b(y, x) = bb[y][x]; tmpImage->b(y, x) = bb[y][x];
@ -11026,6 +11054,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o
for (int y = 0; y < GH ; y++) { for (int y = 0; y < GH ; y++) {
for (int x = 0; x < GW; x++) { for (int x = 0; x < GW; x++) {
LL[y][x] = intp(lp.strbl, LL[y][x] , iL[y][x]);
tmp1->L[y][x] = LL[y][x]; tmp1->L[y][x] = LL[y][x];
} }
} }

View File

@ -937,6 +937,7 @@ enum ProcEventCode {
Evlocallabwaveshow = 908, Evlocallabwaveshow = 908,
EvLocallabSpotwavMethod = 909, EvLocallabSpotwavMethod = 909,
EvlocallabchroMethod = 910, EvlocallabchroMethod = 910,
Evlocallabstrbl = 911,
NUMOFEVENTS NUMOFEVENTS
}; };

View File

@ -2623,6 +2623,7 @@ LocallabParams::LocallabSpot::LocallabSpot() :
sensibn(40), sensibn(40),
itera(1), itera(1),
guidbl(0), guidbl(0),
strbl(50),
isogr(400), isogr(400),
strengr(0), strengr(0),
scalegr(100), scalegr(100),
@ -3072,6 +3073,7 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& sensibn == other.sensibn && sensibn == other.sensibn
&& itera == other.itera && itera == other.itera
&& guidbl == other.guidbl && guidbl == other.guidbl
&& strbl == other.strbl
&& isogr == other.isogr && isogr == other.isogr
&& strengr == other.strengr && strengr == other.strengr
&& scalegr == other.scalegr && scalegr == other.scalegr
@ -4488,6 +4490,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensibn, "Locallab", "Sensibn_" + std::to_string(i), spot.sensibn, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).sensibn, "Locallab", "Sensibn_" + std::to_string(i), spot.sensibn, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).itera, "Locallab", "Iteramed_" + std::to_string(i), spot.itera, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).itera, "Locallab", "Iteramed_" + std::to_string(i), spot.itera, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).guidbl, "Locallab", "Guidbl_" + std::to_string(i), spot.guidbl, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).guidbl, "Locallab", "Guidbl_" + std::to_string(i), spot.guidbl, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strbl, "Locallab", "Strbl_" + std::to_string(i), spot.strbl, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).isogr, "Locallab", "Isogr_" + std::to_string(i), spot.isogr, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).isogr, "Locallab", "Isogr_" + std::to_string(i), spot.isogr, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strengr, "Locallab", "Strengr_" + std::to_string(i), spot.strengr, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).strengr, "Locallab", "Strengr_" + std::to_string(i), spot.strengr, keyFile);
saveToKeyfile(!pedited || pedited->locallab.spots.at(i).scalegr, "Locallab", "Scalegr_" + std::to_string(i), spot.scalegr, keyFile); saveToKeyfile(!pedited || pedited->locallab.spots.at(i).scalegr, "Locallab", "Scalegr_" + std::to_string(i), spot.scalegr, keyFile);
@ -6048,6 +6051,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Sensibn_" + std::to_string(i), pedited, spot.sensibn, spotEdited.sensibn); assignFromKeyfile(keyFile, "Locallab", "Sensibn_" + std::to_string(i), pedited, spot.sensibn, spotEdited.sensibn);
assignFromKeyfile(keyFile, "Locallab", "Iteramed_" + std::to_string(i), pedited, spot.itera, spotEdited.itera); assignFromKeyfile(keyFile, "Locallab", "Iteramed_" + std::to_string(i), pedited, spot.itera, spotEdited.itera);
assignFromKeyfile(keyFile, "Locallab", "Guidbl_" + std::to_string(i), pedited, spot.guidbl, spotEdited.guidbl); assignFromKeyfile(keyFile, "Locallab", "Guidbl_" + std::to_string(i), pedited, spot.guidbl, spotEdited.guidbl);
assignFromKeyfile(keyFile, "Locallab", "Strbl_" + std::to_string(i), pedited, spot.strbl, spotEdited.strbl);
assignFromKeyfile(keyFile, "Locallab", "Isogr_" + std::to_string(i), pedited, spot.isogr, spotEdited.isogr); assignFromKeyfile(keyFile, "Locallab", "Isogr_" + std::to_string(i), pedited, spot.isogr, spotEdited.isogr);
assignFromKeyfile(keyFile, "Locallab", "Strengr_" + std::to_string(i), pedited, spot.strengr, spotEdited.strengr); assignFromKeyfile(keyFile, "Locallab", "Strengr_" + std::to_string(i), pedited, spot.strengr, spotEdited.strengr);
assignFromKeyfile(keyFile, "Locallab", "Scalegr_" + std::to_string(i), pedited, spot.scalegr, spotEdited.scalegr); assignFromKeyfile(keyFile, "Locallab", "Scalegr_" + std::to_string(i), pedited, spot.scalegr, spotEdited.scalegr);

View File

@ -1166,6 +1166,7 @@ struct LocallabParams {
int sensibn; int sensibn;
int itera; int itera;
int guidbl; int guidbl;
int strbl;
int isogr; int isogr;
int strengr; int strengr;
int scalegr; int scalegr;

View File

@ -940,7 +940,8 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, //EvlocallablocalneiMethod LUMINANCECURVE, //EvlocallablocalneiMethod
LUMINANCECURVE, //Evlocallabwaveshow LUMINANCECURVE, //Evlocallabwaveshow
LUMINANCECURVE, // EvLocallabSpotwavMethod LUMINANCECURVE, // EvLocallabSpotwavMethod
LUMINANCECURVE // EvlocallabchroMethod LUMINANCECURVE, // EvlocallabchroMethod
LUMINANCECURVE // Evlocallabstrbl
}; };

View File

@ -511,6 +511,7 @@ radius(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RADIUS"), MINRAD, MAXRAD, 0.1, 1.
strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))), strength(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRENGTH"), 0, 100, 1, 0))),
itera(Gtk::manage(new Adjuster(M("TP_DIRPYRDENOISE_MEDIAN_PASSES"), 1, 4, 1, 1))), itera(Gtk::manage(new Adjuster(M("TP_DIRPYRDENOISE_MEDIAN_PASSES"), 1, 4, 1, 1))),
guidbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDBL"), 0, 1000, 1, 0))), guidbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GUIDBL"), 0, 1000, 1, 0))),
strbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRBL"), 0, 100, 1, 50))),
epsbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EPSBL"), -10, 10, 1, 0))), epsbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_EPSBL"), -10, 10, 1, 0))),
sensibn(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIBN"), 0, 100, 1, 40))), sensibn(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIBN"), 0, 100, 1, 40))),
blendmaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))), blendmaskbl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLENDMASKCOL"), -100, 100, 1, 0))),
@ -3617,8 +3618,10 @@ pe(nullptr)
scalegr->setAdjusterListener(this); scalegr->setAdjusterListener(this);
itera->setAdjusterListener(this); itera->setAdjusterListener(this);
guidbl->setLogScale(100, 0);
guidbl->setAdjusterListener(this); guidbl->setAdjusterListener(this);
epsbl->setAdjusterListener(this); epsbl->setAdjusterListener(this);
strbl->setAdjusterListener(this);
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));
@ -3833,6 +3836,7 @@ pe(nullptr)
blurrBox->pack_start(*medMethod); blurrBox->pack_start(*medMethod);
blurrBox->pack_start(*itera); blurrBox->pack_start(*itera);
blurrBox->pack_start(*guidbl); blurrBox->pack_start(*guidbl);
blurrBox->pack_start(*strbl);
blurrBox->pack_start(*epsbl); blurrBox->pack_start(*epsbl);
blurrBox->pack_start(*sensibn); blurrBox->pack_start(*sensibn);
blurrBox->pack_start(*blurMethod); blurrBox->pack_start(*blurMethod);
@ -5469,6 +5473,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pp->locallab.spots.at(pp->locallab.selspot).itera = itera->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).itera = itera->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).guidbl = guidbl->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).guidbl = guidbl->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).epsbl = epsbl->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).epsbl = epsbl->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).strbl = strbl->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).isogr = isogr->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).isogr = isogr->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).strengr = strengr->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).strengr = strengr->getIntValue();
pp->locallab.spots.at(pp->locallab.selspot).scalegr = scalegr->getIntValue(); pp->locallab.spots.at(pp->locallab.selspot).scalegr = scalegr->getIntValue();
@ -5965,6 +5970,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pe->locallab.spots.at(pp->locallab.selspot).strengr = pe->locallab.spots.at(pp->locallab.selspot).strengr || strengr->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).strengr = pe->locallab.spots.at(pp->locallab.selspot).strengr || strengr->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).scalegr = pe->locallab.spots.at(pp->locallab.selspot).scalegr || scalegr->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).scalegr = pe->locallab.spots.at(pp->locallab.selspot).scalegr || scalegr->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).guidbl = pe->locallab.spots.at(pp->locallab.selspot).guidbl || guidbl->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).guidbl = pe->locallab.spots.at(pp->locallab.selspot).guidbl || guidbl->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).strbl = pe->locallab.spots.at(pp->locallab.selspot).strbl || strbl->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).epsbl = pe->locallab.spots.at(pp->locallab.selspot).epsbl || epsbl->getEditedState(); pe->locallab.spots.at(pp->locallab.selspot).epsbl = pe->locallab.spots.at(pp->locallab.selspot).epsbl || epsbl->getEditedState();
pe->locallab.spots.at(pp->locallab.selspot).blMethod = pe->locallab.spots.at(pp->locallab.selspot).blMethod || blMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).blMethod = pe->locallab.spots.at(pp->locallab.selspot).blMethod || blMethod->get_active_text() != M("GENERAL_UNCHANGED");
pe->locallab.spots.at(pp->locallab.selspot).chroMethod = pe->locallab.spots.at(pp->locallab.selspot).chroMethod || chroMethod->get_active_text() != M("GENERAL_UNCHANGED"); pe->locallab.spots.at(pp->locallab.selspot).chroMethod = pe->locallab.spots.at(pp->locallab.selspot).chroMethod || chroMethod->get_active_text() != M("GENERAL_UNCHANGED");
@ -6401,6 +6407,7 @@ void Locallab::write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited
pedited->locallab.spots.at(pp->locallab.selspot).strengr = pedited->locallab.spots.at(pp->locallab.selspot).strengr || strengr->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).strengr = pedited->locallab.spots.at(pp->locallab.selspot).strengr || strengr->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).scalegr = pedited->locallab.spots.at(pp->locallab.selspot).scalegr || scalegr->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).scalegr = pedited->locallab.spots.at(pp->locallab.selspot).scalegr || scalegr->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).guidbl = pedited->locallab.spots.at(pp->locallab.selspot).guidbl || guidbl->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).guidbl = pedited->locallab.spots.at(pp->locallab.selspot).guidbl || guidbl->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).strbl = pedited->locallab.spots.at(pp->locallab.selspot).strbl || strbl->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).epsbl = pedited->locallab.spots.at(pp->locallab.selspot).epsbl || epsbl->getEditedState(); pedited->locallab.spots.at(pp->locallab.selspot).epsbl = pedited->locallab.spots.at(pp->locallab.selspot).epsbl || epsbl->getEditedState();
pedited->locallab.spots.at(pp->locallab.selspot).blMethod = pedited->locallab.spots.at(pp->locallab.selspot).blMethod || blMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).blMethod = pedited->locallab.spots.at(pp->locallab.selspot).blMethod || blMethod->get_active_text() != M("GENERAL_UNCHANGED");
pedited->locallab.spots.at(pp->locallab.selspot).chroMethod = pedited->locallab.spots.at(pp->locallab.selspot).chroMethod || chroMethod->get_active_text() != M("GENERAL_UNCHANGED"); pedited->locallab.spots.at(pp->locallab.selspot).chroMethod = pedited->locallab.spots.at(pp->locallab.selspot).chroMethod || chroMethod->get_active_text() != M("GENERAL_UNCHANGED");
@ -7277,6 +7284,7 @@ void Locallab::blMethodChanged()
scalegr->show(); scalegr->show();
medMethod->hide(); medMethod->hide();
guidbl->hide(); guidbl->hide();
strbl->hide();
epsbl->hide(); epsbl->hide();
activlum->show(); activlum->show();
} else if (blMethod->get_active_row_number() == 1) { } else if (blMethod->get_active_row_number() == 1) {
@ -7290,6 +7298,7 @@ void Locallab::blMethodChanged()
itera->show(); itera->show();
medMethod->show(); medMethod->show();
guidbl->hide(); guidbl->hide();
strbl->hide();
epsbl->hide(); epsbl->hide();
activlum->show(); activlum->show();
} else if (blMethod->get_active_row_number() == 2) { } else if (blMethod->get_active_row_number() == 2) {
@ -7303,6 +7312,7 @@ void Locallab::blMethodChanged()
itera->hide(); itera->hide();
medMethod->hide(); medMethod->hide();
guidbl->show(); guidbl->show();
strbl->show();
epsbl->show(); epsbl->show();
activlum->hide(); activlum->hide();
} }
@ -9485,6 +9495,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c
strengr->setDefault((double)defSpot->strengr); strengr->setDefault((double)defSpot->strengr);
scalegr->setDefault((double)defSpot->scalegr); scalegr->setDefault((double)defSpot->scalegr);
guidbl->setDefault((double)defSpot->guidbl); guidbl->setDefault((double)defSpot->guidbl);
strbl->setDefault((double)defSpot->strbl);
epsbl->setDefault((double)defSpot->epsbl); epsbl->setDefault((double)defSpot->epsbl);
blendmaskbl->setDefault((double)defSpot->blendmaskbl); blendmaskbl->setDefault((double)defSpot->blendmaskbl);
radmaskbl->setDefault(defSpot->radmaskbl); radmaskbl->setDefault(defSpot->radmaskbl);
@ -9741,6 +9752,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c
strengr->setDefaultEditedState(Irrelevant); strengr->setDefaultEditedState(Irrelevant);
scalegr->setDefaultEditedState(Irrelevant); scalegr->setDefaultEditedState(Irrelevant);
guidbl->setDefaultEditedState(Irrelevant); guidbl->setDefaultEditedState(Irrelevant);
strbl->setDefaultEditedState(Irrelevant);
epsbl->setDefaultEditedState(Irrelevant); epsbl->setDefaultEditedState(Irrelevant);
blendmaskbl->setDefaultEditedState(Irrelevant); blendmaskbl->setDefaultEditedState(Irrelevant);
radmaskbl->setDefaultEditedState(Irrelevant); radmaskbl->setDefaultEditedState(Irrelevant);
@ -10002,6 +10014,7 @@ void Locallab::setDefaults(const rtengine::procparams::ProcParams * defParams, c
strengr->setDefaultEditedState(defSpotState->strengr ? Edited : UnEdited); strengr->setDefaultEditedState(defSpotState->strengr ? Edited : UnEdited);
scalegr->setDefaultEditedState(defSpotState->scalegr ? Edited : UnEdited); scalegr->setDefaultEditedState(defSpotState->scalegr ? Edited : UnEdited);
guidbl->setDefaultEditedState(defSpotState->guidbl ? Edited : UnEdited); guidbl->setDefaultEditedState(defSpotState->guidbl ? Edited : UnEdited);
strbl->setDefaultEditedState(defSpotState->strbl ? Edited : UnEdited);
epsbl->setDefaultEditedState(defSpotState->epsbl ? Edited : UnEdited); epsbl->setDefaultEditedState(defSpotState->epsbl ? Edited : UnEdited);
blendmaskbl->setDefaultEditedState(defSpotState->blendmaskbl ? Edited : UnEdited); blendmaskbl->setDefaultEditedState(defSpotState->blendmaskbl ? Edited : UnEdited);
radmaskbl->setDefaultEditedState(defSpotState->radmaskbl ? Edited : UnEdited); radmaskbl->setDefaultEditedState(defSpotState->radmaskbl ? Edited : UnEdited);
@ -10857,6 +10870,12 @@ void Locallab::adjusterChanged(Adjuster * a, double newval)
} }
} }
if (a == strbl) {
if (listener) {
listener->panelChanged(Evlocallabstrbl, strbl->getTextValue());
}
}
if (a == epsbl) { if (a == epsbl) {
if (listener) { if (listener) {
listener->panelChanged(Evlocallabepsbl, epsbl->getTextValue()); listener->panelChanged(Evlocallabepsbl, epsbl->getTextValue());
@ -11810,6 +11829,7 @@ void Locallab::setBatchMode(bool batchMode)
strengr->showEditedCB(); strengr->showEditedCB();
scalegr->showEditedCB(); scalegr->showEditedCB();
guidbl->showEditedCB(); guidbl->showEditedCB();
strbl->showEditedCB();
epsbl->showEditedCB(); epsbl->showEditedCB();
blendmaskbl->showEditedCB(); blendmaskbl->showEditedCB();
radmaskbl->showEditedCB(); radmaskbl->showEditedCB();
@ -12776,6 +12796,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
strengr->setValue(pp->locallab.spots.at(index).strengr); strengr->setValue(pp->locallab.spots.at(index).strengr);
scalegr->setValue(pp->locallab.spots.at(index).scalegr); scalegr->setValue(pp->locallab.spots.at(index).scalegr);
guidbl->setValue(pp->locallab.spots.at(index).guidbl); guidbl->setValue(pp->locallab.spots.at(index).guidbl);
strbl->setValue(pp->locallab.spots.at(index).strbl);
epsbl->setValue(pp->locallab.spots.at(index).epsbl); epsbl->setValue(pp->locallab.spots.at(index).epsbl);
if (pp->locallab.spots.at(index).blMethod == "blur") { if (pp->locallab.spots.at(index).blMethod == "blur") {
@ -13439,6 +13460,7 @@ void Locallab::updateLocallabGUI(const rtengine::procparams::ProcParams* pp, con
strengr->setEditedState(spotState->strengr ? Edited : UnEdited); strengr->setEditedState(spotState->strengr ? Edited : UnEdited);
scalegr->setEditedState(spotState->scalegr ? Edited : UnEdited); scalegr->setEditedState(spotState->scalegr ? Edited : UnEdited);
guidbl->setEditedState(spotState->guidbl ? Edited : UnEdited); guidbl->setEditedState(spotState->guidbl ? Edited : UnEdited);
strbl->setEditedState(spotState->strbl ? Edited : UnEdited);
epsbl->setEditedState(spotState->epsbl ? Edited : UnEdited); epsbl->setEditedState(spotState->epsbl ? Edited : UnEdited);
if (!spotState->blMethod) { if (!spotState->blMethod) {
@ -14065,6 +14087,7 @@ void Locallab::updateSpecificGUIState()
scalegr->show(); scalegr->show();
medMethod->hide(); medMethod->hide();
guidbl->hide(); guidbl->hide();
strbl->hide();
epsbl->hide(); epsbl->hide();
activlum->show(); activlum->show();
} else if (blMethod->get_active_row_number() == 1) { } else if (blMethod->get_active_row_number() == 1) {
@ -14078,6 +14101,7 @@ void Locallab::updateSpecificGUIState()
itera->show(); itera->show();
medMethod->show(); medMethod->show();
guidbl->hide(); guidbl->hide();
strbl->hide();
epsbl->hide(); epsbl->hide();
activlum->show(); activlum->show();
} else if (blMethod->get_active_row_number() == 2) { } else if (blMethod->get_active_row_number() == 2) {
@ -14091,6 +14115,7 @@ void Locallab::updateSpecificGUIState()
itera->hide(); itera->hide();
medMethod->hide(); medMethod->hide();
guidbl->show(); guidbl->show();
strbl->show();
epsbl->show(); epsbl->show();
activlum->hide(); activlum->hide();
} }

View File

@ -301,6 +301,7 @@ private:
Adjuster* const strength; Adjuster* const strength;
Adjuster* const itera; Adjuster* const itera;
Adjuster* const guidbl; Adjuster* const guidbl;
Adjuster* const strbl;
Adjuster* const epsbl; Adjuster* const epsbl;
Adjuster* const sensibn; Adjuster* const sensibn;
Adjuster* const blendmaskbl; Adjuster* const blendmaskbl;

View File

@ -1161,6 +1161,7 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).sensibn = locallab.spots.at(j).sensibn && pSpot.sensibn == otherSpot.sensibn; locallab.spots.at(j).sensibn = locallab.spots.at(j).sensibn && pSpot.sensibn == otherSpot.sensibn;
locallab.spots.at(j).itera = locallab.spots.at(j).itera && pSpot.itera == otherSpot.itera; locallab.spots.at(j).itera = locallab.spots.at(j).itera && pSpot.itera == otherSpot.itera;
locallab.spots.at(j).guidbl = locallab.spots.at(j).guidbl && pSpot.guidbl == otherSpot.guidbl; locallab.spots.at(j).guidbl = locallab.spots.at(j).guidbl && pSpot.guidbl == otherSpot.guidbl;
locallab.spots.at(j).strbl = locallab.spots.at(j).strbl && pSpot.strbl == otherSpot.strbl;
locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr; locallab.spots.at(j).isogr = locallab.spots.at(j).isogr && pSpot.isogr == otherSpot.isogr;
locallab.spots.at(j).strengr = locallab.spots.at(j).strengr && pSpot.strengr == otherSpot.strengr; locallab.spots.at(j).strengr = locallab.spots.at(j).strengr && pSpot.strengr == otherSpot.strengr;
locallab.spots.at(j).epsbl = locallab.spots.at(j).epsbl && pSpot.epsbl == otherSpot.epsbl; locallab.spots.at(j).epsbl = locallab.spots.at(j).epsbl && pSpot.epsbl == otherSpot.epsbl;
@ -3656,6 +3657,10 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).guidbl = mods.locallab.spots.at(i).guidbl; toEdit.locallab.spots.at(i).guidbl = mods.locallab.spots.at(i).guidbl;
} }
if (locallab.spots.at(i).strbl) {
toEdit.locallab.spots.at(i).strbl = mods.locallab.spots.at(i).strbl;
}
if (locallab.spots.at(i).isogr) { if (locallab.spots.at(i).isogr) {
toEdit.locallab.spots.at(i).isogr = mods.locallab.spots.at(i).isogr; toEdit.locallab.spots.at(i).isogr = mods.locallab.spots.at(i).isogr;
} }
@ -5657,6 +5662,7 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
strengr(v), strengr(v),
scalegr(v), scalegr(v),
guidbl(v), guidbl(v),
strbl(v),
epsbl(v), epsbl(v),
blMethod(v), blMethod(v),
chroMethod(v), chroMethod(v),
@ -6083,6 +6089,7 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
strengr = v; strengr = v;
scalegr = v; scalegr = v;
guidbl = v; guidbl = v;
strbl = v;
epsbl = v; epsbl = v;
blMethod = v; blMethod = v;
chroMethod = v; chroMethod = v;

View File

@ -595,6 +595,7 @@ public:
bool strengr; bool strengr;
bool scalegr; bool scalegr;
bool guidbl; bool guidbl;
bool strbl;
bool epsbl; bool epsbl;
bool blMethod; bool blMethod;
bool chroMethod; bool chroMethod;