From f4351535f3bf10b94cccc721ab395e2c7f5010a4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 17 Aug 2018 16:32:17 +0200 Subject: Consolidate: basegfx::clamp -> o3tl::clamp Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1 Reviewed-on: https://gerrit.libreoffice.org/59265 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- basegfx/source/color/bcolormodifier.cxx | 18 +++++++++--------- basegfx/source/polygon/b2dpolypolygontools.cxx | 3 ++- basegfx/source/tools/keystoplerp.cxx | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'basegfx/source') 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 - +#include 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 +#include #include #include #include @@ -551,7 +552,7 @@ namespace basegfx } else { - nNumber=clamp(nNumber,'0','9') - '0'; + nNumber=o3tl::clamp(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 #include +#include #include #include @@ -86,7 +87,7 @@ namespace basegfx // everything) return ResultType( mnLastIndex, - clamp(fRawLerp,0.0,1.0)); + o3tl::clamp(fRawLerp,0.0,1.0)); } } } -- cgit