Merge branch 'dev' into cleanup_59

This commit is contained in:
Ingo Weyrich
2020-06-14 17:11:15 +02:00
10 changed files with 706 additions and 529 deletions

View File

@@ -462,16 +462,14 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const
cp.t_ly = static_cast<float>(params->wavelet.hueskin2.getTopLeft()) / 100.0f;
cp.b_ry = static_cast<float>(params->wavelet.hueskin2.getBottomRight()) / 100.0f;
cp.t_ry = static_cast<float>(params->wavelet.hueskin2.getTopRight()) / 100.0f;
cp.numlevH = params->wavelet.threshold;
cp.numlevH = params->wavelet.threshold -1;
//shadows
cp.b_lsl = static_cast<float>(params->wavelet.bllev.getBottomLeft());
cp.t_lsl = static_cast<float>(params->wavelet.bllev.getTopLeft());
cp.b_rsl = static_cast<float>(params->wavelet.bllev.getBottomRight());
cp.t_rsl = static_cast<float>(params->wavelet.bllev.getTopRight());
cp.numlevS = 9 - params->wavelet.threshold2;
int maxlevS = cp.numlevH;
cp.numlevS = rtengine::max(cp.numlevS, maxlevS);
cp.numlevS = params->wavelet.threshold2; //rtengine::max(cp.numlevS, maxlevS);
//highlight
cp.b_lhl = static_cast<float>(params->wavelet.hllev.getBottomLeft());
cp.t_lhl = static_cast<float>(params->wavelet.hllev.getTopLeft());
@@ -3498,10 +3496,12 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz,
float red0 = 0.005f * (110.f - lowthr);
float red1 = 0.008f * (110.f - lowthr);
float red2 = 0.011f * (110.f - lowthr);
// int n = 0;
// int m = 0;
// int p = 0;
// int q = 0;
for (int i = 0; i < W_L * H_L; i++) {
float kLlevH = 1.f;
float kLlevS = 1.f;
float kLlev = 1.f;
if (cpMul < 0.f) {
lbeta = 1.f; // disabled for negatives values "less contrast"
@@ -3605,41 +3605,43 @@ void ImProcFunctions::ContAllL(float *koeLi[12], float maxkoeLi, bool lipschitz,
float aaarS = (alpha - 1.f) / (cp.t_rsl - cp.b_rsl);
float bbbrS = 1.f - cp.b_rsl * aaarS;
// if (level <= cp.numlevH) { //in function of levels
float klevred = 2.f * (waOpacityCurveSH[level * 55.5f] - 0.5f);
if(klevred > 0.f && level <= 6) {// level < 6 to avoid bad use of the curve if user put negative values positives
if (level <= cp.numlevH) { //in function of levels
if ((LL100 > cp.t_lhl * kH[level] && LL100 < cp.t_rhl * kH[level])) {
kLlevH = alpha;
kLlev = alpha;
} else if ((LL100 > cp.b_lhl * kH[level] && LL100 <= cp.t_lhl * kH[level])) {
kLlevH = aaal * LL100 + bbal;
kLlev = aaal * LL100 + bbal;
} else if ((LL100 > cp.t_rhl * kH[level] && LL100 <= cp.b_rhl * kH[level])) {
kLlevH = aaar * LL100 + bbbr;
kLlev = aaar * LL100 + bbbr;
} else {
kLlevH = 1.f;
kLlev = 1.f;
}
kLlevH = 1.f + (kLlevH - 1.f) * klevred;
}
// if (level >= (9 - cp.numlevS)) {
if(klevred < 0.f && level >= 3) {//level > 3 to avoid bad use of the curve if user put positives values negatives
if (level >= cp.numlevS - 1) {
// if(klevred < 0.f && level >= 3) {//level > 3 to avoid bad use of the curve if user put positives values negatives
if ((LL100 > cp.t_lsl && LL100 < cp.t_rsl)) {
kLlevS = alpha;
kLlev = alpha;
// n++;
} else if ((LL100 > cp.b_lsl && LL100 <= cp.t_lsl)) {
kLlevS = aaalS * LL100 + bbalS;
kLlev = aaalS * LL100 + bbalS;
// m++;
} else if ((LL100 > cp.t_rsl && LL100 <= cp.b_rsl)) {
kLlevS = aaarS * LL100 + bbbrS;
kLlev = aaarS * LL100 + bbbrS;
// p++;
} else {
kLlevS = 1.f;
kLlev = 1.f;
// q++;
}
kLlevS = 1.f - (kLlevS - 1.f) * klevred;
}
} else {
kLlevH = kLlevS = alpha;
kLlev = alpha;
}
WavCoeffs_L[dir][i] *= (kLlevH * kLlevS);
WavCoeffs_L[dir][i] *= (kLlev);
}
// printf("lev=%i n=%i m=%i p=%i q=%i\n", level, n, m, p, q);
}
if (waOpacityCurveW) {