diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index c8c6e166e..db07fd91f 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -127,6 +127,7 @@ class ImProcFunctions bool needsDistortion() const; bool needsRotation() const; bool needsPerspective() const; + bool needsScale() const; bool needsGradient() const; bool needsVignetting() const; bool needsLCP() const; diff --git a/rtengine/iptransform.cc b/rtengine/iptransform.cc index 99ae90d24..5b48b2a50 100644 --- a/rtengine/iptransform.cc +++ b/rtengine/iptransform.cc @@ -431,7 +431,7 @@ bool ImProcFunctions::transCoord (int W, int H, const std::vector &src, green.clear (); blue.clear (); - if (!needsCA() && !needsDistortion() && !needsRotation() && !needsPerspective() && (!params->lensProf.useDist || pLCPMap == nullptr)) { + if (!needsCA() && !needsDistortion() && !needsRotation() && !needsPerspective() && !needsScale() && (!params->lensProf.useDist || pLCPMap == nullptr)) { for (size_t i = 0; i < src.size(); i++) { red.push_back (Coord2D (src[i].x, src[i].y)); green.push_back (Coord2D (src[i].x, src[i].y)); @@ -700,7 +700,7 @@ void ImProcFunctions::transform (Imagefloat* original, Imagefloat* transformed, } } - if (! (needsCA() || needsDistortion() || needsRotation() || needsPerspective() || needsLCP() || needsMetadata() || needsLensfun()) && (needsVignetting() || needsPCVignetting() || needsGradient())) { + if (! (needsCA() || needsDistortion() || needsRotation() || needsPerspective() || needsScale() || needsLCP() || needsMetadata() || needsLensfun()) && (needsVignetting() || needsPCVignetting() || needsGradient())) { transformLuminanceOnly (original, transformed, cx, cy, oW, oH, fW, fH); } else { bool highQuality; @@ -1451,6 +1451,11 @@ bool ImProcFunctions::needsPerspective () const params->perspective.projection_yaw)); } +bool ImProcFunctions::needsScale () const +{ + return std::abs(1.0 - params->commonTrans.getScale()) > 1e-6; +} + bool ImProcFunctions::needsGradient () const { return params->gradient.enabled && fabs (params->gradient.strength) > 1e-15; @@ -1488,7 +1493,7 @@ bool ImProcFunctions::needsTransform (int oW, int oH, int rawRotationDeg, const std::unique_ptr pLCPMap = LFDatabase::getInstance()->findModifier(params->lensProf, metadata, oW, oH, params->coarse, rawRotationDeg); needsLf = pLCPMap.get(); } - return needsCA () || needsDistortion () || needsRotation () || needsPerspective () || needsGradient () || needsPCVignetting () || needsVignetting () || needsLCP() || needsMetadata() || needsLf; + return needsCA () || needsDistortion () || needsRotation () || needsPerspective () || needsScale () || needsGradient () || needsPCVignetting () || needsVignetting () || needsLCP() || needsMetadata() || needsLf; }