diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-08-17 16:32:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-08-17 20:13:21 +0200 |
commit | f4351535f3bf10b94cccc721ab395e2c7f5010a4 (patch) | |
tree | 19c18c568867d47918fad11b5c2bd70459cf74cc /basegfx | |
parent | 13db6e8671c36e1a028d6a8ad63f518e60f84870 (diff) |
Consolidate: basegfx::clamp -> o3tl::clamp
Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1
Reviewed-on: https://gerrit.libreoffice.org/59265
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/color/bcolormodifier.cxx | 18 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygontools.cxx | 3 | ||||
-rw-r--r-- | basegfx/source/tools/keystoplerp.cxx | 3 |
3 files changed, 13 insertions, 11 deletions
diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx index 6704f7ea489b..f656552f69b2 100644 --- a/basegfx/source/color/bcolormodifier.cxx +++ b/basegfx/source/color/bcolormodifier.cxx @@ -18,7 +18,7 @@ */ #include <basegfx/color/bcolormodifier.hxx> - +#include <o3tl/clamp.hxx> namespace basegfx { @@ -217,11 +217,11 @@ namespace basegfx { BColorModifier_RGBLuminanceContrast::BColorModifier_RGBLuminanceContrast(double fRed, double fGreen, double fBlue, double fLuminance, double fContrast) : BColorModifier(), - mfRed(basegfx::clamp(fRed, -1.0, 1.0)), - mfGreen(basegfx::clamp(fGreen, -1.0, 1.0)), - mfBlue(basegfx::clamp(fBlue, -1.0, 1.0)), - mfLuminance(basegfx::clamp(fLuminance, -1.0, 1.0)), - mfContrast(basegfx::clamp(fContrast, -1.0, 1.0)), + mfRed(o3tl::clamp(fRed, -1.0, 1.0)), + mfGreen(o3tl::clamp(fGreen, -1.0, 1.0)), + mfBlue(o3tl::clamp(fBlue, -1.0, 1.0)), + mfLuminance(o3tl::clamp(fLuminance, -1.0, 1.0)), + mfContrast(o3tl::clamp(fContrast, -1.0, 1.0)), mfContrastOff(1.0), mfRedOff(0.0), mfGreenOff(0.0), @@ -283,9 +283,9 @@ namespace basegfx if(mbUseIt) { return basegfx::BColor( - basegfx::clamp(aSourceColor.getRed() * mfContrastOff + mfRedOff, 0.0, 1.0), - basegfx::clamp(aSourceColor.getGreen() * mfContrastOff + mfGreenOff, 0.0, 1.0), - basegfx::clamp(aSourceColor.getBlue() * mfContrastOff + mfBlueOff, 0.0, 1.0)); + o3tl::clamp(aSourceColor.getRed() * mfContrastOff + mfRedOff, 0.0, 1.0), + o3tl::clamp(aSourceColor.getGreen() * mfContrastOff + mfGreenOff, 0.0, 1.0), + o3tl::clamp(aSourceColor.getBlue() * mfContrastOff + mfBlueOff, 0.0, 1.0)); } else { diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index a02373616a50..856a7bc4deb0 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -18,6 +18,7 @@ */ #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <o3tl/clamp.hxx> #include <osl/diagnose.h> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx> @@ -551,7 +552,7 @@ namespace basegfx } else { - nNumber=clamp<sal_uInt32>(nNumber,'0','9') - '0'; + nNumber=o3tl::clamp<sal_uInt32>(nNumber,'0','9') - '0'; } B2DPolygon aCurrSegment; diff --git a/basegfx/source/tools/keystoplerp.cxx b/basegfx/source/tools/keystoplerp.cxx index 0b0f230253f1..8e9941519e44 100644 --- a/basegfx/source/tools/keystoplerp.cxx +++ b/basegfx/source/tools/keystoplerp.cxx @@ -19,6 +19,7 @@ #include <basegfx/utils/keystoplerp.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <o3tl/clamp.hxx> #include <osl/diagnose.h> #include <algorithm> @@ -86,7 +87,7 @@ namespace basegfx // everything) return ResultType( mnLastIndex, - clamp(fRawLerp,0.0,1.0)); + o3tl::clamp(fRawLerp,0.0,1.0)); } } } |