summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-11-11 10:40:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-11-11 18:11:04 +0100
commita3e725b896d692da39922dc41bed93fcb9dafae0 (patch)
treea733828ce0dbee28d29832d8597854b6fdec2287 /vcl/source/bitmap/BitmapSobelGreyFilter.cxx
parentb9b7f98befb722e59bd84bc9975a4ec381616abc (diff)
Replace uses of SAL_BOUND with o3tl::clamp
Change-Id: I66a7aad64623d778b4bf2fea591f227fdac2fdc7 Reviewed-on: https://gerrit.libreoffice.org/63264 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/source/bitmap/BitmapSobelGreyFilter.cxx')
-rw-r--r--vcl/source/bitmap/BitmapSobelGreyFilter.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
index 47c6f438f995..a631fe4f30a2 100644
--- a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
+++ b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
@@ -8,6 +8,9 @@
*
*/
+#include <sal/config.h>
+
+#include <o3tl/clamp.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bitmapaccess.hxx>
@@ -116,7 +119,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>(SAL_BOUND(nSum1, 0, 255)));
+ aGrey.SetIndex(~static_cast<sal_uInt8>(o3tl::clamp(nSum1, 0L, 255L)));
pWriteAcc->SetPixelOnData(pScanline, nX, aGrey);
if (nX < (nWidth - 1))