From 6e55f6bab5ac9289c4bacf2e6cded9b92c3a3d24 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 8 Apr 2017 22:41:46 +0200 Subject: [PATCH] Fixed a lot of issues reported by cppcheck 1.78 --- rtengine/CA_correct_RT.cc | 7 +- rtengine/EdgePreservingDecomposition.cc | 3 + rtengine/PF_correct_RT.cc | 111 +++++++++++------------ rtengine/cfa_linedn_RT.cc | 2 +- rtengine/color.cc | 2 +- rtengine/color.h | 2 +- rtengine/curves.h | 2 +- rtengine/diagonalcurves.cc | 3 +- rtengine/dirpyr_equalizer.cc | 7 +- rtengine/flatcurves.cc | 6 +- rtengine/fujicompressed.cc | 6 +- rtengine/hilite_recon.cc | 6 +- rtengine/iccjpeg.cc | 3 +- rtengine/iccstore.cc | 2 +- rtengine/iimage.h | 18 ++++ rtengine/imagefloat.cc | 4 +- rtengine/imageio.cc | 2 +- rtengine/imagesource.h | 2 +- rtengine/improccoordinator.cc | 3 + rtengine/improcfun.cc | 112 ++++++++++++------------ rtengine/improcfun.h | 4 +- rtengine/ipsharpen.cc | 18 ++-- rtengine/iptransform.cc | 1 - rtengine/ipwavelet.cc | 2 +- rtengine/pipettebuffer.cc | 6 -- rtengine/pixelshift.cc | 3 +- rtengine/previewimage.cc | 49 ++++------- rtengine/procparams.cc | 1 - rtengine/rawimagesource.cc | 6 +- rtengine/rawimagesource.h | 4 +- rtengine/rtthumbnail.cc | 6 +- rtengine/stdimagesource.cc | 2 +- rtengine/stdimagesource.h | 2 +- rtgui/batchqueue.cc | 1 - rtgui/editorpanel.cc | 6 -- rtgui/filebrowser.cc | 1 - rtgui/guiutils.cc | 6 +- rtgui/guiutils.h | 4 +- rtgui/inspector.cc | 48 +++++----- rtgui/inspector.h | 4 +- rtgui/preferences.cc | 3 +- 41 files changed, 226 insertions(+), 254 deletions(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index 8471a1393..e1493ae40 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -45,15 +45,14 @@ bool LinEqSolve(int nDim, double* pfMatr, double* pfVect, double* pfSolution) // //============================================================================== - double fMaxElem; double fAcc; - int i, j, k, m; + int i, j, k; for(k = 0; k < (nDim - 1); k++) { // base row of matrix // search of line with max element - fMaxElem = fabs( pfMatr[k * nDim + k] ); - m = k; + double fMaxElem = fabs( pfMatr[k * nDim + k] ); + int m = k; for (i = k + 1; i < nDim; i++) { if(fMaxElem < fabs(pfMatr[i * nDim + k]) ) { diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 43a68f024..8c1ca56a7 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -395,6 +395,9 @@ SSEFUNCTION void MultiDiagonalSymmetricMatrix::VectorProduct(float* RESTRICT Pro } } } +#ifdef _OPENMP + static_cast(chunkSize); // to silence cppcheck warning +#endif } bool MultiDiagonalSymmetricMatrix::CreateIncompleteCholeskyFactorization(int MaxFillAbove) diff --git a/rtengine/PF_correct_RT.cc b/rtengine/PF_correct_RT.cc index 6808fd4eb..cfe1e2ba3 100644 --- a/rtengine/PF_correct_RT.cc +++ b/rtengine/PF_correct_RT.cc @@ -663,12 +663,10 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d const int width = src->W, height = src->H; const float piid = 3.14159265f / 180.f; - float shfabs, shmed; - int i1, j1, tot; + int i1, j1; const float eps = 1.0f; const float eps2 = 0.01f; - float shsum, dirsh, norm, sum; float** sraa; sraa = new float*[height]; @@ -848,13 +846,13 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d __m128 onev = F2V(1.0f); #endif // __SSE2__ #ifdef _OPENMP - #pragma omp for private(shfabs, shmed,i1,j1) + #pragma omp for private(i1,j1) #endif for (int i = 0; i < height; i++) { for (j = 0; j < 2; j++) { - shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = 0; j1 <= j + 2; j1++ ) { @@ -879,8 +877,8 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d } for (; j < width - 2; j++) { - shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 <= j + 2; j1++ ) { @@ -893,8 +891,8 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d #else for (; j < width - 2; j++) { - shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 <= j + 2; j1++ ) { @@ -907,8 +905,8 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d #endif for (; j < width; j++) { - shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->sh_p[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 < width; j1++ ) { @@ -927,7 +925,7 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d { int j; #ifdef _OPENMP - #pragma omp for private(shsum,norm,dirsh,sum,i1,j1) schedule(dynamic,16) + #pragma omp for private(i1,j1) schedule(dynamic,16) #endif for (int i = 0; i < height; i++) { @@ -936,10 +934,10 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d continue; } - norm = 0.0f; - shsum = 0.0f; - sum = 0.0f; - tot = 0; + float norm = 0.0f; + float shsum = 0.0f; + float sum = 0.0f; + int tot = 0; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = 0; j1 <= j + 2; j1++ ) { @@ -953,7 +951,7 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d sum += src->sh_p[i1][j1]; tot++; - dirsh = 1.f / (SQR(src->sh_p[i1][j1] - src->sh_p[i][j]) + eps); + float dirsh = 1.f / (SQR(src->sh_p[i1][j1] - src->sh_p[i][j]) + eps); shsum += dirsh * src->sh_p[i1][j1]; norm += dirsh; } @@ -972,10 +970,10 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d continue; } - norm = 0.0f; - shsum = 0.0f; - sum = 0.0f; - tot = 0; + float norm = 0.0f; + float shsum = 0.0f; + float sum = 0.0f; + int tot = 0; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 <= j + 2; j1++ ) { @@ -989,7 +987,7 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d sum += src->sh_p[i1][j1]; tot++; - dirsh = 1.f / (SQR(src->sh_p[i1][j1] - src->sh_p[i][j]) + eps); + float dirsh = 1.f / (SQR(src->sh_p[i1][j1] - src->sh_p[i][j]) + eps); shsum += dirsh * src->sh_p[i1][j1]; norm += dirsh; } @@ -1008,10 +1006,10 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d continue; } - norm = 0.0f; - shsum = 0.0f; - sum = 0.0f; - tot = 0; + float norm = 0.0f; + float shsum = 0.0f; + float sum = 0.0f; + int tot = 0; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 < width; j1++ ) { @@ -1025,7 +1023,7 @@ SSEFUNCTION void ImProcFunctions::Badpixelscam(CieImage * src, CieImage * dst, d sum += src->sh_p[i1][j1]; tot++; - dirsh = 1.f / (SQR(src->sh_p[i1][j1] - src->sh_p[i][j]) + eps); + float dirsh = 1.f / (SQR(src->sh_p[i1][j1] - src->sh_p[i][j]) + eps); shsum += dirsh * src->sh_p[i1][j1]; norm += dirsh; } @@ -1272,13 +1270,10 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d t1.set(); const int width = src->W, height = src->H; -// const float piid=3.14159265f/180.f; - float shfabs, shmed; - int i1, j1, tot; + int i1, j1; const float eps = 1.0f; const float eps2 = 0.01f; - float shsum, dirsh, norm, sum; float** sraa; sraa = new float*[height]; @@ -1455,13 +1450,13 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d __m128 onev = F2V(1.0f); #endif // __SSE2__ #ifdef _OPENMP - #pragma omp for private(shfabs, shmed,i1,j1) + #pragma omp for private(i1,j1) #endif for (int i = 0; i < height; i++) { for (j = 0; j < 2; j++) { - shfabs = fabs(src->L[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->L[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = 0; j1 <= j + 2; j1++ ) { @@ -1474,7 +1469,7 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d #ifdef __SSE2__ for (; j < width - 5; j += 4) { - shfabsv = vabsf(LVFU(src->L[i][j]) - LVFU(tmL[i][j])); + vfloat shfabsv = vabsf(LVFU(src->L[i][j]) - LVFU(tmL[i][j])); shmedv = ZEROV; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) @@ -1486,8 +1481,8 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d } for (; j < width - 2; j++) { - shfabs = fabs(src->L[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->L[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 <= j + 2; j1++ ) { @@ -1500,8 +1495,8 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d #else for (; j < width - 2; j++) { - shfabs = fabs(src->L[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->L[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 <= j + 2; j1++ ) { @@ -1514,8 +1509,8 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d #endif for (; j < width; j++) { - shfabs = fabs(src->L[i][j] - tmL[i][j]); - shmed = 0.0f; + float shfabs = fabs(src->L[i][j] - tmL[i][j]); + float shmed = 0.0f; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 < width; j1++ ) { @@ -1534,7 +1529,7 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d { int j; #ifdef _OPENMP - #pragma omp for private(shsum,norm,dirsh,sum,i1,j1) schedule(dynamic,16) + #pragma omp for private(i1,j1) schedule(dynamic,16) #endif for (int i = 0; i < height; i++) { @@ -1543,10 +1538,10 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d continue; } - norm = 0.0f; - shsum = 0.0f; - sum = 0.0f; - tot = 0; + float norm = 0.0f; + float shsum = 0.0f; + float sum = 0.0f; + int tot = 0; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = 0; j1 <= j + 2; j1++ ) { @@ -1560,7 +1555,7 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d sum += src->L[i1][j1]; tot++; - dirsh = 1.f / (SQR(src->L[i1][j1] - src->L[i][j]) + eps); + float dirsh = 1.f / (SQR(src->L[i1][j1] - src->L[i][j]) + eps); shsum += dirsh * src->L[i1][j1]; norm += dirsh; } @@ -1579,10 +1574,10 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d continue; } - norm = 0.0f; - shsum = 0.0f; - sum = 0.0f; - tot = 0; + float norm = 0.0f; + float shsum = 0.0f; + float sum = 0.0f; + int tot = 0; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 <= j + 2; j1++ ) { @@ -1596,7 +1591,7 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d sum += src->L[i1][j1]; tot++; - dirsh = 1.f / (SQR(src->L[i1][j1] - src->L[i][j]) + eps); + float dirsh = 1.f / (SQR(src->L[i1][j1] - src->L[i][j]) + eps); shsum += dirsh * src->L[i1][j1]; norm += dirsh; } @@ -1615,10 +1610,10 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d continue; } - norm = 0.0f; - shsum = 0.0f; - sum = 0.0f; - tot = 0; + float norm = 0.0f; + float shsum = 0.0f; + float sum = 0.0f; + int tot = 0; for (i1 = max(0, i - 2); i1 <= min(i + 2, height - 1); i1++ ) for (j1 = j - 2; j1 < width; j1++ ) { @@ -1632,7 +1627,7 @@ SSEFUNCTION void ImProcFunctions::BadpixelsLab(LabImage * src, LabImage * dst, d sum += src->L[i1][j1]; tot++; - dirsh = 1.f / (SQR(src->L[i1][j1] - src->L[i][j]) + eps); + float dirsh = 1.f / (SQR(src->L[i1][j1] - src->L[i][j]) + eps); shsum += dirsh * src->L[i1][j1]; norm += dirsh; } diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index 21fcfb1e5..b5578898b 100644 --- a/rtengine/cfa_linedn_RT.cc +++ b/rtengine/cfa_linedn_RT.cc @@ -46,7 +46,7 @@ void RawImageSource::CLASS cfa_linedn(float noise) const float clip_pt = 0.8 * initialGain * 65535.0; - float eps = 1e-5; //tolerance to avoid dividing by zero + const float eps = 1e-5; //tolerance to avoid dividing by zero const float gauss[5] = {0.20416368871516755, 0.18017382291138087, 0.1238315368057753, 0.0662822452863612, 0.02763055063889883}; const float rolloff[8] = {0, 0.135335, 0.249352, 0.411112, 0.606531, 0.800737, 0.945959, 1}; //gaussian with sigma=3 diff --git a/rtengine/color.cc b/rtengine/color.cc index acb50eae5..f045a84d9 100644 --- a/rtengine/color.cc +++ b/rtengine/color.cc @@ -1817,7 +1817,7 @@ void Color::Lab2Yuv(float L, float a, float b, float &Y, float &u, float &v) v = 9.0 * Y / (X + 15 * Y + 3 * Z) - v0; } -void Color::Yuv2Lab(float Yin, float u, float v, float &L, float &a, float &b, double wp[3][3]) +void Color::Yuv2Lab(float Yin, float u, float v, float &L, float &a, float &b, const double wp[3][3]) { float u1 = u + u0; float v1 = v + v0; diff --git a/rtengine/color.h b/rtengine/color.h index 6fda40f12..5889095ca 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -498,7 +498,7 @@ public: * @param a channel [-42000 ; +42000] ; can be more than 42000 (return value) * @param b channel [-42000 ; +42000] ; can be more than 42000 (return value) */ - static void Yuv2Lab(float Y, float u, float v, float &L, float &a, float &b, double wp[3][3]); + static void Yuv2Lab(float Y, float u, float v, float &L, float &a, float &b, const double wp[3][3]); /** diff --git a/rtengine/curves.h b/rtengine/curves.h index cd4384bb4..c20b78772 100644 --- a/rtengine/curves.h +++ b/rtengine/curves.h @@ -273,7 +273,7 @@ public: } float R = hlrange / (val * comp); - return log(1.0 + Y) * R; + return log1p(Y) * R; } else { return exp_scale; } diff --git a/rtengine/diagonalcurves.cc b/rtengine/diagonalcurves.cc index 9ab17a0f4..1c75e3059 100644 --- a/rtengine/diagonalcurves.cc +++ b/rtengine/diagonalcurves.cc @@ -33,7 +33,6 @@ DiagonalCurve::DiagonalCurve (const std::vector& p, int poly_pn) { ppn = poly_pn > 65500 ? 65500 : poly_pn; - bool identity = true; if (ppn < 500) { hashSize = 100; // Arbitrary cut-off value, but mutliple of 10 @@ -46,6 +45,7 @@ DiagonalCurve::DiagonalCurve (const std::vector& p, int poly_pn) if (p.size() < 3) { kind = DCT_Empty; } else { + bool identity = true; kind = (DiagonalCurveType)p[0]; if (kind == DCT_Linear || kind == DCT_Spline || kind == DCT_NURBS) { @@ -364,7 +364,6 @@ double DiagonalCurve::getVal (double t) const } return poly_y[k_lo] + (t - poly_x[k_lo]) * dyByDx[k_lo]; - break; } case DCT_Empty : diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index e0527140b..8f3ebae9f 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -368,9 +368,6 @@ void ImProcFunctions :: dirpyr_equalizercam (CieImage *ncie, float ** src, float idirpyr_eq_channelcam(dirpyrlo[level], dirpyrlo[level - 1], buffer, srcwidth, srcheight, level, multi, dirpyrThreshold , h_p, C_p, skinprot, b_l, t_l, t_r); } - - scale = scales[0]; - idirpyr_eq_channelcam(dirpyrlo[0], dst, buffer, srcwidth, srcheight, 0, multi, dirpyrThreshold, h_p, C_p, skinprot, b_l, t_l, t_r); @@ -625,7 +622,7 @@ SSEFUNCTION void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** da //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], 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) +void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[6], 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) { const float skinprotneg = -skinprot; const float factorHard = (1.f - skinprotneg / 100.f); @@ -717,7 +714,7 @@ void ImProcFunctions::idirpyr_eq_channel(float ** data_coarse, float ** data_fin } -void ImProcFunctions::idirpyr_eq_channelcam(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, float b_l, float t_l, float t_r) +void ImProcFunctions::idirpyr_eq_channelcam(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[6], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, float b_l, float t_l, float t_r) { const float skinprotneg = -skinprot; diff --git a/rtengine/flatcurves.cc b/rtengine/flatcurves.cc index ae1a895ff..fe5ecc5e1 100644 --- a/rtengine/flatcurves.cc +++ b/rtengine/flatcurves.cc @@ -30,9 +30,8 @@ FlatCurve::FlatCurve (const std::vector& p, bool isPeriodic, int poly_pn poly_x.clear(); poly_y.clear(); - bool identity = true; - if (p.size() > 4) { + bool identity = true; kind = (FlatCurveType)p[0]; if (kind == FCT_MinMaxCPoints) { @@ -146,7 +145,6 @@ void FlatCurve::CtrlPoints_set () double length; double dx; double dy; - double xp1, xp2, yp2, xp3; bool startLinear, endLinear; startLinear = (rightTangent[i] == 0.) || (y[i] == y[i + 1]); @@ -171,6 +169,7 @@ void FlatCurve::CtrlPoints_set () sc_length[k++] = length; total_length += length; } else { + double xp1, xp2, yp2, xp3; if (startLinear) { xp1 = x[i]; } else { @@ -363,7 +362,6 @@ double FlatCurve::getVal (double t) const } return poly_y[k_lo] + (t - poly_x[k_lo]) * dyByDx[k_lo]; - break; } /*case Parametric : { diff --git a/rtengine/fujicompressed.cc b/rtengine/fujicompressed.cc index 75ca46c04..c5dfa8f13 100644 --- a/rtengine/fujicompressed.cc +++ b/rtengine/fujicompressed.cc @@ -151,7 +151,6 @@ void CLASS copy_line_to_xtrans (struct fuji_compressed_block* info, int cur_line ushort *lineBufB[3]; ushort *lineBufG[6]; ushort *lineBufR[3]; - unsigned pixel_count; ushort* line_buf; int index; @@ -169,7 +168,7 @@ void CLASS copy_line_to_xtrans (struct fuji_compressed_block* info, int cur_line } while (row_count < 6) { - pixel_count = 0; + unsigned pixel_count = 0; while (static_cast(pixel_count) < cur_block_width) { switch (xtrans_abs[row_count][ (pixel_count % 6)]) { @@ -203,7 +202,6 @@ void CLASS copy_line_to_bayer (struct fuji_compressed_block *info, int cur_line, ushort *lineBufB[3]; ushort *lineBufG[6]; ushort *lineBufR[3]; - unsigned pixel_count; ushort *line_buf; int fuji_bayer[2][2]; @@ -227,7 +225,7 @@ void CLASS copy_line_to_bayer (struct fuji_compressed_block *info, int cur_line, } while (row_count < 6) { - pixel_count = 0; + unsigned pixel_count = 0; while (static_cast(pixel_count) < cur_block_width) { switch (fuji_bayer[row_count & 1][pixel_count & 1]) { diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc index b0b211e3d..f9e630f9d 100644 --- a/rtengine/hilite_recon.cc +++ b/rtengine/hilite_recon.cc @@ -217,7 +217,6 @@ void RawImageSource::boxblur_resamp(float **src, float **dst, float ** temp, int #pragma omp parallel #endif { - float tempval; #ifdef _OPENMP #pragma omp for #endif @@ -227,7 +226,7 @@ void RawImageSource::boxblur_resamp(float **src, float **dst, float ** temp, int for (int row = 0; row < H; row++) { int len = box + 1; - tempval = src[row][0] / len; + float tempval = src[row][0] / len; for (int j = 1; j <= box; j++) { tempval += src[row][j] / len; @@ -339,12 +338,11 @@ void RawImageSource::boxblur_resamp(float **src, float **dst, float ** temp, int // process remaining columns #pragma omp single { - float tempval; //vertical blur for (int col = (W / samp) - ((W / samp) % numCols); col < W / samp; col++) { int len = box + 1; - tempval = temp[0][col] / len; + float tempval = temp[0][col] / len; for (int i = 1; i <= box; i++) { tempval += temp[i][col] / len; diff --git a/rtengine/iccjpeg.cc b/rtengine/iccjpeg.cc index 31aa0ec7c..5e652296f 100644 --- a/rtengine/iccjpeg.cc +++ b/rtengine/iccjpeg.cc @@ -55,7 +55,6 @@ write_icc_profile (j_compress_ptr cinfo, { unsigned int num_markers; /* total number of markers we'll write */ int cur_marker = 1; /* per spec, counting starts at 1 */ - unsigned int length; /* number of bytes to write in this marker */ /* Calculate the number of markers we'll need, rounding up of course */ num_markers = icc_data_len / MAX_DATA_BYTES_IN_MARKER; @@ -66,7 +65,7 @@ write_icc_profile (j_compress_ptr cinfo, while (icc_data_len > 0) { /* length of profile to put in this marker */ - length = icc_data_len; + unsigned int length = icc_data_len; /* number of bytes to write in this marker */ if (length > MAX_DATA_BYTES_IN_MARKER) { length = MAX_DATA_BYTES_IN_MARKER; diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index 4c749e3c4..5aff1d335 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -864,7 +864,7 @@ cmsHPROFILE rtengine::ICCStore::makeStdGammaProfile(cmsHPROFILE iprof) } tags[tag_count]; const uint32_t gamma = 0x239; - int gamma_size =(gamma == 0 || gamma == 256) ? 12 : 14; + int gamma_size = 14; int data_size =(gamma_size + 3) & ~3; for (uint32_t i = 0; i < tag_count; i++) { diff --git a/rtengine/iimage.h b/rtengine/iimage.h index b06a188bc..149ed3787 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -376,6 +376,9 @@ public: v(y, x) = tmp; } } +#ifdef _OPENMP + static_cast(bigImage); // to silence cppcheck warning +#endif } } @@ -460,6 +463,9 @@ public: v(i, j) = v(i, x); v(i, x) = temp; } +#ifdef _OPENMP + static_cast(bigImage); // to silence cppcheck warning +#endif } void vflip () @@ -482,6 +488,9 @@ public: v(i, j) = v(y, j); v(y, j) = temp; } +#ifdef _OPENMP + static_cast(bigImage); // to silence cppcheck warning +#endif } void calcHist(unsigned int *hist16) @@ -790,6 +799,9 @@ public: b(y, x) = tmp; } } +#ifdef _OPENMP + static_cast(bigImage); // to silence cppcheck warning +#endif } } @@ -878,6 +890,9 @@ public: b(i, j) = b(i, x); b(i, x) = temp; } +#ifdef _OPENMP + static_cast(bigImage); // to silence cppcheck warning +#endif } void vflip () @@ -908,6 +923,9 @@ public: b(i, j) = b(y, j); b(y, j) = tempB; } +#ifdef _OPENMP + static_cast(bigImage); // to silence cppcheck warning +#endif } void calcGrayscaleHist(unsigned int *hist16) diff --git a/rtengine/imagefloat.cc b/rtengine/imagefloat.cc index a0a7e293c..30871c9b1 100644 --- a/rtengine/imagefloat.cc +++ b/rtengine/imagefloat.cc @@ -447,10 +447,8 @@ void Imagefloat::calcCroppedHistogram(const ProcParams ¶ms, float scale, LUT #pragma omp for nowait for (int y = y1; y < y2; y++) { - int i; - for (int x = x1; x < x2; x++) { - i = (int)(facRed * r(y, x) + facGreen * g(y, x) + facBlue * b(y, x)); + int i = (int)(facRed * r(y, x) + facGreen * g(y, x) + facBlue * b(y, x)); if (i < 0) { i = 0; diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 197055858..8bc5362fd 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -696,7 +696,7 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, sFormat = IIOSF_HALF; return IMIO_SUCCESS; }*/ - if ((samplesperpixel == 3 || samplesperpixel == 4) && bitspersample == 32) { + if (bitspersample == 32) { sFormat = IIOSF_FLOAT; return IMIO_SUCCESS; } diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 8b4377c89..d6d0a618f 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -101,7 +101,7 @@ public: } virtual void getFullSize (int& w, int& h, int tr = TR_NONE) {} - virtual void getSize (PreviewProps pp, int& w, int& h) = 0; + virtual void getSize (const PreviewProps &pp, int& w, int& h) = 0; virtual int getRotateDegree() const { return 0; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 5aa70e75d..f9bbda301 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -608,6 +608,9 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) #endif lhist16 += lhist16thr; } +#ifdef _OPENMP + static_cast(numThreads); // to silence cppcheck warning +#endif CurveFactory::complexLCurve (params.labCurve.brightness, params.labCurve.contrast, params.labCurve.lcurve, lhist16, lumacurve, histLCurve, scale == 1 ? 1 : 16, utili); } diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 362fdc09a..c68158634 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -181,6 +181,9 @@ void ImProcFunctions::firstAnalysis (const Imagefloat* const original, const Pro histogram += hist; } +#ifdef _OPENMP + static_cast(numThreads); // to silence cppcheck warning +#endif } else { for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { @@ -212,7 +215,6 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh LUTf dLcurve; LUTu hist16JCAM; bool jp = false; - float val; //preparate for histograms CIECAM if(pW != 1) { //only with improccoordinator @@ -222,7 +224,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh hist16JCAM.clear(); for (int i = 0; i < 32768; i++) { //# 32768*1.414 approximation maxi for chroma - val = (double)i / 32767.0; + float val = (double)i / 32767.0; dLcurve[i] = CLIPD(val); } } @@ -230,7 +232,6 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh LUTf dCcurve; LUTu hist16_CCAM; bool chropC = false; - float valc; if(pW != 1) { //only with improccoordinator dCcurve(65536, 0); @@ -238,7 +239,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh hist16_CCAM.clear(); for (int i = 0; i < 48000; i++) { //# 32768*1.414 approximation maxi for chroma - valc = (double)i / 47999.0; + float valc = (double)i / 47999.0; dCcurve[i] = CLIPD(valc); } } @@ -1208,9 +1209,9 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh artifact = 1.f; } - int hotbad = 0; float chrom = 50.f; { + int hotbad = 0; ImProcFunctions::badpixcam (ncie, artifact, 5, 2 , b_l, t_l, t_r, b_r, params->dirpyrequalizer.skinprotect , chrom, hotbad); //enabled remove artifacts for cbDL } } @@ -1233,15 +1234,15 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh //if(params->dirpyrequalizer.enabled) if(execsharp) { if(params->dirpyrequalizer.enabled /*&& (execsharp)*/) { - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; - int choice = 0; //not disabled in case of ! always 0 // if (params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; if(rtt == 1) { + float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + int choice = 0; //not disabled in case of ! always 0 dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scalecd); //contrast by detail adapted to CIECAM } } @@ -1314,7 +1315,6 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh double chsacol = 327.; int libr = 0; int colch = 0; - float sa_t; if(curveMode == ColorAppearanceParams::TC_MODE_BRIGHT) { brli = 70.0; @@ -1358,7 +1358,7 @@ void ImProcFunctions::ciecam_02 (CieImage* ncie, double adap, int begh, int endh if(colch == 0) { posc = CLIP((int)(ncie->C_p[i][j] * chsacol)); //450.0 approximative factor for s 320 for M } else if(colch == 1) { - sa_t = 100.f * sqrt(ncie->C_p[i][j] / ncie->Q_p[i][j]); //Q_p always > 0 + float sa_t = 100.f * sqrt(ncie->C_p[i][j] / ncie->Q_p[i][j]); //Q_p always > 0 posc = CLIP((int)(sa_t * chsacol)); } else /*if(colch == 2)*/ { posc = CLIP((int)(ncie->M_p[i][j] * chsacol)); @@ -2590,15 +2590,15 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int begh, int //if(params->dirpyrequalizer.enabled) if(execsharp) { if(params->dirpyrequalizer.enabled /*&& execsharp*/) { - float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; - float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; - float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; - float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; - int choice = 0; // I have not suppress this statement in case of !! always to 0 // if(params->dirpyrequalizer.algo=="FI") choice=0; // else if(params->dirpyrequalizer.algo=="LA") choice=1; if(rtt == 1) { + float b_l = static_cast(params->dirpyrequalizer.hueskin.value[0]) / 100.0f; + float t_l = static_cast(params->dirpyrequalizer.hueskin.value[1]) / 100.0f; + float b_r = static_cast(params->dirpyrequalizer.hueskin.value[2]) / 100.0f; + float t_r = static_cast(params->dirpyrequalizer.hueskin.value[3]) / 100.0f; + int choice = 0; // I have not suppress this statement in case of !! always to 0 lab->deleteLab(); dirpyr_equalizercam(ncie, ncie->sh_p, ncie->sh_p, ncie->W, ncie->H, ncie->h_p, ncie->C_p, params->dirpyrequalizer.mult, params->dirpyrequalizer.threshold, params->dirpyrequalizer.skinprotect, true, params->dirpyrequalizer.gamutlab, b_l, t_l, t_r, b_r, choice, scalecd); //contrast by detail adapted to CIECAM lab->reallocLab(); @@ -2999,10 +2999,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer {wprof[2][0], wprof[2][1], wprof[2][2]} }; - // For tonecurve histogram - float lumimulf[3] = {static_cast(lumimul[0]), static_cast(lumimul[1]), static_cast(lumimul[2])}; - - bool mixchannels = (params->chmixer.red[0] != 100 || params->chmixer.red[1] != 0 || params->chmixer.red[2] != 0 || params->chmixer.green[0] != 0 || params->chmixer.green[1] != 100 || params->chmixer.green[2] != 0 || params->chmixer.blue[0] != 0 || params->chmixer.blue[1] != 0 || params->chmixer.blue[2] != 100); @@ -3219,9 +3215,6 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer float gamvalr = 125.f; float gamvalg = 125.f; float gamvalb = 125.f; - double nr = 0; - double ng = 0; - double nb = 0; bool computeMixerAuto = params->blackwhite.autoc && (autor < -5000.f); if(bwrgam < 0) { @@ -3260,6 +3253,9 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer histToneCurveCompression = log2(65536 / toneCurveHistSize); } + // For tonecurve histogram + const float lumimulf[3] = {static_cast(lumimul[0]), static_cast(lumimul[1]), static_cast(lumimul[2])}; + #define TS 112 @@ -4406,6 +4402,10 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer //end auto chmix if (computeMixerAuto) { // auto channel-mixer + double nr = 0; + double ng = 0; + double nb = 0; + #ifdef _OPENMP #pragma omp parallel for schedule(dynamic, 16) reduction(+:nr,ng,nb) #endif @@ -4938,9 +4938,6 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go rlob = rlo; } - //second degree - float aa, bb, cc; - float v0 = 0.15f; //fixed value of reducac=0.3 //secondeg_end (reducac, v0, aa, bb, cc); @@ -4951,6 +4948,9 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go kl = (-1.f / 0.85f) * v + (1.f) / 0.85f; //Low light ==> decrease action after v=0.15 } } else { //color + float v0 = 0.15f; + //second degree + float aa, bb, cc; secondeg_end (reducac, v0, aa, bb, cc); float aab, bbb; secondeg_begin (0.7f, v0, aab, bbb); @@ -5010,7 +5010,6 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go // mid tones float km; float v0m = 0.5f; //max action - float v0mm = 0.5f; //max if(v < v0m) { float aam, bbm; @@ -5018,6 +5017,7 @@ void ImProcFunctions::toningsmh (float r, float g, float b, float &ro, float &go secondeg_begin (reducac, vend, aam, bbm); km = aam * v * v + bbm * v; //verification = good } else { + float v0mm = 0.5f; //max float aamm, bbmm, ccmm; secondeg_end (reducac, v0mm, aamm, bbmm, ccmm); km = aamm * v * v + bbmm * v + ccmm; //verification good @@ -5205,17 +5205,16 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g kl = aab * v * v + bbb * v; } - //rl gl bl - float RedL, GreenL, BlueL; - float krl = rl / (rl + gl + bl); - float kgl = gl / (rl + gl + bl); - float kbl = bl / (rl + gl + bl); if(SatLow > 0.f) { - float kmgb; + //rl gl bl + float krl = rl / (rl + gl + bl); + float kgl = gl / (rl + gl + bl); + float kbl = bl / (rl + gl + bl); + float RedL, GreenL, BlueL; if(g < 20000.f || b < 20000.f || r < 20000.f) { - kmgb = min(r, g, b); //I have tested ...0.85 compromise... + float kmgb = min(r, g, b); //I have tested ...0.85 compromise... kl *= pow((kmgb / 20000.f), 0.85f); } @@ -5262,10 +5261,9 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g kh = aa0 * v * v + bb0 * v; } - float kmgb; if(g > 45535.f || b > 45535.f || r > 45535.f) { - kmgb = max(r, g, b); + float kmgb = max(r, g, b); float cora = 1.f / (45535.f - 65535.f); float corb = 1.f - cora * 45535.f; float cor = kmgb * cora + corb; @@ -5277,12 +5275,12 @@ void ImProcFunctions::toning2col (float r, float g, float b, float &ro, float &g kh*=cor;*/ } - float RedH, GreenH, BlueH; - float krh = rh / (rh + gh + bh); - float kgh = gh / (rh + gh + bh); - float kbh = bh / (rh + gh + bh); if(SatHigh > 0.f) { + float RedH, GreenH, BlueH; + float krh = rh / (rh + gh + bh); + float kgh = gh / (rh + gh + bh); + float kbh = bh / (rh + gh + bh); RedH = 1.f + (SatHigh * krh) * kh * rlh * balanH; //1.2 if(krh > 0.f) { @@ -5610,14 +5608,14 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu const float amountchroma = (float) settings->amchroma; TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); - double wip[3][3] = { + const double wip[3][3] = { {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, {wiprof[2][0], wiprof[2][1], wiprof[2][2]} }; TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (params->icm.working); - double wp[3][3] = { + const double wp[3][3] = { {wprof[0][0], wprof[0][1], wprof[0][2]}, {wprof[1][0], wprof[1][1], wprof[1][2]}, {wprof[2][0], wprof[2][1], wprof[2][2]} @@ -5774,7 +5772,6 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu float l_r;//Luminance Lab in 0..1 l_r = Lprov1 / 100.f; { - float khue = 1.9f; //in reserve in case of! float valparam = float((lhCurve->getVal(Color::huelab_to_huehsv2(HH)) - 0.5f)); //get l_r=f(H) float valparamneg; valparamneg = valparam; @@ -5788,6 +5785,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } else //for negative { + float khue = 1.9f; //in reserve in case of! l_r *= (1.f + khue * valparamneg); } } @@ -5894,7 +5892,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } if (clut) { // begin C=f(L) - float factorskin, factorsat, factor, factorskinext, interm; + float factorskin, factorsat, factor, factorskinext; float chromaCfactor = (clcurve[LL * 655.35f]) / (LL * 655.35f); //apply C=f(L) float curf = 0.7f; //empirical coeff because curve is more progressive float scale = 100.0f / 100.1f; //reduction in normal zone for curve C @@ -5928,7 +5926,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } if(chromaCfactor > 1.0) { - interm = (chromaCfactor - 1.0f) * 100.0f; + float interm = (chromaCfactor - 1.0f) * 100.0f; factorskin = 1.0f + (interm * scale) / 100.0f; factorskinext = 1.0f + (interm * scaleext) / 100.0f; } else { @@ -5954,7 +5952,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu }//Lab C=f(C) pipette if (ccut) { - float factorskin, factorsat, factor, factorskinext, interm; + float factorskin, factorsat, factor, factorskinext; float chroma = sqrt(SQR(atmp) + SQR(btmp) + 0.001f); float chromaCfactor = (satcurve[chroma * adjustr]) / (chroma * adjustr); //apply C=f(C) float curf = 0.7f; //empirical coeff because curve is more progressive @@ -5989,7 +5987,7 @@ SSEFUNCTION void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBu } if(chromaCfactor > 1.0) { - interm = (chromaCfactor - 1.0f) * 100.0f; + float interm = (chromaCfactor - 1.0f) * 100.0f; factorskin = 1.0f + (interm * scale) / 100.0f; factorskinext = 1.0f + (interm * scaleext) / 100.0f; } else { @@ -6649,15 +6647,15 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double return; } - lodev = (lodev / (log(2.f) * losum)); - hidev = (hidev / (log(2.f) * hisum)); +// lodev = (lodev / (log(2.f) * losum)); +// hidev = (hidev / (log(2.f) * hisum)); - if (octile[6] > log((float)imax + 1.f) / log2(2.f)) { //if very overxposed image + if (octile[6] > log1p((float)imax) / log2(2.f)) { //if very overxposed image octile[6] = 1.5f * octile[5] - 0.5f * octile[4]; overex = 2; } - if (octile[7] > log((float)imax + 1.f) / log2(2.f)) { //if overexposed + if (octile[7] > log1p((float)imax) / log2(2.f)) { //if overexposed octile[7] = 1.5f * octile[6] - 0.5f * octile[5]; overex = 1; } @@ -6730,10 +6728,10 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double median <<= histcompr; shc <<= histcompr; - //prevent division by 0 - if (lodev == 0.f) { - lodev = 1.f; - } +// //prevent division by 0 +// if (lodev == 0.f) { +// lodev = 1.f; +// } //compute exposure compensation as geometric mean of the amount that //sets the mean or median at middle gray, and the amount that sets the estimated top @@ -6929,7 +6927,7 @@ double ImProcFunctions::getAutoDistor (const Glib::ustring &fname, int thumb_si int dist_result = calcDistortion (thumbGray, rawGray, width, h_thumb, 1, dist_amount); if(dist_result == -1) { // not enough features found, try increasing max. number of features by factor 4 - dist_result = calcDistortion (thumbGray, rawGray, width, h_thumb, 4, dist_amount); + calcDistortion (thumbGray, rawGray, width, h_thumb, 4, dist_amount); } delete thumbGray; diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index e70083b0b..028e55a33 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -331,8 +331,8 @@ public: void dirpyr_equalizer (float ** src, float ** dst, int srcwidth, int srcheight, float ** l_a, float ** l_b, float ** dest_a, float ** dest_b, const double * mult, const double dirpyrThreshold, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale);//Emil's directional pyramid wavelet void dirpyr_equalizercam (CieImage* ncie, float ** src, float ** dst, int srcwidth, int srcheight, float ** h_p, float ** C_p, const double * mult, const double dirpyrThreshold, const double skinprot, bool execdir, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale);//Emil's directional pyramid wavelet void dirpyr_channel (float ** data_fine, float ** data_coarse, int width, int height, int level, int scale); - void idirpyr_eq_channel (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float multi[5], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice); - void idirpyr_eq_channelcam (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float multi[5], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, float b_l, float t_l, float t_r); + void idirpyr_eq_channel (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float multi[6], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice); + void idirpyr_eq_channelcam (float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float multi[6], const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, float b_l, float t_l, float t_r); void defringe (LabImage* lab); void defringecam (CieImage* ncie); void badpixcam (CieImage* ncie, double rad, int thr, int mode, float b_l, float t_l, float t_r, float b_r, float skinprot, float chrom, int hotbad); diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 5b96fc971..00196591e 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -267,26 +267,26 @@ void ImProcFunctions::sharpenHaloCtrl (float** luminance, float** blurmap, float #endif for (int i = 2; i < H - 2; i++) { - float max1 = 0, max2 = 0, min1 = 0, min2 = 0, maxn, minn, np1, np2, np3, min_, max_, labL; + float max1 = 0, max2 = 0, min1 = 0, min2 = 0; for (int j = 2; j < W - 2; j++) { // compute 3 iterations, only forward - np1 = 2.f * (nL[i - 2][j] + nL[i - 2][j + 1] + nL[i - 2][j + 2] + nL[i - 1][j] + nL[i - 1][j + 1] + nL[i - 1][j + 2] + nL[i] [j] + nL[i] [j + 1] + nL[i] [j + 2]) / 27.f + nL[i - 1][j + 1] / 3.f; - np2 = 2.f * (nL[i - 1][j] + nL[i - 1][j + 1] + nL[i - 1][j + 2] + nL[i] [j] + nL[i] [j + 1] + nL[i] [j + 2] + nL[i + 1][j] + nL[i + 1][j + 1] + nL[i + 1][j + 2]) / 27.f + nL[i] [j + 1] / 3.f; - np3 = 2.f * (nL[i] [j] + nL[i] [j + 1] + nL[i] [j + 2] + nL[i + 1][j] + nL[i + 1][j + 1] + nL[i + 1][j + 2] + nL[i + 2][j] + nL[i + 2][j + 1] + nL[i + 2][j + 2]) / 27.f + nL[i + 1][j + 1] / 3.f; + float np1 = 2.f * (nL[i - 2][j] + nL[i - 2][j + 1] + nL[i - 2][j + 2] + nL[i - 1][j] + nL[i - 1][j + 1] + nL[i - 1][j + 2] + nL[i] [j] + nL[i] [j + 1] + nL[i] [j + 2]) / 27.f + nL[i - 1][j + 1] / 3.f; + float np2 = 2.f * (nL[i - 1][j] + nL[i - 1][j + 1] + nL[i - 1][j + 2] + nL[i] [j] + nL[i] [j + 1] + nL[i] [j + 2] + nL[i + 1][j] + nL[i + 1][j + 1] + nL[i + 1][j + 2]) / 27.f + nL[i] [j + 1] / 3.f; + float np3 = 2.f * (nL[i] [j] + nL[i] [j + 1] + nL[i] [j + 2] + nL[i + 1][j] + nL[i + 1][j + 1] + nL[i + 1][j + 2] + nL[i + 2][j] + nL[i + 2][j + 1] + nL[i + 2][j + 2]) / 27.f + nL[i + 1][j + 1] / 3.f; // Max/Min of all these deltas and the last two max/min - maxn = max(np1, np2, np3); - minn = min(np1, np2, np3); - max_ = max(max1, max2, maxn); - min_ = min(min1, min2, minn); + float maxn = max(np1, np2, np3); + float minn = min(np1, np2, np3); + float max_ = max(max1, max2, maxn); + float min_ = min(min1, min2, minn); // Shift the queue max1 = max2; max2 = maxn; min1 = min2; min2 = minn; - labL = luminance[i][j]; + float labL = luminance[i][j]; if (max_ < labL) { max_ = labL; diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 04ba4966d..3c6d47344 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -390,7 +390,6 @@ static void calcGradientParams (int oW, int oH, const GradientParams& gradient, // division with extremely small numbers gp.transpose = true; gradient_angle += 0.5 * rtengine::RT_PI; - cosgrad = cos (gradient_angle); double gxc = gradient_center_x; gradient_center_x = 1.0 - gradient_center_y; gradient_center_y = gxc; diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index 5e0188856..629dfcb66 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -149,7 +149,7 @@ SSEFUNCTION void ImProcFunctions::ip_wavelet(LabImage * lab, LabImage * dst, int MunsellDebugInfo* MunsDebugInfo = new MunsellDebugInfo(); #endif TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (params->icm.working); - double wip[3][3] = { + const double wip[3][3] = { {wiprof[0][0], wiprof[0][1], wiprof[0][2]}, {wiprof[1][0], wiprof[1][1], wiprof[1][2]}, {wiprof[2][0], wiprof[2][1], wiprof[2][2]} diff --git a/rtengine/pipettebuffer.cc b/rtengine/pipettebuffer.cc index 6f6d9dcef..8981b6480 100644 --- a/rtengine/pipettebuffer.cc +++ b/rtengine/pipettebuffer.cc @@ -28,12 +28,6 @@ PipetteBuffer::PipetteBuffer(::EditDataProvider *dataProvider) : PipetteBuffer::~PipetteBuffer() { flush(); -#ifndef NDEBUG - imgFloatBuffer = (Imagefloat*)(0xbaadf00d); -#endif -#ifndef NDEBUG - LabBuffer = (LabImage*)(0xbaadf00d); -#endif } void PipetteBuffer::createBuffer(int width, int height) diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 744950ba8..0a6d24688 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -994,10 +994,11 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA #ifdef PIXELSHIFTDEV if(detectMotion || (adaptive && checkGreen)) { bool skipNext = false; + float gridMax = 0.f; #else if(adaptive && checkGreen) { -#endif float gridMax; +#endif #ifdef PIXELSHIFTDEV diff --git a/rtengine/previewimage.cc b/rtengine/previewimage.cc index 1bf11dc17..29b319d2c 100644 --- a/rtengine/previewimage.cc +++ b/rtengine/previewimage.cc @@ -76,23 +76,17 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext previewImage = Cairo::ImageSurface::create(Cairo::FORMAT_RGB24, w, h); previewImage->flush(); - #pragma omp parallel - { - const unsigned char *src; - unsigned char *dst; - #pragma omp for schedule(static,10) + #pragma omp parallel for + for (unsigned int i = 0; i < (unsigned int)(h); ++i) { + const unsigned char *src = data + i * w * 3; + unsigned char *dst = previewImage->get_data() + i * w * 4; - for (unsigned int i = 0; i < (unsigned int)(h); ++i) { - src = data + i * w * 3; - dst = previewImage->get_data() + i * w * 4; + for (unsigned int j = 0; j < (unsigned int)(w); ++j) { + unsigned char r = *(src++); + unsigned char g = *(src++); + unsigned char b = *(src++); - for (unsigned int j = 0; j < (unsigned int)(w); ++j) { - unsigned char r = *(src++); - unsigned char g = *(src++); - unsigned char b = *(src++); - - poke255_uc(dst, r, g, b); - } + poke255_uc(dst, r, g, b); } } previewImage->mark_dirty(); @@ -139,29 +133,22 @@ PreviewImage::PreviewImage (const Glib::ustring &fname, const Glib::ustring &ext if (data) { int w, h; - // double scale = 1.; w = output->getWidth(); h = output->getHeight(); previewImage = Cairo::ImageSurface::create(Cairo::FORMAT_RGB24, w, h); previewImage->flush(); - #pragma omp parallel - { - const unsigned char *src; - unsigned char *dst; - #pragma omp for schedule(static,10) + #pragma omp parallel for + for (unsigned int i = 0; i < (unsigned int)(h); i++) { + const unsigned char *src = data + i * w * 3; + unsigned char *dst = previewImage->get_data() + i * w * 4; - for (unsigned int i = 0; i < (unsigned int)(h); i++) { - src = data + i * w * 3; - dst = previewImage->get_data() + i * w * 4; + for (unsigned int j = 0; j < (unsigned int)(w); j++) { + unsigned char r = *(src++); + unsigned char g = *(src++); + unsigned char b = *(src++); - for (unsigned int j = 0; j < (unsigned int)(w); j++) { - unsigned char r = *(src++); - unsigned char g = *(src++); - unsigned char b = *(src++); - - poke255_uc(dst, r, g, b); - } + poke255_uc(dst, r, g, b); } } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 35d690eb4..cad810205 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -8339,7 +8339,6 @@ bool ProcParams::operator== (const ProcParams& other) && wavelet.sup == other.wavelet.sup && wavelet.sky == other.wavelet.sky && wavelet.thres == other.wavelet.thres - && wavelet.threshold == other.wavelet.threshold && wavelet.chroma == other.wavelet.chroma && wavelet.chro == other.wavelet.chro && wavelet.tmr == other.wavelet.tmr diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 7c99801c6..e178906d4 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -501,7 +501,7 @@ RawImageSource::~RawImageSource () //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::transformRect (PreviewProps pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) +void RawImageSource::transformRect (const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) { int pp_x = pp.getX() + border; int pp_y = pp.getY() + border; @@ -1490,7 +1490,7 @@ void RawImageSource::getFullSize (int& w, int& h, int tr) //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void RawImageSource::getSize (PreviewProps pp, int& w, int& h) +void RawImageSource::getSize (const PreviewProps &pp, int& w, int& h) { w = pp.getWidth() / pp.getSkip() + (pp.getWidth() % pp.getSkip() > 0); h = pp.getHeight() / pp.getSkip() + (pp.getHeight() % pp.getSkip() > 0); @@ -2297,7 +2297,7 @@ void RawImageSource::retinexPrepareBuffers(ColorManagementParams cmp, RetinexPar } } else { TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (cmp.working); - float wp[3][3] = { + const float wp[3][3] = { {static_cast(wprof[0][0]), static_cast(wprof[0][1]), static_cast(wprof[0][2])}, {static_cast(wprof[1][0]), static_cast(wprof[1][1]), static_cast(wprof[1][2])}, {static_cast(wprof[2][0]), static_cast(wprof[2][1]), static_cast(wprof[2][2])} diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index cfcda8477..2c0ac6f19 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -97,7 +97,7 @@ protected: void hphd_green (float** hpmap); void processFalseColorCorrectionThread (Imagefloat* im, array2D &rbconv_Y, array2D &rbconv_I, array2D &rbconv_Q, array2D &rbout_I, array2D &rbout_Q, const int row_from, const int row_to); void hlRecovery (const std::string &method, float* red, float* green, float* blue, int width, float* hlmax); - void transformRect (PreviewProps pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw); + void transformRect (const PreviewProps &pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw); void transformPosition (int x, int y, int tran, int& tx, int& ty); unsigned FC(int row, int col) @@ -156,7 +156,7 @@ public: } void getFullSize (int& w, int& h, int tr = TR_NONE); - void getSize (PreviewProps pp, int& w, int& h); + void getSize (const PreviewProps &pp, int& w, int& h); int getRotateDegree() const { return ri->get_rotateDegree(); diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 16fd4dc5d..00b660036 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -964,7 +964,6 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei gm = camwbGreen / gm; bm = camwbBlue / bm; double mul_lum = 0.299 * rm + 0.587 * gm + 0.114 * bm; - double logDefGain = 0.0; float rmi, gmi, bmi; rmi = rm * defGain / mul_lum; @@ -1083,6 +1082,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, int rhei int hlcomprthresh = params.toneCurve.hlcomprthresh; if (params.toneCurve.autoexp && aeHistogram) { + double logDefGain = 0.0; ipf.getAutoExp (aeHistogram, aeHistCompression, logDefGain, params.toneCurve.clip, expcomp, bright, contr, black, hlcompr, hlcomprthresh); } @@ -1487,7 +1487,7 @@ unsigned char* Thumbnail::getGrayscaleHistEQ (int trim_width) // to utilize the 8 bit color range of the thumbnail we brighten it and apply gamma correction unsigned char* tmpdata = new unsigned char[thumbImg->getHeight() * trim_width]; - int ix = 0, max; + int ix = 0; if (gammaCorrected) { // if it's gamma correct (usually a RAW), we have the problem that there is a lot noise etc. that makes the maximum way too high. @@ -1571,7 +1571,7 @@ unsigned char* Thumbnail::getGrayscaleHistEQ (int trim_width) } } else { // If it's not gamma corrected (usually a JPG) we take the normal maximum - max = 0; + int max = 0; if (thumbImg->getType() == sImage8) { Image8 *image = static_cast(thumbImg); diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc index 5e7001028..87f25a497 100644 --- a/rtengine/stdimagesource.cc +++ b/rtengine/stdimagesource.cc @@ -285,7 +285,7 @@ void StdImageSource::getFullSize (int& w, int& h, int tr) } } -void StdImageSource::getSize (PreviewProps pp, int& w, int& h) +void StdImageSource::getSize (const PreviewProps &pp, int& w, int& h) { w = pp.getWidth() / pp.getSkip() + (pp.getWidth() % pp.getSkip() > 0); h = pp.getHeight() / pp.getSkip() + (pp.getHeight() % pp.getSkip() > 0); diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index baff5559d..330c08244 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -66,7 +66,7 @@ public: } void getFullSize (int& w, int& h, int tr = TR_NONE); - void getSize (PreviewProps pp, int& w, int& h); + void getSize (const PreviewProps &pp, int& w, int& h); ImageData* getImageData () { diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index fae7bdf6b..0cd53279c 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -62,7 +62,6 @@ BatchQueue::BatchQueue (FileCatalog* aFileCatalog) : processing(nullptr), fileCa p++; pmenu.attach (*Gtk::manage(cancel = new MyImageMenuItem (M("FILEBROWSER_POPUPCANCELJOB"), "gtk-close.png")), 0, 1, p, p + 1); - p++; pmenu.show_all (); diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 5160f695f..3e3ca1bfb 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -2113,12 +2113,6 @@ void EditorPanel::updateHistogramPosition (int oldPosition, int newPosition) // No histogram if (!oldPosition) { // An histogram actually exist, we delete it - if (oldPosition == 1) { - removeIfThere (leftbox, histogramPanel, false); - } else if (oldPosition == 2) { - removeIfThere (vboxright, histogramPanel, false); - } - delete histogramPanel; histogramPanel = nullptr; } diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 2979b556f..eedb6e262 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -375,7 +375,6 @@ FileBrowser::FileBrowser () pmenu->attach (*Gtk::manage(new Gtk::SeparatorMenuItem ()), 0, 1, p, p + 1); p++; pmenu->attach (*Gtk::manage(cachemenu = new Gtk::MenuItem (M("FILEBROWSER_CACHE"))), 0, 1, p, p + 1); - p++; pmenu->show_all (); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 9da116e11..48e5c6b4d 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -1460,8 +1460,6 @@ bool BackBuffer::setDrawRectangle(Cairo::Format format, int newX, int newY, int */ void BackBuffer::copyRGBCharData(const unsigned char *srcData, int srcX, int srcY, int srcW, int srcH, int srcRowStride, int dstX, int dstY) { - const unsigned char *src; - unsigned char *dst; unsigned char r, g, b; if (!surface) { @@ -1483,8 +1481,8 @@ void BackBuffer::copyRGBCharData(const unsigned char *srcData, int srcX, int src break; } - src = srcData + i * srcRowStride; - dst = dstData + ((dstY + i) * surfW + dstX) * 4; + const unsigned char *src = srcData + i * srcRowStride; + unsigned char *dst = dstData + ((dstY + i) * surfW + dstX) * 4; for (int j = 0; j < srcW; ++j) { if (dstX + j >= surfW) { diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index ed342f5af..c27862c6e 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -322,7 +322,7 @@ class MyComboBoxText : public Gtk::ComboBoxText void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const; public: - MyComboBoxText (bool has_entry = false); + explicit MyComboBoxText (bool has_entry = false); void setPreferredWidth (int minimum_width, int natural_width); void connect(const sigc::connection &connection) { myConnection = connection; } @@ -439,7 +439,7 @@ private: void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const; public: - MyProgressBar(int width); + explicit MyProgressBar(int width); MyProgressBar(); void setPreferredWidth(int width); diff --git a/rtgui/inspector.cc b/rtgui/inspector.cc index 6de56e81b..79839b5f9 100644 --- a/rtgui/inspector.cc +++ b/rtgui/inspector.cc @@ -56,30 +56,30 @@ InspectorBuffer::~InspectorBuffer() { } */ -int InspectorBuffer::infoFromImage (const Glib::ustring& fname) -{ - - rtengine::ImageMetaData* idata = rtengine::ImageMetaData::fromFile (fname, nullptr); - - if (!idata) { - return 0; - } - - int deg = 0; - - if (idata->hasExif()) { - if (idata->getOrientation() == "Rotate 90 CW" ) { - deg = 90; - } else if (idata->getOrientation() == "Rotate 180" ) { - deg = 180; - } else if (idata->getOrientation() == "Rotate 270 CW") { - deg = 270; - } - } - - delete idata; - return deg; -} +//int InspectorBuffer::infoFromImage (const Glib::ustring& fname) +//{ +// +// rtengine::ImageMetaData* idata = rtengine::ImageMetaData::fromFile (fname, nullptr); +// +// if (!idata) { +// return 0; +// } +// +// int deg = 0; +// +// if (idata->hasExif()) { +// if (idata->getOrientation() == "Rotate 90 CW" ) { +// deg = 90; +// } else if (idata->getOrientation() == "Rotate 180" ) { +// deg = 180; +// } else if (idata->getOrientation() == "Rotate 270 CW") { +// deg = 270; +// } +// } +// +// delete idata; +// return deg; +//} Inspector::Inspector () : currImage(nullptr), zoom(0.0), active(false) { diff --git a/rtgui/inspector.h b/rtgui/inspector.h index 305558817..f68912dc1 100644 --- a/rtgui/inspector.h +++ b/rtgui/inspector.h @@ -25,8 +25,8 @@ class InspectorBuffer { -private: - int infoFromImage (const Glib::ustring& fname); +//private: +// int infoFromImage (const Glib::ustring& fname); public: BackBuffer imgBuffer; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 8130e2dfc..27088ed47 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1518,10 +1518,9 @@ void Preferences::parseThemeDir (Glib::ustring dirname) Glib::ustring fname = Glib::build_filename(dirname, *i); Glib::ustring sname = *i; - bool keepIt = false; - // ignore directories and filter out unsupported theme if (regex->match(sname, matchInfo) && !Glib::file_test (fname, Glib::FILE_TEST_IS_DIR) && sname.size() >= 4) { + bool keepIt = false; Glib::ustring fname2 = matchInfo.fetch(1); Glib::ustring minMinor = matchInfo.fetch(2); Glib::ustring maxMinor = matchInfo.fetch(3);