diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 435e2d49f..d5a36b959 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -887,7 +887,9 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb mean = (sum / ((height) * width)) / 327.68f; //for Yb for all image...if one day "pipette" we can adapt Yb for each zone } } - +#ifdef _OPENMP + static_cast(numThreads); // to silence cppcheck warning +#endif //evaluate lightness, contrast } @@ -1487,8 +1489,8 @@ void ImProcFunctions::ciecam_02float(CieImage* ncie, float adap, int pW, int pwb if (ciedata) { //only with improccoordinator // Data for J Q M s and C histograms int posl, posc; - float brli = 327.f; - float chsacol = 327.f; + float brli; + float chsacol; float libr; float colch; @@ -2067,17 +2069,25 @@ filmlike_clip(float *r, float *g, float *b) } } -void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, - const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, + const ColorGradientCurve& ctColorCurve, const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clToningcurve, const LUTf& cl2Toningcurve, + const ToneCurve& customToneCurve1, const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState& asIn, + LUTu& histToneCurve, size_t chunkSize, bool measure) { - rgbProc (working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure); + rgbProc(working, lab, pipetteBuffer, hltonecurve, shtonecurve, tonecurve, sat, rCurve, gCurve, bCurve, satLimit, satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, + clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, + params->toneCurve.expcomp, params->toneCurve.hlcompr, params->toneCurve.hlcomprthresh, dcpProf, asIn, histToneCurve, chunkSize, measure); } // Process RGB image and convert to LAB space -void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clToningcurve, LUTf & cl2Toningcurve, - const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize, bool measure) +void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, + const ColorGradientCurve& ctColorCurve, const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clToningcurve, const LUTf& cl2Toningcurve, + const ToneCurve& customToneCurve1, const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, int hlcomprthresh, + DCPProfile *dcpProf, const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize, bool measure) { std::unique_ptr stop; @@ -3787,10 +3797,9 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go, float rlo; //0.4 0.5 float rlm; //1.1 float rlh; //1.1 - float rlob; //for BW old mode if (mode == 0) { //colour - rlo = rlob = strProtect; //0.5 ==> 0.75 + rlo = strProtect; //0.5 ==> 0.75 rlh = 2.2f * strProtect; rlm = 1.5f * strProtect; constexpr float v0 = 0.15f; @@ -3807,7 +3816,6 @@ void ImProcFunctions::toningsmh(float r, float g, float b, float &ro, float &go, } } else { //bw coefficient to preserve same results as before for satlimtopacity = 0.5 (default) rlo = strProtect * 0.8f; //0.4 - rlob = strProtect; //0.5 rlm = strProtect * 2.2f; //1.1 rlh = strProtect * 2.4f; //1.2 @@ -4121,7 +4129,7 @@ void ImProcFunctions::toning2col(float r, float g, float b, float &ro, float &go * @param iplow iphigh [0..1] luminance * @param wp wip 3x3 matrix and inverse conversion rgb XYZ **/ -void ImProcFunctions::labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]) +void ImProcFunctions::labtoning (float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, const LUTf & clToningcurve, const LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3] ) { ro = CLIP(r); go = CLIP(g); @@ -4180,7 +4188,7 @@ void ImProcFunctions::labtoning(float r, float g, float b, float &ro, float &go, } -void ImProcFunctions::luminanceCurve(LabImage* lold, LabImage* lnew, LUTf & curve) +void ImProcFunctions::luminanceCurve (LabImage* lold, LabImage* lnew, const LUTf& curve) { int W = lold->W; @@ -4200,7 +4208,7 @@ void ImProcFunctions::luminanceCurve(LabImage* lold, LabImage* lnew, LUTf & curv -void ImProcFunctions::chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf & acurve, LUTf & bcurve, LUTf & satcurve, LUTf & lhskcurve, LUTf & clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve) +void ImProcFunctions::chromiLuminanceCurve (PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, const LUTf& acurve, const LUTf& bcurve, const LUTf& satcurve, const LUTf& lhskcurve, const LUTf& clcurve, LUTf & curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLCurve) { int W = lold->W; int H = lold->H; @@ -5488,7 +5496,7 @@ void ImProcFunctions::getAutoExp(const LUTu &histogram, int histcompr, double cl int imax = 65536 >> histcompr; int overex = 0; float sum = 0.f, hisum = 0.f, losum = 0.f; - float ave = 0.f, hidev = 0.f, lodev = 0.f; + float ave = 0.f; //find average luminance histogram.getSumAndAverage(sum, ave); @@ -5516,36 +5524,32 @@ void ImProcFunctions::getAutoExp(const LUTu &histogram, int histcompr, double cl float octile[8] = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}, ospread = 0.f; count = 0; - int i = 0; + int j = 0; - for (; i < min((int)ave, imax); i++) { + for (; j < min ((int)ave, imax); ++j) { if (count < 8) { - octile[count] += histogram[i]; + octile[count] += histogram[j]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog(1. + (float)i) / log(2.f); + octile[count] = xlog (1. + j) / log (2.f); count++;// = min(count+1,7); } } - //lodev += SQR(ave-i)*histogram[i]; - lodev += (xlog(ave + 1.f) - xlog((float)i + 1.)) * histogram[i]; - losum += histogram[i]; + losum += histogram[j]; } - for (; i < imax; i++) { + for (; j < imax; ++j) { if (count < 8) { - octile[count] += histogram[i]; + octile[count] += histogram[j]; if (octile[count] > sum / 8.f || (count == 7 && octile[count] > sum / 16.f)) { - octile[count] = xlog(1. + (float)i) / log(2.f); + octile[count] = xlog (1. + j) / log (2.f); count++;// = min(count+1,7); } } - //hidev += SQR(i-ave)*histogram[i]; - hidev += (xlog((float)i + 1.) - xlog(ave + 1.f)) * histogram[i]; - hisum += histogram[i]; + hisum += histogram[j]; } diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 6de812d70..954969f74 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -148,14 +148,19 @@ public: float calcGradientFactor (const struct grad_params& gp, int x, int y); void firstAnalysis(const Imagefloat* const working, const procparams::ProcParams ¶ms, LUTu & vhist16); void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck); - void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, - const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); - void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, LUTf & hltonecurve, LUTf & shtonecurve, LUTf & tonecurve, - int sat, LUTf & rCurve, LUTf & gCurve, LUTf & bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, bool opautili, LUTf & clcurve, LUTf & cl2curve, const ToneCurve & customToneCurve1, const ToneCurve & customToneCurve2, - const ToneCurve & customToneCurvebw1, const ToneCurve & customToneCurvebw2, double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, - double expcomp, int hlcompr, int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState &asIn, LUTu &histToneCurve, size_t chunkSize = 1, bool measure = false); - void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, LUTf & clToningcurve, LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]); + void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve& ctColorCurve, + const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clcurve, const LUTf& cl2curve, const ToneCurve& customToneCurve1, + const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, DCPProfile *dcpProf, + const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize = 1, bool measure = false); + void rgbProc(Imagefloat* working, LabImage* lab, PipetteBuffer *pipetteBuffer, const LUTf& hltonecurve, const LUTf& shtonecurve, const LUTf& tonecurve, + int sat, const LUTf& rCurve, const LUTf& gCurve, const LUTf& bCurve, float satLimit, float satLimitOpacity, const ColorGradientCurve& ctColorCurve, + const OpacityCurve& ctOpacityCurve, bool opautili, const LUTf& clcurve, const LUTf& cl2curve, const ToneCurve& customToneCurve1, + const ToneCurve& customToneCurve2, const ToneCurve& customToneCurvebw1, const ToneCurve& customToneCurvebw2, + double &rrm, double &ggm, double &bbm, float &autor, float &autog, float &autob, double expcomp, int hlcompr, + int hlcomprthresh, DCPProfile *dcpProf, const DCPProfileApplyState& asIn, LUTu& histToneCurve, size_t chunkSize = 1, bool measure = false); + void labtoning(float r, float g, float b, float &ro, float &go, float &bo, int algm, int metchrom, int twoc, float satLimit, float satLimitOpacity, const ColorGradientCurve & ctColorCurve, const OpacityCurve & ctOpacityCurve, const LUTf & clToningcurve, const LUTf & cl2Toningcurve, float iplow, float iphigh, double wp[3][3], double wip[3][3]); void toning2col(float r, float g, float b, float &ro, float &go, float &bo, float iplow, float iphigh, float rl, float gl, float bl, float rh, float gh, float bh, float SatLow, float SatHigh, float balanS, float balanH, float reducac, int mode, int preser, float strProtect); void toningsmh(float r, float g, float b, float &ro, float &go, float &bo, float RedLow, float GreenLow, float BlueLow, float RedMed, float GreenMed, float BlueMed, float RedHigh, float GreenHigh, float BlueHigh, float reducac, int mode, float strProtect); void toningsmh2(float r, float g, float b, float &ro, float &go, float &bo, float low[3], float satLow, float med[3], float satMed, float high[3], float satHigh, float reducac, int mode, int preser); @@ -165,14 +170,14 @@ public: void retreavergb(float &r, float &g, float &b); void moyeqt(Imagefloat* working, float &moyS, float &eqty); - void luminanceCurve(LabImage* lold, LabImage* lnew, LUTf &curve); + void luminanceCurve(LabImage* lold, LabImage* lnew, const LUTf &curve); void ciecamloc_02float(int sp, LabImage* lab); void ciecam_02float(CieImage* ncie, float adap, int pW, int pwb, LabImage* lab, const procparams::ProcParams* params, const ColorAppearance & customColCurve1, const ColorAppearance & customColCurve, const ColorAppearance & customColCurve3, LUTu &histLCAM, LUTu &histCCAM, LUTf & CAMBrightCurveJ, LUTf & CAMBrightCurveQ, float &mean, int Iterates, int scale, bool execsharp, float &d, float &dj, float &yb, int rtt, bool showSharpMask = false); - void chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, LUTf &acurve, LUTf &bcurve, LUTf & satcurve, LUTf & satclcurve, LUTf &clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve); + void chromiLuminanceCurve(PipetteBuffer *pipetteBuffer, int pW, LabImage* lold, LabImage* lnew, const LUTf& acurve, const LUTf& bcurve, const LUTf& satcurve, const LUTf& satclcurve, const LUTf& clcurve, LUTf &curve, bool utili, bool autili, bool butili, bool ccutili, bool cclutili, bool clcutili, LUTu &histCCurve, LUTu &histLurve); void vibrance(LabImage* lab, const procparams::VibranceParams &vibranceParams, bool highlight, const Glib::ustring &workingProfile); //Jacques' vibrance void softprocess(const LabImage* bufcolorig, array2D &buflight, /* float ** bufchro, float ** buf_a, float ** buf_b, */ float rad, int bfh, int bfw, double epsilmax, double epsilmin, float thres, int sk, bool multiThread); void softproc(const LabImage* bufcolorig, const LabImage* bufcolfin, float rad, int bfh, int bfw, double epsilmax, double epsilmin, float thres, int sk, bool multiThread, int flag); diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 57a87c1f1..7fec79717 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -27,7 +27,6 @@ #ifdef WIN32 #include -#include #endif #include "lcp.h" diff --git a/rtengine/mytime.h b/rtengine/mytime.h index 80fb0899a..787fefcc3 100644 --- a/rtengine/mytime.h +++ b/rtengine/mytime.h @@ -19,7 +19,7 @@ #pragma once #ifdef WIN32 -#include +#include #elif defined __APPLE__ #include #else diff --git a/rtengine/pdaflinesfilter.cc b/rtengine/pdaflinesfilter.cc index 8ac0d3091..1eddbc1ea 100644 --- a/rtengine/pdaflinesfilter.cc +++ b/rtengine/pdaflinesfilter.cc @@ -206,7 +206,7 @@ std::unique_ptr PDAFLinesFilter::lineD } -int PDAFLinesFilter::markLine(array2D &rawData, PixelsMap &bpMap, int y) +int PDAFLinesFilter::markLine(const array2D &rawData, PixelsMap &bpMap, int y) { rowmap_.clear(); rowmap_.resize((W_+1)/2, false); @@ -258,7 +258,7 @@ int PDAFLinesFilter::markLine(array2D &rawData, PixelsMap &bpMap, int y) } -int PDAFLinesFilter::mark(array2D &rawData, PixelsMap &bpMap) +int PDAFLinesFilter::mark(const array2D &rawData, PixelsMap &bpMap) { if (pattern_.empty()) { diff --git a/rtengine/pdaflinesfilter.h b/rtengine/pdaflinesfilter.h index c3d8b47f4..707eb9371 100644 --- a/rtengine/pdaflinesfilter.h +++ b/rtengine/pdaflinesfilter.h @@ -36,12 +36,12 @@ public: explicit PDAFLinesFilter(RawImage *ri); ~PDAFLinesFilter(); - int mark(array2D &rawData, PixelsMap &bpMap); + int mark(const array2D &rawData, PixelsMap &bpMap); RawImageSource::GreenEqulibrateThreshold &greenEqThreshold(); std::unique_ptr lineDenoiseRowBlender(); private: - int markLine(array2D &rawData, PixelsMap &bpMap, int y); + int markLine(const array2D& rawData, PixelsMap &bpMap, int y); RawImage *ri_; int W_; diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 8ecf57507..6535942d8 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -805,17 +805,7 @@ private: void stage_denoise() { - procparams::ProcParams& params = job->pparams; - //ImProcFunctions ipf (¶ms, true); - ImProcFunctions &ipf = * (ipf_p.get()); - - // perform luma/chroma denoise -// CieImage *cieView; -// NoisCurve noiseLCurve; -// bool lldenoiseutili=false; -// Imagefloat *calclum ; -// params.dirpyrDenoise.getCurves(noiseLCurve, lldenoiseutili); -// if (params.dirpyrDenoise.enabled && lldenoiseutili) { + const procparams::ProcParams& params = job->pparams; DirPyrDenoiseParams denoiseParams = params.dirpyrDenoise; // make a copy because we cheat here @@ -848,9 +838,7 @@ private: } if (denoiseParams.enabled) { - // CurveFactory::denoiseLL(lldenoiseutili, denoiseParams.lcurve, Noisecurve,1); - //denoiseParams.getCurves(noiseLCurve); -// ipf.RGB_denoise(baseImg, baseImg, calclum, imgsrc->isRAW(), denoiseParams, params.defringe, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, lldenoiseutili); + ImProcFunctions &ipf = * (ipf_p.get()); float nresi, highresi; int kall = 2; ipf.RGB_denoise(kall, baseImg, baseImg, calclum, ch_M, max_r, max_b, imgsrc->isRAW(), denoiseParams, imgsrc->getDirPyrDenoiseExpComp(), noiseLCurve, noiseCCurve, nresi, highresi); @@ -872,7 +860,7 @@ private: void stage_transform() { - procparams::ProcParams& params = job->pparams; + const procparams::ProcParams& params = job->pparams; //ImProcFunctions ipf (¶ms, true); ImProcFunctions &ipf = * (ipf_p.get()); @@ -1362,13 +1350,10 @@ private: ipf.vibrance(labView, params.vibrance, params.toneCurve.hrenabled, params.icm.workingProfile); ipf.labColorCorrectionRegions(labView); - if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { - ipf.impulsedenoise(labView); - } - // for all treatments Defringe, Sharpening, Contrast detail ,Microcontrast they are activated if "CIECAM" function are disabled if ((params.colorappearance.enabled && !settings->autocielab) || (!params.colorappearance.enabled)) { + ipf.impulsedenoise (labView); ipf.defringe(labView); } diff --git a/rtgui/adjuster.cc b/rtgui/adjuster.cc index 302a2de00..2267a9fc1 100644 --- a/rtgui/adjuster.cc +++ b/rtgui/adjuster.cc @@ -246,7 +246,7 @@ void Adjuster::autoToggled () } if (adjusterListener != nullptr && !blocked) { - adjusterListener->adjusterAutoToggled(this, automatic->get_active()); + adjusterListener->adjusterAutoToggled(this); } } @@ -493,7 +493,7 @@ bool Adjuster::notifyListenerAutoToggled () { if (adjusterListener != nullptr && !blocked) { - adjusterListener->adjusterAutoToggled(this, automatic->get_active()); + adjusterListener->adjusterAutoToggled(this); } return false; diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h index 9800dbac8..59250bc81 100644 --- a/rtgui/adjuster.h +++ b/rtgui/adjuster.h @@ -28,7 +28,7 @@ class AdjusterListener public: virtual ~AdjusterListener() = default; virtual void adjusterChanged (Adjuster* a, double newval) = 0; - virtual void adjusterAutoToggled (Adjuster* a, bool newval) {} + virtual void adjusterAutoToggled (Adjuster* a) {} }; typedef double(*double2double_fun)(double val); diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index afbec9efb..8b4583877 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -147,7 +147,7 @@ int BatchQueue::getThumbnailHeight () return std::max(std::min(options.thumbSizeQueue, 200), 10); } -void BatchQueue::rightClicked (ThumbBrowserEntryBase* entry) +void BatchQueue::rightClicked () { pmenu.popup (3, this->eventTime); } @@ -344,9 +344,8 @@ bool BatchQueue::loadBatchQueue () auto job = rtengine::ProcessingJob::create (source, thumb->getType () == FT_Raw, pparams, fast); - auto prevh = getMaxThumbnailHeight (); - auto prevw = prevh; - thumb->getThumbnailSize (prevw, prevh, &pparams); + const auto prevh = getMaxThumbnailHeight (); + const auto prevw = thumb->getThumbnailWidth(prevh, &pparams); auto entry = new BatchQueueEntry (job, pparams, source, prevw, prevh, thumb, options.overwriteOutputFile); thumb->decreaseRef (); // Removing the refCount acquired by cacheMgr->getEntry diff --git a/rtgui/batchqueue.h b/rtgui/batchqueue.h index f0289faa4..5cde37748 100644 --- a/rtgui/batchqueue.h +++ b/rtgui/batchqueue.h @@ -74,7 +74,7 @@ public: void error(const Glib::ustring& descr) override; rtengine::ProcessingJob* imageReady(rtengine::IImagefloat* img) override; - void rightClicked (ThumbBrowserEntryBase* entry) override; + void rightClicked () override; void doubleClicked (ThumbBrowserEntryBase* entry) override; bool keyPressed (GdkEventKey* event) override; void buttonPressed (LWButton* button, int actionCode, void* actionData) override; diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index 9107aaaa8..f7a73a30b 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -18,7 +18,6 @@ */ #include "batchqueuepanel.h" #include "options.h" -#include "preferences.h" #include "multilangmgr.h" #include "rtwindow.h" #include "soundman.h" diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc index 4a57177e1..5b5cfe9c4 100644 --- a/rtgui/bayerprocess.cc +++ b/rtgui/bayerprocess.cc @@ -672,7 +672,7 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval) } } -void BayerProcess::adjusterAutoToggled(Adjuster* a, bool newval) +void BayerProcess::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (dualDemosaicContrast->getAutoInconsistent()) { diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h index 5c7498986..f8348e02b 100644 --- a/rtgui/bayerprocess.h +++ b/rtgui/bayerprocess.h @@ -88,7 +88,7 @@ public: void methodChanged(); void imageNumberChanged(); void adjusterChanged(Adjuster* a, double newval) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; void checkBoxToggled(CheckBox* c, CheckValue newval) override; void pixelShiftMotionMethodChanged(); void pixelShiftDemosaicMethodChanged(); diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index 20b179529..9a3fc9574 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -25,7 +25,7 @@ #include #ifdef WIN32 -#include +#include #endif #include "cachemanager.h" diff --git a/rtgui/colorappearance.cc b/rtgui/colorappearance.cc index 9a6bee524..62f6eee2c 100644 --- a/rtgui/colorappearance.cc +++ b/rtgui/colorappearance.cc @@ -1565,7 +1565,7 @@ void ColorAppearance::adjusterChanged(Adjuster* a, double newval) } } -void ColorAppearance::adjusterAutoToggled(Adjuster* a, bool newval) +void ColorAppearance::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (degree->getAutoInconsistent()) { diff --git a/rtgui/colorappearance.h b/rtgui/colorappearance.h index 170212ffe..c42bca774 100644 --- a/rtgui/colorappearance.h +++ b/rtgui/colorappearance.h @@ -47,7 +47,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void setBatchMode (bool batchMode) override; void adjusterChanged (Adjuster* a, double newval) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; // void adjusterAdapToggled (Adjuster* a, bool newval); void enabledChanged () override; void surroundChanged (); diff --git a/rtgui/crophandler.h b/rtgui/crophandler.h index d5da1cf6e..98c925b67 100644 --- a/rtgui/crophandler.h +++ b/rtgui/crophandler.h @@ -24,7 +24,6 @@ #include -#include "editbuffer.h" #include "lockablecolorpicker.h" #include "threadutils.h" diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index f44e78a56..b00032191 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -33,6 +33,7 @@ #include "editcallbacks.h" #include "editbuffer.h" #include "editwidgets.h" +#include "pointermotionlistener.h" #include "rtsurface.h" #include "../rtengine/dcrop.h" @@ -259,7 +260,7 @@ void CropWindow::getCropAnchorPosition (int& x, int& y) cropHandler.getAnchorPosition(x, y); } -void CropWindow::setCropAnchorPosition (int& x, int& y) +void CropWindow::setCropAnchorPosition (int x, int y) { cropHandler.setAnchorPosition(x, y); } diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h index db44a2508..491124ad5 100644 --- a/rtgui/cropwindow.h +++ b/rtgui/cropwindow.h @@ -30,7 +30,6 @@ #include "editenums.h" #include "lwbutton.h" #include "lwbuttonset.h" -#include "pointermotionlistener.h" #include "../rtengine/noncopyable.h" @@ -42,6 +41,7 @@ struct Coord; } class CropWindow; +class PointerMotionListener; class CropWindowListener { @@ -224,7 +224,7 @@ public: void centerCrop (bool update = true); void getCropSize (int& w, int& h); void getCropAnchorPosition (int& w, int& h); - void setCropAnchorPosition (int& w, int& h); + void setCropAnchorPosition (int w, int h); // listeners void setCropGUIListener (CropGUIListener* cgl); diff --git a/rtgui/curveeditorgroup.h b/rtgui/curveeditorgroup.h index 4049d8d6c..0f7c01a32 100644 --- a/rtgui/curveeditorgroup.h +++ b/rtgui/curveeditorgroup.h @@ -23,7 +23,6 @@ #include -#include "adjuster.h" #include "guiutils.h" #include "mycurve.h" #include "shcselector.h" diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h index 184fa576f..a077da807 100644 --- a/rtgui/diagonalcurveeditorsubgroup.h +++ b/rtgui/diagonalcurveeditorsubgroup.h @@ -21,7 +21,7 @@ #include #include "curveeditorgroup.h" - +#include "adjuster.h" #include "../rtengine/noncopyable.h" class DiagonalCurveEditor; diff --git a/rtgui/dirbrowser.h b/rtgui/dirbrowser.h index fa526c3a6..6ead83919 100644 --- a/rtgui/dirbrowser.h +++ b/rtgui/dirbrowser.h @@ -23,10 +23,6 @@ #include "guiutils.h" -#ifdef WIN32 -#include "windows.h" -#endif - class DirBrowser : public Gtk::VBox { public: diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 5824bcba3..4d4bb8dd6 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -28,9 +28,12 @@ #include "soundman.h" #include "rtimage.h" #include "rtwindow.h" +#include "filepanel.h" #include "guiutils.h" #include "popupbutton.h" #include "options.h" +#include "navigator.h" +#include "previewwindow.h" #include "progressconnector.h" #include "procparamchangers.h" #include "placesbrowser.h" @@ -38,6 +41,10 @@ #include "thumbnail.h" #include "toolpanelcoord.h" +#ifdef WIN32 +#include "windows.h" +#endif + using namespace rtengine::procparams; namespace diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index e348222a5..8993fea07 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -21,11 +21,9 @@ #include -#include "filepanel.h" #include "histogrampanel.h" #include "history.h" #include "imageareapanel.h" -#include "navigator.h" #include "profilepanel.h" #include "progressconnector.h" #include "saveasdlg.h" @@ -38,6 +36,7 @@ class BatchQueueEntry; class EditorPanel; class FilePanel; class MyProgressBar; +class Navigator; class Thumbnail; class ToolPanelCoordinator; diff --git a/rtgui/editwidgets.h b/rtgui/editwidgets.h index 3735cd46a..4238f6d83 100644 --- a/rtgui/editwidgets.h +++ b/rtgui/editwidgets.h @@ -20,9 +20,9 @@ #ifdef GUIVERSION +#include #include -#include "editbuffer.h" #include "editcoordsys.h" #include "../rtengine/coord.h" @@ -286,7 +286,7 @@ public: rtengine::Coord end; Line (); - Line (rtengine::Coord& begin, rtengine::Coord& end); + Line (const rtengine::Coord& begin, const rtengine::Coord& end); Line (int beginX, int beginY, int endX, int endY); void drawOuterGeometry (Cairo::RefPtr &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override; @@ -556,7 +556,7 @@ inline Circle::Circle (int centerX, int centerY, int radius, bool filled, radiusInImageSpace) { } -inline Line::Line (rtengine::Coord& begin, rtengine::Coord& end) : +inline Line::Line (const rtengine::Coord& begin, const rtengine::Coord& end) : begin (begin), end (end) { } diff --git a/rtgui/editwindow.cc b/rtgui/editwindow.cc index 11c0be4e2..8841d3d42 100644 --- a/rtgui/editwindow.cc +++ b/rtgui/editwindow.cc @@ -16,13 +16,14 @@ */ #include "editwindow.h" +#include "editorpanel.h" +#include "filepanel.h" #include "../rtengine/procparams.h" #include "options.h" #include "preferences.h" #include "cursormanager.h" #include "rtwindow.h" #include -#include "rtimage.h" #include "threadutils.h" extern Glib::ustring argv0; diff --git a/rtgui/editwindow.h b/rtgui/editwindow.h index 08e8c0199..f4ada571d 100644 --- a/rtgui/editwindow.h +++ b/rtgui/editwindow.h @@ -20,10 +20,11 @@ #include -#include "editorpanel.h" -#include "filepanel.h" #include "rtimage.h" +class EditorPanel; +class RTWindow; + class EditWindow : public Gtk::Window { diff --git a/rtgui/exportpanel.h b/rtgui/exportpanel.h index f70e47386..7ae7e043c 100644 --- a/rtgui/exportpanel.h +++ b/rtgui/exportpanel.h @@ -21,7 +21,6 @@ #include -#include "adjuster.h" #include "guiutils.h" class ExportPanelListener diff --git a/rtgui/extprog.cc b/rtgui/extprog.cc index a7a757c1b..57d57ecd8 100644 --- a/rtgui/extprog.cc +++ b/rtgui/extprog.cc @@ -22,8 +22,8 @@ #include #ifdef WIN32 -#include #include +#include #endif #include @@ -145,20 +145,19 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name, filePath = progFilesDir + "\\" + Glib::ustring::compose(exePath, ver); - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } - if (!exePath86.empty ()) { + if (!exePath86.empty()) { filePath = progFilesDirx86 + "\\" + Glib::ustring::compose(exePath86, ver); - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } } - - filePath.clear (); + filePath.clear(); } } else { @@ -166,21 +165,19 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name, filePath = progFilesDir + "\\" + exePath; - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } - if (!exePath86.empty ()) { + if (!exePath86.empty()) { filePath = progFilesDirx86 + "\\" + exePath86; - if (Glib::file_test (filePath, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(filePath, Glib::FILE_TEST_EXISTS)) { break; } } - - filePath.clear (); - + filePath.clear(); } while (false); } @@ -264,7 +261,7 @@ bool ExtProgStore::openInGimp (const Glib::ustring& fileName) #endif #ifdef WIN32 - if ((uintptr_t)success > 32) { + if (reinterpret_cast(success) > 32) { return true; } #else @@ -279,9 +276,9 @@ bool ExtProgStore::openInGimp (const Glib::ustring& fileName) for (auto ver = 12; ver >= 0; --ver) { executable = Glib::build_filename (options.gimpDir, "bin", Glib::ustring::compose (Glib::ustring("gimp-2.%1.exe"), ver)); - auto success = ShellExecute( NULL, "open", executable.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL ); + auto lsuccess = ShellExecute( NULL, "open", executable.c_str(), fileName.c_str(), NULL, SW_SHOWNORMAL ); - if ((uintptr_t)success > 32) { + if (reinterpret_cast(lsuccess) > 32) { return true; } } diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 48ade4036..2f4bd3d38 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -91,41 +91,36 @@ ThumbBrowserEntryBase* selectOriginalEntry (ThumbBrowserEntryBase* original, Thu void findOriginalEntries (const std::vector& entries) { - typedef std::vector EntryVector; - typedef EntryVector::const_iterator EntryIterator; - typedef std::map BasenameMap; - typedef BasenameMap::const_iterator BasenameIterator; - // Sort all entries into buckets by basename without extension - BasenameMap byBasename; + std::map> byBasename; - for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { - const Glib::ustring basename = Glib::path_get_basename ((*entry)->filename.lowercase()); + for (const auto entry : entries) { + const auto basename = Glib::path_get_basename(entry->filename.lowercase()); - const Glib::ustring::size_type pos = basename.find_last_of ('.'); - if (pos >= basename.length () - 1) { - (*entry)->setOriginal (nullptr); + const auto pos = basename.find_last_of('.'); + if (pos >= basename.length() - 1) { + entry->setOriginal(nullptr); continue; } - const Glib::ustring withoutExtension = basename.substr (0, pos); + const auto withoutExtension = basename.substr(0, pos); - byBasename[withoutExtension].push_back (*entry); + byBasename[withoutExtension].push_back(entry); } // Find the original image for each bucket - for (BasenameIterator bucket = byBasename.begin (); bucket != byBasename.end (); ++bucket) { - const EntryVector& entries = bucket->second; + for (const auto& bucket : byBasename) { + const auto& lentries = bucket.second; ThumbBrowserEntryBase* original = nullptr; // Select the most likely original in a first pass... - for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { - original = selectOriginalEntry (original, *entry); + for (const auto entry : lentries) { + original = selectOriginalEntry(original, entry); } // ...and link all other images to it in a second pass. - for (EntryIterator entry = entries.begin (); entry != entries.end (); ++entry) { - (*entry)->setOriginal (*entry != original ? original : nullptr); + for (const auto entry : lentries) { + entry->setOriginal(entry != original ? original : nullptr); } } } @@ -488,7 +483,7 @@ FileBrowser::~FileBrowser () delete[] amiExtProg; } -void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry) +void FileBrowser::rightClicked () { { diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index b941ea9df..86ab59395 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -23,7 +23,6 @@ #include #include "browserfilter.h" -#include "exiffiltersettings.h" #include "exportpanel.h" #include "extprog.h" #include "filebrowserentry.h" @@ -174,7 +173,7 @@ public: void buttonPressed (LWButton* button, int actionCode, void* actionData) override; void redrawNeeded (LWButton* button) override; bool checkFilter (ThumbBrowserEntryBase* entry) const override; - void rightClicked (ThumbBrowserEntryBase* entry) override; + void rightClicked () override; void doubleClicked (ThumbBrowserEntryBase* entry) override; bool keyPressed (GdkEventKey* event) override; diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc index 9da4044c1..3129e93e2 100644 --- a/rtgui/filebrowserentry.cc +++ b/rtgui/filebrowserentry.cc @@ -118,7 +118,7 @@ void FileBrowserEntry::calcThumbnailSize () { if (thumbnail) { - thumbnail->getThumbnailSize (prew, preh); + prew = thumbnail->getThumbnailWidth(preh); } } diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h index 1bdbb2ecb..ea5140ed6 100644 --- a/rtgui/filebrowserentry.h +++ b/rtgui/filebrowserentry.h @@ -23,7 +23,6 @@ #include -#include "crophandler.h" #include "editenums.h" #include "filethumbnailbuttonset.h" #include "imageareatoollistener.h" diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index c3866a5f3..aeeb6ef5d 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -32,6 +32,7 @@ #include "rtimage.h" #include "cachemanager.h" #include "multilangmgr.h" +#include "coarsepanel.h" #include "filepanel.h" #include "renamedlg.h" #include "thumbimageupdater.h" @@ -40,6 +41,7 @@ #include "placesbrowser.h" #include "pathutils.h" #include "thumbnail.h" +#include "toolbar.h" using namespace std; @@ -1222,9 +1224,8 @@ void FileCatalog::developRequested(const std::vector& tbe, bo rtengine::ProcessingJob* pjob = rtengine::ProcessingJob::create (fbe->filename, th->getType() == FT_Raw, params, fastmode && options.fastexport_use_fast_pipeline); - int pw; - int ph = BatchQueue::calcMaxThumbnailHeight(); - th->getThumbnailSize (pw, ph); + const int ph = BatchQueue::calcMaxThumbnailHeight(); + const int pw = th->getThumbnailWidth(ph); // processThumbImage is the processing intensive part, but adding to queue must be ordered //#pragma omp ordered diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index f78ca2808..3a9d82b67 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -22,21 +22,21 @@ #include -#include "coarsepanel.h" #include "exiffiltersettings.h" #include "exportpanel.h" #include "filebrowser.h" #include "fileselectionchangelistener.h" #include "fileselectionlistener.h" #include "filterpanel.h" -#include "multilangmgr.h" #include "previewloader.h" #include "threadutils.h" -#include "toolbar.h" #include "../rtengine/noncopyable.h" class FilePanel; +class CoarsePanel; +class ToolBar; + /* * Class: * - handling the list of file (add/remove them) diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index 8f45343de..1a66aed7c 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -18,6 +18,7 @@ */ #include "filepanel.h" +#include "dirbrowser.h" #include "batchtoolpanelcoord.h" #include "editorpanel.h" #include "rtwindow.h" @@ -25,6 +26,10 @@ #include "placesbrowser.h" #include "thumbnail.h" +#ifdef WIN32 +#include "windows.h" +#endif + FilePanel::FilePanel () : parent(nullptr), error(0) { diff --git a/rtgui/filepanel.h b/rtgui/filepanel.h index 9db9d99b7..cbfe8e53e 100644 --- a/rtgui/filepanel.h +++ b/rtgui/filepanel.h @@ -20,7 +20,6 @@ #include -#include "dirbrowser.h" #include "exportpanel.h" #include "filecatalog.h" #include "fileselectionlistener.h" @@ -35,6 +34,7 @@ class BatchToolPanelCoordinator; class RTWindow; +class DirBrowser; class FilePanel final : public Gtk::HPaned, diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index ff0c0f9dd..7433fd4de 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -252,7 +252,7 @@ void FlatField::adjusterChanged(Adjuster* a, double newval) } } -void FlatField::adjusterAutoToggled (Adjuster* a, bool newval) +void FlatField::adjusterAutoToggled (Adjuster* a) { if (multiImage) { if (flatFieldClipControl->getAutoInconsistent()) { diff --git a/rtgui/flatfield.h b/rtgui/flatfield.h index d20a96acd..5cbc49684 100644 --- a/rtgui/flatfield.h +++ b/rtgui/flatfield.h @@ -79,7 +79,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void adjusterChanged (Adjuster* a, double newval) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; void flatFieldFileChanged (); void flatFieldFile_Reset (); void flatFieldAutoSelectChanged (); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index d6ede26da..02a28607f 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -946,22 +946,21 @@ bool MyScrolledWindow::on_scroll_event (GdkEventScroll* event) const double lowerBound = adjust->get_lower(); double value = adjust->get_value(); double step = adjust->get_step_increment(); - double value2 = 0.; if (event->direction == GDK_SCROLL_DOWN) { - value2 = rtengine::min(value + step, upperBound); + const double value2 = rtengine::min(value + step, upperBound); if (value2 != value) { scroll->set_value(value2); } } else if (event->direction == GDK_SCROLL_UP) { - value2 = rtengine::max(value - step, lowerBound); + const double value2 = rtengine::max(value - step, lowerBound); if (value2 != value) { scroll->set_value(value2); } } else if (event->direction == GDK_SCROLL_SMOOTH) { - value2 = rtengine::LIM(value + event->delta_y * step, lowerBound, upperBound); + const double value2 = rtengine::LIM(value + event->delta_y * step, lowerBound, upperBound); if (value2 != value) { scroll->set_value(value2); diff --git a/rtgui/histogrampanel.cc b/rtgui/histogrampanel.cc index ddf60ca75..dd0cbde46 100644 --- a/rtgui/histogrampanel.cc +++ b/rtgui/histogrampanel.cc @@ -983,7 +983,7 @@ void HistogramArea::on_realize () } void HistogramArea::drawCurve(Cairo::RefPtr &cr, - LUTu & data, double scale, int hsize, int vsize) + const LUTu & data, double scale, int hsize, int vsize) { double s = RTScalable::getScale(); @@ -1013,7 +1013,7 @@ void HistogramArea::drawCurve(Cairo::RefPtr &cr, } void HistogramArea::drawMarks(Cairo::RefPtr &cr, - LUTu & data, double scale, int hsize, int & ui, int & oi) + const LUTu & data, double scale, int hsize, int & ui, int & oi) { int s = 8 * RTScalable::getScale(); diff --git a/rtgui/histogrampanel.h b/rtgui/histogrampanel.h index 23b065534..4fd21bcc2 100644 --- a/rtgui/histogrampanel.h +++ b/rtgui/histogrampanel.h @@ -165,8 +165,8 @@ public: type_signal_factor_changed signal_factor_changed(); private: - void drawCurve(Cairo::RefPtr &cr, LUTu & data, double scale, int hsize, int vsize); - void drawMarks(Cairo::RefPtr &cr, LUTu & data, double scale, int hsize, int & ui, int & oi); + void drawCurve(Cairo::RefPtr &cr, const LUTu & data, double scale, int hsize, int vsize); + void drawMarks(Cairo::RefPtr &cr, const LUTu & data, double scale, int hsize, int & ui, int & oi); Gtk::SizeRequestMode get_request_mode_vfunc () const override; void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const override; void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const override; diff --git a/rtgui/hsvequalizer.h b/rtgui/hsvequalizer.h index 987fd20b2..77c1ee1b0 100644 --- a/rtgui/hsvequalizer.h +++ b/rtgui/hsvequalizer.h @@ -20,7 +20,6 @@ #include -#include "adjuster.h" #include "colorprovider.h" #include "curvelistener.h" #include "guiutils.h" @@ -58,6 +57,5 @@ public: void autoOpenCurve () override; void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override; - //void adjusterChanged (Adjuster* a, double newval); void enabledChanged() override; }; diff --git a/rtgui/lockablecolorpicker.cc b/rtgui/lockablecolorpicker.cc index cb334c7e4..071847424 100644 --- a/rtgui/lockablecolorpicker.cc +++ b/rtgui/lockablecolorpicker.cc @@ -240,7 +240,7 @@ void LockableColorPicker::updateBackBuffer () } -void LockableColorPicker::draw (Cairo::RefPtr &cr) +void LockableColorPicker::draw (const Cairo::RefPtr &cr) { if (validity == Validity::OUTSIDE) { return; @@ -284,12 +284,12 @@ void LockableColorPicker::setRGB (const float R, const float G, const float B, c } } -void LockableColorPicker::getImagePosition (rtengine::Coord &imgPos) +void LockableColorPicker::getImagePosition (rtengine::Coord &imgPos) const { imgPos = position; } -void LockableColorPicker::getScreenPosition (rtengine::Coord &screenPos) +void LockableColorPicker::getScreenPosition (rtengine::Coord &screenPos) const { if (cropWindow) { cropWindow->imageCoordToScreen(position.x, position.y, screenPos.x, screenPos.y); @@ -328,7 +328,7 @@ void LockableColorPicker::setSize (Size newSize) } } -LockableColorPicker::Size LockableColorPicker::getSize () +LockableColorPicker::Size LockableColorPicker::getSize () const { return size; } diff --git a/rtgui/lockablecolorpicker.h b/rtgui/lockablecolorpicker.h index eadf71773..77d2e8e9f 100644 --- a/rtgui/lockablecolorpicker.h +++ b/rtgui/lockablecolorpicker.h @@ -74,14 +74,14 @@ public: LockableColorPicker (CropWindow* cropWindow, Glib::ustring *oProfile, Glib::ustring *wProfile); - void draw (Cairo::RefPtr &cr); + void draw (const Cairo::RefPtr &cr); // Used to update the RGB color, the HSV values will be updated accordingly void setPosition (const rtengine::Coord &newPos); void setRGB (const float R, const float G, const float B, const float previewR, const float previewG, const float previewB); - void getImagePosition (rtengine::Coord &imgPos); - void getScreenPosition (rtengine::Coord &screenPos); - Size getSize (); + void getImagePosition (rtengine::Coord &imgPos) const; + void getScreenPosition (rtengine::Coord &screenPos) const; + Size getSize () const; bool isOver (int x, int y); void setValidity (Validity isValid); void setSize (Size newSize); diff --git a/rtgui/lwbutton.cc b/rtgui/lwbutton.cc index c6c75584d..26d36f9e0 100644 --- a/rtgui/lwbutton.cc +++ b/rtgui/lwbutton.cc @@ -153,7 +153,7 @@ bool LWButton::releaseNotify (int x, int y) { bool in = inside (x, y); - State nstate = state; + State nstate; bool action = false; if (in && (state == Pressed_In || state == Pressed_Out)) { diff --git a/rtgui/main.cc b/rtgui/main.cc index 09008a2f6..abe431bde 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -53,6 +53,7 @@ #else #include #include "conio.h" +#include "windows.h" #endif // Set this to 1 to make RT work when started with Eclipse and arguments, at least on Windows platform diff --git a/rtgui/mydiagonalcurve.cc b/rtgui/mydiagonalcurve.cc index 9aa52c67e..abd339ce0 100644 --- a/rtgui/mydiagonalcurve.cc +++ b/rtgui/mydiagonalcurve.cc @@ -592,7 +592,6 @@ bool MyDiagonalCurve::handleEvents (GdkEvent* event) curve.x.insert (itx, 0); curve.y.insert (ity, 0); - num++; // the graph is refreshed only if a new point is created curve.x.at(closest_point) = clampedX; @@ -1504,7 +1503,7 @@ void MyDiagonalCurve::setActiveParam (int ac) queue_draw (); } -void MyDiagonalCurve::updateBackgroundHistogram (LUTu & hist) +void MyDiagonalCurve::updateBackgroundHistogram (const LUTu & hist) { if (hist) { //memcpy (bghist, hist, 256*sizeof(unsigned int)); diff --git a/rtgui/mydiagonalcurve.h b/rtgui/mydiagonalcurve.h index a71c0565c..b38373006 100644 --- a/rtgui/mydiagonalcurve.h +++ b/rtgui/mydiagonalcurve.h @@ -85,7 +85,7 @@ public: bool handleEvents (GdkEvent* event) override; void setActiveParam (int ac); void reset (const std::vector &resetCurve, double identityValue = 0.5) override; - void updateBackgroundHistogram (LUTu & hist); + void updateBackgroundHistogram (const LUTu & hist); void pipetteMouseOver (CurveEditor *ce, EditDataProvider *provider, int modifierKey) override; bool pipetteButton1Pressed(EditDataProvider *provider, int modifierKey) override; diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index afb2c9f09..904b379c2 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -668,7 +668,6 @@ bool MyFlatCurve::handleEvents (GdkEvent* event) curve.y.insert (ity, 0); curve.leftTangent.insert (itlt, 0); curve.rightTangent.insert (itrt, 0); - num++; if (mod_type & GDK_CONTROL_MASK) { clampedY = point.getVal01(clampedX); diff --git a/rtgui/navigator.cc b/rtgui/navigator.cc index 6a8137737..619ea0cfd 100644 --- a/rtgui/navigator.cc +++ b/rtgui/navigator.cc @@ -18,6 +18,7 @@ */ #include #include "navigator.h" +#include "previewwindow.h" #include "toolpanel.h" #include "../rtengine/color.h" #include "../rtengine/rt_math.h" diff --git a/rtgui/navigator.h b/rtgui/navigator.h index 953a0a44b..c1c23c6dc 100644 --- a/rtgui/navigator.h +++ b/rtgui/navigator.h @@ -22,7 +22,8 @@ #include "options.h" #include "pointermotionlistener.h" -#include "previewwindow.h" + +class PreviewWindow; class Navigator : public Gtk::Frame, diff --git a/rtgui/pdsharpening.cc b/rtgui/pdsharpening.cc index 4f5416c82..18fa7aa2a 100644 --- a/rtgui/pdsharpening.cc +++ b/rtgui/pdsharpening.cc @@ -270,7 +270,7 @@ void PdSharpening::autoRadiusChanged(double autoRadius) ); } -void PdSharpening::adjusterAutoToggled(Adjuster* a, bool newval) +void PdSharpening::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (a->getAutoInconsistent()) { diff --git a/rtgui/pdsharpening.h b/rtgui/pdsharpening.h index 7d971eaee..eb0576ceb 100644 --- a/rtgui/pdsharpening.h +++ b/rtgui/pdsharpening.h @@ -59,7 +59,7 @@ public: void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override; void setBatchMode (bool batchMode) override; - void adjusterAutoToggled (Adjuster* a, bool newval) override; + void adjusterAutoToggled (Adjuster* a) override; void adjusterChanged (Adjuster* a, double newval) override; void enabledChanged () override; diff --git a/rtgui/placesbrowser.h b/rtgui/placesbrowser.h index 78c94969f..d4640fff4 100644 --- a/rtgui/placesbrowser.h +++ b/rtgui/placesbrowser.h @@ -22,8 +22,6 @@ #include -#include "multilangmgr.h" - class PlacesBrowser : public Gtk::VBox { diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index b52738eab..9fbb8c7ad 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -128,7 +128,7 @@ Preferences::~Preferences() get_size(options.preferencesWidth, options.preferencesHeight); } -int Preferences::getThemeRowNumber(Glib::ustring& longThemeFName) +int Preferences::getThemeRowNumber (const Glib::ustring& longThemeFName) { if (regex->match(longThemeFName + ".css", matchInfo)) { diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 1c05aaa82..19e280762 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -22,7 +22,6 @@ #include -#include "adjuster.h" #include "dynamicprofilepanel.h" #include "options.h" #include "../rtengine/profilestore.h" @@ -252,7 +251,7 @@ class Preferences : void switchFontTo (const Glib::ustring &newFontFamily, const int newFontSize); bool splashClosed (GdkEventAny* event); - int getThemeRowNumber (Glib::ustring& longThemeFName); + int getThemeRowNumber (const Glib::ustring& longThemeFName); void appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustring label, int id, bool set); diff --git a/rtgui/previewmodepanel.h b/rtgui/previewmodepanel.h index 98160a5e3..4121dfb92 100644 --- a/rtgui/previewmodepanel.h +++ b/rtgui/previewmodepanel.h @@ -19,8 +19,6 @@ #include -#include "adjuster.h" - class ImageArea; class PreviewModePanel : diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 6268fe3d2..67fa87e0c 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -230,7 +230,7 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) if (x>imgX || y>imgY || w < imgW || h < imgH) { bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6; - CursorShape newType = cursor_type; + CursorShape newType; if (isMoving) { mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom); diff --git a/rtgui/progressconnector.h b/rtgui/progressconnector.h index eb6eb3a66..f4d1d8f7e 100644 --- a/rtgui/progressconnector.h +++ b/rtgui/progressconnector.h @@ -79,9 +79,9 @@ class ProgressConnector static int emitEndSignalUI (void* data) { - sigc::signal0* opEnd = (sigc::signal0*) data; - int r = opEnd->emit (); - delete opEnd; + const sigc::signal0* lopEnd = reinterpret_cast*>(data); + const int r = lopEnd->emit (); + delete lopEnd; return r; } diff --git a/rtgui/recentbrowser.h b/rtgui/recentbrowser.h index 68a7962f9..bc8374087 100644 --- a/rtgui/recentbrowser.h +++ b/rtgui/recentbrowser.h @@ -21,7 +21,6 @@ #include #include "guiutils.h" -#include "multilangmgr.h" class RecentBrowser : public Gtk::VBox diff --git a/rtgui/rgbcurves.h b/rtgui/rgbcurves.h index 5ed2ea540..edc80eb41 100644 --- a/rtgui/rgbcurves.h +++ b/rtgui/rgbcurves.h @@ -20,7 +20,6 @@ #include -#include "adjuster.h" #include "colorprovider.h" #include "curvelistener.h" #include "toolpanel.h" diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 064aac1a8..08d2dd296 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -44,14 +44,14 @@ extern unsigned char initialGdkScale; static gboolean osx_should_quit_cb (GtkosxApplication *app, gpointer data) { - RTWindow *rtWin = (RTWindow *)data; + RTWindow * const rtWin = static_cast(data); return rtWin->on_delete_event (0); } static void osx_will_quit_cb (GtkosxApplication *app, gpointer data) { - RTWindow *rtWin = (RTWindow *)data; + RTWindow *rtWin = static_cast(data); rtWin->on_delete_event (0); gtk_main_quit (); } @@ -75,7 +75,7 @@ bool RTWindow::osxFileOpenEvent (Glib::ustring path) static gboolean osx_open_file_cb (GtkosxApplication *app, gchar *path_, gpointer data) { - RTWindow *rtWin = (RTWindow *)data; + RTWindow *rtWin = static_cast(data); if (!argv1.empty()) { // skip handling if we have a file argument or else we get double open of same file @@ -232,13 +232,6 @@ RTWindow::RTWindow () } } -#ifndef NDEBUG - else if (!screen) { - printf ("ERROR: Can't get default screen!\n"); - } - -#endif - // ------- end loading theme files RTScalable::init(this); diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 29a833871..ab2b6779a 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -34,6 +34,7 @@ class BatchQueueEntry; class BatchQueuePanel; class EditorPanel; class FilePanel; +class PLDBridge; class RTWindow : public Gtk::Window, public rtengine::ProgressListener, diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index e4567f69b..448b37fd7 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -20,7 +20,6 @@ #include -#include "adjuster.h" #include "saveformatpanel.h" class SaveAsDialog : diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index c9329cf91..5f75ab413 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -967,7 +967,7 @@ void ThumbBrowserBase::buttonPressed (int x, int y, int button, GdkEventType typ } MYWRITERLOCK_RELEASE(l); - rightClicked (fileDescr); + rightClicked (); } } // end of MYWRITERLOCK(l, entryRW); diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h index d6bafaf69..b4caac0a9 100644 --- a/rtgui/thumbbrowserbase.h +++ b/rtgui/thumbbrowserbase.h @@ -225,7 +225,7 @@ public: { return true; } - virtual void rightClicked (ThumbBrowserEntryBase* entry) {} + virtual void rightClicked () = 0; virtual void doubleClicked (ThumbBrowserEntryBase* entry) {} virtual bool keyPressed (GdkEventKey* event) { diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index c151ca916..273980ffe 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -592,10 +592,8 @@ void Thumbnail::decreaseRef () cachemgr->closeThumbnail (this); } -void Thumbnail::getThumbnailSize (int &w, int &h, const rtengine::procparams::ProcParams *pparams) +int Thumbnail::getThumbnailWidth (const int h, const rtengine::procparams::ProcParams *pparams) const { - MyMutex::MyLock lock(mutex); - int tw_ = tw; int th_ = th; float imgRatio_ = imgRatio; @@ -615,20 +613,17 @@ void Thumbnail::getThumbnailSize (int &w, int &h, const rtengine::procparams::Pr if (thisCoarse != ppCoarse) { // different orientation -> swapping width & height - int tmp = th_; - th_ = tw_; - tw_ = tmp; - + std::swap(th_, tw_); if (imgRatio_ >= 0.0001f) { imgRatio_ = 1.f / imgRatio_; } } } - if (imgRatio_ > 0.) { - w = (int)(imgRatio_ * (float)h); + if (imgRatio_ > 0.f) { + return imgRatio_ * h; } else { - w = tw_ * h / th_; + return tw_ * h / th_; } } diff --git a/rtgui/thumbnail.h b/rtgui/thumbnail.h index aee5ee0a6..c22c80cea 100644 --- a/rtgui/thumbnail.h +++ b/rtgui/thumbnail.h @@ -119,7 +119,7 @@ public: // unsigned char* getThumbnailImage (int &w, int &h, int fixwh=1); // fixwh = 0: fix w and calculate h, =1: fix h and calculate w rtengine::IImage8* processThumbImage (const rtengine::procparams::ProcParams& pparams, int h, double& scale); rtengine::IImage8* upgradeThumbImage (const rtengine::procparams::ProcParams& pparams, int h, double& scale); - void getThumbnailSize (int &w, int &h, const rtengine::procparams::ProcParams *pparams = nullptr); + int getThumbnailWidth (int h, const rtengine::procparams::ProcParams *pparams = nullptr) const; void getFinalSize (const rtengine::procparams::ProcParams& pparams, int& w, int& h); void getOriginalSize (int& w, int& h); diff --git a/rtgui/toolbar.cc b/rtgui/toolbar.cc index e7b247f33..e642ae51b 100644 --- a/rtgui/toolbar.cc +++ b/rtgui/toolbar.cc @@ -20,6 +20,7 @@ #include "toolbar.h" #include "multilangmgr.h" #include "guiutils.h" +#include "lockablecolorpicker.h" #include "rtimage.h" ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(nullptr) diff --git a/rtgui/toolbar.h b/rtgui/toolbar.h index 14177dc24..c4ec4977b 100644 --- a/rtgui/toolbar.h +++ b/rtgui/toolbar.h @@ -20,10 +20,10 @@ #include -#include "lockablecolorpicker.h" #include "toolenum.h" class RTImage; +class LockablePickerToolListener; class ToolBarListener { diff --git a/rtgui/toolpanel.h b/rtgui/toolpanel.h index 0f002e048..aecf1f39f 100644 --- a/rtgui/toolpanel.h +++ b/rtgui/toolpanel.h @@ -22,7 +22,6 @@ #include -#include "editbuffer.h" #include "guiutils.h" #include "multilangmgr.h" #include "paramsedited.h" diff --git a/rtgui/xtransprocess.cc b/rtgui/xtransprocess.cc index 52c46be65..a371bad88 100644 --- a/rtgui/xtransprocess.cc +++ b/rtgui/xtransprocess.cc @@ -225,7 +225,7 @@ void XTransProcess::adjusterChanged(Adjuster* a, double newval) } } -void XTransProcess::adjusterAutoToggled(Adjuster* a, bool newval) +void XTransProcess::adjusterAutoToggled(Adjuster* a) { if (multiImage) { if (dualDemosaicContrast->getAutoInconsistent()) { diff --git a/rtgui/xtransprocess.h b/rtgui/xtransprocess.h index d6cb120e0..fc0dd7502 100644 --- a/rtgui/xtransprocess.h +++ b/rtgui/xtransprocess.h @@ -66,5 +66,5 @@ public: void autoContrastChanged (double autoContrast) override; void adjusterChanged(Adjuster* a, double newval) override; void checkBoxToggled(CheckBox* c, CheckValue newval) override; - void adjusterAutoToggled(Adjuster* a, bool newval) override; + void adjusterAutoToggled(Adjuster* a) override; };