summaryrefslogtreecommitdiff
path: root/vcl/inc/bitmap/impoctree.hxx
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-13 10:23:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 08:10:35 +0100
commit548d77d0c06f7088dd3eb408797aa1fc1d7eb277 (patch)
tree1d937daefcd40b9d2c0e05eaec2da500b2b68845 /vcl/inc/bitmap/impoctree.hxx
parentbf4bbc3c2174b21577b8878bc3197923ba44a029 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc/bitmap/impoctree.hxx')
-rw-r--r--vcl/inc/bitmap/impoctree.hxx30
1 files 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<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