diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-12 14:50:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-13 12:25:12 +0100 |
commit | abd42bdc86904d1b310e8298393c887e0c195499 (patch) | |
tree | 980c10fe687a52272830de739b5967893b3fbb67 /vcl | |
parent | f2dfa6bec9895892b58e22682ecdc5865fc249a3 (diff) |
tools::Long->sal_Int32 in vcl filters
Change-Id: I39cf98d1dc3f04ca91856f125b0a5b4fe1dfe237
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105749
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx | 6 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmappaint.cxx | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx index b92a0124b458..2d050b5cc117 100644 --- a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx +++ b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx @@ -45,8 +45,8 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const BitmapColor* pRowTmp3 = pColRow3.get(); BitmapColor* pColor; tools::Long nY, nX, i, nSumR, nSumG, nSumB, nMatrixVal, nTmp; - std::array<std::array<tools::Long, 256>, 9> aKoeff; - tools::Long* pTmp; + std::array<std::array<sal_Int32, 256>, 9> aKoeff; + sal_Int32* pTmp; // create LUT of products of matrix value and possible color component values for (nY = 0; nY < 9; nY++) @@ -199,7 +199,7 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const return BitmapEx(); } -const tools::Long g_SharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 }; +const sal_Int32 g_SharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 }; BitmapSharpenFilter::BitmapSharpenFilter() : BitmapConvolutionMatrixFilter(g_SharpenMatrix) diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index dd9eb1a5999b..49713869069b 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -926,12 +926,12 @@ bool Bitmap::Replace(const Color* pSearchColors, const Color* pReplaceColors, sa if (pAcc) { - std::unique_ptr<tools::Long[]> pMinR(new tools::Long[nColorCount]); - std::unique_ptr<tools::Long[]> pMaxR(new tools::Long[nColorCount]); - std::unique_ptr<tools::Long[]> pMinG(new tools::Long[nColorCount]); - std::unique_ptr<tools::Long[]> pMaxG(new tools::Long[nColorCount]); - std::unique_ptr<tools::Long[]> pMinB(new tools::Long[nColorCount]); - std::unique_ptr<tools::Long[]> pMaxB(new tools::Long[nColorCount]); + std::unique_ptr<sal_Int8[]> pMinR(new sal_Int8[nColorCount]); + std::unique_ptr<sal_Int8[]> pMaxR(new sal_Int8[nColorCount]); + std::unique_ptr<sal_Int8[]> pMinG(new sal_Int8[nColorCount]); + std::unique_ptr<sal_Int8[]> pMaxG(new sal_Int8[nColorCount]); + std::unique_ptr<sal_Int8[]> pMinB(new sal_Int8[nColorCount]); + std::unique_ptr<sal_Int8[]> pMaxB(new sal_Int8[nColorCount]); if (pTols) { @@ -940,12 +940,12 @@ bool Bitmap::Replace(const Color* pSearchColors, const Color* pReplaceColors, sa const Color& rCol = pSearchColors[i]; const sal_uInt8 nTol = pTols[i]; - pMinR[i] = MinMax<tools::Long>(rCol.GetRed() - nTol, 0, 255); - pMaxR[i] = MinMax<tools::Long>(rCol.GetRed() + nTol, 0, 255); - pMinG[i] = MinMax<tools::Long>(rCol.GetGreen() - nTol, 0, 255); - pMaxG[i] = MinMax<tools::Long>(rCol.GetGreen() + nTol, 0, 255); - pMinB[i] = MinMax<tools::Long>(rCol.GetBlue() - nTol, 0, 255); - pMaxB[i] = MinMax<tools::Long>(rCol.GetBlue() + nTol, 0, 255); + pMinR[i] = std::clamp(rCol.GetRed() - nTol, 0, 255); + pMaxR[i] = std::clamp(rCol.GetRed() + nTol, 0, 255); + pMinG[i] = std::clamp(rCol.GetGreen() - nTol, 0, 255); + pMaxG[i] = std::clamp(rCol.GetGreen() + nTol, 0, 255); + pMinB[i] = std::clamp(rCol.GetBlue() - nTol, 0, 255); + pMaxB[i] = std::clamp(rCol.GetBlue() + nTol, 0, 255); } } else |