summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap
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 /vcl/source/bitmap
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 'vcl/source/bitmap')
-rw-r--r--vcl/source/bitmap/BitmapEmbossGreyFilter.cxx7
-rw-r--r--vcl/source/bitmap/BitmapSepiaFilter.cxx5
-rw-r--r--vcl/source/bitmap/BitmapSobelGreyFilter.cxx5
3 files changed, 10 insertions, 7 deletions
diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
index 3b20d14657df..4ea239b1a549 100644
--- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
+++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
@@ -10,8 +10,9 @@
#include <sal/config.h>
+#include <algorithm>
+
#include <tools/helpers.hxx>
-#include <o3tl/clamp.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bitmapaccess.hxx>
@@ -54,7 +55,7 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const
const long nLz = FRound(sin(fElev) * 255.0);
const auto nZ2 = ((6 * 255) / 4) * ((6 * 255) / 4);
const long nNzLz = ((6 * 255) / 4) * nLz;
- const sal_uInt8 cLz = static_cast<sal_uInt8>(o3tl::clamp(nLz, 0L, 255L));
+ const sal_uInt8 cLz = static_cast<sal_uInt8>(std::clamp(nLz, 0L, 255L));
// fill mapping tables
pHMap[0] = 0;
@@ -105,7 +106,7 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const
{
const double fGrey
= nDotL / sqrt(static_cast<double>(nNx * nNx + nNy * nNy + nZ2));
- aGrey.SetIndex(static_cast<sal_uInt8>(o3tl::clamp(fGrey, 0.0, 255.0)));
+ aGrey.SetIndex(static_cast<sal_uInt8>(std::clamp(fGrey, 0.0, 255.0)));
}
pWriteAcc->SetPixelOnData(pScanline, nX, aGrey);
diff --git a/vcl/source/bitmap/BitmapSepiaFilter.cxx b/vcl/source/bitmap/BitmapSepiaFilter.cxx
index 6df4fe1b5221..5123bf13075c 100644
--- a/vcl/source/bitmap/BitmapSepiaFilter.cxx
+++ b/vcl/source/bitmap/BitmapSepiaFilter.cxx
@@ -10,7 +10,8 @@
#include <sal/config.h>
-#include <o3tl/clamp.hxx>
+#include <algorithm>
+
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bitmapaccess.hxx>
@@ -27,7 +28,7 @@ BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) const
if (pReadAcc)
{
const long nSepia
- = 10000 - 100 * o3tl::clamp(mnSepiaPercent, sal_uInt16(0), sal_uInt16(100));
+ = 10000 - 100 * std::clamp(mnSepiaPercent, sal_uInt16(0), sal_uInt16(100));
BitmapPalette aSepiaPal(256);
for (sal_uInt16 i = 0; i < 256; i++)
diff --git a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
index 397d0e6d1d5c..5ce4987a26fd 100644
--- a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
+++ b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
@@ -10,7 +10,8 @@
#include <sal/config.h>
-#include <o3tl/clamp.hxx>
+#include <algorithm>
+
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bitmapaccess.hxx>
@@ -119,7 +120,7 @@ BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const
nSum1 = static_cast<long>(
sqrt(static_cast<double>(nSum1 * nSum1 + nSum2 * nSum2)));
- aGrey.SetIndex(~static_cast<sal_uInt8>(o3tl::clamp(nSum1, 0L, 255L)));
+ aGrey.SetIndex(~static_cast<sal_uInt8>(std::clamp(nSum1, 0L, 255L)));
pWriteAcc->SetPixelOnData(pScanline, nX, aGrey);
if (nX < (nWidth - 1))