vcl/inc/bitmap/impoctree.hxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
New commits: commit 548d77d0c06f7088dd3eb408797aa1fc1d7eb277 Author: Noel <noelgran...@gmail.com> AuthorDate: Fri Nov 13 10:23:36 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Nov 16 08:10:35 2020 +0100 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 <noel.gran...@collabora.co.uk> 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<sal_uInt16>(nRed, 0, 8160) >> 5, + std::clamp<sal_uInt16>(nGreen, 0, 8160) >> 5, + std::clamp<sal_uInt16>(nBlue, 0, 8160) >> 5); } #endif // INCLUDED_VCL_INC_IMPOCTREE_HXX _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits