Make some more files cppcheck clean (#6133)
* Make some more files cppcheck clean * revert change of dcrop.cc from last commit * Replace calculation: y = pow(x, 1/ (2.f * 2.f)) by y = sqrt(sqrt(x)) * Revert "Replace calculation: y = pow(x, 1/ (2.f * 2.f)) by y = sqrt(sqrt(x))" This reverts commit d639c67249f1723fa9f9e55e0442afcb862eba91.
This commit is contained in:
parent
7a2463a81a
commit
f727477710
@ -65,7 +65,7 @@ public:
|
||||
virtual void onDestroy() = 0;
|
||||
};
|
||||
|
||||
Cache(unsigned long _size, Hook* _hook = nullptr) :
|
||||
explicit Cache(unsigned long _size, Hook* _hook = nullptr) :
|
||||
store_size(_size),
|
||||
hook(_hook)
|
||||
{
|
||||
|
@ -1132,7 +1132,6 @@ void Crop::update(int todo)
|
||||
/*
|
||||
if (params.icm.workingTRC == "Custom") { //exec TRC IN free
|
||||
const Glib::ustring profile = params.icm.workingProfile;
|
||||
|
||||
if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") {
|
||||
const int cw = baseCrop->getWidth();
|
||||
const int ch = baseCrop->getHeight();
|
||||
@ -1159,22 +1158,6 @@ void Crop::update(int todo)
|
||||
}
|
||||
}
|
||||
|
||||
/*xref=000;yref=000;
|
||||
if (colortest && cropw>115 && croph>115)
|
||||
for(int j=1;j<5;j++){
|
||||
xref+=j*30;yref+=j*30;
|
||||
if (settings->verbose) {
|
||||
printf("after rgbProc RGB Xr%i Yr%i Skip=%d R=%f G=%f B=%f \n",xref,yref,skip,
|
||||
baseCrop->r[(int)(xref/skip)][(int)(yref/skip)]/256,
|
||||
baseCrop->g[(int)(xref/skip)][(int)(yref/skip)]/256,
|
||||
baseCrop->b[(int)(xref/skip)][(int)(yref/skip)]/256);
|
||||
printf("after rgbProc Lab Xr%i Yr%i Skip=%d l=%f a=%f b=%f \n",xref,yref,skip,
|
||||
laboCrop->L[(int)(xref/skip)][(int)(yref/skip)]/327,
|
||||
laboCrop->a[(int)(xref/skip)][(int)(yref/skip)]/327,
|
||||
laboCrop->b[(int)(xref/skip)][(int)(yref/skip)]/327);
|
||||
}
|
||||
}*/
|
||||
|
||||
// apply luminance operations
|
||||
if (todo & (M_LUMINANCE + M_COLOR)) { //
|
||||
//I made a little change here. Rather than have luminanceCurve (and others) use in/out lab images, we can do more if we copy right here.
|
||||
|
@ -322,7 +322,7 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buff
|
||||
hfnbrave += fabs(ncie->sh_p[i1][j1] - lpf[i1][j1]);
|
||||
}
|
||||
|
||||
impish[i][j] = (hpfabs > ((hfnbrave - hpfabs) * impthrDiv24));
|
||||
impish[i][j] = static_cast<float>(hpfabs > ((hfnbrave - hpfabs) * impthrDiv24));
|
||||
}
|
||||
|
||||
#ifdef __SSE2__
|
||||
@ -353,7 +353,7 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buff
|
||||
hfnbrave += fabs(ncie->sh_p[i1][j1] - lpf[i1][j1]);
|
||||
}
|
||||
|
||||
impish[i][j] = (hpfabs > ((hfnbrave - hpfabs) * impthrDiv24));
|
||||
impish[i][j] = static_cast<float>(hpfabs > ((hfnbrave - hpfabs) * impthrDiv24));
|
||||
}
|
||||
|
||||
for (; j < width; j++) {
|
||||
@ -365,7 +365,7 @@ void ImProcFunctions::impulse_nrcam (CieImage* ncie, double thresh, float **buff
|
||||
hfnbrave += fabs(ncie->sh_p[i1][j1] - lpf[i1][j1]);
|
||||
}
|
||||
|
||||
impish[i][j] = (hpfabs > ((hfnbrave - hpfabs) * impthrDiv24));
|
||||
impish[i][j] = static_cast<float>(hpfabs > ((hfnbrave - hpfabs) * impthrDiv24));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ inline void copyAndClamp(const LabImage *src, unsigned char *dst, const double r
|
||||
gbuffer[j] = Color::gamma2curve[G];
|
||||
bbuffer[j] = Color::gamma2curve[B];
|
||||
}
|
||||
for (int j = 0; j < W; ++j) {
|
||||
|
||||
for (j = 0; j < W; ++j) {
|
||||
dst[ix++] = uint16ToUint8Rounded(rbuffer[j]);
|
||||
dst[ix++] = uint16ToUint8Rounded(gbuffer[j]);
|
||||
dst[ix++] = uint16ToUint8Rounded(bbuffer[j]);
|
||||
|
@ -543,8 +543,8 @@ BENCHFUN
|
||||
|
||||
// calculate contrast based blend factors to reduce sharpening in regions with low contrast
|
||||
JaggedArray<float> blend(W, H);
|
||||
float contrast = params->sharpenMicro.contrast / 100.0;
|
||||
buildBlendMask(luminance, blend, W, H, contrast);
|
||||
float contrastThreshold = params->sharpenMicro.contrast / 100.0;
|
||||
buildBlendMask(luminance, blend, W, H, contrastThreshold);
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
|
@ -1182,30 +1182,28 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const
|
||||
float* noisevarhue = new float[GHL * GWL];
|
||||
int GW2L = (GWL + 1) / 2;
|
||||
|
||||
float nvlh[13] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 0.7f, 0.5f}; //high value
|
||||
float nvll[13] = {0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.7f, 0.8f, 1.f, 1.f, 1.f}; //low value
|
||||
constexpr float nvlh[13] = {1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 1.f, 0.7f, 0.5f}; //high value
|
||||
constexpr float nvll[13] = {0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.7f, 0.8f, 1.f, 1.f, 1.f}; //low value
|
||||
|
||||
float seuillow = 3000.f;//low
|
||||
float seuilhigh = 18000.f;//high
|
||||
int i = 10 - cp.ballum;
|
||||
float ac = (nvlh[i] - nvll[i]) / (seuillow - seuilhigh);
|
||||
float bc = nvlh[i] - seuillow * ac;
|
||||
constexpr float seuillow = 3000.f;//low
|
||||
constexpr float seuilhigh = 18000.f;//high
|
||||
const int index = 10 - cp.ballum;
|
||||
const float ac = (nvlh[index] - nvll[index]) / (seuillow - seuilhigh);
|
||||
const float bc = nvlh[index] - seuillow * ac;
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
|
||||
#endif
|
||||
|
||||
for (int ir = 0; ir < GHL; ir++)
|
||||
for (int jr = 0; jr < GWL; jr++) {
|
||||
float lN = labco->L[ir][jr];
|
||||
|
||||
if (lN < seuillow) {
|
||||
noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvlh[i];
|
||||
noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvlh[index];
|
||||
} else if (lN < seuilhigh) {
|
||||
noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = ac * lN + bc;
|
||||
} else {
|
||||
noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvll[i];
|
||||
noisevarlum[(ir >> 1)*GW2L + (jr >> 1)] = nvll[index];
|
||||
}
|
||||
}
|
||||
|
||||
@ -2265,11 +2263,7 @@ void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int kall, const
|
||||
absciss = asig * std::fabs(tempwav) + bsig;
|
||||
} else {
|
||||
absciss = amean * std::fabs(tempwav);
|
||||
float k = sig;
|
||||
if(sig > 1.f) {
|
||||
k = SQR(sig);
|
||||
}
|
||||
float abs = pow(2.f * absciss, (1.f / k));
|
||||
float abs = pow(2.f * absciss, (1.f / SQR(sig)));
|
||||
absciss = 0.5f * abs;
|
||||
}
|
||||
float kc = wavguid.getVal(absciss) -1.f;
|
||||
|
Loading…
x
Reference in New Issue
Block a user