summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 15:26:59 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 20:25:08 +0100
commit27cd397b1a1a8a39843c093eff68c5ea6cb249e7 (patch)
treeecf63804421b12987ae070a24a6ed967f29de1d8 /basegfx
parent5b19be032c51e0f7489b29c2c98e484587ed0865 (diff)
Drop o3tl/clamp.hxx, use C++17 std::clamp instead
Change-Id: I5043c787dcc3b78bc7fdff130564801194e39f46 Reviewed-on: https://gerrit.libreoffice.org/66177 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/color/bcolormodifier.cxx21
-rw-r--r--basegfx/source/polygon/b2dpolypolygontools.cxx5
-rw-r--r--basegfx/source/tools/keystoplerp.cxx3
3 files changed, 16 insertions, 13 deletions
diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx
index f656552f69b2..182083f6fbdb 100644
--- a/basegfx/source/color/bcolormodifier.cxx
+++ b/basegfx/source/color/bcolormodifier.cxx
@@ -17,8 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <algorithm>
+
#include <basegfx/color/bcolormodifier.hxx>
-#include <o3tl/clamp.hxx>
namespace basegfx
{
@@ -217,11 +220,11 @@ namespace basegfx
{
BColorModifier_RGBLuminanceContrast::BColorModifier_RGBLuminanceContrast(double fRed, double fGreen, double fBlue, double fLuminance, double fContrast)
: BColorModifier(),
- 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)),
+ mfRed(std::clamp(fRed, -1.0, 1.0)),
+ mfGreen(std::clamp(fGreen, -1.0, 1.0)),
+ mfBlue(std::clamp(fBlue, -1.0, 1.0)),
+ mfLuminance(std::clamp(fLuminance, -1.0, 1.0)),
+ mfContrast(std::clamp(fContrast, -1.0, 1.0)),
mfContrastOff(1.0),
mfRedOff(0.0),
mfGreenOff(0.0),
@@ -283,9 +286,9 @@ namespace basegfx
if(mbUseIt)
{
return basegfx::BColor(
- 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));
+ std::clamp(aSourceColor.getRed() * mfContrastOff + mfRedOff, 0.0, 1.0),
+ std::clamp(aSourceColor.getGreen() * mfContrastOff + mfGreenOff, 0.0, 1.0),
+ std::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 305934579ec5..d156506c147c 100644
--- a/basegfx/source/polygon/b2dpolypolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolypolygontools.cxx
@@ -18,7 +18,6 @@
*/
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include <o3tl/clamp.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -26,6 +25,8 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+
+#include <algorithm>
#include <numeric>
namespace basegfx
@@ -511,7 +512,7 @@ namespace basegfx
}
else
{
- nNumber=o3tl::clamp<sal_uInt32>(nNumber,'0','9') - '0';
+ nNumber=std::clamp<sal_uInt32>(nNumber,'0','9') - '0';
}
B2DPolygon aCurrSegment;
diff --git a/basegfx/source/tools/keystoplerp.cxx b/basegfx/source/tools/keystoplerp.cxx
index 8e9941519e44..0d7ac7537be6 100644
--- a/basegfx/source/tools/keystoplerp.cxx
+++ b/basegfx/source/tools/keystoplerp.cxx
@@ -19,7 +19,6 @@
#include <basegfx/utils/keystoplerp.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#include <o3tl/clamp.hxx>
#include <osl/diagnose.h>
#include <algorithm>
@@ -87,7 +86,7 @@ namespace basegfx
// everything)
return ResultType(
mnLastIndex,
- o3tl::clamp(fRawLerp,0.0,1.0));
+ std::clamp(fRawLerp,0.0,1.0));
}
}
}