From f7c57eeeda6d9e217419addeb4e74c9f208c35c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Tue, 8 Oct 2019 14:12:42 +0200 Subject: [PATCH] Make ImProcFunctions::transCoord() const --- rtengine/improcfun.h | 26 +++++++++++++------------- rtengine/iptransform.cc | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 84da1cacc..3a3d461a0 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -67,14 +67,14 @@ class ImProcFunctions void transformGeneral(bool highQuality, Imagefloat *original, Imagefloat *transformed, int cx, int cy, int sx, int sy, int oW, int oH, int fW, int fH, const LensCorrection *pLCPMap); void transformLCPCAOnly(Imagefloat *original, Imagefloat *transformed, int cx, int cy, const LensCorrection *pLCPMap); - bool needsCA(); - bool needsDistortion(); - bool needsRotation(); - bool needsPerspective(); - bool needsGradient(); - bool needsVignetting(); - bool needsLCP(); - bool needsLensfun(); + bool needsCA() const; + bool needsDistortion() const; + bool needsRotation() const; + bool needsPerspective() const; + bool needsGradient() const; + bool needsVignetting() const; + bool needsLCP() const; + bool needsLensfun() const; // static cmsUInt8Number* Mempro = NULL; @@ -99,8 +99,8 @@ public: } void setScale(double iscale); - bool needsTransform(); - bool needsPCVignetting(); + bool needsTransform() const; + bool needsPCVignetting() const; void firstAnalysis(const Imagefloat* const working, const procparams::ProcParams ¶ms, LUTu & vhist16); void updateColorProfiles(const Glib::ustring& monitorProfile, RenderingIntent monitorIntent, bool softProof, bool gamutCheck); @@ -247,11 +247,11 @@ public: // CieImage *ciec; void workingtrc(const Imagefloat* src, Imagefloat* dst, int cw, int ch, int mul, const Glib::ustring &profile, double gampos, double slpos, cmsHTRANSFORM &transform, bool normalizeIn = true, bool normalizeOut = true, bool keepTransForm = false) const; - bool transCoord(int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr); - bool transCoord(int W, int H, const std::vector &src, std::vector &red, std::vector &green, std::vector &blue, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr); + bool transCoord(int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr) const; + bool transCoord(int W, int H, const std::vector &src, std::vector &red, std::vector &green, std::vector &blue, double ascaleDef = -1, const LensCorrection *pLCPMap = nullptr) const; static void getAutoExp(const LUTu & histogram, int histcompr, double clip, double& expcomp, int& bright, int& contr, int& black, int& hlcompr, int& hlcomprthresh); static double getAutoDistor(const Glib::ustring& fname, int thumb_size); - double getTransformAutoFill(int oW, int oH, const LensCorrection *pLCPMap = nullptr); + double getTransformAutoFill(int oW, int oH, const LensCorrection *pLCPMap = nullptr) const; void rgb2lab(const Imagefloat &src, LabImage &dst, const Glib::ustring &workingSpace); void lab2rgb(const LabImage &src, Imagefloat &dst, const Glib::ustring &workingSpace); }; diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 99fd39f7e..69b57d0ba 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -208,7 +208,7 @@ namespace rtengine #define CLIPTOC(a,b,c,d) ((a)>=(b)?((a)<=(c)?(a):(d=true,(c))):(d=true,(b))) bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, std::vector &red, std::vector &green, std::vector &blue, double ascaleDef, - const LensCorrection *pLCPMap) + const LensCorrection *pLCPMap) const { bool clipped = false; @@ -310,7 +310,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, } // Transform all corners and critical sidelines of an image -bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef, const LensCorrection *pLCPMap) +bool ImProcFunctions::transCoord (int W, int H, int x, int y, int w, int h, int& xv, int& yv, int& wv, int& hv, double ascaleDef, const LensCorrection *pLCPMap) const { const int DivisionsPerBorder = 32; @@ -1113,7 +1113,7 @@ void ImProcFunctions::transformLCPCAOnly(Imagefloat *original, Imagefloat *trans } -double ImProcFunctions::getTransformAutoFill (int oW, int oH, const LensCorrection *pLCPMap) +double ImProcFunctions::getTransformAutoFill (int oW, int oH, const LensCorrection *pLCPMap) const { if (!needsCA() && !needsDistortion() && !needsRotation() && !needsPerspective() && (!params->lensProf.useDist || pLCPMap == nullptr)) { return 1; @@ -1137,52 +1137,52 @@ double ImProcFunctions::getTransformAutoFill (int oW, int oH, const LensCorrecti return scaleL; } -bool ImProcFunctions::needsCA () +bool ImProcFunctions::needsCA () const { return fabs (params->cacorrection.red) > 1e-15 || fabs (params->cacorrection.blue) > 1e-15; } -bool ImProcFunctions::needsDistortion () +bool ImProcFunctions::needsDistortion () const { return fabs (params->distortion.amount) > 1e-15; } -bool ImProcFunctions::needsRotation () +bool ImProcFunctions::needsRotation () const { return fabs (params->rotate.degree) > 1e-15; } -bool ImProcFunctions::needsPerspective () +bool ImProcFunctions::needsPerspective () const { return params->perspective.horizontal || params->perspective.vertical; } -bool ImProcFunctions::needsGradient () +bool ImProcFunctions::needsGradient () const { return params->gradient.enabled && fabs (params->gradient.strength) > 1e-15; } -bool ImProcFunctions::needsPCVignetting () +bool ImProcFunctions::needsPCVignetting () const { return params->pcvignette.enabled && fabs (params->pcvignette.strength) > 1e-15; } -bool ImProcFunctions::needsVignetting () +bool ImProcFunctions::needsVignetting () const { return params->vignetting.amount; } -bool ImProcFunctions::needsLCP () +bool ImProcFunctions::needsLCP () const { return params->lensProf.useLcp(); } -bool ImProcFunctions::needsLensfun() +bool ImProcFunctions::needsLensfun() const { return params->lensProf.useLensfun(); } -bool ImProcFunctions::needsTransform () +bool ImProcFunctions::needsTransform () const { return needsCA () || needsDistortion () || needsRotation () || needsPerspective () || needsGradient () || needsPCVignetting () || needsVignetting () || needsLCP() || needsLensfun(); }