further cleanups

This commit is contained in:
Ingo Weyrich 2020-07-16 21:44:00 +02:00
parent 6caf33a589
commit 6cb29be31c
17 changed files with 511 additions and 701 deletions

View File

@ -29,7 +29,6 @@
#include "improcfun.h"
#include "LUT.h"
#include "opthelper.h"
#include "boxblur.h"
#include "rt_math.h"
#include "settings.h"
@ -247,8 +246,7 @@ void fillLut(LUTf &irangefn, int level, double dirpyrThreshold, float mult, floa
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult, const float blurcb, const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev, bool multiThread)
void idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult, const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev, bool multiThread)
{
LUTf irangefn(0x20000);
fillLut(irangefn, level, dirpyrThreshold, mult, skinprot);
@ -258,35 +256,10 @@ void idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** b
#endif
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
float hipass = (data_fine[i][j] - data_coarse[i][j]);
const float hipass = data_fine[i][j] - data_coarse[i][j];
buffer[i][j] += irangefn[hipass + 0x10000] * hipass;
}
}
if(blurcb > 0.f && choice == 0 && level != 5) {
float multbis;
if (level == 4 && mult > 1.f) {
multbis = 1.f + 0.65f * (mult - 1.f);
} else if (level == 5 && mult > 1.f) {
multbis = 1.f + 0.45f * (mult - 1.f);
} else {
multbis = mult; //multbis to reduce artifacts for high values mult
}
AlignedBuffer<float> blurbufcbdl(width * height);
float rad = 0.05f * blurcb * fabs((level + 1) * (multbis - 1.f)) / scaleprev;
// printf("rad=%f level=%i\n", rad, level);
#ifdef _OPENMP
#pragma omp parallel if (multiThread)
#endif
// rtengine::boxblur<float, float>(buffer, buffer, blurbufcbdl.data, rad, rad, width, height);
rtengine::boxblur(buffer, buffer, rad, width, height, false);
blurbufcbdl.resize(0);
}
irangefn.clear();
}
void idirpyr_eq_channel(const float * const * data_coarse, const float * const * data_fine, float ** buffer, int width, int height, int level, float mult, const double dirpyrThreshold, const float * const * hue, const float * const * chrom, const double skinprot, float b_l, float t_l, float t_r)
@ -552,7 +525,7 @@ void ImProcFunctions::dirpyr_equalizercam(const CieImage *ncie, float ** src, fl
}
}
void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwidth, int srcheight, const float * mult, float kchro, const double dirpyrThreshold, const float mergeL, const float contres, const float blurcb, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev, bool multiThread)
void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwidth, int srcheight, const float * mult, float kchro, const double dirpyrThreshold, const float mergeL, const float contres, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev, bool multiThread)
{
constexpr int maxlevelloc = 6;
constexpr int scalesloc[maxlevelloc] = {1, 2, 4, 8, 16, 32};
@ -663,13 +636,12 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid
for (int level = lastlevel - 1; level > 0; level--) {
idirpyr_eq_channel_loc(dirpyrlo[level], dirpyrlo[level - 1], residbuff, srcwidth, srcheight, level, multi[level], blurcb, dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, scaleprev, multiThread);
idirpyr_eq_channel_loc(dirpyrlo[level], dirpyrlo[level - 1], residbuff, srcwidth, srcheight, level, multi[level], dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, scaleprev, multiThread);
}
scale = scalesloc[0];
idirpyr_eq_channel_loc(dirpyrlo[0], src, residbuff, srcwidth, srcheight, 0, multi[0], blurcb, dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, scaleprev, multiThread);
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
idirpyr_eq_channel_loc(dirpyrlo[0], src, residbuff, srcwidth, srcheight, 0, multi[0], dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, scaleprev, multiThread);
array2D<float> loct(srcwidth, srcheight);
#ifdef _OPENMP

View File

@ -281,7 +281,6 @@ void RawImageSource::fast_demosaic()
int right = min(left + TS, W - bord + 2);
#ifdef __SSE2__
int j, cc;
__m128 wtuv, wtdv, wtlv, wtrv;
__m128 greenv, tempv, absv, abs2v;
__m128 c16v = _mm_set1_ps( 16.0f );
@ -302,7 +301,7 @@ void RawImageSource::fast_demosaic()
float wtu, wtd, wtl, wtr;
#ifdef __SSE2__
selmask = (vmask)_mm_andnot_ps( (__m128)selmask, (__m128)andmask);
int j, cc;
for (j = left, cc = 0; j < right - 3; j += 4, cc += 4) {
tempv = LVFU(rawData[i][j]);
absv = vabsf(LVFU(rawData[i - 1][j]) - LVFU(rawData[i + 1][j]));
@ -421,16 +420,12 @@ void RawImageSource::fast_demosaic()
temp1v = LVFU(redtile[rr * TS + cc]);
temp2v = greenv - zd25v * (greensumv - LVFU(redtile[(rr - 1) * TS + cc]) - LVFU(redtile[(rr + 1) * TS + cc]) - LVFU(redtile[rr * TS + cc - 1]) - LVFU(redtile[rr * TS + cc + 1]));
// temp2v = greenv - zd25v*((LVFU(greentile[(rr-1)*TS+cc])-LVFU(redtile[(rr-1)*TS+cc]))+(LVFU(greentile[(rr+1)*TS+cc])-LVFU(redtile[(rr+1)*TS+cc]))+
// (LVFU(greentile[rr*TS+cc-1])-LVFU(redtile[rr*TS+cc-1]))+(LVFU(greentile[rr*TS+cc+1])-LVFU(redtile[rr*TS+cc+1])));
_mm_storeu_ps( &redtile[rr * TS + cc], vself(selmask, temp1v, temp2v));
temp1v = LVFU(bluetile[rr * TS + cc]);
temp2v = greenv - zd25v * (greensumv - LVFU(bluetile[(rr - 1) * TS + cc]) - LVFU(bluetile[(rr + 1) * TS + cc]) - LVFU(bluetile[rr * TS + cc - 1]) - LVFU(bluetile[rr * TS + cc + 1]));
// temp2v = greenv - zd25v*((LVFU(greentile[(rr-1)*TS+cc])-LVFU(bluetile[(rr-1)*TS+cc]))+(LVFU(greentile[(rr+1)*TS+cc])-LVFU(bluetile[(rr+1)*TS+cc]))+
// (LVFU(greentile[rr*TS+cc-1])-LVFU(bluetile[rr*TS+cc-1]))+(LVFU(greentile[rr*TS+cc+1])-LVFU(bluetile[rr*TS+cc+1])));
_mm_storeu_ps( &bluetile[rr * TS + cc], vself(selmask, temp1v, temp2v));
}
@ -450,7 +445,7 @@ void RawImageSource::fast_demosaic()
for (int i = top + 2, rr = 2; i < bottom - 2; i++, rr++) {
#ifdef __SSE2__
int j, cc;
for (j = left + 2, cc = 2; j < right - 5; j += 4, cc += 4) {
_mm_storeu_ps(&red[i][j], vmaxf(LVFU(redtile[rr * TS + cc]), ZEROV));
_mm_storeu_ps(&green[i][j], vmaxf(LVFU(greentile[rr * TS + cc]), ZEROV));

View File

@ -254,9 +254,9 @@ public:
void fftw_tile_blur(int GW, int GH, int tilssize , int max_numblox_W, int min_numblox_W, float **tmp1, int numThreads, double radius);
void maskforretinex(int sp, int before, float ** luminance, float ** out, int W_L, int H_L, int skip,
const LocCCmaskCurve & locccmasretiCurve, bool &lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool &llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool & lhmasretiutili,
const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili,
int llretiMask, bool retiMasktmap, bool retiMask, float rad, float lap, bool pde, float gamm, float slop, float chro, float blend,
LUTf & lmaskretilocalcurve, bool & localmaskretiutili,
const LUTf & lmaskretilocalcurve, bool localmaskretiutili,
LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, bool multiThread,
bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask);
@ -269,8 +269,8 @@ public:
void MSRLocal(int call, int sp, bool fftw, int lum, float** reducDE, LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, float** luminance, const float* const *originalLuminance,
const int width, const int height, int bfwr, int bfhr, const procparams::LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const LocretitransCurve &locRETtransCcurve,
const int chrome, const int scall, const float krad, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax,
const LocCCmaskCurve & locccmasretiCurve, bool &lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool &llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool & lhmasretiutili, int llretiMask,
LUTf & lmaskretilocalcurve, bool & localmaskretiutili,
const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili, int llretiMask,
const LUTf & lmaskretilocalcurve, bool localmaskretiutili,
LabImage * transformed, bool retiMasktmap, bool retiMask,
bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask);
@ -424,7 +424,7 @@ public:
float MadRgb(const float * DataList, int datalen);
// pyramid wavelet
void cbdl_local_temp(float ** src, float ** loctemp, int srcwidth, int srcheight, const float * mult, float kchro, const double dirpyrThreshold, const float mergeL, const float contres, const float blurcb, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale, bool multiThread);
void cbdl_local_temp(float ** src, float ** loctemp, int srcwidth, int srcheight, const float * mult, float kchro, const double dirpyrThreshold, const float mergeL, const float contres, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale, bool multiThread);
void dirpyr_equalizer(const float * const * src, float ** dst, int srcwidth, int srcheight, const float * const * l_a, const float * const * l_b, const double * mult, double dirpyrThreshold, double skinprot, float b_l, float t_l, float t_r, int scale); //Emil's directional pyramid wavelet
void dirpyr_equalizercam(const CieImage* ncie, float ** src, float ** dst, int srcwidth, int srcheight, const float * const * h_p, const float * const * C_p, const double * mult, const double dirpyrThreshold, const double skinprot, float b_l, float t_l, float t_r, int scale); //Emil's directional pyramid wavelet
void defringe(LabImage* lab);

View File

@ -392,7 +392,6 @@ struct local_params {
int chro, cont, sens, sensh, senscb, sensbn, senstm, sensex, sensexclu, sensden, senslc, senssf, senshs, senscolor;
float clarityml;
float contresid;
float blurcbdl;
bool deltaem;
float struco;
float strengrid;
@ -988,7 +987,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall
int local_sensicb = locallab.spots.at(sp).sensicb;
float local_clarityml = (float) locallab.spots.at(sp).clarityml;
float local_contresid = (float) locallab.spots.at(sp).contresid;
int local_blurcbdl = 0; //(float) locallab.spots.at(sp).blurcbdl;
int local_contrast = locallab.spots.at(sp).contrast;
float local_lightness = (float) locallab.spots.at(sp).lightness;
float labgridALowloc = locallab.spots.at(sp).labgridALow;
@ -1238,7 +1236,6 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall
lp.senscb = local_sensicb;
lp.clarityml = local_clarityml;
lp.contresid = local_contresid;
lp.blurcbdl = local_blurcbdl;
lp.cont = local_contrast;
lp.ligh = local_lightness;
lp.lowA = labgridALowloc;
@ -10780,7 +10777,7 @@ void ImProcFunctions::Lab_Local(
lp.mulloc[5] = 1.001f;
}
ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, lp.mulloc, 1.f, lp.threshol, lp.clarityml, lp.contresid, lp.blurcbdl, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread);
ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, lp.mulloc, 1.f, lp.threshol, lp.clarityml, lp.contresid, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread);
if (lp.softradiuscb > 0.f) {
softproc(origcbdl.get(), loctemp.get(), lp.softradiuscb, bfh, bfw, 0.001, 0.00001, 0.5f, sk, multiThread, 1);
@ -10819,7 +10816,7 @@ void ImProcFunctions::Lab_Local(
}
choice = 1;
ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, multc, rtengine::max(lp.chromacb, 1.f), lp.threshol, clarich, 0.f, lp.blurcbdl, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread);
ImProcFunctions::cbdl_local_temp(bufsh, loctemp->L, bfw, bfh, multc, rtengine::max(lp.chromacb, 1.f), lp.threshol, clarich, 0.f, skinprot, false, b_l, t_l, t_r, b_r, choice, sk, multiThread);
float minC = loctemp->L[0][0] - std::sqrt(SQR(loctemp->a[0][0]) + SQR(loctemp->b[0][0]));

View File

@ -779,9 +779,9 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e
void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, float ** out, int W_L, int H_L, int skip,
const LocCCmaskCurve & locccmasretiCurve, bool &lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool &llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool & lhmasretiutili,
const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili,
int llretiMask, bool retiMasktmap, bool retiMask, float rad, float lap, bool pde, float gamm, float slop, float chro, float blend,
LUTf & lmaskretilocalcurve, bool & localmaskretiutili,
const LUTf & lmaskretilocalcurve, bool localmaskretiutili,
LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, bool multiThread,
bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask)
@ -1127,23 +1127,20 @@ void ImProcFunctions::maskforretinex(int sp, int before, float ** luminance, flo
void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** reducDE, LabImage * bufreti, LabImage * bufmask, LabImage * buforig, LabImage * buforigmas, float** luminance, const float* const *originalLuminance,
const int width, const int height, int bfwr, int bfhr, const procparams::LocallabParams &loc, const int skip, const LocretigainCurve &locRETgainCcurve, const LocretitransCurve &locRETtransCcurve,
const int chrome, const int scall, const float krad, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax,
const LocCCmaskCurve & locccmasretiCurve, bool &lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool &llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool & lhmasretiutili, int llretiMask,
LUTf & lmaskretilocalcurve, bool & localmaskretiutili,
const LocCCmaskCurve & locccmasretiCurve, bool lcmasretiutili, const LocLLmaskCurve & locllmasretiCurve, bool llmasretiutili, const LocHHmaskCurve & lochhmasretiCurve, bool lhmasretiutili, int llretiMask,
const LUTf & lmaskretilocalcurve, bool localmaskretiutili,
LabImage * transformed, bool retiMasktmap, bool retiMask,
bool delt, const float hueref, const float chromaref, const float lumaref,
float maxdE, float mindE, float maxdElim, float mindElim, float iterat, float limscope, int scope, float balance, float balanceh, float lumask)
{
BENCHFUN
bool py = true;
if (py) {//enabled
float mean, stddv, maxtr, mintr;
mean = 0.f;
stddv = 0.f;
maxtr = 0.f;
mintr = 0.f;
float delta;
constexpr float eps = 2.f;
bool useHslLin = false;
const float offse = loc.spots.at(sp).offs;
@ -1187,7 +1184,7 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
//nei = (int)(0.1f * nei + 2.f); //not too bad
nei = (int)(nei / (1.5f * skip)) / divsca;
vart *= sqrt(skip);
} else if (skip > 1 && skip < 4) {
} else if (skip > 1) {
//nei = (int)(0.3f * nei + 2.f);
nei = (int)(nei / skip) / divsca;
vart *= sqrt(skip);
@ -1238,10 +1235,8 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
pond /= log(elogt);
}
float kr = 1.f;//on FFTW
float kr;//on FFTW
float kg = 1.f;//on Gaussianblur
std::unique_ptr<float[]> buffer;
buffer.reset(new float[W_L * H_L]);
for (int scale = scal - 1; scale >= 0; --scale) {
// printf("retscale=%f scale=%i \n", mulradiusfftw * RetinexScales[scale], scale);
@ -1279,7 +1274,7 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
kg = 1.f;
kr = sigm;
}
printf("call=%i\n", call);
if (!fftw) { // || (fftw && call != 2)) {
if (scale == scal - 1) {
gaussianBlur(src, out, W_L, H_L, kg * RetinexScales[scale], true);
@ -1319,7 +1314,6 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
}
}
}
}
#ifdef _OPENMP
@ -1359,9 +1353,6 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
}
// srcBuffer.reset();
if (scal == 1) {//only if user select scal = 1
float kval = 1.f;
@ -1422,14 +1413,14 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
#pragma omp parallel for
#endif
for (int i = 0; i < H_L; i++)
for (int i = 0; i < H_L; i++) {
for (int j = 0; j < W_L; j++) {
float buf = LIM01(luminance[i][j] / 32768.f);
buf = reti_contrast.getVal(buf);
buf *= 32768.f;
luminance[i][j] = buf;
}
}
}
srcBuffer.reset();
@ -1442,7 +1433,6 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
stddv = 0.f;
mean_stddv2(luminance, mean, stddv, W_L, H_L, maxtr, mintr);
// printf("mean=%f std=%f delta=%f maxtr=%f mintr=%f\n", mean, stddv, delta, maxtr, mintr);
if (locRETtransCcurve && mean != 0.f && stddv != 0.f) { //if curve
float asig = 0.166666f / stddv;
@ -1503,9 +1493,7 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
maxi = maxtr - epsil;
}
delta = maxi - mini;
// printf("maxi=%f mini=%f mean=%f std=%f delta=%f maxtr=%f mintr=%f\n", maxi, mini, mean, stddv, delta, maxtr, mintr);
float delta = maxi - mini;
if (!delta) {
delta = 1.0f;
}
@ -1614,8 +1602,6 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
delete [] copylumBuffer;
copylumBuffer = nullptr;
// printf("mean=%f std=%f maxtr=%f mintr=%f\n", mean, stddv, maxtr, mintr);
} else {
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16)
@ -1655,6 +1641,5 @@ void ImProcFunctions::MSRLocal(int call, int sp, bool fftw, int lum, float** red
Tsigma = stddv;
Tmin = mintr;
Tmax = maxtr;
}
}
}

