From 548d77d0c06f7088dd3eb408797aa1fc1d7eb277 Mon Sep 17 00:00:00 2001 From: Noel Date: Fri, 13 Nov 2020 10:23:36 +0200 Subject: tools::Long->sal_uInt16 in ImpErrorQuad This class only wants about 12 bits of data per color component. Change-Id: I363ef085a302b3f1599b626e5cec92efe1c65026 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105909 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/inc/bitmap/impoctree.hxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/vcl/inc/bitmap/impoctree.hxx b/vcl/inc/bitmap/impoctree.hxx index aab1c53f5019..50083e38d6a0 100644 --- a/vcl/inc/bitmap/impoctree.hxx +++ b/vcl/inc/bitmap/impoctree.hxx @@ -24,9 +24,9 @@ class ImpErrorQuad { - tools::Long nRed; - tools::Long nGreen; - tools::Long nBlue; + sal_uInt16 nRed; + sal_uInt16 nGreen; + sal_uInt16 nBlue; public: ImpErrorQuad() @@ -37,9 +37,9 @@ public: } ImpErrorQuad(const BitmapColor& rColor) - : nRed(tools::Long(rColor.GetRed()) << 5) - , nGreen(tools::Long(rColor.GetGreen()) << 5) - , nBlue(tools::Long(rColor.GetBlue()) << 5) + : nRed(rColor.GetRed() << 5) + , nGreen(rColor.GetGreen() << 5) + , nBlue(rColor.GetBlue() << 5) { } @@ -56,16 +56,16 @@ public: inline void ImpErrorQuad::operator=(const BitmapColor& rColor) { - nRed = tools::Long(rColor.GetRed()) << 5; - nGreen = tools::Long(rColor.GetGreen()) << 5; - nBlue = tools::Long(rColor.GetBlue()) << 5; + nRed = rColor.GetRed() << 5; + nGreen = rColor.GetGreen() << 5; + nBlue = rColor.GetBlue() << 5; } inline ImpErrorQuad& ImpErrorQuad::operator-=(const BitmapColor& rColor) { - nRed -= tools::Long(rColor.GetRed()) << 5; - nGreen -= tools::Long(rColor.GetGreen()) << 5; - nBlue -= tools::Long(rColor.GetBlue()) << 5; + nRed -= rColor.GetRed() << 5; + nGreen -= rColor.GetGreen() << 5; + nBlue -= rColor.GetBlue() << 5; return *this; } @@ -100,9 +100,9 @@ inline void ImpErrorQuad::ImplAddColorError7(const ImpErrorQuad& rErrQuad) inline BitmapColor ImpErrorQuad::ImplGetColor() { - return BitmapColor(std::clamp(nRed, tools::Long(0), tools::Long(8160)) >> 5, - std::clamp(nGreen, tools::Long(0), tools::Long(8160)) >> 5, - std::clamp(nBlue, tools::Long(0), tools::Long(8160)) >> 5); + return BitmapColor(std::clamp(nRed, 0, 8160) >> 5, + std::clamp(nGreen, 0, 8160) >> 5, + std::clamp(nBlue, 0, 8160) >> 5); } #endif // INCLUDED_VCL_INC_IMPOCTREE_HXX -- cgit v1.2.3