summaryrefslogtreecommitdiff
path: root/vcl/source/bitmap
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-19 15:12:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-19 21:34:46 +0200
commit3aef606f2758172a27718a06fea0ff9080e4d80f (patch)
treead323c90301d80bbb3b68163d8b87e5402b687ed /vcl/source/bitmap
parent5afba3e12c8d4eb1ebb8e087134eb87593bb017a (diff)
use tools::Long in vcl
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/bitmap')
-rw-r--r--vcl/source/bitmap/BitmapAlphaClampFilter.cxx4
-rw-r--r--vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx79
-rw-r--r--vcl/source/bitmap/BitmapColorQuantizationFilter.cxx32
-rw-r--r--vcl/source/bitmap/BitmapColorizeFilter.cxx8
-rw-r--r--vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx12
-rw-r--r--vcl/source/bitmap/BitmapDisabledImageFilter.cxx4
-rw-r--r--vcl/source/bitmap/BitmapDuoToneFilter.cxx8
-rw-r--r--vcl/source/bitmap/BitmapEmbossGreyFilter.cxx22
-rw-r--r--vcl/source/bitmap/BitmapFastScaleFilter.cxx22
-rw-r--r--vcl/source/bitmap/BitmapFilterStackBlur.cxx191
-rw-r--r--vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx4
-rw-r--r--vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx68
-rw-r--r--vcl/source/bitmap/BitmapLightenFilter.cxx4
-rw-r--r--vcl/source/bitmap/BitmapMedianFilter.cxx14
-rw-r--r--vcl/source/bitmap/BitmapMonochromeFilter.cxx12
-rw-r--r--vcl/source/bitmap/BitmapMosaicFilter.cxx6
-rw-r--r--vcl/source/bitmap/BitmapPopArtFilter.cxx8
-rw-r--r--vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx74
-rw-r--r--vcl/source/bitmap/BitmapScaleSuperFilter.cxx192
-rw-r--r--vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx8
-rw-r--r--vcl/source/bitmap/BitmapSepiaFilter.cxx14
-rw-r--r--vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx12
-rw-r--r--vcl/source/bitmap/BitmapSobelGreyFilter.cxx28
-rw-r--r--vcl/source/bitmap/BitmapSolarizeFilter.cxx8
-rw-r--r--vcl/source/bitmap/BitmapSymmetryCheck.cxx16
-rw-r--r--vcl/source/bitmap/BitmapTools.cxx66
-rw-r--r--vcl/source/bitmap/Octree.cxx38
-rw-r--r--vcl/source/bitmap/bitmap.cxx136
-rw-r--r--vcl/source/bitmap/bitmappaint.cxx221
-rw-r--r--vcl/source/bitmap/salbmp.cxx4
30 files changed, 672 insertions, 643 deletions
diff --git a/vcl/source/bitmap/BitmapAlphaClampFilter.cxx b/vcl/source/bitmap/BitmapAlphaClampFilter.cxx
index 3db6b43e2c76..9753d82666fd 100644
--- a/vcl/source/bitmap/BitmapAlphaClampFilter.cxx
+++ b/vcl/source/bitmap/BitmapAlphaClampFilter.cxx
@@ -23,11 +23,11 @@ BitmapEx BitmapAlphaClampFilter::execute(BitmapEx const& rBitmapEx) const
AlphaScopedWriteAccess pWriteAlpha(aBitmapAlpha);
const Size aSize(rBitmapEx.GetSizePixel());
- for (long nY = 0; nY < aSize.Height(); ++nY)
+ for (tools::Long nY = 0; nY < aSize.Height(); ++nY)
{
Scanline pScanAlpha = pWriteAlpha->GetScanline(nY);
- for (long nX = 0; nX < aSize.Width(); ++nX)
+ for (tools::Long nX = 0; nX < aSize.Width(); ++nX)
{
BitmapColor aBitmapAlphaValue(pWriteAlpha->GetPixelFromData(pScanAlpha, nX));
if (aBitmapAlphaValue.GetIndex() > mcThreshold)
diff --git a/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx b/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx
index 9ee1ad3822b4..62be25514e90 100644
--- a/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx
+++ b/vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx
@@ -29,12 +29,12 @@ struct FilterSharedData
{
BitmapReadAccess* mpReadAccess;
BitmapWriteAccess* mpWriteAccess;
- long mnRadius;
+ tools::Long mnRadius;
sal_uInt8 mnOutsideVal;
Color maOutsideColor;
FilterSharedData(Bitmap::ScopedReadAccess& rReadAccess, BitmapScopedWriteAccess& rWriteAccess,
- long nRadius, sal_uInt8 nOutsideVal)
+ tools::Long nRadius, sal_uInt8 nOutsideVal)
: mpReadAccess(rReadAccess.get())
, mpWriteAccess(rWriteAccess.get())
, mnRadius(nRadius)
@@ -74,13 +74,15 @@ template <typename MorphologyOp, int nComponentWidth> struct Value
bLookOutside ? rShared.mnOutsideVal : MorphologyOp::initVal);
}
- void apply(const BitmapReadAccess* pReadAccess, long x, long y, sal_uInt8* pHint = nullptr)
+ void apply(const BitmapReadAccess* pReadAccess, tools::Long x, tools::Long y,
+ sal_uInt8* pHint = nullptr)
{
sal_uInt8* pSource = (pHint ? pHint : pReadAccess->GetScanline(y)) + nWidthBytes * x;
std::transform(pSource, pSource + nWidthBytes, aResult, aResult, MorphologyOp::apply);
}
- void copy(const BitmapWriteAccess* pWriteAccess, long x, long y, sal_uInt8* pHint = nullptr)
+ void copy(const BitmapWriteAccess* pWriteAccess, tools::Long x, tools::Long y,
+ sal_uInt8* pHint = nullptr)
{
sal_uInt8* pDest = (pHint ? pHint : pWriteAccess->GetScanline(y)) + nWidthBytes * x;
std::copy_n(aResult, nWidthBytes, pDest);
@@ -102,7 +104,8 @@ template <typename MorphologyOp> struct Value<MorphologyOp, 0>
{
}
- void apply(const BitmapReadAccess* pReadAccess, long x, long y, sal_uInt8* /*pHint*/ = nullptr)
+ void apply(const BitmapReadAccess* pReadAccess, tools::Long x, tools::Long y,
+ sal_uInt8* /*pHint*/ = nullptr)
{
const auto& rSource = pReadAccess->GetColor(y, x);
aResult = Color(MorphologyOp::apply(rSource.GetTransparency(), aResult.GetTransparency()),
@@ -111,13 +114,15 @@ template <typename MorphologyOp> struct Value<MorphologyOp, 0>
MorphologyOp::apply(rSource.GetBlue(), aResult.GetBlue()));
}
- void copy(BitmapWriteAccess* pWriteAccess, long x, long y, sal_uInt8* /*pHint*/ = nullptr)
+ void copy(BitmapWriteAccess* pWriteAccess, tools::Long x, tools::Long y,
+ sal_uInt8* /*pHint*/ = nullptr)
{
pWriteAccess->SetPixel(y, x, aResult);
}
};
-bool GetMinMax(long nCenter, long nRadius, long nMaxLimit, long& nMin, long& nMax)
+bool GetMinMax(tools::Long nCenter, tools::Long nRadius, tools::Long nMaxLimit, tools::Long& nMin,
+ tools::Long& nMax)
{
nMin = nCenter - nRadius;
nMax = nCenter + nRadius;
@@ -137,26 +142,27 @@ bool GetMinMax(long nCenter, long nRadius, long nMaxLimit, long& nMin, long& nMa
template <typename MorphologyOp, int nComponentWidth> struct pass
{
- static void Horizontal(FilterSharedData const& rShared, const long nStart, const long nEnd)
+ static void Horizontal(FilterSharedData const& rShared, const tools::Long nStart,
+ const tools::Long nEnd)
{
BitmapReadAccess* pReadAccess = rShared.mpReadAccess;
BitmapWriteAccess* pWriteAccess = rShared.mpWriteAccess;
- const long nLastIndex = pReadAccess->Width() - 1;
+ const tools::Long nLastIndex = pReadAccess->Width() - 1;
- for (long y = nStart; y <= nEnd; y++)
+ for (tools::Long y = nStart; y <= nEnd; y++)
{
// Optimization
sal_uInt8* const pSourceHint = pReadAccess->GetScanline(y);
sal_uInt8* const pDestHint = pWriteAccess->GetScanline(y);
- for (long x = 0; x <= nLastIndex; x++)
+ for (tools::Long x = 0; x <= nLastIndex; x++)
{
// This processes [nRadius * 2 + 1] pixels of source per resulting pixel
// TODO: try to optimize this to not process same pixels repeatedly
- long iMin, iMax;
+ tools::Long iMin, iMax;
const bool bLookOutside = GetMinMax(x, rShared.mnRadius, nLastIndex, iMin, iMax);
Value<MorphologyOp, nComponentWidth> aResult(rShared, bLookOutside);
- for (long i = iMin; i <= iMax; ++i)
+ for (tools::Long i = iMin; i <= iMax; ++i)
aResult.apply(pReadAccess, i, y, pSourceHint);
aResult.copy(pWriteAccess, x, y, pDestHint);
@@ -164,23 +170,24 @@ template <typename MorphologyOp, int nComponentWidth> struct pass
}
}
- static void Vertical(FilterSharedData const& rShared, const long nStart, const long nEnd)
+ static void Vertical(FilterSharedData const& rShared, const tools::Long nStart,
+ const tools::Long nEnd)
{
BitmapReadAccess* pReadAccess = rShared.mpReadAccess;
BitmapWriteAccess* pWriteAccess = rShared.mpWriteAccess;
- const long nLastIndex = pReadAccess->Height() - 1;
+ const tools::Long nLastIndex = pReadAccess->Height() - 1;
- for (long x = nStart; x <= nEnd; x++)
+ for (tools::Long x = nStart; x <= nEnd; x++)
{
- for (long y = 0; y <= nLastIndex; y++)
+ for (tools::Long y = 0; y <= nLastIndex; y++)
{
// This processes [nRadius * 2 + 1] pixels of source per resulting pixel
// TODO: try to optimize this to not process same pixels repeatedly
- long iMin, iMax;
+ tools::Long iMin, iMax;
const bool bLookOutside = GetMinMax(y, rShared.mnRadius, nLastIndex, iMin, iMax);
Value<MorphologyOp, nComponentWidth> aResult(rShared, bLookOutside);
- for (long i = iMin; i <= iMax; ++i)
+ for (tools::Long i = iMin; i <= iMax; ++i)
aResult.apply(pReadAccess, x, i);
aResult.copy(pWriteAccess, x, y);
@@ -189,18 +196,18 @@ template <typename MorphologyOp, int nComponentWidth> struct pass
}
};
-typedef void (*passFn)(FilterSharedData const& rShared, long nStart, long nEnd);
+typedef void (*passFn)(FilterSharedData const& rShared, tools::Long nStart, tools::Long nEnd);
class FilterTask : public comphelper::ThreadTask
{
passFn mpFunction;
FilterSharedData& mrShared;
- long mnStart;
- long mnEnd;
+ tools::Long mnStart;
+ tools::Long mnEnd;
public:
explicit FilterTask(const std::shared_ptr<comphelper::ThreadTaskTag>& pTag, passFn pFunction,
- FilterSharedData& rShared, long nStart, long nEnd)
+ FilterSharedData& rShared, tools::Long nStart, tools::Long nEnd)
: comphelper::ThreadTask(pTag)
, mpFunction(pFunction)
, mrShared(rShared)
@@ -212,11 +219,11 @@ public:
virtual void doWork() override { mpFunction(mrShared, mnStart, mnEnd); }
};
-constexpr long nThreadStrip = 16;
+constexpr tools::Long nThreadStrip = 16;
template <typename MorphologyOp, int nComponentWidth>
-void runFilter(Bitmap& rBitmap, const long nRadius, const bool bParallel, bool bUseValueOutside,
- sal_uInt8 nValueOutside)
+void runFilter(Bitmap& rBitmap, const tools::Long nRadius, const bool bParallel,
+ bool bUseValueOutside, sal_uInt8 nValueOutside)
{
using myPass = pass<MorphologyOp, nComponentWidth>;
const sal_uInt8 nOutsideVal = bUseValueOutside ? nValueOutside : MorphologyOp::initVal;
@@ -232,11 +239,11 @@ void runFilter(Bitmap& rBitmap, const long nRadius, const bool bParallel, bool b
BitmapScopedWriteAccess pWriteAccess(rBitmap);
FilterSharedData aSharedData(pReadAccess, pWriteAccess, nRadius, nOutsideVal);
- const long nLastIndex = pReadAccess->Height() - 1;
- long nStripStart = 0;
+ const tools::Long nLastIndex = pReadAccess->Height() - 1;
+ tools::Long nStripStart = 0;
for (; nStripStart < nLastIndex - nThreadStrip; nStripStart += nThreadStrip)
{
- long nStripEnd = nStripStart + nThreadStrip - 1;
+ tools::Long nStripEnd = nStripStart + nThreadStrip - 1;
auto pTask(std::make_unique<FilterTask>(pTag, myPass::Horizontal, aSharedData,
nStripStart, nStripEnd));
rShared.pushTask(std::move(pTask));
@@ -250,11 +257,11 @@ void runFilter(Bitmap& rBitmap, const long nRadius, const bool bParallel, bool b
BitmapScopedWriteAccess pWriteAccess(rBitmap);
FilterSharedData aSharedData(pReadAccess, pWriteAccess, nRadius, nOutsideVal);
- const long nLastIndex = pReadAccess->Width() - 1;
- long nStripStart = 0;
+ const tools::Long nLastIndex = pReadAccess->Width() - 1;
+ tools::Long nStripStart = 0;
for (; nStripStart < nLastIndex - nThreadStrip; nStripStart += nThreadStrip)
{
- long nStripEnd = nStripStart + nThreadStrip - 1;
+ tools::Long nStripEnd = nStripStart + nThreadStrip - 1;
auto pTask(std::make_unique<FilterTask>(pTag, myPass::Vertical, aSharedData,
nStripStart, nStripEnd));
rShared.pushTask(std::move(pTask));
@@ -275,16 +282,16 @@ void runFilter(Bitmap& rBitmap, const long nRadius, const bool bParallel, bool b
Bitmap::ScopedReadAccess pReadAccess(rBitmap);
BitmapScopedWriteAccess pWriteAccess(rBitmap);
FilterSharedData aSharedData(pReadAccess, pWriteAccess, nRadius, nOutsideVal);
- long nFirstIndex = 0;
- long nLastIndex = pReadAccess->Height() - 1;
+ tools::Long nFirstIndex = 0;
+ tools::Long nLastIndex = pReadAccess->Height() - 1;
myPass::Horizontal(aSharedData, nFirstIndex, nLastIndex);
}
{
Bitmap::ScopedReadAccess pReadAccess(rBitmap);
BitmapScopedWriteAccess pWriteAccess(rBitmap);
FilterSharedData aSharedData(pReadAccess, pWriteAccess, nRadius, nOutsideVal);
- long nFirstIndex = 0;
- long nLastIndex = pReadAccess->Width() - 1;
+ tools::Long nFirstIndex = 0;
+ tools::Long nLastIndex = pReadAccess->Width() - 1;
myPass::Vertical(aSharedData, nFirstIndex, nLastIndex);
}
}
diff --git a/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx b/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx
index 390319d8ad9e..40b4b803dcb0 100644
--- a/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx
+++ b/vcl/source/bitmap/BitmapColorQuantizationFilter.cxx
@@ -53,17 +53,17 @@ BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const
const sal_uInt32 nColorOffset = 256 / nColorsPerComponent;
const sal_uInt32 nTotalColors
= nColorsPerComponent * nColorsPerComponent * nColorsPerComponent;
- const long nWidth = pRAcc->Width();
- const long nHeight = pRAcc->Height();
+ const tools::Long nWidth = pRAcc->Width();
+ const tools::Long nHeight = pRAcc->Height();
std::unique_ptr<PopularColorCount[]> pCountTable(new PopularColorCount[nTotalColors]);
memset(pCountTable.get(), 0, nTotalColors * sizeof(PopularColorCount));
- for (long nR = 0, nIndex = 0; nR < 256; nR += nColorOffset)
+ for (tools::Long nR = 0, nIndex = 0; nR < 256; nR += nColorOffset)
{
- for (long nG = 0; nG < 256; nG += nColorOffset)
+ for (tools::Long nG = 0; nG < 256; nG += nColorOffset)
{
- for (long nB = 0; nB < 256; nB += nColorOffset)
+ for (tools::Long nB = 0; nB < 256; nB += nColorOffset)
{
pCountTable[nIndex].mnIndex = nIndex;
nIndex++;
@@ -73,10 +73,10 @@ BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const
if (pRAcc->HasPalette())
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
const BitmapColor& rCol
= pRAcc->GetPaletteColor(pRAcc->GetIndexFromData(pScanlineRead, nX));
@@ -91,10 +91,10 @@ BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const
}
else
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
const BitmapColor aCol(pRAcc->GetPixelFromData(pScanlineRead, nX));
pCountTable[((static_cast<sal_uInt32>(aCol.GetRed()) >> nRightShiftBits)
@@ -145,11 +145,11 @@ BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const
BitmapColor aDstCol(sal_uInt8(0));
std::unique_ptr<sal_uInt8[]> pIndexMap(new sal_uInt8[nTotalColors]);
- for (long nR = 0, nIndex = 0; nR < 256; nR += nColorOffset)
+ for (tools::Long nR = 0, nIndex = 0; nR < 256; nR += nColorOffset)
{
- for (long nG = 0; nG < 256; nG += nColorOffset)
+ for (tools::Long nG = 0; nG < 256; nG += nColorOffset)
{
- for (long nB = 0; nB < 256; nB += nColorOffset)
+ for (tools::Long nB = 0; nB < 256; nB += nColorOffset)
{
pIndexMap[nIndex++] = static_cast<sal_uInt8>(aNewPal.GetBestIndex(
BitmapColor(static_cast<sal_uInt8>(nR), static_cast<sal_uInt8>(nG),
@@ -160,11 +160,11 @@ BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const
if (pRAcc->HasPalette())
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWAcc->GetScanline(nY);
Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
const BitmapColor& rCol = pRAcc->GetPaletteColor(
pRAcc->GetIndexFromData(pScanlineRead, nX));
@@ -182,12 +182,12 @@ BitmapEx BitmapColorQuantizationFilter::execute(BitmapEx const& aBitmapEx) const
}
else
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWAcc->GetScanline(nY);
Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
const BitmapColor aCol(pRAcc->GetPixelFromData(pScanlineRead, nX));
aDstCol.SetIndex(pIndexMap[((static_cast<sal_uInt32>(aCol.GetRed())
diff --git a/vcl/source/bitmap/BitmapColorizeFilter.cxx b/vcl/source/bitmap/BitmapColorizeFilter.cxx
index 343642b77a6f..4e063e1ef75a 100644
--- a/vcl/source/bitmap/BitmapColorizeFilter.cxx
+++ b/vcl/source/bitmap/BitmapColorizeFilter.cxx
@@ -23,13 +23,13 @@ BitmapEx BitmapColorizeFilter::execute(BitmapEx const& rBitmapEx) const
return rBitmapEx;
BitmapColor aBitmapColor;
- const long nW = pWriteAccess->Width();
- const long nH = pWriteAccess->Height();
+ const tools::Long nW = pWriteAccess->Width();
+ const tools::Long nH = pWriteAccess->Height();
std::vector<sal_uInt8> aMapR(256);
std::vector<sal_uInt8> aMapG(256);
std::vector<sal_uInt8> aMapB(256);
- long nX;
- long nY;
+ tools::Long nX;
+ tools::Long nY;
const sal_uInt8 cR = maColor.GetRed();
const sal_uInt8 cG = maColor.GetGreen();
diff --git a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx
index 6237d3db97ff..1febdf3503c5 100644
--- a/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx
+++ b/vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx
@@ -22,7 +22,7 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const
{
Bitmap aBitmap(rBitmapEx.GetBitmap());
- const long nDivisor = 8;
+ const tools::Long nDivisor = 8;
Bitmap::ScopedReadAccess pReadAcc(aBitmap);
bool bRet = false;
@@ -33,8 +33,8 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
- const long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
- const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
+ const tools::Long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
+ const tools::Long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
std::unique_ptr<long[]> pColm(new long[nWidth2]);
std::unique_ptr<long[]> pRows(new long[nHeight2]);
std::unique_ptr<BitmapColor[]> pColRow1(new BitmapColor[nWidth2]);
@@ -44,9 +44,9 @@ BitmapEx BitmapConvolutionMatrixFilter::execute(BitmapEx const& rBitmapEx) const
BitmapColor* pRowTmp2 = pColRow2.get();
BitmapColor* pRowTmp3 = pColRow3.get();
BitmapColor* pColor;
- long nY, nX, i, nSumR, nSumG, nSumB, nMatrixVal, nTmp;
+ tools::Long nY, nX, i, nSumR, nSumG, nSumB, nMatrixVal, nTmp;
std::array<std::array<long, 256>, 9> aKoeff;
- long* pTmp;
+ tools::Long* 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 long g_SharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 };
+const tools::Long g_SharpenMatrix[] = { -1, -1, -1, -1, 16, -1, -1, -1, -1 };
BitmapSharpenFilter::BitmapSharpenFilter()
: BitmapConvolutionMatrixFilter(g_SharpenMatrix)
diff --git a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
index 5ade2451a438..1110b9c5d5a6 100644
--- a/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
+++ b/vcl/source/bitmap/BitmapDisabledImageFilter.cxx
@@ -32,12 +32,12 @@ BitmapEx BitmapDisabledImageFilter::execute(BitmapEx const& rBitmapEx) const
Bitmap::ScopedReadAccess pRead(aReadBitmap);
if (pRead && pGrey)
{
- for (long nY = 0; nY < aSize.Height(); ++nY)
+ for (tools::Long nY = 0; nY < aSize.Height(); ++nY)
{
Scanline pGreyScan = pGrey->GetScanline(nY);
Scanline pReadScan = pRead->GetScanline(nY);
- for (long nX = 0; nX < aSize.Width(); ++nX)
+ for (tools::Long nX = 0; nX < aSize.Width(); ++nX)
{
// Get the luminance from RGB color and remap the value from 0-255 to 160-224
const BitmapColor aColor = pRead->GetPixelFromData(pReadScan, nX);
diff --git a/vcl/source/bitmap/BitmapDuoToneFilter.cxx b/vcl/source/bitmap/BitmapDuoToneFilter.cxx
index 65d4b3f41442..3bcf1035a4c7 100644
--- a/vcl/source/bitmap/BitmapDuoToneFilter.cxx
+++ b/vcl/source/bitmap/BitmapDuoToneFilter.cxx
@@ -27,8 +27,8 @@ BitmapEx BitmapDuoToneFilter::execute(BitmapEx const& rBitmapEx) const
{
Bitmap aBitmap(rBitmapEx.GetBitmap());
- const long nWidth = aBitmap.GetSizePixel().Width();
- const long nHeight = aBitmap.GetSizePixel().Height();
+ const tools::Long nWidth = aBitmap.GetSizePixel().Width();
+ const tools::Long nHeight = aBitmap.GetSizePixel().Height();
Bitmap aResultBitmap(aBitmap.GetSizePixel(), 24);
Bitmap::ScopedReadAccess pReadAcc(aBitmap);
@@ -40,9 +40,9 @@ BitmapEx BitmapDuoToneFilter::execute(BitmapEx const& rBitmapEx) const
static_cast<sal_uInt8>(mnColorTwo >> 8),
static_cast<sal_uInt8>(mnColorTwo));
- for (long x = 0; x < nWidth; x++)
+ for (tools::Long x = 0; x < nWidth; x++)
{
- for (long y = 0; y < nHeight; y++)
+ for (tools::Long y = 0; y < nHeight; y++)
{
BitmapColor aColor = pReadAcc->GetColor(y, x);
sal_uInt8 nLuminance = aColor.GetLuminance();
diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
index 4ea239b1a549..a19683ab6582 100644
--- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
+++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
@@ -40,21 +40,21 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
BitmapColor aGrey(sal_uInt8(0));
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
- long nGrey11, nGrey12, nGrey13;
- long nGrey21, nGrey22, nGrey23;
- long nGrey31, nGrey32, nGrey33;
+ const tools::Long nWidth = pWriteAcc->Width();
+ const tools::Long nHeight = pWriteAcc->Height();
+ tools::Long nGrey11, nGrey12, nGrey13;
+ tools::Long nGrey21, nGrey22, nGrey23;
+ tools::Long nGrey31, nGrey32, nGrey33;
double fAzim = basegfx::deg2rad(mnAzimuthAngle100 * 0.01);
double fElev = basegfx::deg2rad(mnElevationAngle100 * 0.01);
std::unique_ptr<long[]> pHMap(new long[nWidth + 2]);
std::unique_ptr<long[]> pVMap(new long[nHeight + 2]);
- long nX, nY, nNx, nNy, nDotL;
- const long nLx = FRound(cos(fAzim) * cos(fElev) * 255.0);
- const long nLy = FRound(sin(fAzim) * cos(fElev) * 255.0);
- const long nLz = FRound(sin(fElev) * 255.0);
+ tools::Long nX, nY, nNx, nNy, nDotL;
+ const tools::Long nLx = FRound(cos(fAzim) * cos(fElev) * 255.0);
+ const tools::Long nLy = FRound(sin(fAzim) * cos(fElev) * 255.0);
+ const tools::Long nLz = FRound(sin(fElev) * 255.0);
const auto nZ2 = ((6 * 255) / 4) * ((6 * 255) / 4);
- const long nNzLz = ((6 * 255) / 4) * nLz;
+ const tools::Long nNzLz = ((6 * 255) / 4) * nLz;
const sal_uInt8 cLz = static_cast<sal_uInt8>(std::clamp(nLz, 0L, 255L));
// fill mapping tables
@@ -113,7 +113,7 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const
if (nX < (nWidth - 1))
{
- const long nNextX = pHMap[nX + 3];
+ const tools::Long nNextX = pHMap[nX + 3];
nGrey11 = nGrey12;
nGrey12 = nGrey13;
diff --git a/vcl/source/bitmap/BitmapFastScaleFilter.cxx b/vcl/source/bitmap/BitmapFastScaleFilter.cxx
index a48f9e193beb..5b9ff591c953 100644
--- a/vcl/source/bitmap/BitmapFastScaleFilter.cxx
+++ b/vcl/source/bitmap/BitmapFastScaleFilter.cxx
@@ -33,8 +33,8 @@ BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) const
Bitmap aBitmap(rBitmapEx.GetBitmap());
const Size aSizePix(aBitmap.GetSizePixel());
- const long nNewWidth = FRound(aSizePix.Width() * mfScaleX);
- const long nNewHeight = FRound(aSizePix.Height() * mfScaleY);
+ const tools::Long nNewWidth = FRound(aSizePix.Width() * mfScaleX);
+ const tools::Long nNewHeight = FRound(aSizePix.Height() * mfScaleY);
bool bRet = false;
SAL_INFO("vcl.gdi", "New width: " << nNewWidth << "\nNew height: " << nNewHeight);
@@ -51,8 +51,8 @@ BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
- const long nScanlineSize = pWriteAcc->GetScanlineSize();
- const long nNewHeight1 = nNewHeight - 1;
+ const tools::Long nScanlineSize = pWriteAcc->GetScanlineSize();
+ const tools::Long nNewHeight1 = nNewHeight - 1;
if (nNewWidth && nNewHeight)
{
@@ -61,24 +61,24 @@ BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) const
std::unique_ptr<long[]> pLutX(new long[nNewWidth]);
std::unique_ptr<long[]> pLutY(new long[nNewHeight]);
- for (long nX = 0; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0; nX < nNewWidth; nX++)
{
- pLutX[nX] = long(nX * nWidth / nNewWidth);
+ pLutX[nX] = tools::Long(nX * nWidth / nNewWidth);
}
- for (long nY = 0; nY < nNewHeight; nY++)
+ for (tools::Long nY = 0; nY < nNewHeight; nY++)
{
- pLutY[nY] = long(nY * nHeight / nNewHeight);
+ pLutY[nY] = tools::Long(nY * nHeight / nNewHeight);
}
- long nActY = 0;
+ tools::Long nActY = 0;
while (nActY < nNewHeight)
{
- long nMapY = pLutY[nActY];
+ tools::Long nMapY = pLutY[nActY];
Scanline pScanline = pWriteAcc->GetScanline(nActY);
Scanline pScanlineRead = pReadAcc->GetScanline(nMapY);
- for (long nX = 0; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0; nX < nNewWidth; nX++)
{
pWriteAcc->SetPixelOnData(
pScanline, nX,
diff --git a/vcl/source/bitmap/BitmapFilterStackBlur.cxx b/vcl/source/bitmap/BitmapFilterStackBlur.cxx
index 6883808ebe4a..66645077eb0f 100644
--- a/vcl/source/bitmap/BitmapFilterStackBlur.cxx
+++ b/vcl/source/bitmap/BitmapFilterStackBlur.cxx
@@ -52,13 +52,13 @@ struct BlurSharedData
{
BitmapReadAccess* mpReadAccess;
BitmapWriteAccess* mpWriteAccess;
- long mnRadius;
- long mnComponentWidth;
- long mnDiv;
- long mnColorChannels;
+ tools::Long mnRadius;
+ tools::Long mnComponentWidth;
+ tools::Long mnDiv;
+ tools::Long mnColorChannels;
- BlurSharedData(BitmapReadAccess* pReadAccess, BitmapWriteAccess* pWriteAccess, long aRadius,
- long nComponentWidth, long nColorChannels)
+ BlurSharedData(BitmapReadAccess* pReadAccess, BitmapWriteAccess* pWriteAccess,
+ tools::Long aRadius, tools::Long nComponentWidth, tools::Long nColorChannels)
: mpReadAccess(pReadAccess)
, mpWriteAccess(pWriteAccess)
, mnRadius(aRadius)
@@ -92,35 +92,39 @@ struct BlurArrays
{
}
- void initializeWeightAndPositions(long nLastIndex)
+ void initializeWeightAndPositions(tools::Long nLastIndex)
{
- for (long i = 0; i < maShared.mnDiv; i++)
+ for (tools::Long i = 0; i < maShared.mnDiv; i++)
{
maPositionTable[i] = std::clamp(i - maShared.mnRadius, 0L, nLastIndex);
maWeightTable[i] = maShared.mnRadius + 1 - std::abs(i - maShared.mnRadius);
}
}
- long getMultiplyValue() const
+ tools::Long getMultiplyValue() const
{
- return static_cast<long>(constMultiplyTable[maShared.mnRadius]);
+ return static_cast<tools::Long>(constMultiplyTable[maShared.mnRadius]);
}
- long getShiftValue() const { return static_cast<long>(constShiftTable[maShared.mnRadius]); }
+ tools::Long getShiftValue() const
+ {
+ return static_cast<tools::Long>(constShiftTable[maShared.mnRadius]);
+ }
};
-typedef void (*BlurRangeFn)(BlurSharedData const& rShared, long nStartY, long nEndY);
+typedef void (*BlurRangeFn)(BlurSharedData const& rShared, tools::Long nStartY, tools::Long nEndY);
class BlurTask : public comphelper::ThreadTask
{
BlurRangeFn mpBlurFunction;
BlurSharedData& mrShared;
- long mnStartY;
- long mnEndY;
+ tools::Long mnStartY;
+ tools::Long mnEndY;
public:
explicit BlurTask(const std::shared_ptr<comphelper::ThreadTaskTag>& pTag,
- BlurRangeFn pBlurFunction, BlurSharedData& rShared, long nStartY, long nEndY)
+ BlurRangeFn pBlurFunction, BlurSharedData& rShared, tools::Long nStartY,
+ tools::Long nEndY)
: comphelper::ThreadTask(pTag)
, mpBlurFunction(pBlurFunction)
, mrShared(rShared)
@@ -134,42 +138,42 @@ public:
struct SumFunction24
{
- static inline void add(long*& pValue1, long nConstant)
+ static inline void add(tools::Long*& pValue1, tools::Long nConstant)
{
pValue1[0] += nConstant;
pValue1[1] += nConstant;
pValue1[2] += nConstant;
}
- static inline void set(long*& pValue1, long nConstant)
+ static inline void set(tools::Long*& pValue1, tools::Long nConstant)
{
pValue1[0] = nConstant;
pValue1[1] = nConstant;
pValue1[2] = nConstant;
}
- static inline void add(long*& pValue1, const sal_uInt8* pValue2)
+ static inline void add(tools::Long*& pValue1, const sal_uInt8* pValue2)
{
pValue1[0] += pValue2[0];
pValue1[1] += pValue2[1];
pValue1[2] += pValue2[2];
}
- static inline void add(long*& pValue1, const long* pValue2)
+ static inline void add(tools::Long*& pValue1, const tools::Long* pValue2)
{
pValue1[0] += pValue2[0];
pValue1[1] += pValue2[1];
pValue1[2] += pValue2[2];
}
- static inline void sub(long*& pValue1, const sal_uInt8* pValue2)
+ static inline void sub(tools::Long*& pValue1, const sal_uInt8* pValue2)
{
pValue1[0] -= pValue2[0];
pValue1[1] -= pValue2[1];
pValue1[2] -= pValue2[2];
}
- static inline void sub(long*& pValue1, const long* pValue2)
+ static inline void sub(tools::Long*& pValue1, const tools::Long* pValue2)
{
pValue1[0] -= pValue2[0];
pValue1[1] -= pValue2[1];
@@ -183,8 +187,8 @@ struct SumFunction24
pValue1[2] = pValue2[2];
}
- static inline void assignMulAndShr(sal_uInt8*& result, const long* sum, long multiply,
- long shift)
+ static inline void assignMulAndShr(sal_uInt8*& result, const tools::Long* sum,
+ tools::Long multiply, tools::Long shift)
{
result[0] = (multiply * sum[0]) >> shift;
result[1] = (multiply * sum[1]) >> shift;
@@ -194,32 +198,47 @@ struct SumFunction24
struct SumFunction8
{
- static inline void add(long*& pValue1, long nConstant) { pValue1[0] += nConstant; }
+ static inline void add(tools::Long*& pValue1, tools::Long nConstant)
+ {
+ pValue1[0] += nConstant;
+ }
- static inline void set(long*& pValue1, long nConstant) { pValue1[0] = nConstant; }
+ static inline void set(tools::Long*& pValue1, tools::Long nConstant) { pValue1[0] = nConstant; }
- static inline void add(long*& pValue1, const sal_uInt8* pValue2) { pValue1[0] += pValue2[0]; }
+ static inline void add(tools::Long*& pValue1, const sal_uInt8* pValue2)
+ {
+ pValue1[0] += pValue2[0];
+ }
- static inline void add(long*& pValue1, const long* pValue2) { pValue1[0] += pValue2[0]; }
+ static inline void add(tools::Long*& pValue1, const tools::Long* pValue2)
+ {
+ pValue1[0] += pValue2[0];
+ }
- static inline void sub(long*& pValue1, const sal_uInt8* pValue2) { pValue1[0] -= pValue2[0]; }
+ static inline void sub(tools::Long*& pValue1, const sal_uInt8* pValue2)
+ {
+ pValue1[0] -= pValue2[0];
+ }
- static inline void sub(long*& pValue1, const long* pValue2) { pValue1[0] -= pValue2[0]; }
+ static inline void sub(tools::Long*& pValue1, const tools::Long* pValue2)
+ {
+ pValue1[0] -= pValue2[0];
+ }
static inline void assignPtr(sal_uInt8*& pValue1, const sal_uInt8* pValue2)
{
pValue1[0] = pValue2[0];
}
- static inline void assignMulAndShr(sal_uInt8*& result, const long* sum, long multiply,
- long shift)
+ static inline void assignMulAndShr(sal_uInt8*& result, const tools::Long* sum,
+ tools::Long multiply, tools::Long shift)
{
result[0] = (multiply * sum[0]) >> shift;
}
};
template <typename SumFunction>
-void stackBlurHorizontal(BlurSharedData const& rShared, long nStart, long nEnd)
+void stackBlurHorizontal(BlurSharedData const& rShared, tools::Long nStart, tools::Long nEnd)
{
BitmapReadAccess* pReadAccess = rShared.mpReadAccess;
BitmapWriteAccess* pWriteAccess = rShared.mpWriteAccess;
@@ -229,34 +248,34 @@ void stackBlurHorizontal(BlurSharedData const& rShared, long nStart, long nEnd)
sal_uInt8* pStack = aArrays.maStackBuffer.data();
sal_uInt8* pStackPtr;
- long nWidth = pReadAccess->Width();
- long nLastIndexX = nWidth - 1;
+ tools::Long nWidth = pReadAccess->Width();
+ tools::Long nLastIndexX = nWidth - 1;
- long nMultiplyValue = aArrays.getMultiplyValue();
- long nShiftValue = aArrays.getShiftValue();
+ tools::Long nMultiplyValue = aArrays.getMultiplyValue();
+ tools::Long nShiftValue = aArrays.getShiftValue();
- long nRadius = rShared.mnRadius;
- long nComponentWidth = rShared.mnComponentWidth;
- long nDiv = rShared.mnDiv;
+ tools::Long nRadius = rShared.mnRadius;
+ tools::Long nComponentWidth = rShared.mnComponentWidth;
+ tools::Long nDiv = rShared.mnDiv;
Scanline pSourcePointer;
Scanline pDestinationPointer;
- long nXPosition;
- long nStackIndex;
- long nStackIndexStart;
- long nWeight;
+ tools::Long nXPosition;
+ tools::Long nStackIndex;
+ tools::Long nStackIndexStart;
+ tools::Long nWeight;
aArrays.initializeWeightAndPositions(nLastIndexX);
- long* nSum = aArrays.mnSumVector.data();
- long* nInSum = aArrays.mnInSumVector.data();
- long* nOutSum = aArrays.mnOutSumVector.data();
+ tools::Long* nSum = aArrays.mnSumVector.data();
+ tools::Long* nInSum = aArrays.mnInSumVector.data();
+ tools::Long* nOutSum = aArrays.mnOutSumVector.data();
- long* pPositionPointer = aArrays.maPositionTable.data();
- long* pWeightPointer = aArrays.maWeightTable.data();
+ tools::Long* pPositionPointer = aArrays.maPositionTable.data();
+ tools::Long* pWeightPointer = aArrays.maWeightTable.data();
- for (long y = nStart; y <= nEnd; y++)
+ for (tools::Long y = nStart; y <= nEnd; y++)
{
SumFunction::set(nSum, 0L);
SumFunction::set(nInSum, 0L);
@@ -268,7 +287,7 @@ void stackBlurHorizontal(BlurSharedData const& rShared, long nStart, long nEnd)
// for the first pixel; aArrays.maWeightTable has [1,2,3,4,5,6,5,4,3,2,1]. Before looking at
// the first row pixel, we pretend to have processed fake previous pixels, as if the row was
// extended to the left with the same color as that of the first pixel.
- for (long i = 0; i < nDiv; i++)
+ for (tools::Long i = 0; i < nDiv; i++)
{
pSourcePointer = pReadAccess->GetScanline(y) + nComponentWidth * pPositionPointer[i];
@@ -295,7 +314,7 @@ void stackBlurHorizontal(BlurSharedData const& rShared, long nStart, long nEnd)
pSourcePointer = pReadAccess->GetScanline(y) + nComponentWidth * nXPosition;
- for (long x = 0; x < nWidth; x++)
+ for (tools::Long x = 0; x < nWidth; x++)
{
pDestinationPointer = pWriteAccess->GetScanline(y) + nComponentWidth * x;
@@ -339,7 +358,7 @@ void stackBlurHorizontal(BlurSharedData const& rShared, long nStart, long nEnd)
}
template <typename SumFunction>
-void stackBlurVertical(BlurSharedData const& rShared, long nStart, long nEnd)
+void stackBlurVertical(BlurSharedData const& rShared, tools::Long nStart, tools::Long nEnd)
{
BitmapReadAccess* pReadAccess = rShared.mpReadAccess;
BitmapWriteAccess* pWriteAccess = rShared.mpWriteAccess;
@@ -349,33 +368,33 @@ void stackBlurVertical(BlurSharedData const& rShared, long nStart, long nEnd)
sal_uInt8* pStack = aArrays.maStackBuffer.data();
sal_uInt8* pStackPtr;
- long nHeight = pReadAccess->Height();
- long nLastIndexY = nHeight - 1;
+ tools::Long nHeight = pReadAccess->Height();
+ tools::Long nLastIndexY = nHeight - 1;
- long nMultiplyValue = aArrays.getMultiplyValue();
- long nShiftValue = aArrays.getShiftValue();
+ tools::Long nMultiplyValue = aArrays.getMultiplyValue();
+ tools::Long nShiftValue = aArrays.getShiftValue();
- long nRadius = rShared.mnRadius;
- long nComponentWidth = rShared.mnComponentWidth;
- long nDiv = rShared.mnDiv;
+ tools::Long nRadius = rShared.mnRadius;
+ tools::Long nComponentWidth = rShared.mnComponentWidth;
+ tools::Long nDiv = rShared.mnDiv;
Scanline pSourcePointer;
Scanline pDestinationPointer;
- long nYPosition;
- long nStackIndex;
- long nStackIndexStart;
- long nWeight;
+ tools::Long nYPosition;
+ tools::Long nStackIndex;
+ tools::Long nStackIndexStart;
+ tools::Long nWeight;
aArrays.initializeWeightAndPositions(nLastIndexY);
- long* nSum = aArrays.mnSumVector.data();
- long* nInSum = aArrays.mnInSumVector.data();
- long* nOutSum = aArrays.mnOutSumVector.data();
- long* pPositionPointer = aArrays.maPositionTable.data();
- long* pWeightPointer = aArrays.maWeightTable.data();
+ tools::Long* nSum = aArrays.mnSumVector.data();
+ tools::Long* nInSum = aArrays.mnInSumVector.data();
+ tools::Long* nOutSum = aArrays.mnOutSumVector.data();
+ tools::Long* pPositionPointer = aArrays.maPositionTable.data();
+ tools::Long* pWeightPointer = aArrays.maWeightTable.data();
- for (long x = nStart; x <= nEnd; x++)
+ for (tools::Long x = nStart; x <= nEnd; x++)
{
SumFunction::set(nSum, 0L);
SumFunction::set(nInSum, 0L);
@@ -387,7 +406,7 @@ void stackBlurVertical(BlurSharedData const& rShared, long nStart, long nEnd)
// for the first pixel; aArrays.maWeightTable has [1,2,3,4,5,6,5,4,3,2,1]. Before looking at
// the first column pixels, we pretend to have processed fake previous pixels, as if the
// column was extended to the top with the same color as that of the first pixel.
- for (long i = 0; i < nDiv; i++)
+ for (tools::Long i = 0; i < nDiv; i++)
{
pSourcePointer = pReadAccess->GetScanline(pPositionPointer[i]) + nComponentWidth * x;
@@ -414,7 +433,7 @@ void stackBlurVertical(BlurSharedData const& rShared, long nStart, long nEnd)
pSourcePointer = pReadAccess->GetScanline(nYPosition) + nComponentWidth * x;
- for (long y = 0; y < nHeight; y++)
+ for (tools::Long y = 0; y < nHeight; y++)
{
pDestinationPointer = pWriteAccess->GetScanline(y) + nComponentWidth * x;
@@ -455,10 +474,10 @@ void stackBlurVertical(BlurSharedData const& rShared, long nStart, long nEnd)
}
}
-constexpr long nThreadStrip = 16;
+constexpr tools::Long nThreadStrip = 16;
-void runStackBlur(Bitmap& rBitmap, const long nRadius, const long nComponentWidth,
- const long nColorChannels, BlurRangeFn pBlurHorizontalFn,
+void runStackBlur(Bitmap& rBitmap, const tools::Long nRadius, const tools::Long nComponentWidth,
+ const tools::Long nColorChannels, BlurRangeFn pBlurHorizontalFn,
BlurRangeFn pBlurVerticalFn, const bool bParallel)
{
if (bParallel)
@@ -474,12 +493,12 @@ void runStackBlur(Bitmap& rBitmap, const long nRadius, const long nComponentWidt
BlurSharedData aSharedData(pReadAccess.get(), pWriteAccess.get(), nRadius,
nComponentWidth, nColorChannels);
- const long nFirstIndex = 0;
- const long nLastIndex = pReadAccess->Height() - 1;
+ const tools::Long nFirstIndex = 0;
+ const tools::Long nLastIndex = pReadAccess->Height() - 1;
vcl::bitmap::generateStripRanges<nThreadStrip>(
nFirstIndex, nLastIndex,
- [&](long const nStart, long const nEnd, bool const bLast) {
+ [&](tools::Long const nStart, tools::Long const nEnd, bool const bLast) {
if (!bLast)
{
auto pTask(std::make_unique<BlurTask>(pTag, pBlurHorizontalFn,
@@ -497,12 +516,12 @@ void runStackBlur(Bitmap& rBitmap, const long nRadius, const long nComponentWidt
BlurSharedData aSharedData(pReadAccess.get(), pWriteAccess.get(), nRadius,
nComponentWidth, nColorChannels);
- const long nFirstIndex = 0;
- const long nLastIndex = pReadAccess->Width() - 1;
+ const tools::Long nFirstIndex = 0;
+ const tools::Long nLastIndex = pReadAccess->Width() - 1;
vcl::bitmap::generateStripRanges<nThreadStrip>(
nFirstIndex, nLastIndex,
- [&](long const nStart, long const nEnd, bool const bLast) {
+ [&](tools::Long const nStart, tools::Long const nEnd, bool const bLast) {
if (!bLast)
{
auto pTask(std::make_unique<BlurTask>(pTag, pBlurVerticalFn,
@@ -528,8 +547,8 @@ void runStackBlur(Bitmap& rBitmap, const long nRadius, const long nComponentWidt
BitmapScopedWriteAccess pWriteAccess(rBitmap);
BlurSharedData aSharedData(pReadAccess.get(), pWriteAccess.get(), nRadius,
nComponentWidth, nColorChannels);
- long nFirstIndex = 0;
- long nLastIndex = pReadAccess->Height() - 1;
+ tools::Long nFirstIndex = 0;
+ tools::Long nLastIndex = pReadAccess->Height() - 1;
pBlurHorizontalFn(aSharedData, nFirstIndex, nLastIndex);
}
{
@@ -537,8 +556,8 @@ void runStackBlur(Bitmap& rBitmap, const long nRadius, const long nComponentWidt
BitmapScopedWriteAccess pWriteAccess(rBitmap);
BlurSharedData aSharedData(pReadAccess.get(), pWriteAccess.get(), nRadius,
nComponentWidth, nColorChannels);
- long nFirstIndex = 0;
- long nLastIndex = pReadAccess->Width() - 1;
+ tools::Long nFirstIndex = 0;
+ tools::Long nLastIndex = pReadAccess->Width() - 1;
pBlurVerticalFn(aSharedData, nFirstIndex, nLastIndex);
}
}
@@ -549,7 +568,7 @@ void stackBlur24(Bitmap& rBitmap, sal_Int32 nRadius, sal_Int32 nComponentWidth)
const bool bParallel = true;
// Limit radius
nRadius = std::clamp<sal_Int32>(nRadius, 2, 254);
- const long nColorChannels = 3; // 3 color channel
+ const tools::Long nColorChannels = 3; // 3 color channel
BlurRangeFn pBlurHorizontalFn = stackBlurHorizontal<SumFunction24>;
BlurRangeFn pBlurVerticalFn = stackBlurVertical<SumFunction24>;
@@ -563,7 +582,7 @@ void stackBlur8(Bitmap& rBitmap, sal_Int32 nRadius, sal_Int32 nComponentWidth)
const bool bParallel = true;
// Limit radius
nRadius = std::clamp<sal_Int32>(nRadius, 2, 254);
- const long nColorChannels = 1; // 1 color channel
+ const tools::Long nColorChannels = 1; // 1 color channel
BlurRangeFn pBlurHorizontalFn = stackBlurHorizontal<SumFunction8>;
BlurRangeFn pBlurVerticalFn = stackBlurVertical<SumFunction8>;
diff --git a/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx b/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx
index c264dcd1382a..b1837f4a5867 100644
--- a/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx
+++ b/vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx
@@ -20,8 +20,8 @@ BitmapEx BitmapGaussianSeparableBlurFilter::execute(BitmapEx const& rBitmapEx) c
{
Bitmap aBitmap(rBitmapEx.GetBitmap());
- const long nWidth = aBitmap.GetSizePixel().Width();
- const long nHeight = aBitmap.GetSizePixel().Height();
+ const tools::Long nWidth = aBitmap.GetSizePixel().Width();
+ const tools::Long nHeight = aBitmap.GetSizePixel().Height();
// Prepare Blur Vector
int aNumberOfContributions;
diff --git a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx
index 73f521480f09..1542b34a40c7 100644
--- a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx
+++ b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx
@@ -32,8 +32,8 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
Bitmap aBitmap(rBitmapEx.GetBitmap());
const Size aSizePix(aBitmap.GetSizePixel());
- const long nNewWidth = FRound(aSizePix.Width() * mfScaleX);
- const long nNewHeight = FRound(aSizePix.Height() * mfScaleY);
+ const tools::Long nNewWidth = FRound(aSizePix.Width() * mfScaleX);
+ const tools::Long nNewHeight = FRound(aSizePix.Height() * mfScaleY);
bool bRet = false;
if ((nNewWidth > 1) && (nNewHeight > 1))
@@ -41,29 +41,29 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
Bitmap::ScopedReadAccess pReadAcc(aBitmap);
if (pReadAcc)
{
- long nWidth = pReadAcc->Width();
- long nHeight = pReadAcc->Height();
+ tools::Long nWidth = pReadAcc->Width();
+ tools::Long nHeight = pReadAcc->Height();
Bitmap aNewBmp(Size(nNewWidth, nHeight), 24);
BitmapScopedWriteAccess pWriteAcc(aNewBmp);
if (pWriteAcc)
{
- const long nNewWidth1 = nNewWidth - 1;
- const long nWidth1 = pReadAcc->Width() - 1;
+ const tools::Long nNewWidth1 = nNewWidth - 1;
+ const tools::Long nWidth1 = pReadAcc->Width() - 1;
const double fRevScaleX = static_cast<double>(nWidth1) / nNewWidth1;
std::unique_ptr<long[]> pLutInt(new long[nNewWidth]);
std::unique_ptr<long[]> pLutFrac(new long[nNewWidth]);
- for (long nX = 0, nTemp = nWidth - 2; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0, nTemp = nWidth - 2; nX < nNewWidth; nX++)
{
double fTemp = nX * fRevScaleX;
- pLutInt[nX] = MinMax(static_cast<long>(fTemp), 0, nTemp);
+ pLutInt[nX] = MinMax(static_cast<tools::Long>(fTemp), 0, nTemp);
fTemp -= pLutInt[nX];
- pLutFrac[nX] = static_cast<long>(fTemp * 1024.);
+ pLutFrac[nX] = static_cast<tools::Long>(fTemp * 1024.);
}
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
if (1 == nWidth)
@@ -80,7 +80,7 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
}
Scanline pScanline = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0; nX < nNewWidth; nX++)
{
pWriteAcc->SetPixelOnData(pScanline, nX, aCol0);
}
@@ -88,9 +88,9 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
else
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0; nX < nNewWidth; nX++)
{
- long nTemp = pLutInt[nX];
+ tools::Long nTemp = pLutInt[nX];
BitmapColor aCol0, aCol1;
if (pReadAcc->HasPalette())
@@ -108,12 +108,12 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
nTemp = pLutFrac[nX];
- long lXR0 = aCol0.GetRed();
- long lXG0 = aCol0.GetGreen();
- long lXB0 = aCol0.GetBlue();
- long lXR1 = aCol1.GetRed() - lXR0;
- long lXG1 = aCol1.GetGreen() - lXG0;
- long lXB1 = aCol1.GetBlue() - lXB0;
+ tools::Long lXR0 = aCol0.GetRed();
+ tools::Long lXG0 = aCol0.GetGreen();
+ tools::Long lXB0 = aCol0.GetBlue();
+ tools::Long lXR1 = aCol1.GetRed() - lXR0;
+ tools::Long lXG1 = aCol1.GetGreen() - lXG0;
+ tools::Long lXB1 = aCol1.GetBlue() - lXB0;
aCol0.SetRed(
static_cast<sal_uInt8>((lXR1 * nTemp + (lXR0 << 10)) >> 10));
@@ -144,19 +144,19 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
if (pReadAcc && pWriteAcc)
{
- const long nNewHeight1 = nNewHeight - 1;
- const long nHeight1 = pReadAcc->Height() - 1;
+ const tools::Long nNewHeight1 = nNewHeight - 1;
+ const tools::Long nHeight1 = pReadAcc->Height() - 1;
const double fRevScaleY = static_cast<double>(nHeight1) / nNewHeight1;
std::unique_ptr<long[]> pLutInt(new long[nNewHeight]);
std::unique_ptr<long[]> pLutFrac(new long[nNewHeight]);
- for (long nY = 0, nTemp = nHeight - 2; nY < nNewHeight; nY++)
+ for (tools::Long nY = 0, nTemp = nHeight - 2; nY < nNewHeight; nY++)
{
double fTemp = nY * fRevScaleY;
- pLutInt[nY] = MinMax(static_cast<long>(fTemp), 0, nTemp);
+ pLutInt[nY] = MinMax(static_cast<tools::Long>(fTemp), 0, nTemp);
fTemp -= pLutInt[nY];
- pLutFrac[nY] = static_cast<long>(fTemp * 1024.);
+ pLutFrac[nY] = static_cast<tools::Long>(fTemp * 1024.);
}
// after 1st step, bitmap *is* 24bit format (see above)
@@ -164,34 +164,34 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
"in-between format has palette, should not "
"happen (!)");
- for (long nX = 0; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0; nX < nNewWidth; nX++)
{
if (1 == nHeight)
{
BitmapColor aCol0 = pReadAcc->GetPixel(0, nX);
- for (long nY = 0; nY < nNewHeight; nY++)
+ for (tools::Long nY = 0; nY < nNewHeight; nY++)
{
pWriteAcc->SetPixel(nY, nX, aCol0);
}
}
else
{
- for (long nY = 0; nY < nNewHeight; nY++)
+ for (tools::Long nY = 0; nY < nNewHeight; nY++)
{
- long nTemp = pLutInt[nY];
+ tools::Long nTemp = pLutInt[nY];
BitmapColor aCol0 = pReadAcc->GetPixel(nTemp++, nX);
BitmapColor aCol1 = pReadAcc->GetPixel(nTemp, nX);
nTemp = pLutFrac[nY];
- long lXR0 = aCol0.GetRed();
- long lXG0 = aCol0.GetGreen();
- long lXB0 = aCol0.GetBlue();
- long lXR1 = aCol1.GetRed() - lXR0;
- long lXG1 = aCol1.GetGreen() - lXG0;
- long lXB1 = aCol1.GetBlue() - lXB0;
+ tools::Long lXR0 = aCol0.GetRed();
+ tools::Long lXG0 = aCol0.GetGreen();
+ tools::Long lXB0 = aCol0.GetBlue();
+ tools::Long lXR1 = aCol1.GetRed() - lXR0;
+ tools::Long lXG1 = aCol1.GetGreen() - lXG0;
+ tools::Long lXB1 = aCol1.GetBlue() - lXB0;
aCol0.SetRed(
static_cast<sal_uInt8>((lXR1 * nTemp + (lXR0 << 10)) >> 10));
diff --git a/vcl/source/bitmap/BitmapLightenFilter.cxx b/vcl/source/bitmap/BitmapLightenFilter.cxx
index 45013b143783..b85ac4387406 100644
--- a/vcl/source/bitmap/BitmapLightenFilter.cxx
+++ b/vcl/source/bitmap/BitmapLightenFilter.cxx
@@ -27,11 +27,11 @@ BitmapEx BitmapLightenFilter::execute(BitmapEx const& rBitmapEx) const
if (pRead && pWrite)
{
- for (long nY = 0; nY < aSize.Height(); ++nY)
+ for (tools::Long nY = 0; nY < aSize.Height(); ++nY)
{
Scanline pScanline = pWrite->GetScanline(nY);
Scanline pScanlineRead = pRead->GetScanline(nY);
- for (long nX = 0; nX < aSize.Width(); ++nX)
+ for (tools::Long nX = 0; nX < aSize.Width(); ++nX)
{
BitmapColor aBmpColor
= pRead->HasPalette()
diff --git a/vcl/source/bitmap/BitmapMedianFilter.cxx b/vcl/source/bitmap/BitmapMedianFilter.cxx
index 60edc557a9de..4f1c857c0878 100644
--- a/vcl/source/bitmap/BitmapMedianFilter.cxx
+++ b/vcl/source/bitmap/BitmapMedianFilter.cxx
@@ -17,7 +17,7 @@
#define S2(a, b) \
{ \
- long t; \
+ tools::Long t; \
if ((t = b - a) < 0) \
{ \
a += t; \
@@ -64,8 +64,8 @@ BitmapEx BitmapMedianFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
- const long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
- const long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
+ const tools::Long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2;
+ const tools::Long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2;
std::unique_ptr<long[]> pColm(new long[nWidth2]);
std::unique_ptr<long[]> pRows(new long[nHeight2]);
std::unique_ptr<BitmapColor[]> pColRow1(new BitmapColor[nWidth2]);
@@ -75,10 +75,10 @@ BitmapEx BitmapMedianFilter::execute(BitmapEx const& rBitmapEx) const
BitmapColor* pRowTmp2 = pColRow2.get();
BitmapColor* pRowTmp3 = pColRow3.get();
BitmapColor* pColor;
- long nY, nX, i;
- long nR1, nR2, nR3, nR4, nR5, nR6, nR7, nR8, nR9;
- long nG1, nG2, nG3, nG4, nG5, nG6, nG7, nG8, nG9;
- long nB1, nB2, nB3, nB4, nB5, nB6, nB7, nB8, nB9;
+ tools::Long nY, nX, i;
+ tools::Long nR1, nR2, nR3, nR4, nR5, nR6, nR7, nR8, nR9;
+ tools::Long nG1, nG2, nG3, nG4, nG5, nG6, nG7, nG8, nG9;
+ tools::Long nB1, nB2, nB3, nB4, nB5, nB6, nB7, nB8, nB9;
// create column LUT
for (i = 0; i < nWidth2; i++)
diff --git a/vcl/source/bitmap/BitmapMonochromeFilter.cxx b/vcl/source/bitmap/BitmapMonochromeFilter.cxx
index 72bacf84955a..224a66ab9558 100644
--- a/vcl/source/bitmap/BitmapMonochromeFilter.cxx
+++ b/vcl/source/bitmap/BitmapMonochromeFilter.cxx
@@ -30,16 +30,16 @@ BitmapEx BitmapMonochromeFilter::execute(BitmapEx const& aBitmapEx) const
{
const BitmapColor aBlack(pWriteAcc->GetBestMatchingColor(COL_BLACK));
const BitmapColor aWhite(pWriteAcc->GetBestMatchingColor(COL_WHITE));
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const tools::Long nWidth = pWriteAcc->Width();
+ const tools::Long nHeight = pWriteAcc->Height();
if (pReadAcc->HasPalette())
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
const sal_uInt8 cIndex = pReadAcc->GetIndexFromData(pScanlineRead, nX);
if (pReadAcc->GetPaletteColor(cIndex).GetLuminance() >= mcThreshold)
@@ -55,11 +55,11 @@ BitmapEx BitmapMonochromeFilter::execute(BitmapEx const& aBitmapEx) const
}
else
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
if (pReadAcc->GetPixelFromData(pScanlineRead, nX).GetLuminance()
>= mcThreshold)
diff --git a/vcl/source/bitmap/BitmapMosaicFilter.cxx b/vcl/source/bitmap/BitmapMosaicFilter.cxx
index ee0d102750dc..5afbb90d6bcb 100644
--- a/vcl/source/bitmap/BitmapMosaicFilter.cxx
+++ b/vcl/source/bitmap/BitmapMosaicFilter.cxx
@@ -39,8 +39,8 @@ BitmapEx BitmapMosaicFilter::execute(BitmapEx const& rBitmapEx) const
}
bool bConditionsMet = false;
- long nWidth(0);
- long nHeight(0);
+ tools::Long nWidth(0);
+ tools::Long nHeight(0);
if (pReadAcc && pWriteAcc)
{
nWidth = pReadAcc->Width();
@@ -51,7 +51,7 @@ BitmapEx BitmapMosaicFilter::execute(BitmapEx const& rBitmapEx) const
if (bConditionsMet)
{
BitmapColor aCol;
- long nX, nY, nX1, nX2, nY1, nY2, nSumR, nSumG, nSumB;
+ tools::Long nX, nY, nX1, nX2, nY1, nY2, nSumR, nSumG, nSumB;
double fArea_1;
nY1 = 0;
diff --git a/vcl/source/bitmap/BitmapPopArtFilter.cxx b/vcl/source/bitmap/BitmapPopArtFilter.cxx
index a335f04fb824..bf33a98381f4 100644
--- a/vcl/source/bitmap/BitmapPopArtFilter.cxx
+++ b/vcl/source/bitmap/BitmapPopArtFilter.cxx
@@ -28,8 +28,8 @@ BitmapEx BitmapPopArtFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const tools::Long nWidth = pWriteAcc->Width();
+ const tools::Long nHeight = pWriteAcc->Height();
const int nEntryCount = 1 << pWriteAcc->GetBitCount();
int n = 0;
std::vector<PopArtEntry> aPopArtTable(nEntryCount);
@@ -42,10 +42,10 @@ BitmapEx BitmapPopArtFilter::execute(BitmapEx const& rBitmapEx) const
}
// get pixel count for each palette entry
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aPopArtTable[pWriteAcc->GetIndexFromData(pScanline, nX)].mnCount++;
}
diff --git a/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx b/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx
index b679e172d554..bf210fa21236 100644
--- a/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx
+++ b/vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx
@@ -35,9 +35,9 @@ namespace
{
void ImplCalculateContributions(
- const long aSourceSize,
- const long aDestinationSize,
- long& aNumberOfContributions,
+ const tools::Long aSourceSize,
+ const tools::Long aDestinationSize,
+ tools::Long& aNumberOfContributions,
std::vector<sal_Int16>& rWeights,
std::vector<sal_Int32>& rPixels,
std::vector<sal_Int32>& rCounts,
@@ -48,19 +48,19 @@ void ImplCalculateContributions(
const double fScaledRadius((fScale < 1.0) ? fSamplingRadius / fScale : fSamplingRadius);
const double fFilterFactor(std::min(fScale, 1.0));
- aNumberOfContributions = (long(fabs(ceil(fScaledRadius))) * 2) + 1;
- const long nAllocSize(aDestinationSize * aNumberOfContributions);
+ aNumberOfContributions = (tools::Long(fabs(ceil(fScaledRadius))) * 2) + 1;
+ const tools::Long nAllocSize(aDestinationSize * aNumberOfContributions);
rWeights.resize(nAllocSize);
rPixels.resize(nAllocSize);
rCounts.resize(aDestinationSize);
- for(long i(0); i < aDestinationSize; i++)
+ for(tools::Long i(0); i < aDestinationSize; i++)
{
- const long aIndex(i * aNumberOfContributions);
+ const tools::Long aIndex(i * aNumberOfContributions);
const double aCenter(i / fScale);
const sal_Int32 aLeft(static_cast< sal_Int32 >(floor(aCenter - fScaledRadius)));
const sal_Int32 aRight(static_cast< sal_Int32 >(ceil(aCenter + fScaledRadius)));
- long aCurrentCount(0);
+ tools::Long aCurrentCount(0);
for(sal_Int32 j(aLeft); j <= aRight; j++)
{
@@ -73,8 +73,8 @@ void ImplCalculateContributions(
}
// Handling on edges
- const long aPixelIndex(MinMax(j, 0, aSourceSize - 1));
- const long nIndex(aIndex + aCurrentCount);
+ const tools::Long aPixelIndex(MinMax(j, 0, aSourceSize - 1));
+ const tools::Long nIndex(aIndex + aCurrentCount);
// scale the weight by 255 since we're converting from float to int
rWeights[nIndex] = aWeight * 255;
@@ -91,8 +91,8 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
{
// Do horizontal filtering
OSL_ENSURE(rScaleX > 0.0, "Error in scaling: Mirror given in non-mirror-capable method (!)");
- const long nWidth(rSource.GetSizePixel().Width());
- const long nNewWidth(FRound(nWidth * rScaleX));
+ const tools::Long nWidth(rSource.GetSizePixel().Width());
+ const tools::Long nNewWidth(FRound(nWidth * rScaleX));
if(nWidth == nNewWidth)
{
@@ -106,9 +106,9 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
std::vector<sal_Int16> aWeights;
std::vector<sal_Int32> aPixels;
std::vector<sal_Int32> aCounts;
- long aNumberOfContributions(0);
+ tools::Long aNumberOfContributions(0);
- const long nHeight(rSource.GetSizePixel().Height());
+ const tools::Long nHeight(rSource.GetSizePixel().Height());
ImplCalculateContributions(nWidth, nNewWidth, aNumberOfContributions, aWeights, aPixels, aCounts, aKernel);
rTarget = Bitmap(Size(nNewWidth, nHeight), 24);
BitmapScopedWriteAccess pWriteAcc(rTarget);
@@ -116,21 +116,21 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
if(bResult)
{
- for(long y(0); y < nHeight; y++)
+ for(tools::Long y(0); y < nHeight; y++)
{
Scanline pScanline = pWriteAcc->GetScanline( y );
Scanline pScanlineRead = pReadAcc->GetScanline( y );
- for(long x(0); x < nNewWidth; x++)
+ for(tools::Long x(0); x < nNewWidth; x++)
{
- const long aBaseIndex(x * aNumberOfContributions);
+ const tools::Long aBaseIndex(x * aNumberOfContributions);
sal_Int32 aSum(0);
sal_Int32 aValueRed(0);
sal_Int32 aValueGreen(0);
sal_Int32 aValueBlue(0);
- for(long j(0); j < aCounts[x]; j++)
+ for(tools::Long j(0); j < aCounts[x]; j++)
{
- const long aIndex(aBaseIndex + j);
+ const tools::Long aIndex(aBaseIndex + j);
const sal_Int16 aWeight(aWeights[aIndex]);
BitmapColor aColor;
@@ -181,8 +181,8 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
{
// Do vertical filtering
OSL_ENSURE(rScaleY > 0.0, "Error in scaling: Mirror given in non-mirror-capable method (!)");
- const long nHeight(rSource.GetSizePixel().Height());
- const long nNewHeight(FRound(nHeight * rScaleY));
+ const tools::Long nHeight(rSource.GetSizePixel().Height());
+ const tools::Long nNewHeight(FRound(nHeight * rScaleY));
if(nHeight == nNewHeight)
{
@@ -196,9 +196,9 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
std::vector<sal_Int16> aWeights;
std::vector<sal_Int32> aPixels;
std::vector<sal_Int32> aCounts;
- long aNumberOfContributions(0);
+ tools::Long aNumberOfContributions(0);
- const long nWidth(rSource.GetSizePixel().Width());
+ const tools::Long nWidth(rSource.GetSizePixel().Width());
ImplCalculateContributions(nHeight, nNewHeight, aNumberOfContributions, aWeights, aPixels, aCounts, aKernel);
rTarget = Bitmap(Size(nWidth, nNewHeight), 24);
BitmapScopedWriteAccess pWriteAcc(rTarget);
@@ -207,24 +207,24 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
if(pWriteAcc)
{
std::vector<BitmapColor> aScanline(nHeight);
- for(long x(0); x < nWidth; x++)
+ for(tools::Long x(0); x < nWidth; x++)
{
- for(long y(0); y < nHeight; y++)
+ for(tools::Long y(0); y < nHeight; y++)
if(pReadAcc->HasPalette())
aScanline[y] = pReadAcc->GetPaletteColor(pReadAcc->GetPixelIndex(y, x));
else
aScanline[y] = pReadAcc->GetPixel(y, x);
- for(long y(0); y < nNewHeight; y++)
+ for(tools::Long y(0); y < nNewHeight; y++)
{
- const long aBaseIndex(y * aNumberOfContributions);
+ const tools::Long aBaseIndex(y * aNumberOfContributions);
sal_Int32 aSum(0);
sal_Int32 aValueRed(0);
sal_Int32 aValueGreen(0);
sal_Int32 aValueBlue(0);
- for(long j(0); j < aCounts[y]; j++)
+ for(tools::Long j(0); j < aCounts[y]; j++)
{
- const long aIndex(aBaseIndex + j);
+ const tools::Long aIndex(aBaseIndex + j);
const sal_Int16 aWeight(aWeights[aIndex]);
aSum += aWeight;
const BitmapColor & aColor = aScanline[aPixels[aIndex]];
@@ -271,10 +271,10 @@ bool ImplScaleConvolution(Bitmap& rBitmap, const double& rScaleX, const double&
const bool bMirrorVer(rScaleY < 0.0);
const double fScaleX(bMirrorHor ? -rScaleX : rScaleX);
const double fScaleY(bMirrorVer ? -rScaleY : rScaleY);
- const long nWidth(rBitmap.GetSizePixel().Width());
- const long nHeight(rBitmap.GetSizePixel().Height());
- const long nNewWidth(FRound(nWidth * fScaleX));
- const long nNewHeight(FRound(nHeight * fScaleY));
+ const tools::Long nWidth(rBitmap.GetSizePixel().Width());
+ const tools::Long nHeight(rBitmap.GetSizePixel().Height());
+ const tools::Long nNewWidth(FRound(nWidth * fScaleX));
+ const tools::Long nNewHeight(FRound(nHeight * fScaleY));
const bool bScaleHor(nWidth != nNewWidth);
const bool bScaleVer(nHeight != nNewHeight);
const bool bMirror(bMirrorHor || bMirrorVer);
@@ -300,8 +300,8 @@ bool ImplScaleConvolution(Bitmap& rBitmap, const double& rScaleX, const double&
nMirrorFlags |= BmpMirrorFlags::Vertical;
}
- const long nStartSize(nWidth * nHeight);
- const long nEndSize(nNewWidth * nNewHeight);
+ const tools::Long nStartSize(nWidth * nHeight);
+ const tools::Long nEndSize(nNewWidth * nNewHeight);
bMirrorAfter = nStartSize > nEndSize;
@@ -315,8 +315,8 @@ bool ImplScaleConvolution(Bitmap& rBitmap, const double& rScaleX, const double&
if (bResult)
{
- const long nInBetweenSizeHorFirst(nHeight * nNewWidth);
- const long nInBetweenSizeVerFirst(nNewHeight * nWidth);
+ const tools::Long nInBetweenSizeHorFirst(nHeight * nNewWidth);
+ const tools::Long nInBetweenSizeVerFirst(nNewHeight * nWidth);
Bitmap aSource(rBitmap);
if(nInBetweenSizeHorFirst < nInBetweenSizeVerFirst)
diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
index 97ceeb45ad35..3d5fe51d1c5d 100644
--- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
+++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
@@ -50,7 +50,7 @@ struct ScaleContext
{
BitmapReadAccess* mpSrc;
BitmapWriteAccess* mpDest;
- long mnDestW;
+ tools::Long mnDestW;
bool mbHMirr;
bool mbVMirr;
std::vector<long> maMapIX;
@@ -60,8 +60,8 @@ struct ScaleContext
ScaleContext( BitmapReadAccess *pSrc,
BitmapWriteAccess *pDest,
- long nSrcW, long nDestW,
- long nSrcH, long nDestH,
+ tools::Long nSrcW, tools::Long nDestW,
+ tools::Long nSrcH, tools::Long nDestH,
bool bHMirr, bool bVMirr)
: mpSrc(pSrc)
, mpDest(pDest)
@@ -77,28 +77,28 @@ struct ScaleContext
generateMap(nSrcH, nDestH, bVMirr, maMapIY, maMapFY);
}
- static void generateMap(long nSourceLength, long nDestinationLength, bool bMirrored,
+ static void generateMap(tools::Long nSourceLength, tools::Long nDestinationLength, bool bMirrored,
std::vector<long> & rMapIX, std::vector<BilinearWeightType> & rMapFX)
{
const double fRevScale = (nDestinationLength > 1) ? double(nSourceLength - 1) / (nDestinationLength - 1) : 0.0;
- long nTemp = nSourceLength - 2;
- long nTempX = nSourceLength - 1;
+ tools::Long nTemp = nSourceLength - 2;
+ tools::Long nTempX = nSourceLength - 1;
- for (long i = 0; i < nDestinationLength; i++)
+ for (tools::Long i = 0; i < nDestinationLength; i++)
{
double fTemp = i * fRevScale;
if (bMirrored)
fTemp = nTempX - fTemp;
- rMapIX[i] = MinMax(long(fTemp), 0, nTemp);
+ rMapIX[i] = MinMax(tools::Long(fTemp), 0, nTemp);
rMapFX[i] = BilinearWeightType((fTemp - rMapIX[i]) * (BilinearWeightType(1) << MAP_PRECISION));
}
}
};
-constexpr long constScaleThreadStrip = 32;
+constexpr tools::Long constScaleThreadStrip = 32;
-typedef void (*ScaleRangeFn)(const ScaleContext & rContext, long nStartY, long nEndY);
+typedef void (*ScaleRangeFn)(const ScaleContext & rContext, tools::Long nStartY, tools::Long nEndY);
template <size_t nSize> struct ScaleFunc
{
@@ -165,21 +165,21 @@ template <size_t nSize> struct ScaleFunc
};
template <int nColorBits>
-void scaleDown (const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleDown (const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
constexpr int nColorComponents = nColorBits / 8;
static_assert(nColorComponents * 8 == nColorBits, "nColorBits must be divisible by 8");
using ScaleFunction = ScaleFunc<nColorComponents>;
- const long nStartX = 0;
- const long nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0;
+ const tools::Long nEndX = rCtx.mnDestW - 1;
- for (long nY = nStartY; nY <= nEndY; nY++)
+ for (tools::Long nY = nStartY; nY <= nEndY; nY++)
{
- long nTop = rCtx.mbVMirr ? (nY + 1) : nY;
- long nBottom = rCtx.mbVMirr ? nY : (nY + 1);
+ tools::Long nTop = rCtx.mbVMirr ? (nY + 1) : nY;
+ tools::Long nBottom = rCtx.mbVMirr ? nY : (nY + 1);
- long nLineStart;
- long nLineRange;
+ tools::Long nLineStart;
+ tools::Long nLineRange;
if (nY == nEndY)
{
nLineStart = rCtx.maMapIY[nY];
@@ -193,13 +193,13 @@ void scaleDown (const ScaleContext &rCtx, long nStartY, long nEndY)
}
Scanline pScanDest = rCtx.mpDest->GetScanline(nY);
- for (long nX = nStartX; nX <= nEndX; nX++)
+ for (tools::Long nX = nStartX; nX <= nEndX; nX++)
{
- long nLeft = rCtx.mbHMirr ? (nX + 1) : nX;
- long nRight = rCtx.mbHMirr ? nX : (nX + 1);
+ tools::Long nLeft = rCtx.mbHMirr ? (nX + 1) : nX;
+ tools::Long nRight = rCtx.mbHMirr ? nX : (nX + 1);
- long nRowStart;
- long nRowRange;
+ tools::Long nRowStart;
+ tools::Long nRowRange;
if (nX == nEndX)
{
nRowStart = rCtx.maMapIX[nX];
@@ -215,7 +215,7 @@ void scaleDown (const ScaleContext &rCtx, long nStartY, long nEndY)
std::array<int, nColorComponents> sumNumbers{}; // zero-initialize
BilinearWeightType nTotalWeightY = 0;
- for (long i = 0; i<= nLineRange; i++)
+ for (tools::Long i = 0; i<= nLineRange; i++)
{
Scanline pTmpY = rCtx.mpSrc->GetScanline(nLineStart + i);
Scanline pTmpX = pTmpY + nColorComponents * nRowStart;
@@ -223,7 +223,7 @@ void scaleDown (const ScaleContext &rCtx, long nStartY, long nEndY)
std::array<int, nColorComponents> sumRows{}; // zero-initialize
BilinearWeightType nTotalWeightX = 0;
- for (long j = 0; j <= nRowRange; j++)
+ for (tools::Long j = 0; j <= nRowRange; j++)
{
if (nX == nEndX)
{
@@ -280,17 +280,17 @@ void scaleDown (const ScaleContext &rCtx, long nStartY, long nEndY)
}
template <int nColorBits>
-void scaleUp(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleUp(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
constexpr int nColorComponents = nColorBits / 8;
static_assert(nColorComponents * 8 == nColorBits, "nColorBits must be divisible by 8");
using ScaleFunction = ScaleFunc<nColorComponents>;
- const long nStartX = 0;
- const long nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0;
+ const tools::Long nEndX = rCtx.mnDestW - 1;
- for (long nY = nStartY; nY <= nEndY; nY++)
+ for (tools::Long nY = nStartY; nY <= nEndY; nY++)
{
- long nTempY = rCtx.maMapIY[nY];
+ tools::Long nTempY = rCtx.maMapIY[nY];
BilinearWeightType nTempFY = rCtx.maMapFY[nY];
Scanline pLine0 = rCtx.mpSrc->GetScanline(nTempY+0);
@@ -303,9 +303,9 @@ void scaleUp(const ScaleContext &rCtx, long nStartY, long nEndY)
Scanline pColorPtr0;
Scanline pColorPtr1;
- for (long nX = nStartX; nX <= nEndX; nX++)
+ for (tools::Long nX = nStartX; nX <= nEndX; nX++)
{
- long nTempX = rCtx.maMapIX[nX];
+ tools::Long nTempX = rCtx.maMapIX[nX];
BilinearWeightType nTempFX = rCtx.maMapFX[nX];
pColorPtr0 = pLine0 + nTempX * nColorComponents;
@@ -326,14 +326,14 @@ class ScaleTask : public comphelper::ThreadTask
{
ScaleRangeFn mpScaleRangeFunction;
const ScaleContext& mrContext;
- long mnStartY;
- long mnEndY;
+ tools::Long mnStartY;
+ tools::Long mnEndY;
public:
explicit ScaleTask(const std::shared_ptr<comphelper::ThreadTaskTag>& pTag,
ScaleRangeFn pScaleRangeFunction,
const ScaleContext& rContext,
- long nStartY, long nEndY)
+ tools::Long nStartY, tools::Long nEndY)
: comphelper::ThreadTask(pTag)
, mpScaleRangeFunction(pScaleRangeFunction)
, mrContext(rContext)
@@ -347,21 +347,21 @@ public:
}
};
-void scaleUpPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleUpPalette8bit(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
- const long nStartX = 0, nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0, nEndX = rCtx.mnDestW - 1;
- for( long nY = nStartY; nY <= nEndY; nY++ )
+ for( tools::Long nY = nStartY; nY <= nEndY; nY++ )
{
- long nTempY = rCtx.maMapIY[ nY ];
+ tools::Long nTempY = rCtx.maMapIY[ nY ];
BilinearWeightType nTempFY = rCtx.maMapFY[ nY ];
Scanline pLine0 = rCtx.mpSrc->GetScanline( nTempY );
Scanline pLine1 = rCtx.mpSrc->GetScanline( ++nTempY );
Scanline pScanDest = rCtx.mpDest->GetScanline( nY );
- for(long nX = nStartX, nXDst = 0; nX <= nEndX; nX++ )
+ for(tools::Long nX = nStartX, nXDst = 0; nX <= nEndX; nX++ )
{
- long nTempX = rCtx.maMapIX[ nX ];
+ tools::Long nTempX = rCtx.maMapIX[ nX ];
BilinearWeightType nTempFX = rCtx.maMapFX[ nX ];
const BitmapColor& rCol0 = rCtx.mpSrc->GetPaletteColor( pLine0[ nTempX ] );
@@ -385,19 +385,19 @@ void scaleUpPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
}
}
-void scaleUpPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleUpPaletteGeneral(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
- const long nStartX = 0, nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0, nEndX = rCtx.mnDestW - 1;
- for( long nY = nStartY; nY <= nEndY; nY++ )
+ for( tools::Long nY = nStartY; nY <= nEndY; nY++ )
{
- long nTempY = rCtx.maMapIY[ nY ];
+ tools::Long nTempY = rCtx.maMapIY[ nY ];
BilinearWeightType nTempFY = rCtx.maMapFY[ nY ];
Scanline pScanline = rCtx.mpDest->GetScanline( nY );
- for( long nX = nStartX, nXDst = 0; nX <= nEndX; nX++ )
+ for( tools::Long nX = nStartX, nXDst = 0; nX <= nEndX; nX++ )
{
- long nTempX = rCtx.maMapIX[ nX ];
+ tools::Long nTempX = rCtx.maMapIX[ nX ];
BilinearWeightType nTempFX = rCtx.maMapFX[ nX ];
BitmapColor aCol0 = rCtx.mpSrc->GetPaletteColor( rCtx.mpSrc->GetPixelIndex( nTempY, nTempX ) );
@@ -420,19 +420,19 @@ void scaleUpPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
}
}
-void scaleUpNonPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleUpNonPaletteGeneral(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
- const long nStartX = 0, nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0, nEndX = rCtx.mnDestW - 1;
- for( long nY = nStartY; nY <= nEndY; nY++ )
+ for( tools::Long nY = nStartY; nY <= nEndY; nY++ )
{
- long nTempY = rCtx.maMapIY[ nY ];
+ tools::Long nTempY = rCtx.maMapIY[ nY ];
BilinearWeightType nTempFY = rCtx.maMapFY[ nY ];
Scanline pScanDest = rCtx.mpDest->GetScanline( nY );
- for( long nX = nStartX, nXDst = 0; nX <= nEndX; nX++ )
+ for( tools::Long nX = nStartX, nXDst = 0; nX <= nEndX; nX++ )
{
- long nTempX = rCtx.maMapIX[ nX ];
+ tools::Long nTempX = rCtx.maMapIX[ nX ];
BilinearWeightType nTempFX = rCtx.maMapFX[ nX ];
BitmapColor aCol0 = rCtx.mpSrc->GetPixel( nTempY, nTempX );
@@ -455,16 +455,16 @@ void scaleUpNonPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY
}
}
-void scaleDownPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleDownPalette8bit(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
- const long nStartX = 0, nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0, nEndX = rCtx.mnDestW - 1;
- for( long nY = nStartY; nY <= nEndY; nY++ )
+ for( tools::Long nY = nStartY; nY <= nEndY; nY++ )
{
- long nTop = rCtx.mbVMirr ? ( nY + 1 ) : nY;
- long nBottom = rCtx.mbVMirr ? nY : ( nY + 1 ) ;
+ tools::Long nTop = rCtx.mbVMirr ? ( nY + 1 ) : nY;
+ tools::Long nBottom = rCtx.mbVMirr ? nY : ( nY + 1 ) ;
- long nLineStart, nLineRange;
+ tools::Long nLineStart, nLineRange;
if( nY == nEndY )
{
nLineStart = rCtx.maMapIY[ nY ];
@@ -477,13 +477,13 @@ void scaleDownPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
}
Scanline pScanDest = rCtx.mpDest->GetScanline( nY );
- for( long nX = nStartX , nXDst = 0; nX <= nEndX; nX++ )
+ for( tools::Long nX = nStartX , nXDst = 0; nX <= nEndX; nX++ )
{
- long nLeft = rCtx.mbHMirr ? ( nX + 1 ) : nX;
- long nRight = rCtx.mbHMirr ? nX : ( nX + 1 ) ;
+ tools::Long nLeft = rCtx.mbHMirr ? ( nX + 1 ) : nX;
+ tools::Long nRight = rCtx.mbHMirr ? nX : ( nX + 1 ) ;
- long nRowStart;
- long nRowRange;
+ tools::Long nRowStart;
+ tools::Long nRowRange;
if( nX == nEndX )
{
nRowStart = rCtx.maMapIX[ nX ];
@@ -500,7 +500,7 @@ void scaleDownPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
int nSumB = 0;
BilinearWeightType nTotalWeightY = 0;
- for(long i = 0; i<= nLineRange; i++)
+ for(tools::Long i = 0; i<= nLineRange; i++)
{
Scanline pTmpY = rCtx.mpSrc->GetScanline( nLineStart + i );
int nSumRowR = 0;
@@ -508,7 +508,7 @@ void scaleDownPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
int nSumRowB = 0;
BilinearWeightType nTotalWeightX = 0;
- for(long j = 0; j <= nRowRange; j++)
+ for(tools::Long j = 0; j <= nRowRange; j++)
{
const BitmapColor& rCol = rCtx.mpSrc->GetPaletteColor( pTmpY[ nRowStart + j ] );
@@ -580,16 +580,16 @@ void scaleDownPalette8bit(const ScaleContext &rCtx, long nStartY, long nEndY)
}
}
-void scaleDownPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleDownPaletteGeneral(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
- const long nStartX = 0, nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0, nEndX = rCtx.mnDestW - 1;
- for( long nY = nStartY; nY <= nEndY; nY++ )
+ for( tools::Long nY = nStartY; nY <= nEndY; nY++ )
{
- long nTop = rCtx.mbVMirr ? ( nY + 1 ) : nY;
- long nBottom = rCtx.mbVMirr ? nY : ( nY + 1 ) ;
+ tools::Long nTop = rCtx.mbVMirr ? ( nY + 1 ) : nY;
+ tools::Long nBottom = rCtx.mbVMirr ? nY : ( nY + 1 ) ;
- long nLineStart, nLineRange;
+ tools::Long nLineStart, nLineRange;
if( nY ==nEndY )
{
nLineStart = rCtx.maMapIY[ nY ];
@@ -602,12 +602,12 @@ void scaleDownPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
}
Scanline pScanDest = rCtx.mpDest->GetScanline( nY );
- for( long nX = nStartX , nXDst = 0; nX <= nEndX; nX++ )
+ for( tools::Long nX = nStartX , nXDst = 0; nX <= nEndX; nX++ )
{
- long nLeft = rCtx.mbHMirr ? ( nX + 1 ) : nX;
- long nRight = rCtx.mbHMirr ? nX : ( nX + 1 ) ;
+ tools::Long nLeft = rCtx.mbHMirr ? ( nX + 1 ) : nX;
+ tools::Long nRight = rCtx.mbHMirr ? nX : ( nX + 1 ) ;
- long nRowStart, nRowRange;
+ tools::Long nRowStart, nRowRange;
if( nX == nEndX )
{
nRowStart = rCtx.maMapIX[ nX ];
@@ -624,7 +624,7 @@ void scaleDownPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
int nSumB = 0;
BilinearWeightType nTotalWeightY = 0;
- for(long i = 0; i<= nLineRange; i++)
+ for(tools::Long i = 0; i<= nLineRange; i++)
{
int nSumRowR = 0;
int nSumRowG = 0;
@@ -632,7 +632,7 @@ void scaleDownPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
BilinearWeightType nTotalWeightX = 0;
Scanline pScanlineSrc = rCtx.mpSrc->GetScanline( nLineStart + i );
- for(long j = 0; j <= nRowRange; j++)
+ for(tools::Long j = 0; j <= nRowRange; j++)
{
BitmapColor aCol0 = rCtx.mpSrc->GetPaletteColor ( rCtx.mpSrc->GetIndexFromData( pScanlineSrc, nRowStart + j ) );
@@ -672,7 +672,7 @@ void scaleDownPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
}
}
- long nWeightY = lclMaxWeight();
+ tools::Long nWeightY = lclMaxWeight();
if( nY == nEndY )
nWeightY = lclMaxWeight();
else if( i == 0 )
@@ -708,16 +708,16 @@ void scaleDownPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
}
}
-void scaleDownNonPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEndY)
+void scaleDownNonPaletteGeneral(const ScaleContext &rCtx, tools::Long nStartY, tools::Long nEndY)
{
- const long nStartX = 0, nEndX = rCtx.mnDestW - 1;
+ const tools::Long nStartX = 0, nEndX = rCtx.mnDestW - 1;
- for( long nY = nStartY; nY <= nEndY; nY++ )
+ for( tools::Long nY = nStartY; nY <= nEndY; nY++ )
{
- long nTop = rCtx.mbVMirr ? ( nY + 1 ) : nY;
- long nBottom = rCtx.mbVMirr ? nY : ( nY + 1 ) ;
+ tools::Long nTop = rCtx.mbVMirr ? ( nY + 1 ) : nY;
+ tools::Long nBottom = rCtx.mbVMirr ? nY : ( nY + 1 ) ;
- long nLineStart, nLineRange;
+ tools::Long nLineStart, nLineRange;
if( nY ==nEndY )
{
nLineStart = rCtx.maMapIY[ nY ];
@@ -730,12 +730,12 @@ void scaleDownNonPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEn
}
Scanline pScanDest = rCtx.mpDest->GetScanline( nY );
- for( long nX = nStartX , nXDst = 0; nX <= nEndX; nX++ )
+ for( tools::Long nX = nStartX , nXDst = 0; nX <= nEndX; nX++ )
{
- long nLeft = rCtx.mbHMirr ? ( nX + 1 ) : nX;
- long nRight = rCtx.mbHMirr ? nX : ( nX + 1 ) ;
+ tools::Long nLeft = rCtx.mbHMirr ? ( nX + 1 ) : nX;
+ tools::Long nRight = rCtx.mbHMirr ? nX : ( nX + 1 ) ;
- long nRowStart, nRowRange;
+ tools::Long nRowStart, nRowRange;
if( nX == nEndX )
{
nRowStart = rCtx.maMapIX[ nX ];
@@ -752,7 +752,7 @@ void scaleDownNonPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEn
int nSumB = 0;
BilinearWeightType nTotalWeightY = 0;
- for(long i = 0; i<= nLineRange; i++)
+ for(tools::Long i = 0; i<= nLineRange; i++)
{
int nSumRowR = 0;
int nSumRowG = 0;
@@ -760,7 +760,7 @@ void scaleDownNonPaletteGeneral(const ScaleContext &rCtx, long nStartY, long nEn
BilinearWeightType nTotalWeightX = 0;
Scanline pScanlineSrc = rCtx.mpSrc->GetScanline( nLineStart + i );
- for(long j = 0; j <= nRowRange; j++)
+ for(tools::Long j = 0; j <= nRowRange; j++)
{
BitmapColor aCol0 = rCtx.mpSrc->GetPixelFromData( pScanlineSrc, nRowStart + j );
@@ -858,8 +858,8 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const
double fScaleX = std::fabs(mrScaleX);
double fScaleY = std::fabs(mrScaleY);
- const long nDstW = FRound(aSizePix.Width() * fScaleX);
- const long nDstH = FRound(aSizePix.Height() * fScaleY);
+ const tools::Long nDstW = FRound(aSizePix.Width() * fScaleX);
+ const tools::Long nDstH = FRound(aSizePix.Height() * fScaleY);
constexpr double fScaleThresh = 0.6;
@@ -898,7 +898,7 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const
BitmapScopedWriteAccess pWriteAccess(aOutBmp);
- const long nEndY = nDstH - 1;
+ const tools::Long nEndY = nDstH - 1;
if (pReadAccess && pWriteAccess)
{
@@ -966,7 +966,7 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const
// A large source image.
bool bHorizontalWork = pReadAccess->Height() >= 512 && pReadAccess->Width() >= 512;
bool bUseThreads = true;
- const long nStartY = 0;
+ const tools::Long nStartY = 0;
static bool bDisableThreadedScaling = getenv ("VCL_NO_THREAD_SCALE");
if (bDisableThreadedScaling || !bHorizontalWork)
@@ -984,7 +984,7 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const
std::shared_ptr<comphelper::ThreadTaskTag> pTag = comphelper::ThreadPool::createThreadTaskTag();
vcl::bitmap::generateStripRanges<constScaleThreadStrip>(nStartY, nEndY,
- [&] (long const nStart, long const nEnd, bool const bLast)
+ [&] (tools::Long const nStart, tools::Long const nEnd, bool const bLast)
{
if (!bLast)
{
diff --git a/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx b/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx
index 58d5e381087d..9a8b462e47a2 100644
--- a/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx
+++ b/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx
@@ -21,8 +21,8 @@ BitmapEx BitmapSeparableUnsharpenFilter::execute(BitmapEx const& rBitmapEx) cons
{
Bitmap aBitmap(rBitmapEx.GetBitmap());
- const long nWidth = aBitmap.GetSizePixel().Width();
- const long nHeight = aBitmap.GetSizePixel().Height();
+ const tools::Long nWidth = aBitmap.GetSizePixel().Width();
+ const tools::Long nHeight = aBitmap.GetSizePixel().Height();
Bitmap aBlur(aBitmap);
BitmapEx aBlurEx(aBlur);
@@ -42,10 +42,10 @@ BitmapEx BitmapSeparableUnsharpenFilter::execute(BitmapEx const& rBitmapEx) cons
BitmapColor aColor, aColorBlur;
// For all pixels in original image subtract pixels values from blurred image
- for (long y = 0; y < nHeight; y++)
+ for (tools::Long y = 0; y < nHeight; y++)
{
Scanline pScanline = pWriteAcc->GetScanline(y);
- for (long x = 0; x < nWidth; x++)
+ for (tools::Long x = 0; x < nWidth; x++)
{
aColorBlur = pReadAccBlur->GetColor(y, x);
aColor = pReadAcc->GetColor(y, x);
diff --git a/vcl/source/bitmap/BitmapSepiaFilter.cxx b/vcl/source/bitmap/BitmapSepiaFilter.cxx
index 5123bf13075c..cfac984b8fa3 100644
--- a/vcl/source/bitmap/BitmapSepiaFilter.cxx
+++ b/vcl/source/bitmap/BitmapSepiaFilter.cxx
@@ -27,7 +27,7 @@ BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) const
if (pReadAcc)
{
- const long nSepia
+ const tools::Long nSepia
= 10000 - 100 * std::clamp(mnSepiaPercent, sal_uInt16(0), sal_uInt16(100));
BitmapPalette aSepiaPal(256);
@@ -47,8 +47,8 @@ BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
BitmapColor aCol(sal_uInt8(0));
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const tools::Long nWidth = pWriteAcc->Width();
+ const tools::Long nHeight = pWriteAcc->Height();
if (pReadAcc->HasPalette())
{
@@ -59,11 +59,11 @@ BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) const
pIndexMap[i] = pReadAcc->GetPaletteColor(i).GetLuminance();
}
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aCol.SetIndex(pIndexMap[pReadAcc->GetIndexFromData(pScanlineRead, nX)]);
pWriteAcc->SetPixelOnData(pScanline, nX, aCol);
@@ -72,11 +72,11 @@ BitmapEx BitmapSepiaFilter::execute(BitmapEx const& rBitmapEx) const
}
else
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aCol.SetIndex(pReadAcc->GetPixelFromData(pScanlineRead, nX).GetLuminance());
pWriteAcc->SetPixelOnData(pScanline, nX, aCol);
diff --git a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
index 1d21ed9e1279..4284db563ac3 100644
--- a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
+++ b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
@@ -50,16 +50,16 @@ BitmapEx BitmapSimpleColorQuantizationFilter::execute(BitmapEx const& aBitmapEx)
if (pWAcc)
{
- const long nWidth = pRAcc->Width();
- const long nHeight = pRAcc->Height();
+ const tools::Long nWidth = pRAcc->Width();
+ const tools::Long nHeight = pRAcc->Height();
if (pRAcc->HasPalette())
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWAcc->GetScanline(nY);
Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
auto c = pRAcc->GetPaletteColor(
pRAcc->GetIndexFromData(pScanlineRead, nX));
@@ -71,11 +71,11 @@ BitmapEx BitmapSimpleColorQuantizationFilter::execute(BitmapEx const& aBitmapEx)
}
else
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWAcc->GetScanline(nY);
Scanline pScanlineRead = pRAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
auto c = pRAcc->GetPixelFromData(pScanlineRead, nX);
pWAcc->SetPixelOnData(
diff --git a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
index 5ce4987a26fd..e6609f77d9f4 100644
--- a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
+++ b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx
@@ -39,20 +39,20 @@ BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const
if (pWriteAcc)
{
BitmapColor aGrey(sal_uInt8(0));
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
- const long nMask111 = -1, nMask121 = 0, nMask131 = 1;
- const long nMask211 = -2, nMask221 = 0, nMask231 = 2;
- const long nMask311 = -1, nMask321 = 0, nMask331 = 1;
- const long nMask112 = 1, nMask122 = 2, nMask132 = 1;
- const long nMask212 = 0, nMask222 = 0, nMask232 = 0;
- const long nMask312 = -1, nMask322 = -2, nMask332 = -1;
- long nGrey11, nGrey12, nGrey13;
- long nGrey21, nGrey22, nGrey23;
- long nGrey31, nGrey32, nGrey33;
+ const tools::Long nWidth = pWriteAcc->Width();
+ const tools::Long nHeight = pWriteAcc->Height();
+ const tools::Long nMask111 = -1, nMask121 = 0, nMask131 = 1;
+ const tools::Long nMask211 = -2, nMask221 = 0, nMask231 = 2;
+ const tools::Long nMask311 = -1, nMask321 = 0, nMask331 = 1;
+ const tools::Long nMask112 = 1, nMask122 = 2, nMask132 = 1;
+ const tools::Long nMask212 = 0, nMask222 = 0, nMask232 = 0;
+ const tools::Long nMask312 = -1, nMask322 = -2, nMask332 = -1;
+ tools::Long nGrey11, nGrey12, nGrey13;
+ tools::Long nGrey21, nGrey22, nGrey23;
+ tools::Long nGrey31, nGrey32, nGrey33;
std::unique_ptr<long[]> pHMap(new long[nWidth + 2]);
std::unique_ptr<long[]> pVMap(new long[nHeight + 2]);
- long nX, nY, nSum1, nSum2;
+ tools::Long nX, nY, nSum1, nSum2;
// fill mapping tables
pHMap[0] = 0;
@@ -117,7 +117,7 @@ BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const
nSum1 += nMask331 * nGrey33;
nSum2 += nMask332 * nGrey33;
- nSum1 = static_cast<long>(
+ nSum1 = static_cast<tools::Long>(
sqrt(static_cast<double>(nSum1 * nSum1 + nSum2 * nSum2)));
aGrey.SetIndex(~static_cast<sal_uInt8>(std::clamp(nSum1, 0L, 255L)));
@@ -125,7 +125,7 @@ BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const
if (nX < (nWidth - 1))
{
- const long nNextX = pHMap[nX + 3];
+ const tools::Long nNextX = pHMap[nX + 3];
nGrey11 = nGrey12;
nGrey12 = nGrey13;
diff --git a/vcl/source/bitmap/BitmapSolarizeFilter.cxx b/vcl/source/bitmap/BitmapSolarizeFilter.cxx
index bd7518b4cabf..c4df366a65cb 100644
--- a/vcl/source/bitmap/BitmapSolarizeFilter.cxx
+++ b/vcl/source/bitmap/BitmapSolarizeFilter.cxx
@@ -39,13 +39,13 @@ BitmapEx BitmapSolarizeFilter::execute(BitmapEx const& rBitmapEx) const
else
{
BitmapColor aCol;
- const long nWidth = pWriteAcc->Width();
- const long nHeight = pWriteAcc->Height();
+ const tools::Long nWidth = pWriteAcc->Width();
+ const tools::Long nHeight = pWriteAcc->Height();
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aCol = pWriteAcc->GetPixelFromData(pScanline, nX);
diff --git a/vcl/source/bitmap/BitmapSymmetryCheck.cxx b/vcl/source/bitmap/BitmapSymmetryCheck.cxx
index 9abb480864e2..ce5235132e80 100644
--- a/vcl/source/bitmap/BitmapSymmetryCheck.cxx
+++ b/vcl/source/bitmap/BitmapSymmetryCheck.cxx
@@ -24,20 +24,20 @@ bool BitmapSymmetryCheck::check(Bitmap& rBitmap)
bool BitmapSymmetryCheck::checkImpl(BitmapReadAccess const * pReadAccess)
{
- long nHeight = pReadAccess->Height();
- long nWidth = pReadAccess->Width();
+ tools::Long nHeight = pReadAccess->Height();
+ tools::Long nWidth = pReadAccess->Width();
- long nHeightHalf = nHeight / 2;
- long nWidthHalf = nWidth / 2;
+ tools::Long nHeightHalf = nHeight / 2;
+ tools::Long nWidthHalf = nWidth / 2;
bool bHeightEven = (nHeight % 2) == 0;
bool bWidthEven = (nWidth % 2) == 0;
- for (long y = 0; y < nHeightHalf; ++y)
+ for (tools::Long y = 0; y < nHeightHalf; ++y)
{
Scanline pScanlineRead = pReadAccess->GetScanline( y );
Scanline pScanlineRead2 = pReadAccess->GetScanline( nHeight - y - 1 );
- for (long x = 0; x < nWidthHalf; ++x)
+ for (tools::Long x = 0; x < nWidthHalf; ++x)
{
if (pReadAccess->GetPixelFromData(pScanlineRead, x) != pReadAccess->GetPixelFromData(pScanlineRead2, x))
{
@@ -56,7 +56,7 @@ bool BitmapSymmetryCheck::checkImpl(BitmapReadAccess const * pReadAccess)
if (bWidthEven)
{
- for (long y = 0; y < nHeightHalf; ++y)
+ for (tools::Long y = 0; y < nHeightHalf; ++y)
{
if (pReadAccess->GetPixel(y, nWidthHalf) != pReadAccess->GetPixel(nHeight - y - 1, nWidthHalf))
{
@@ -68,7 +68,7 @@ bool BitmapSymmetryCheck::checkImpl(BitmapReadAccess const * pReadAccess)
if (bHeightEven)
{
Scanline pScanlineRead = pReadAccess->GetScanline( nHeightHalf );
- for (long x = 0; x < nWidthHalf; ++x)
+ for (tools::Long x = 0; x < nWidthHalf; ++x)
{
if (pReadAccess->GetPixelFromData(pScanlineRead, x) != pReadAccess->GetPixelFromData(pScanlineRead, nWidth - x - 1))
{
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index f0c5c522b7de..d49fd7a5efb3 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -141,10 +141,10 @@ BitmapEx CreateFromData( sal_uInt8 const *pData, sal_Int32 nWidth, sal_Int32 nHe
}
if (nBitCount == 1)
{
- for( long y = 0; y < nHeight; ++y )
+ for( tools::Long y = 0; y < nHeight; ++y )
{
Scanline pScanline = pWrite->GetScanline(y);
- for (long x = 0; x < nWidth; ++x)
+ for (tools::Long x = 0; x < nWidth; ++x)
{
sal_uInt8 const *p = pData + y * nStride / 8;
int bitIndex = (y * nStride) % 8;
@@ -154,11 +154,11 @@ BitmapEx CreateFromData( sal_uInt8 const *pData, sal_Int32 nWidth, sal_Int32 nHe
}
else
{
- for( long y = 0; y < nHeight; ++y )
+ for( tools::Long y = 0; y < nHeight; ++y )
{
sal_uInt8 const *p = pData + (y * nStride);
Scanline pScanline = pWrite->GetScanline(y);
- for (long x = 0; x < nWidth; ++x)
+ for (tools::Long x = 0; x < nWidth; ++x)
{
BitmapColor col(p[0], p[1], p[2]);
pWrite->SetPixelOnData(pScanline, x, col);
@@ -168,7 +168,7 @@ BitmapEx CreateFromData( sal_uInt8 const *pData, sal_Int32 nWidth, sal_Int32 nHe
{
p = pData + (y * nStride) + 3;
Scanline pMaskScanLine = xMaskAcc->GetScanline(y);
- for (long x = 0; x < nWidth; ++x)
+ for (tools::Long x = 0; x < nWidth; ++x)
{
xMaskAcc->SetPixelOnData(pMaskScanLine, x, BitmapColor(*p));
p += 4;
@@ -206,11 +206,11 @@ BitmapEx CreateFromData( RawBitmap&& rawBitmap )
auto nHeight = rawBitmap.maSize.getHeight();
auto nWidth = rawBitmap.maSize.getWidth();
auto nStride = nWidth * nBitCount / 8;
- for( long y = 0; y < nHeight; ++y )
+ for( tools::Long y = 0; y < nHeight; ++y )
{
sal_uInt8 const *p = rawBitmap.mpData.get() + (y * nStride);
Scanline pScanline = pWrite->GetScanline(y);
- for (long x = 0; x < nWidth; ++x)
+ for (tools::Long x = 0; x < nWidth; ++x)
{
BitmapColor col(p[0], p[1], p[2]);
pWrite->SetPixelOnData(pScanline, x, col);
@@ -220,7 +220,7 @@ BitmapEx CreateFromData( RawBitmap&& rawBitmap )
{
p = rawBitmap.mpData.get() + (y * nStride) + 3;
Scanline pMaskScanLine = xMaskAcc->GetScanline(y);
- for (long x = 0; x < nWidth; ++x)
+ for (tools::Long x = 0; x < nWidth; ++x)
{
xMaskAcc->SetPixelOnData(pMaskScanLine, x, BitmapColor(*p));
p += 4;
@@ -273,10 +273,10 @@ BitmapEx* CreateFromCairoSurface(Size aSize, cairo_surface_t * pSurface)
unsigned char *pSrc = cairo_image_surface_get_data( pPixels );
unsigned int nStride = cairo_image_surface_get_stride( pPixels );
vcl::bitmap::lookup_table unpremultiply_table = vcl::bitmap::get_unpremultiply_table();
- for( long y = 0; y < aSize.Height(); y++ )
+ for( tools::Long y = 0; y < aSize.Height(); y++ )
{
sal_uInt32 *pPix = reinterpret_cast<sal_uInt32 *>(pSrc + nStride * y);
- for( long x = 0; x < aSize.Width(); x++ )
+ for( tools::Long x = 0; x < aSize.Width(); x++ )
{
#if defined OSL_BIGENDIAN
sal_uInt8 nB = (*pPix >> 24);
@@ -407,7 +407,7 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
aTransform.invert();
// for the time being, always read as ARGB
- for( long y=0; y<aDestBmpSize.Height(); ++y )
+ for( tools::Long y=0; y<aDestBmpSize.Height(); ++y )
{
// differentiate mask and alpha channel (on-off
// vs. multi-level transparency)
@@ -416,7 +416,7 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
Scanline pScan = pWriteAccess->GetScanline( y );
Scanline pScanAlpha = pAlphaWriteAccess->GetScanline( y );
// Handling alpha and mask just the same...
- for( long x=0; x<aDestBmpSize.Width(); ++x )
+ for( tools::Long x=0; x<aDestBmpSize.Width(); ++x )
{
::basegfx::B2DPoint aPoint(x,y);
aPoint *= aTransform;
@@ -440,7 +440,7 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap,
{
Scanline pScan = pWriteAccess->GetScanline( y );
Scanline pScanAlpha = pAlphaWriteAccess->GetScanline( y );
- for( long x=0; x<aDestBmpSize.Width(); ++x )
+ for( tools::Long x=0; x<aDestBmpSize.Width(); ++x )
{
::basegfx::B2DPoint aPoint(x,y);
aPoint *= aTransform;
@@ -503,10 +503,10 @@ void DrawAlphaBitmapAndAlphaGradient(BitmapEx & rBitmapEx, bool bFixedTransparen
{
const double fOpNew(1.0 - fTransparence);
- for(long y(0); y < pOld->Height(); y++)
+ for(tools::Long y(0); y < pOld->Height(); y++)
{
Scanline pScanline = pOld->GetScanline( y );
- for(long x(0); x < pOld->Width(); x++)
+ for(tools::Long x(0); x < pOld->Width(); x++)
{
const double fOpOld(1.0 - (pOld->GetIndexFromData(pScanline, x) * fFactor));
const sal_uInt8 aCol(basegfx::fround((1.0 - (fOpOld * fOpNew)) * 255.0));
@@ -524,10 +524,10 @@ void DrawAlphaBitmapAndAlphaGradient(BitmapEx & rBitmapEx, bool bFixedTransparen
assert(pOld->Width() == pNew->Width() && pOld->Height() == pNew->Height() &&
"Alpha masks have different sizes (!)");
- for(long y(0); y < pOld->Height(); y++)
+ for(tools::Long y(0); y < pOld->Height(); y++)
{
Scanline pScanline = pOld->GetScanline( y );
- for(long x(0); x < pOld->Width(); x++)
+ for(tools::Long x(0); x < pOld->Width(); x++)
{
const double fOpOld(1.0 - (pOld->GetIndexFromData(pScanline, x) * fFactor));
const double fOpNew(1.0 - (pNew->GetIndexFromData(pScanline, x) * fFactor));
@@ -581,14 +581,14 @@ void DrawAndClipBitmap(const Point& rPos, const Size& rSize, const BitmapEx& rBi
if(pR && pW)
{
- const long nWidth(std::min(pR->Width(), pW->Width()));
- const long nHeight(std::min(pR->Height(), pW->Height()));
+ const tools::Long nWidth(std::min(pR->Width(), pW->Width()));
+ const tools::Long nHeight(std::min(pR->Height(), pW->Height()));
- for(long nY(0); nY < nHeight; nY++)
+ for(tools::Long nY(0); nY < nHeight; nY++)
{
Scanline pScanlineR = pR->GetScanline( nY );
Scanline pScanlineW = pW->GetScanline( nY );
- for(long nX(0); nX < nWidth; nX++)
+ for(tools::Long nX(0); nX < nWidth; nX++)
{
const sal_uInt8 nIndR(pR->GetIndexFromData(pScanlineR, nX));
const sal_uInt8 nIndW(pW->GetIndexFromData(pScanlineW, nX));
@@ -651,10 +651,10 @@ css::uno::Sequence< sal_Int8 > GetMaskDIB(BitmapEx const & aBmpEx)
return css::uno::Sequence< sal_Int8 >();
}
-static bool readAlpha( BitmapReadAccess const * pAlphaReadAcc, long nY, const long nWidth, unsigned char* data, long nOff )
+static bool readAlpha( BitmapReadAccess const * pAlphaReadAcc, tools::Long nY, const tools::Long nWidth, unsigned char* data, tools::Long nOff )
{
bool bIsAlpha = false;
- long nX;
+ tools::Long nX;
int nAlpha;
Scanline pReadScan;
@@ -705,15 +705,15 @@ static bool readAlpha( BitmapReadAccess const * pAlphaReadAcc, long nY, const lo
* @param data will be filled with alpha data, if xBitmap is alpha/transparent image
* @param bHasAlpha will be set to true if resulting surface has alpha
**/
-void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, unsigned char*& data, bool& bHasAlpha, long& rnWidth, long& rnHeight )
+void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, unsigned char*& data, bool& bHasAlpha, tools::Long& rnWidth, tools::Long& rnHeight )
{
AlphaMask aAlpha = aBmpEx.GetAlpha();
::BitmapReadAccess* pBitmapReadAcc = aBitmap.AcquireReadAccess();
::BitmapReadAccess* pAlphaReadAcc = nullptr;
- const long nWidth = rnWidth = pBitmapReadAcc->Width();
- const long nHeight = rnHeight = pBitmapReadAcc->Height();
- long nX, nY;
+ const tools::Long nWidth = rnWidth = pBitmapReadAcc->Width();
+ const tools::Long nHeight = rnHeight = pBitmapReadAcc->Height();
+ tools::Long nX, nY;
bool bIsAlpha = false;
if( aBmpEx.IsTransparent() || aBmpEx.IsAlpha() )
@@ -721,7 +721,7 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
data = static_cast<unsigned char*>(malloc( nWidth*nHeight*4 ));
- long nOff = 0;
+ tools::Long nOff = 0;
::Color aColor;
unsigned int nAlpha = 255;
@@ -946,14 +946,14 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
sal_Int8* pRes = aRes.getArray();
int nCurrPos(0);
- for( long y=rect.Y1;
+ for( tools::Long y=rect.Y1;
y<aBmpSize.Height() && y<rect.Y2;
++y )
{
if( pAlphaReadAccess.get() != nullptr )
{
Scanline pScanlineReadAlpha = pAlphaReadAccess->GetScanline( y );
- for( long x=rect.X1;
+ for( tools::Long x=rect.X1;
x<aBmpSize.Width() && x<rect.X2;
++x )
{
@@ -965,7 +965,7 @@ void CanvasCairoExtractBitmapData( BitmapEx const & aBmpEx, Bitmap & aBitmap, un
}
else
{
- for( long x=rect.X1;
+ for( tools::Long x=rect.X1;
x<aBmpSize.Width() && x<rect.X2;
++x )
{
@@ -1101,14 +1101,14 @@ bool convertBitmap32To24Plus8(BitmapEx const & rInput, BitmapEx & rResult)
Bitmap::ScopedReadAccess pReadAccess(aBitmap);
- for (long nY = 0; nY < aSize.Height(); ++nY)
+ for (tools::Long nY = 0; nY < aSize.Height(); ++nY)
{
Scanline aResultScan = pResultBitmapAccess->GetScanline(nY);
Scanline aResultScanAlpha = pResultAlphaAccess->GetScanline(nY);
Scanline aReadScan = pReadAccess->GetScanline(nY);
- for (long nX = 0; nX < aSize.Width(); ++nX)
+ for (tools::Long nX = 0; nX < aSize.Width(); ++nX)
{
const BitmapColor aColor = pReadAccess->GetPixelFromData(aReadScan, nX);
BitmapColor aResultColor(aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue());
diff --git a/vcl/source/bitmap/Octree.cxx b/vcl/source/bitmap/Octree.cxx
index b39e5a1673f2..8f813315600e 100644
--- a/vcl/source/bitmap/Octree.cxx
+++ b/vcl/source/bitmap/Octree.cxx
@@ -43,15 +43,15 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors)
if (!*pAccess)
return;
- const long nWidth = pAccess->Width();
- const long nHeight = pAccess->Height();
+ const tools::Long nWidth = pAccess->Width();
+ const tools::Long nHeight = pAccess->Height();
if (pAccess->HasPalette())
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAccess->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
mpColor = &pAccess->GetPaletteColor(pAccess->GetIndexFromData(pScanline, nX));
mnLevel = 0;
@@ -68,10 +68,10 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors)
mpColor = &aColor;
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAccess->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aColor = pAccess->GetPixelFromData(pScanline, nX);
mnLevel = 0;
@@ -225,28 +225,28 @@ InverseColorMap::InverseColorMap(const BitmapPalette& rPal)
const unsigned long xsqr = 1 << (gnBits << 1);
const unsigned long xsqr2 = xsqr << 1;
const int nColors = rPal.GetEntryCount();
- const long x = 1 << gnBits;
- const long x2 = x >> 1;
+ const tools::Long x = 1 << gnBits;
+ const tools::Long x2 = x >> 1;
sal_uLong r, g, b;
- long rxx, gxx, bxx;
+ tools::Long rxx, gxx, bxx;
ImplCreateBuffers();
for (int nIndex = 0; nIndex < nColors; nIndex++)
{
const BitmapColor& rColor = rPal[static_cast<sal_uInt16>(nIndex)];
- const long cRed = rColor.GetRed();
- const long cGreen = rColor.GetGreen();
- const long cBlue = rColor.GetBlue();
+ const tools::Long cRed = rColor.GetRed();
+ const tools::Long cGreen = rColor.GetGreen();
+ const tools::Long cBlue = rColor.GetBlue();
- long rdist = cRed - x2;
- long gdist = cGreen - x2;
- long bdist = cBlue - x2;
+ tools::Long rdist = cRed - x2;
+ tools::Long gdist = cGreen - x2;
+ tools::Long bdist = cBlue - x2;
rdist = rdist * rdist + gdist * gdist + bdist * bdist;
- const long crinc = (xsqr - (cRed << gnBits)) << 1;
- const long cginc = (xsqr - (cGreen << gnBits)) << 1;
- const long cbinc = (xsqr - (cBlue << gnBits)) << 1;
+ const tools::Long crinc = (xsqr - (cRed << gnBits)) << 1;
+ const tools::Long cginc = (xsqr - (cGreen << gnBits)) << 1;
+ const tools::Long cbinc = (xsqr - (cBlue << gnBits)) << 1;
sal_uLong* cdp = reinterpret_cast<sal_uLong*>(mpBuffer.data());
sal_uInt8* crgbp = mpMap.data();
@@ -257,7 +257,7 @@ InverseColorMap::InverseColorMap(const BitmapPalette& rPal)
{
for (b = 0, bdist = gdist, bxx = cbinc; b < nColorMax;
bdist += bxx, b++, cdp++, crgbp++, bxx += xsqr2)
- if (!nIndex || static_cast<long>(*cdp) > bdist)
+ if (!nIndex || static_cast<tools::Long>(*cdp) > bdist)
{
*cdp = bdist;
*crgbp = static_cast<sal_uInt8>(nIndex);
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index dfa50e29e592..c7b7b9b7e70c 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -475,16 +475,16 @@ bool Bitmap::Crop( const tools::Rectangle& rRectPixel )
if( pWriteAcc )
{
- const long nOldX = aRect.Left();
- const long nOldY = aRect.Top();
- const long nNewWidth = aNewRect.GetWidth();
- const long nNewHeight = aNewRect.GetHeight();
+ const tools::Long nOldX = aRect.Left();
+ const tools::Long nOldY = aRect.Top();
+ const tools::Long nNewWidth = aNewRect.GetWidth();
+ const tools::Long nNewHeight = aNewRect.GetHeight();
- for( long nY = 0, nY2 = nOldY; nY < nNewHeight; nY++, nY2++ )
+ for( tools::Long nY = 0, nY2 = nOldY; nY < nNewHeight; nY++, nY2++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY2);
- for( long nX = 0, nX2 = nOldX; nX < nNewWidth; nX++, nX2++ )
+ for( tools::Long nX = 0, nX2 = nOldX; nX < nNewWidth; nX++, nX2++ )
pWriteAcc->SetPixelOnData( pScanline, nX, pReadAcc->GetPixelFromData( pScanlineRead, nX2 ) );
}
@@ -582,11 +582,11 @@ bool Bitmap::CopyPixel( const tools::Rectangle& rRectDst,
if( pWriteAcc )
{
- const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcEndX = aRectSrc.Left() + nWidth;
- const long nSrcEndY = aRectSrc.Top() + nHeight;
- long nDstY = aRectDst.Top();
+ const tools::Long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const tools::Long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const tools::Long nSrcEndX = aRectSrc.Left() + nWidth;
+ const tools::Long nSrcEndY = aRectSrc.Top() + nHeight;
+ tools::Long nDstY = aRectDst.Top();
if( pReadAcc->HasPalette() && pWriteAcc->HasPalette() )
{
@@ -598,30 +598,30 @@ bool Bitmap::CopyPixel( const tools::Rectangle& rRectDst,
for( sal_uInt16 i = 0; i < nCount; i++ )
pMap[ i ] = static_cast<sal_uInt8>(pWriteAcc->GetBestPaletteIndex( pReadAcc->GetPaletteColor( i ) ));
- for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
+ for( tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nDstY);
Scanline pScanlineRead = pReadAcc->GetScanline(nSrcY);
- for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
+ for( tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
pWriteAcc->SetPixelOnData( pScanline, nDstX, BitmapColor( pMap[ pReadAcc->GetIndexFromData( pScanlineRead, nSrcX ) ] ));
}
}
else if( pReadAcc->HasPalette() )
{
- for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
+ for( tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nDstY);
Scanline pScanlineRead = pReadAcc->GetScanline(nSrcY);
- for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
+ for( tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
pWriteAcc->SetPixelOnData( pScanline, nDstX, pReadAcc->GetPaletteColor( pReadAcc->GetIndexFromData( pScanlineRead, nSrcX ) ) );
}
}
else
- for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
+ for( tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nDstY);
Scanline pScanlineRead = pReadAcc->GetScanline(nSrcY);
- for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
+ for( tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
pWriteAcc->SetPixelOnData( pScanline, nDstX, pReadAcc->GetPixelFromData( pScanlineRead, nSrcX ) );
}
@@ -645,54 +645,54 @@ bool Bitmap::CopyPixel( const tools::Rectangle& rRectDst,
if( pWriteAcc )
{
- const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcX = aRectSrc.Left();
- const long nSrcY = aRectSrc.Top();
- const long nSrcEndX1 = nSrcX + nWidth - 1;
- const long nSrcEndY1 = nSrcY + nHeight - 1;
- const long nDstX = aRectDst.Left();
- const long nDstY = aRectDst.Top();
- const long nDstEndX1 = nDstX + nWidth - 1;
- const long nDstEndY1 = nDstY + nHeight - 1;
+ const tools::Long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const tools::Long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const tools::Long nSrcX = aRectSrc.Left();
+ const tools::Long nSrcY = aRectSrc.Top();
+ const tools::Long nSrcEndX1 = nSrcX + nWidth - 1;
+ const tools::Long nSrcEndY1 = nSrcY + nHeight - 1;
+ const tools::Long nDstX = aRectDst.Left();
+ const tools::Long nDstY = aRectDst.Top();
+ const tools::Long nDstEndX1 = nDstX + nWidth - 1;
+ const tools::Long nDstEndY1 = nDstY + nHeight - 1;
if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
{
- for( long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
+ for( tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
+ for( tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
else if( ( nDstX <= nSrcX ) && ( nDstY >= nSrcY ) )
{
- for( long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
+ for( tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
+ for( tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
else if( ( nDstX >= nSrcX ) && ( nDstY <= nSrcY ) )
{
- for( long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
+ for( tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
+ for( tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
else
{
- for( long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
+ for( tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
+ for( tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
@@ -738,17 +738,17 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t
if( pWriteAcc )
{
- const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcEndX = aRectSrc.Left() + nWidth;
- const long nSrcEndY = aRectSrc.Top() + nHeight;
- long nDstY = aRectDst.Top();
+ const tools::Long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const tools::Long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const tools::Long nSrcEndX = aRectSrc.Left() + nWidth;
+ const tools::Long nSrcEndY = aRectSrc.Top() + nHeight;
+ tools::Long nDstY = aRectDst.Top();
- for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++)
+ for( tools::Long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nDstY);
Scanline pScanlineRead = pReadAcc->GetScanline(nSrcY);
- for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
+ for( tools::Long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
pWriteAcc->SetPixelOnData( pScanline, nDstX, pReadAcc->GetPixelFromData( pScanlineRead, nSrcX ) );
}
@@ -772,54 +772,54 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t
if( pWriteAcc )
{
- const long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
- const long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
- const long nSrcX = aRectSrc.Left();
- const long nSrcY = aRectSrc.Top();
- const long nSrcEndX1 = nSrcX + nWidth - 1;
- const long nSrcEndY1 = nSrcY + nHeight - 1;
- const long nDstX = aRectDst.Left();
- const long nDstY = aRectDst.Top();
- const long nDstEndX1 = nDstX + nWidth - 1;
- const long nDstEndY1 = nDstY + nHeight - 1;
+ const tools::Long nWidth = std::min( aRectSrc.GetWidth(), aRectDst.GetWidth() );
+ const tools::Long nHeight = std::min( aRectSrc.GetHeight(), aRectDst.GetHeight() );
+ const tools::Long nSrcX = aRectSrc.Left();
+ const tools::Long nSrcY = aRectSrc.Top();
+ const tools::Long nSrcEndX1 = nSrcX + nWidth - 1;
+ const tools::Long nSrcEndY1 = nSrcY + nHeight - 1;
+ const tools::Long nDstX = aRectDst.Left();
+ const tools::Long nDstY = aRectDst.Top();
+ const tools::Long nDstEndX1 = nDstX + nWidth - 1;
+ const tools::Long nDstEndY1 = nDstY + nHeight - 1;
if( ( nDstX <= nSrcX ) && ( nDstY <= nSrcY ) )
{
- for( long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
+ for( tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
+ for( tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
else if( ( nDstX <= nSrcX ) && ( nDstY >= nSrcY ) )
{
- for( long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
+ for( tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
+ for( tools::Long nX = nSrcX, nXN = nDstX; nX <= nSrcEndX1; nX++, nXN++ )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
else if( ( nDstX >= nSrcX ) && ( nDstY <= nSrcY ) )
{
- for( long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
+ for( tools::Long nY = nSrcY, nYN = nDstY; nY <= nSrcEndY1; nY++, nYN++ )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
+ for( tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
else
{
- for( long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
+ for( tools::Long nY = nSrcEndY1, nYN = nDstEndY1; nY >= nSrcY; nY--, nYN-- )
{
Scanline pScanline = pWriteAcc->GetScanline(nYN);
Scanline pScanlineSrc = pWriteAcc->GetScanline(nY);
- for( long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
+ for( tools::Long nX = nSrcEndX1, nXN = nDstEndX1; nX >= nSrcX; nX--, nXN-- )
pWriteAcc->SetPixelOnData( pScanline, nXN, pWriteAcc->GetPixelFromData( pScanlineSrc, nX ) );
}
}
@@ -842,8 +842,8 @@ bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
if( nDX || nDY )
{
const Size aSizePixel( GetSizePixel() );
- const long nWidth = aSizePixel.Width();
- const long nHeight = aSizePixel.Height();
+ const tools::Long nWidth = aSizePixel.Width();
+ const tools::Long nHeight = aSizePixel.Height();
const Size aNewSize( nWidth + nDX, nHeight + nDY );
ScopedReadAccess pReadAcc(*this);
@@ -856,12 +856,12 @@ bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
if( pWriteAcc )
{
BitmapColor aColor;
- const long nNewX = nWidth;
- const long nNewY = nHeight;
- const long nNewWidth = pWriteAcc->Width();
- const long nNewHeight = pWriteAcc->Height();
- long nX;
- long nY;
+ const tools::Long nNewX = nWidth;
+ const tools::Long nNewY = nHeight;
+ const tools::Long nNewWidth = pWriteAcc->Width();
+ const tools::Long nNewHeight = pWriteAcc->Height();
+ tools::Long nX;
+ tools::Long nY;
if( pInitColor )
aColor = pWriteAcc->GetBestMatchingColor( *pInitColor );
diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx
index 0f4c929480f9..ebc7e1288ef5 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -82,13 +82,13 @@ bool Bitmap::Invert()
}
else
{
- const long nWidth = pAcc->Width();
- const long nHeight = pAcc->Height();
+ const tools::Long nWidth = pAcc->Width();
+ const tools::Long nHeight = pAcc->Height();
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
BitmapColor aBmpColor = pAcc->GetPixelFromData(pScanline, nX);
aBmpColor.Invert();
@@ -117,15 +117,15 @@ bool Bitmap::Mirror(BmpMirrorFlags nMirrorFlags)
if (pAcc)
{
- const long nWidth = pAcc->Width();
- const long nHeight = pAcc->Height();
- const long nWidth1 = nWidth - 1;
- const long nWidth_2 = nWidth >> 1;
+ const tools::Long nWidth = pAcc->Width();
+ const tools::Long nHeight = pAcc->Height();
+ const tools::Long nWidth1 = nWidth - 1;
+ const tools::Long nWidth_2 = nWidth >> 1;
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
- for (long nX = 0, nOther = nWidth1; nX < nWidth_2; nX++, nOther--)
+ for (tools::Long nX = 0, nOther = nWidth1; nX < nWidth_2; nX++, nOther--)
{
const BitmapColor aTemp(pAcc->GetPixelFromData(pScanline, nX));
@@ -144,13 +144,13 @@ bool Bitmap::Mirror(BmpMirrorFlags nMirrorFlags)
if (pAcc)
{
- const long nScanSize = pAcc->GetScanlineSize();
+ const tools::Long nScanSize = pAcc->GetScanlineSize();
std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[nScanSize]);
- const long nHeight = pAcc->Height();
- const long nHeight1 = nHeight - 1;
- const long nHeight_2 = nHeight >> 1;
+ const tools::Long nHeight = pAcc->Height();
+ const tools::Long nHeight1 = nHeight - 1;
+ const tools::Long nHeight_2 = nHeight >> 1;
- for (long nY = 0, nOther = nHeight1; nY < nHeight_2; nY++, nOther--)
+ for (tools::Long nY = 0, nOther = nHeight1; nY < nHeight_2; nY++, nOther--)
{
memcpy(pBuffer.get(), pAcc->GetScanline(nY), nScanSize);
memcpy(pAcc->GetScanline(nY), pAcc->GetScanline(nOther), nScanSize);
@@ -167,16 +167,16 @@ bool Bitmap::Mirror(BmpMirrorFlags nMirrorFlags)
if (pAcc)
{
- const long nWidth = pAcc->Width();
- const long nWidth1 = nWidth - 1;
- const long nHeight = pAcc->Height();
- long nHeight_2 = nHeight >> 1;
+ const tools::Long nWidth = pAcc->Width();
+ const tools::Long nWidth1 = nWidth - 1;
+ const tools::Long nHeight = pAcc->Height();
+ tools::Long nHeight_2 = nHeight >> 1;
- for (long nY = 0, nOtherY = nHeight - 1; nY < nHeight_2; nY++, nOtherY--)
+ for (tools::Long nY = 0, nOtherY = nHeight - 1; nY < nHeight_2; nY++, nOtherY--)
{
Scanline pScanline = pAcc->GetScanline(nY);
Scanline pScanlineOther = pAcc->GetScanline(nOtherY);
- for (long nX = 0, nOtherX = nWidth1; nX < nWidth; nX++, nOtherX--)
+ for (tools::Long nX = 0, nOtherX = nWidth1; nX < nWidth; nX++, nOtherX--)
{
const BitmapColor aTemp(pAcc->GetPixelFromData(pScanline, nX));
@@ -190,7 +190,7 @@ bool Bitmap::Mirror(BmpMirrorFlags nMirrorFlags)
if (nHeight & 1)
{
Scanline pScanline = pAcc->GetScanline(nHeight_2);
- for (long nX = 0, nOtherX = nWidth1, nWidth_2 = nWidth >> 1; nX < nWidth_2;
+ for (tools::Long nX = 0, nOtherX = nWidth1, nWidth_2 = nWidth >> 1; nX < nWidth_2;
nX++, nOtherX--)
{
const BitmapColor aTemp(pAcc->GetPixelFromData(pScanline, nX));
@@ -209,7 +209,7 @@ bool Bitmap::Mirror(BmpMirrorFlags nMirrorFlags)
return bRet;
}
-bool Bitmap::Rotate(long nAngle10, const Color& rFillColor)
+bool Bitmap::Rotate(tools::Long nAngle10, const Color& rFillColor)
{
bool bRet = false;
@@ -237,19 +237,20 @@ bool Bitmap::Rotate(long nAngle10, const Color& rFillColor)
if (pWriteAcc)
{
- const long nWidth = aSizePix.Width();
- const long nWidth1 = nWidth - 1;
- const long nHeight = aSizePix.Height();
- const long nHeight1 = nHeight - 1;
- const long nNewWidth = aNewSizePix.Width();
- const long nNewHeight = aNewSizePix.Height();
+ const tools::Long nWidth = aSizePix.Width();
+ const tools::Long nWidth1 = nWidth - 1;
+ const tools::Long nHeight = aSizePix.Height();
+ const tools::Long nHeight1 = nHeight - 1;
+ const tools::Long nNewWidth = aNewSizePix.Width();
+ const tools::Long nNewHeight = aNewSizePix.Height();
if (nAngle10 == 900)
{
- for (long nY = 0, nOtherX = nWidth1; nY < nNewHeight; nY++, nOtherX--)
+ for (tools::Long nY = 0, nOtherX = nWidth1; nY < nNewHeight;
+ nY++, nOtherX--)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
- for (long nX = 0, nOtherY = 0; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0, nOtherY = 0; nX < nNewWidth; nX++)
{
pWriteAcc->SetPixelOnData(pScanline, nX,
pReadAcc->GetPixel(nOtherY++, nOtherX));
@@ -258,10 +259,10 @@ bool Bitmap::Rotate(long nAngle10, const Color& rFillColor)
}
else if (nAngle10 == 2700)
{
- for (long nY = 0, nOtherX = 0; nY < nNewHeight; nY++, nOtherX++)
+ for (tools::Long nY = 0, nOtherX = 0; nY < nNewHeight; nY++, nOtherX++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
- for (long nX = 0, nOtherY = nHeight1; nX < nNewWidth; nX++)
+ for (tools::Long nX = 0, nOtherY = nHeight1; nX < nNewWidth; nX++)
{
pWriteAcc->SetPixelOnData(pScanline, nX,
pReadAcc->GetPixel(nOtherY--, nOtherX));
@@ -293,14 +294,14 @@ bool Bitmap::Rotate(long nAngle10, const Color& rFillColor)
const double fSinAngle = sin(nAngle10 * F_PI1800);
const double fXMin = aNewBound.Left();
const double fYMin = aNewBound.Top();
- const long nWidth = aSizePix.Width();
- const long nHeight = aSizePix.Height();
- const long nNewWidth = aNewSizePix.Width();
- const long nNewHeight = aNewSizePix.Height();
- long nX;
- long nY;
- long nRotX;
- long nRotY;
+ const tools::Long nWidth = aSizePix.Width();
+ const tools::Long nHeight = aSizePix.Height();
+ const tools::Long nNewWidth = aNewSizePix.Width();
+ const tools::Long nNewHeight = aNewSizePix.Height();
+ tools::Long nX;
+ tools::Long nY;
+ tools::Long nRotX;
+ tools::Long nRotY;
std::unique_ptr<long[]> pCosX(new long[nNewWidth]);
std::unique_ptr<long[]> pSinX(new long[nNewWidth]);
std::unique_ptr<long[]> pCosY(new long[nNewHeight]);
@@ -324,8 +325,8 @@ bool Bitmap::Rotate(long nAngle10, const Color& rFillColor)
for (nY = 0; nY < nNewHeight; nY++)
{
- long nSinY = pSinY[nY];
- long nCosY = pCosY[nY];
+ tools::Long nSinY = pSinY[nY];
+ tools::Long nCosY = pCosY[nY];
Scanline pScanline = pWriteAcc->GetScanline(nY);
for (nX = 0; nX < nNewWidth; nX++)
@@ -390,8 +391,8 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
if (pWriteAcc && pReadAcc)
{
- const long nWidth = pReadAcc->Width();
- const long nHeight = pReadAcc->Height();
+ const tools::Long nWidth = pReadAcc->Width();
+ const tools::Long nHeight = pReadAcc->Height();
const BitmapColor aBlack(pWriteAcc->GetBestMatchingColor(COL_BLACK));
const BitmapColor aWhite(pWriteAcc->GetBestMatchingColor(COL_WHITE));
@@ -405,18 +406,19 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
{
// optimized for 4Bit-MSN/LSN source palette
const sal_uInt8 cTest = aTest.GetIndex();
- const long nShiftInit
+ const tools::Long nShiftInit
= ((pReadAcc->GetScanlineFormat() == ScanlineFormat::N4BitMsnPal) ? 4 : 0);
if (pWriteAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal
&& aWhite.GetIndex() == 1)
{
// optimized for 1Bit-MSB destination palette
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pSrc = pReadAcc->GetScanline(nY);
Scanline pDst = pWriteAcc->GetScanline(nY);
- for (long nX = 0, nShift = nShiftInit; nX < nWidth; nX++, nShift ^= 4)
+ for (tools::Long nX = 0, nShift = nShiftInit; nX < nWidth;
+ nX++, nShift ^= 4)
{
if (cTest == ((pSrc[nX >> 1] >> nShift) & 0x0f))
pDst[nX >> 3] |= 1 << (7 - (nX & 7));
@@ -427,11 +429,12 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
}
else
{
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pSrc = pReadAcc->GetScanline(nY);
Scanline pDst = pWriteAcc->GetScanline(nY);
- for (long nX = 0, nShift = nShiftInit; nX < nWidth; nX++, nShift ^= 4)
+ for (tools::Long nX = 0, nShift = nShiftInit; nX < nWidth;
+ nX++, nShift ^= 4)
{
if (cTest == ((pSrc[nX >> 1] >> nShift) & 0x0f))
pWriteAcc->SetPixelOnData(pDst, nX, aWhite);
@@ -451,11 +454,11 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
&& aWhite.GetIndex() == 1)
{
// optimized for 1Bit-MSB destination palette
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pSrc = pReadAcc->GetScanline(nY);
Scanline pDst = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; ++nX)
+ for (tools::Long nX = 0; nX < nWidth; ++nX)
{
if (cTest == pSrc[nX])
pDst[nX >> 3] |= 1 << (7 - (nX & 7));
@@ -466,11 +469,11 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
}
else
{
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pSrc = pReadAcc->GetScanline(nY);
Scanline pDst = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; ++nX)
+ for (tools::Long nX = 0; nX < nWidth; ++nX)
{
if (cTest == pSrc[nX])
pWriteAcc->SetPixelOnData(pDst, nX, aWhite);
@@ -485,13 +488,13 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
|| pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal))
{
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pSrc = pReadAcc->GetScanline(nY);
Scanline pDst = pWriteAcc->GetScanline(nY);
assert(pWriteAcc->GetScanlineSize() == pReadAcc->GetScanlineSize());
- const long nScanlineSize = pWriteAcc->GetScanlineSize();
- for (long nX = 0; nX < nScanlineSize; ++nX)
+ const tools::Long nScanlineSize = pWriteAcc->GetScanlineSize();
+ for (tools::Long nX = 0; nX < nScanlineSize; ++nX)
pDst[nX] = ~pSrc[nX];
}
}
@@ -501,11 +504,11 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
// optimized for 8Bit source palette
const sal_uInt8 cTest = aTest.GetIndex();
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pSrc = pReadAcc->GetScanline(nY);
Scanline pDst = pWriteAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; ++nX)
+ for (tools::Long nX = 0; nX < nWidth; ++nX)
{
if (cTest == pSrc[nX])
pDst[nX] = aWhite.GetIndex();
@@ -517,11 +520,11 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
else
{
// not optimized
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; ++nX)
+ for (tools::Long nX = 0; nX < nWidth; ++nX)
{
if (aTest == pReadAcc->GetPixelFromData(pScanlineRead, nX))
pWriteAcc->SetPixelOnData(pScanline, nX, aWhite);
@@ -534,21 +537,21 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
else
{
BitmapColor aCol;
- long nR, nG, nB;
- const long nMinR = MinMax<long>(rTransColor.GetRed() - nTol, 0, 255);
- const long nMaxR = MinMax<long>(rTransColor.GetRed() + nTol, 0, 255);
- const long nMinG = MinMax<long>(rTransColor.GetGreen() - nTol, 0, 255);
- const long nMaxG = MinMax<long>(rTransColor.GetGreen() + nTol, 0, 255);
- const long nMinB = MinMax<long>(rTransColor.GetBlue() - nTol, 0, 255);
- const long nMaxB = MinMax<long>(rTransColor.GetBlue() + nTol, 0, 255);
+ tools::Long nR, nG, nB;
+ const tools::Long nMinR = MinMax<long>(rTransColor.GetRed() - nTol, 0, 255);
+ const tools::Long nMaxR = MinMax<long>(rTransColor.GetRed() + nTol, 0, 255);
+ const tools::Long nMinG = MinMax<long>(rTransColor.GetGreen() - nTol, 0, 255);
+ const tools::Long nMaxG = MinMax<long>(rTransColor.GetGreen() + nTol, 0, 255);
+ const tools::Long nMinB = MinMax<long>(rTransColor.GetBlue() - nTol, 0, 255);
+ const tools::Long nMaxB = MinMax<long>(rTransColor.GetBlue() + nTol, 0, 255);
if (pReadAcc->HasPalette())
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aCol = pReadAcc->GetPaletteColor(
pReadAcc->GetIndexFromData(pScanlineRead, nX));
@@ -570,11 +573,11 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
}
else
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pWriteAcc->GetScanline(nY);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aCol = pReadAcc->GetPixelFromData(pScanlineRead, nX);
nR = aCol.GetRed();
@@ -623,20 +626,20 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR
if (pReadAcc)
{
- const long nLeft = aRect.Left();
- const long nTop = aRect.Top();
- const long nRight = aRect.Right();
- const long nBottom = aRect.Bottom();
+ const tools::Long nLeft = aRect.Left();
+ const tools::Long nTop = aRect.Top();
+ const tools::Long nRight = aRect.Right();
+ const tools::Long nBottom = aRect.Bottom();
const BitmapColor aMatch(pReadAcc->GetBestMatchingColor(rColor));
std::vector<long> aLine;
- long nYStart(nTop);
- long nY(nTop);
+ tools::Long nYStart(nTop);
+ tools::Long nY(nTop);
for (; nY <= nBottom; nY++)
{
std::vector<long> aNewLine;
- long nX(nLeft);
+ tools::Long nX(nLeft);
Scanline pScanlineRead = pReadAcc->GetScanline(nY);
for (; nX <= nRight;)
@@ -718,8 +721,8 @@ bool Bitmap::Replace(const Bitmap& rMask, const Color& rReplaceColor)
if (pMaskAcc && pAcc)
{
- const long nWidth = std::min(pMaskAcc->Width(), pAcc->Width());
- const long nHeight = std::min(pMaskAcc->Height(), pAcc->Height());
+ const tools::Long nWidth = std::min(pMaskAcc->Width(), pAcc->Width());
+ const tools::Long nHeight = std::min(pMaskAcc->Height(), pAcc->Height());
const BitmapColor aMaskWhite(pMaskAcc->GetBestMatchingColor(COL_WHITE));
BitmapColor aReplace;
@@ -749,10 +752,10 @@ bool Bitmap::Replace(const Bitmap& rMask, const Color& rReplaceColor)
// Set all entries to false
std::fill(pFlags.get(), pFlags.get() + nMaxColors, false);
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
pFlags[pAcc->GetIndexFromData(pScanline, nX)] = true;
}
@@ -771,11 +774,11 @@ bool Bitmap::Replace(const Bitmap& rMask, const Color& rReplaceColor)
else
aReplace = rReplaceColor;
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
Scanline pScanlineMask = pMaskAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
if (pMaskAcc->GetPixelFromData(pScanlineMask, nX) == aMaskWhite)
pAcc->SetPixelOnData(pScanline, nX, aReplace);
@@ -799,14 +802,14 @@ bool Bitmap::Replace(const AlphaMask& rAlpha, const Color& rMergeColor)
if (pAcc && pAlphaAcc && pNewAcc)
{
BitmapColor aCol;
- const long nWidth = std::min(pAlphaAcc->Width(), pAcc->Width());
- const long nHeight = std::min(pAlphaAcc->Height(), pAcc->Height());
+ const tools::Long nWidth = std::min(pAlphaAcc->Width(), pAcc->Width());
+ const tools::Long nHeight = std::min(pAlphaAcc->Height(), pAcc->Height());
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pNewAcc->GetScanline(nY);
Scanline pScanlineAlpha = pAlphaAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
aCol = pAcc->GetColor(nY, nX);
aCol.Merge(rMergeColor, 255 - pAlphaAcc->GetIndexFromData(pScanlineAlpha, nX));
@@ -860,12 +863,12 @@ bool Bitmap::Replace(const Color& rSearchColor, const Color& rReplaceColor, sal_
if (pAcc)
{
- const long nMinR = MinMax<long>(rSearchColor.GetRed() - nTol, 0, 255);
- const long nMaxR = MinMax<long>(rSearchColor.GetRed() + nTol, 0, 255);
- const long nMinG = MinMax<long>(rSearchColor.GetGreen() - nTol, 0, 255);
- const long nMaxG = MinMax<long>(rSearchColor.GetGreen() + nTol, 0, 255);
- const long nMinB = MinMax<long>(rSearchColor.GetBlue() - nTol, 0, 255);
- const long nMaxB = MinMax<long>(rSearchColor.GetBlue() + nTol, 0, 255);
+ const tools::Long nMinR = MinMax<long>(rSearchColor.GetRed() - nTol, 0, 255);
+ const tools::Long nMaxR = MinMax<long>(rSearchColor.GetRed() + nTol, 0, 255);
+ const tools::Long nMinG = MinMax<long>(rSearchColor.GetGreen() - nTol, 0, 255);
+ const tools::Long nMaxG = MinMax<long>(rSearchColor.GetGreen() + nTol, 0, 255);
+ const tools::Long nMinB = MinMax<long>(rSearchColor.GetBlue() - nTol, 0, 255);
+ const tools::Long nMaxB = MinMax<long>(rSearchColor.GetBlue() + nTol, 0, 255);
if (pAcc->HasPalette())
{
@@ -886,10 +889,10 @@ bool Bitmap::Replace(const Color& rSearchColor, const Color& rReplaceColor, sal_
BitmapColor aCol;
const BitmapColor aReplace(pAcc->GetBestMatchingColor(rReplaceColor));
- for (long nY = 0, nHeight = pAcc->Height(); nY < nHeight; nY++)
+ for (tools::Long nY = 0, nHeight = pAcc->Height(); nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
- for (long nX = 0, nWidth = pAcc->Width(); nX < nWidth; nX++)
+ for (tools::Long nX = 0, nWidth = pAcc->Width(); nX < nWidth; nX++)
{
aCol = pAcc->GetPixelFromData(pScanline, nX);
@@ -987,10 +990,10 @@ bool Bitmap::Replace(const Color* pSearchColors, const Color* pReplaceColors, sa
for (sal_uLong i = 0; i < nColorCount; i++)
pReplaces[i] = pAcc->GetBestMatchingColor(pReplaceColors[i]);
- for (long nY = 0, nHeight = pAcc->Height(); nY < nHeight; nY++)
+ for (tools::Long nY = 0, nHeight = pAcc->Height(); nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
- for (long nX = 0, nWidth = pAcc->Width(); nX < nWidth; nX++)
+ for (tools::Long nX = 0, nWidth = pAcc->Width(); nX < nWidth; nX++)
{
aCol = pAcc->GetPixelFromData(pScanline, nX);
@@ -1023,8 +1026,8 @@ bool Bitmap::CombineSimple(const Bitmap& rMask, BmpCombine eCombine)
if (pMaskAcc && pAcc)
{
- const long nWidth = std::min(pMaskAcc->Width(), pAcc->Width());
- const long nHeight = std::min(pMaskAcc->Height(), pAcc->Height());
+ const tools::Long nWidth = std::min(pMaskAcc->Width(), pAcc->Width());
+ const tools::Long nHeight = std::min(pMaskAcc->Height(), pAcc->Height());
const Color aColBlack(COL_BLACK);
const BitmapColor aWhite(pAcc->GetBestMatchingColor(COL_WHITE));
const BitmapColor aBlack(pAcc->GetBestMatchingColor(aColBlack));
@@ -1034,11 +1037,11 @@ bool Bitmap::CombineSimple(const Bitmap& rMask, BmpCombine eCombine)
{
case BmpCombine::And:
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
Scanline pScanlineMask = pMaskAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
if (pMaskAcc->GetPixelFromData(pScanlineMask, nX) != aMaskBlack
&& pAcc->GetPixelFromData(pScanline, nX) != aBlack)
@@ -1056,11 +1059,11 @@ bool Bitmap::CombineSimple(const Bitmap& rMask, BmpCombine eCombine)
case BmpCombine::Or:
{
- for (long nY = 0; nY < nHeight; nY++)
+ for (tools::Long nY = 0; nY < nHeight; nY++)
{
Scanline pScanline = pAcc->GetScanline(nY);
Scanline pScanlineMask = pMaskAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; nX++)
+ for (tools::Long nX = 0; nX < nWidth; nX++)
{
if (pMaskAcc->GetPixelFromData(pScanlineMask, nX) != aMaskBlack
|| pAcc->GetPixelFromData(pScanline, nX) != aBlack)
@@ -1099,14 +1102,14 @@ bool Bitmap::Blend(const AlphaMask& rAlpha, const Color& rBackgroundColor)
if (pAlphaAcc && pAcc)
{
- const long nWidth = std::min(pAlphaAcc->Width(), pAcc->Width());
- const long nHeight = std::min(pAlphaAcc->Height(), pAcc->Height());
+ const tools::Long nWidth = std::min(pAlphaAcc->Width(), pAcc->Width());
+ const tools::Long nHeight = std::min(pAlphaAcc->Height(), pAcc->Height());
- for (long nY = 0; nY < nHeight; ++nY)
+ for (tools::Long nY = 0; nY < nHeight; ++nY)
{
Scanline pScanline = pAcc->GetScanline(nY);
Scanline pScanlineAlpha = pAlphaAcc->GetScanline(nY);
- for (long nX = 0; nX < nWidth; ++nX)
+ for (tools::Long nX = 0; nX < nWidth; ++nX)
{
BitmapColor aBmpColor = pAcc->GetPixelFromData(pScanline, nX);
aBmpColor.Merge(rBackgroundColor,
diff --git a/vcl/source/bitmap/salbmp.cxx b/vcl/source/bitmap/salbmp.cxx
index eae8aadc5d0e..8393df96f47d 100644
--- a/vcl/source/bitmap/salbmp.cxx
+++ b/vcl/source/bitmap/salbmp.cxx
@@ -79,12 +79,12 @@ void SalBitmap::updateChecksum() const
if( pBuf->mnScanlineSize == lineBitsCount / 8 )
nCrc = vcl_get_checksum(nCrc, pBuf->mpBits, pBuf->mnScanlineSize * pBuf->mnHeight);
else // Do not include padding with undefined content in the checksum.
- for( long y = 0; y < pBuf->mnHeight; ++y )
+ for( tools::Long y = 0; y < pBuf->mnHeight; ++y )
nCrc = scanlineChecksum(nCrc, pBuf->mpBits + y * pBuf->mnScanlineSize, lineBitsCount, extraBitsMask);
}
else // Compute checksum in the order of scanlines, to make it consistent between different bitmap implementations.
{
- for( long y = pBuf->mnHeight - 1; y >= 0; --y )
+ for( tools::Long y = pBuf->mnHeight - 1; y >= 0; --y )
nCrc = scanlineChecksum(nCrc, pBuf->mpBits + y * pBuf->mnScanlineSize, lineBitsCount, extraBitsMask);
}
pThis->ReleaseBuffer(pBuf, BitmapAccessMode::Read);