View File

@ -283,20 +283,20 @@ void calcFrameBrightnessFactor(unsigned int frame, uint32_t datalen, LUTu *histo
{
float medians[4];
for(int i = 0; i < 4; ++i) {
for (int i = 0; i < 4; ++i) {
//find median of histogram
uint32_t median = 0, count = 0;
uint32_t lmedian = 0, count = 0;
while(count < datalen / 2) {
count += (*histo[i])[median];
++median;
while (count < datalen / 2) {
count += (*histo[i])[lmedian];
++lmedian;
}
const float weight = (count - datalen / 2.f) / (*histo[i])[median - 1];
medians[i] = rtengine::intp(weight, (float)(median - 2), (float)(median - 1));
const float weight = (count - datalen / 2.f) / (*histo[i])[lmedian - 1];
medians[i] = rtengine::intp(weight, (float)(lmedian - 2), (float)(lmedian - 1));
}
for(int i = 0; i < 4; ++i) {
for (int i = 0; i < 4; ++i) {
brightnessFactor[i] = medians[frame] / medians[i];
}

View File

@ -686,7 +686,7 @@ enum ProcEventCode {
EvLocallabcontresid = 660,
Evlocallabnoiselumf0 = 661,
Evlocallabnoiselumf2 = 662,
EvLocallabblurcbdl = 663,
//EvLocallabblurcbdl = 663,
Evlocallabblendmaskcb = 664,
Evlocallabradmaskcb = 665,
Evlocallabchromaskcb = 666,

View File

@ -3686,7 +3686,6 @@ LocallabParams::LocallabSpot::LocallabSpot() :
sensicb(60),
clarityml(0.1),
contresid(0),
blurcbdl(0.),
softradiuscb(0.0),
enacbMask(false),
CCmaskcbcurve{
@ -4309,7 +4308,6 @@ bool LocallabParams::LocallabSpot::operator ==(const LocallabSpot& other) const
&& sensicb == other.sensicb
&& clarityml == other.clarityml
&& contresid == other.contresid
&& blurcbdl == other.blurcbdl
&& softradiuscb == other.softradiuscb
&& enacbMask == other.enacbMask
&& CCmaskcbcurve == other.CCmaskcbcurve
@ -5833,7 +5831,6 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || spot_edited->sensicb, "Locallab", "Sensicb_" + index_str, spot.sensicb, keyFile);
saveToKeyfile(!pedited || spot_edited->clarityml, "Locallab", "Clarityml_" + index_str, spot.clarityml, keyFile);
saveToKeyfile(!pedited || spot_edited->contresid, "Locallab", "Contresid_" + index_str, spot.contresid, keyFile);
saveToKeyfile(!pedited || spot_edited->blurcbdl, "Locallab", "Blurcbdl_" + index_str, spot.blurcbdl, keyFile);
saveToKeyfile(!pedited || spot_edited->softradiuscb, "Locallab", "Softradiuscb_" + index_str, spot.softradiuscb, keyFile);
saveToKeyfile(!pedited || spot_edited->enacbMask, "Locallab", "EnacbMask_" + index_str, spot.enacbMask, keyFile);
saveToKeyfile(!pedited || spot_edited->CCmaskcbcurve, "Locallab", "CCmaskcbCurve_" + index_str, spot.CCmaskcbcurve, keyFile);
@ -7577,7 +7574,6 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "Locallab", "Sensicb_" + index_str, pedited, spot.sensicb, spotEdited.sensicb);
assignFromKeyfile(keyFile, "Locallab", "Clarityml_" + index_str, pedited, spot.clarityml, spotEdited.clarityml);
assignFromKeyfile(keyFile, "Locallab", "Contresid_" + index_str, pedited, spot.contresid, spotEdited.contresid);
assignFromKeyfile(keyFile, "Locallab", "Blurcbdl_" + index_str, pedited, spot.blurcbdl, spotEdited.blurcbdl);
assignFromKeyfile(keyFile, "Locallab", "Softradiuscb_" + index_str, pedited, spot.softradiuscb, spotEdited.softradiuscb);
assignFromKeyfile(keyFile, "Locallab", "EnacbMask_" + index_str, pedited, spot.enacbMask, spotEdited.enacbMask);
assignFromKeyfile(keyFile, "Locallab", "CCmaskcbCurve_" + index_str, pedited, spot.CCmaskcbcurve, spotEdited.CCmaskcbcurve);

View File

@ -1397,7 +1397,6 @@ struct LocallabParams {
int sensicb;
double clarityml;
int contresid;
double blurcbdl;
double softradiuscb;
bool enacbMask;
std::vector<double> CCmaskcbcurve;

View File

@ -690,7 +690,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
LUMINANCECURVE, // EvLocallabcontresid
LUMINANCECURVE, // Evlocallabnoiselumf0
LUMINANCECURVE, // Evlocallabnoiselumf2
LUMINANCECURVE, // Evlocallabblurcbdl
0, // Evlocallabblurcbdl
LUMINANCECURVE, // Evlocallabblendmaskcb
LUMINANCECURVE, // Evlocallabradmaskcb
LUMINANCECURVE, // Evlocallabchromaskcb

View File

@ -1180,7 +1180,6 @@ void ImProcFunctions::ToneMapFattal02(Imagefloat *rgb, const FattalToneMappingPa
scale = (oldMedian == 0.f || newMedian == 0.f) ? 65535.f : (oldMedian / newMedian); // avoid Nan
} else {
scale = 65535.f;
{
float ratio = 0.f;
int ww, hh;

View File

@ -309,7 +309,6 @@ ControlSpotPanel::ControlSpotPanel():
sigc::mem_fun(
*this, &ControlSpotPanel::qualityMethodChanged));
ctboxqualitymethod->pack_start(*qualityMethod_);
// pack_start(*ctboxqualitymethod);
if (showtooltip) {
expTransGrad_->set_tooltip_text(M("TP_LOCALLAB_TRANSIT_TOOLTIP"));
@ -319,21 +318,9 @@ ControlSpotPanel::ControlSpotPanel():
if (showtooltip) {
transit_->set_tooltip_text(M("TP_LOCALLAB_TRANSIT_TOOLTIP"));
}
if (showtooltip) {
transitweak_->set_tooltip_text(M("TP_LOCALLAB_TRANSITWEAK_TOOLTIP"));
}
if (showtooltip) {
feather_->set_tooltip_text(M("TP_LOCALLAB_FEATH_TOOLTIP"));
}
if (showtooltip) {
transitgrad_->set_tooltip_text(M("TP_LOCALLAB_TRANSITGRAD_TOOLTIP"));
}
if (showtooltip) {
scopemask_->set_tooltip_text(M("TP_LOCALLAB_SCOPEMASK_TOOLTIP"));
}

View File

@ -470,9 +470,8 @@ void HistogramRGBArea::updateBackBuffer (int r, int g, int b, const Glib::ustrin
cc->set_antialias(Cairo::ANTIALIAS_NONE);
cc->set_line_width (1.0 * s);
double xpos;
if ( r != -1 && g != -1 && b != -1 ) {
double xpos;
if (needRed) {
// Red
cc->set_source_rgb(1.0, 0.0, 0.0);

View File

@ -1093,7 +1093,6 @@ private:
Gtk::Frame* const levFrame;
Adjuster* const chromacbdl;
Adjuster* const threshold;
Adjuster* const blurcbdl;
Adjuster* const clarityml;
Adjuster* const contresid;
Adjuster* const softradiuscb;

View File

@ -438,159 +438,63 @@ void LocallabTone::setDefaults(const rtengine::procparams::ProcParams* defParams
void LocallabTone::adjusterChanged(Adjuster* a, double newval)
{
if (isLocActivated && exp->getEnabled()) {
if (isLocActivated && exp->getEnabled() && listener) {
const auto spName = " (" + escapeHtmlChars(spotName) + ")";
if (a == amount) {
if (listener) {
listener->panelChanged(Evlocallabamount,
amount->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == stren) {
if (listener) {
listener->panelChanged(Evlocallabstren,
stren->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == gamma) {
if (listener) {
listener->panelChanged(Evlocallabgamma,
gamma->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == satur) {
if (listener) {
listener->panelChanged(Evlocallabsatur,
satur->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == estop) {
if (listener) {
listener->panelChanged(Evlocallabestop,
estop->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == scaltm) {
if (listener) {
listener->panelChanged(Evlocallabscaltm,
scaltm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == rewei) {
if (listener) {
listener->panelChanged(Evlocallabrewei,
rewei->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == softradiustm) {
if (listener) {
listener->panelChanged(Evlocallabsoftradiustm,
softradiustm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == sensitm) {
if (listener) {
listener->panelChanged(Evlocallabsensitm,
sensitm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == blendmasktm) {
if (listener) {
listener->panelChanged(Evlocallabblendmasktm,
blendmasktm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == lapmasktm) {
if (listener) {
listener->panelChanged(Evlocallablapmasktm,
lapmasktm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == radmasktm) {
if (listener) {
listener->panelChanged(Evlocallabradmasktm,
radmasktm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == chromasktm) {
if (listener) {
listener->panelChanged(Evlocallabchromasktm,
chromasktm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == gammasktm) {
if (listener) {
listener->panelChanged(Evlocallabgammasktm,
gammasktm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == slomasktm) {
if (listener) {
listener->panelChanged(Evlocallabslomasktm,
slomasktm->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
listener->panelChanged(Evlocallabamount, amount->getTextValue() + spName);
} else if (a == stren) {
listener->panelChanged(Evlocallabstren, stren->getTextValue() + spName);
} else if (a == gamma) {
listener->panelChanged(Evlocallabgamma, gamma->getTextValue() + spName);
} else if (a == satur) {
listener->panelChanged(Evlocallabsatur, satur->getTextValue() + spName);
} else if (a == estop) {
listener->panelChanged(Evlocallabestop, estop->getTextValue() + spName);
} else if (a == scaltm) {
listener->panelChanged(Evlocallabscaltm, scaltm->getTextValue() + spName);
} else if (a == rewei) {
listener->panelChanged(Evlocallabrewei, rewei->getTextValue() + spName);
} else if (a == softradiustm) {
listener->panelChanged(Evlocallabsoftradiustm, softradiustm->getTextValue() + spName);
} else if (a == sensitm) {
listener->panelChanged(Evlocallabsensitm, sensitm->getTextValue() + spName);
} else if (a == blendmasktm) {
listener->panelChanged(Evlocallabblendmasktm, blendmasktm->getTextValue() + spName);
} else if (a == lapmasktm) {
listener->panelChanged(Evlocallablapmasktm, lapmasktm->getTextValue() + spName);
} else if (a == radmasktm) {
listener->panelChanged(Evlocallabradmasktm, radmasktm->getTextValue() + spName);
} else if (a == chromasktm) {
listener->panelChanged(Evlocallabchromasktm, chromasktm->getTextValue() + spName);
} else if (a == gammasktm) {
listener->panelChanged(Evlocallabgammasktm, gammasktm->getTextValue() + spName);
} else if (a == slomasktm) {
listener->panelChanged(Evlocallabslomasktm, slomasktm->getTextValue() + spName);
}
}
}
void LocallabTone::curveChanged(CurveEditor* ce)
{
if (isLocActivated && exp->getEnabled()) {
if (isLocActivated && exp->getEnabled() && listener) {
const auto spName = M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")";
if (ce == CCmasktmshape) {
if (listener) {
listener->panelChanged(EvlocallabCCmasktmshape,
M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (ce == LLmasktmshape) {
if (listener) {
listener->panelChanged(EvlocallabLLmasktmshape,
M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (ce == HHmasktmshape) {
if (listener) {
listener->panelChanged(EvlocallabHHmasktmshape,
M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (ce == Lmasktmshape) {
if (listener) {
listener->panelChanged(EvlocallabLmasktmshape,
M("HISTORY_CUSTOMCURVE") + " (" + escapeHtmlChars(spotName) + ")");
}
listener->panelChanged(EvlocallabCCmasktmshape, spName);
} else if (ce == LLmasktmshape) {
listener->panelChanged(EvlocallabLLmasktmshape, spName);
} else if (ce == HHmasktmshape) {
listener->panelChanged(EvlocallabHHmasktmshape, spName);
} else if (ce == Lmasktmshape) {
listener->panelChanged(EvlocallabLmasktmshape, spName);
}
}
}
void LocallabTone::enabledChanged()
{
if (isLocActivated) {
if (listener) {
if (exp->getEnabled()) {
listener->panelChanged(EvLocenatonemap,
M("GENERAL_ENABLED") + " (" + escapeHtmlChars(spotName) + ")");
} else {
listener->panelChanged(EvLocenatonemap,
M("GENERAL_DISABLED") + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (isLocActivated && listener) {
listener->panelChanged(EvLocenatonemap, (exp->getEnabled() ? M("GENERAL_ENABLED") : M("GENERAL_DISABLED"))
+ " (" + escapeHtmlChars(spotName) + ")");
}
}
@ -3683,7 +3587,6 @@ LocallabCBDL::LocallabCBDL():
levFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LEVFRA")))),
chromacbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMACBDL"), 0., 1.5, 0.01, 0.))),
threshold(Gtk::manage(new Adjuster(M("TP_DIRPYREQUALIZER_THRESHOLD"), 0, 1., 0.01, 0.2))),
blurcbdl(Gtk::manage(new Adjuster(M("TP_LOCALLAB_BLURCBDL"), 0., 100., 0.1, 0.))),
clarityml(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARITYML"), 0.1, 100., 0.1, 0.1))),
contresid(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CONTRESID"), -100, 100, 1, 0))),
softradiuscb(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), 0.0, 100.0, 0.5, 0.))),
@ -3719,8 +3622,6 @@ LocallabCBDL::LocallabCBDL():
threshold->setAdjusterListener(this);
blurcbdl->setAdjusterListener(this);
clarityml->setAdjusterListener(this);
contresid->setAdjusterListener(this);
@ -3803,7 +3704,6 @@ LocallabCBDL::LocallabCBDL():
levBox->pack_start(*threshold);
levFrame->add(*levBox);
pack_start(*levFrame);
// pack_start(*blurcbdl);
Gtk::Frame* const residFrame = Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")));
residFrame->set_label_align(0.025, 0.5);
ToolParamBlock* const residBox = Gtk::manage(new ToolParamBlock());
@ -3929,7 +3829,6 @@ void LocallabCBDL::read(const rtengine::procparams::ProcParams* pp, const Params
chromacbdl->setValue(spot.chromacbdl);
threshold->setValue(spot.threshold);
blurcbdl->setValue(spot.blurcbdl);
clarityml->setValue(spot.clarityml);
contresid->setValue((double)spot.contresid);
softradiuscb->setValue(spot.softradiuscb);
@ -3973,7 +3872,6 @@ void LocallabCBDL::write(rtengine::procparams::ProcParams* pp, ParamsEdited* ped
spot.chromacbdl = chromacbdl->getValue();
spot.threshold = threshold->getValue();
spot.blurcbdl = blurcbdl->getValue();
spot.clarityml = clarityml->getValue();
spot.contresid = contresid->getIntValue();
spot.softradiuscb = softradiuscb->getValue();
@ -4008,7 +3906,6 @@ void LocallabCBDL::setDefaults(const rtengine::procparams::ProcParams* defParams
chromacbdl->setDefault(defSpot.chromacbdl);
threshold->setDefault(defSpot.threshold);
blurcbdl->setDefault(defSpot.blurcbdl);
clarityml->setDefault(defSpot.clarityml);
contresid->setDefault((double)defSpot.contresid);
softradiuscb->setDefault(defSpot.softradiuscb);
@ -4055,13 +3952,6 @@ void LocallabCBDL::adjusterChanged(Adjuster* a, double newval)
}
}
if (a == blurcbdl) {
if (listener) {
listener->panelChanged(EvLocallabblurcbdl,
blurcbdl->getTextValue() + " (" + escapeHtmlChars(spotName) + ")");
}
}
if (a == clarityml) {
if (listener) {
listener->panelChanged(EvLocallabclarityml,

View File

@ -1452,7 +1452,6 @@ void ParamsEdited::initFrom(const std::vector<rtengine::procparams::ProcParams>&
locallab.spots.at(j).sensicb = locallab.spots.at(j).sensicb && pSpot.sensicb == otherSpot.sensicb;
locallab.spots.at(j).clarityml = locallab.spots.at(j).clarityml && pSpot.clarityml == otherSpot.clarityml;
locallab.spots.at(j).contresid = locallab.spots.at(j).contresid && pSpot.contresid == otherSpot.contresid;
locallab.spots.at(j).blurcbdl = locallab.spots.at(j).blurcbdl && pSpot.blurcbdl == otherSpot.blurcbdl;
locallab.spots.at(j).softradiuscb = locallab.spots.at(j).softradiuscb && pSpot.softradiuscb == otherSpot.softradiuscb;
locallab.spots.at(j).enacbMask = locallab.spots.at(j).enacbMask && pSpot.enacbMask == otherSpot.enacbMask;
locallab.spots.at(j).CCmaskcbcurve = locallab.spots.at(j).CCmaskcbcurve && pSpot.CCmaskcbcurve == otherSpot.CCmaskcbcurve;
@ -4717,10 +4716,6 @@ void ParamsEdited::combine(rtengine::procparams::ProcParams& toEdit, const rteng
toEdit.locallab.spots.at(i).contresid = mods.locallab.spots.at(i).contresid;
}
if (locallab.spots.at(i).blurcbdl) {
toEdit.locallab.spots.at(i).blurcbdl = mods.locallab.spots.at(i).blurcbdl;
}
if (locallab.spots.at(i).softradiuscb) {
toEdit.locallab.spots.at(i).softradiuscb = mods.locallab.spots.at(i).softradiuscb;
}
@ -6483,7 +6478,6 @@ LocallabParamsEdited::LocallabSpotEdited::LocallabSpotEdited(bool v) :
sensicb(v),
clarityml(v),
contresid(v),
blurcbdl(v),
softradiuscb(v),
enacbMask(v),
CCmaskcbcurve(v),
@ -6981,7 +6975,6 @@ void LocallabParamsEdited::LocallabSpotEdited::set(bool v)
CCmaskcbcurve = v;
LLmaskcbcurve = v;
HHmaskcbcurve = v;
blurcbdl = v;
blendmaskcb = v;
radmaskcb = v;
chromaskcb = v;

View File

@ -810,7 +810,6 @@ public:
bool sensicb;
bool clarityml;
bool contresid;
bool blurcbdl;
bool softradiuscb;
bool enacbMask;
bool CCmaskcbcurve;