30 SAL_INFO(
"vcl.gdi",
"BitmapFastScaleFilter::execute()");
39 SAL_INFO(
"vcl.gdi",
"New width: " << nNewWidth <<
"\nNew height: " << nNewHeight);
41 if (nNewWidth > 0 && nNewHeight > 0)
53 const sal_Int32 nScanlineSize = pWriteAcc->GetScanlineSize();
54 const sal_Int32 nNewHeight1 = nNewHeight - 1;
56 if (nNewWidth && nNewHeight)
58 const double nWidth = pReadAcc->
Width();
59 const double nHeight = pReadAcc->
Height();
60 std::unique_ptr<sal_Int32[]> pLutX(
new sal_Int32[nNewWidth]);
61 std::unique_ptr<sal_Int32[]> pLutY(
new sal_Int32[nNewHeight]);
63 for (sal_Int32 nX = 0; nX < nNewWidth; nX++)
65 pLutX[nX] = sal_Int32(nX * nWidth / nNewWidth);
68 for (sal_Int32 nY = 0; nY < nNewHeight; nY++)
70 pLutY[nY] = sal_Int32(nY * nHeight / nNewHeight);
74 while (nActY < nNewHeight)
76 sal_Int32 nMapY = pLutY[nActY];
77 Scanline pScanline = pWriteAcc->GetScanline(nActY);
80 for (sal_Int32 nX = 0; nX < nNewWidth; nX++)
82 pWriteAcc->SetPixelOnData(
87 while ((nActY < nNewHeight1) && (pLutY[nActY + 1] == nMapY))
89 memcpy(pWriteAcc->GetScanline(nActY + 1), pWriteAcc->GetScanline(nActY),
121 "BitmapEx::Scale(): size mismatch for bitmap and alpha mask.");
const AlphaMask & GetAlphaMask() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
virtual BitmapEx execute(BitmapEx const &rBitmapEx) const override
tools::Long Height() const
tools::Long Width() const
const BitmapPalette & GetPalette() const
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
Scanline GetScanline(tools::Long nY) const
SAL_DLLPRIVATE void ReassignWithSize(const Bitmap &rBitmap)
ReassignWithSize and recalculate bitmap.
Size GetSizePixel() const
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
vcl::PixelFormat getPixelFormat() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
tools::Long FRound(double fVal)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)