29 #include <config_features.h>
45 #include <osl/diagnose.h>
48 #include <rtl/math.hxx>
71 const Point& rSrcPtPixel,
const Size& rSrcSizePixel,
99 Color aCol( cCmpVal, cCmpVal, cCmpVal );
128 rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, aBmp ) );
159 aBmp.
Mirror( nMirrFlags );
169 if ( nScaleX < 1.0 || nScaleY < 1.0 )
171 aBmp.
Scale(nScaleX, nScaleY);
190 const Point& rSrcPt,
const Size& rSrcSz,
201 if( aSrcRect.Intersection( aBmpRect ) != aBmpRect )
203 if( !aSrcRect.IsEmpty() )
204 aBmp.
Crop( aSrcRect );
215 aDstSizeTwip =
Size( std::abs(aDstSizeTwip.
Width()), std::abs(aDstSizeTwip.
Height()) );
218 const double fBmpPixelX = aBmpSize.
Width();
219 const double fBmpPixelY = aBmpSize.Height();
220 const double fMaxPixelX
223 const double fMaxPixelY
228 if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
229 ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
230 ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
234 const double fBmpWH = fBmpPixelX / fBmpPixelY;
235 const double fMaxWH = fMaxPixelX / fMaxPixelY;
237 if( fBmpWH < fMaxWH )
242 else if( fBmpWH > 0.0 )
249 aBmp.
Scale( aNewBmpSize );
298 const Point& rSrcPtPixel,
const Size& rSrcSizePixel,
333 aColorBmp.
Erase(
Color( cCmpVal, cCmpVal, cCmpVal ) );
344 aBmpEx =
BitmapEx(aColorBmp, aMaskEx.GetBitmap());
372 rSrcPtPixel, rSrcSizePixel, aBmpEx ) );
410 bool bClipped =
false;
449 if ( aVDev->SetOutputSizePixel( aRect.
GetSize() ) )
451 if ( aVDev->mpGraphics || aVDev->AcquireGraphics() )
453 if ( (nWidth > 0) && (nHeight > 0) )
459 aVDev->mpGraphics->CopyBits(aPosAry, *
mpGraphics, *
this, *
this);
463 OSL_ENSURE(
false,
"CopyBits with zero or negative width or height");
466 aBmp = aVDev->GetBitmap(
Point(), aVDev->GetOutputSizePixel() );
477 std::shared_ptr<SalBitmap> pSalBmp =
mpGraphics->
GetBitmap( nX, nY, nWidth, nHeight, *
this );
499 if( aAlphaBitmap.GetBitCount() > 8 )
509 const Point& rSrcPtPixel,
const Size& rSrcSizePixel,
518 else if (!!rBitmapEx)
531 rBitmapEx.
Mirror(nMirrFlags);
538 bool bTryDirectPaint(pSalSrcBmp);
575 if (!aClipRegionBounds.
IsEmpty() &&
589 if (!aClipRegionBounds.
IsEmpty())
636 const Point& rDestPt,
const Size& rDestSize,
637 const Point& rSrcPtPixel,
const Size& rSrcSizePixel )
645 const bool bHMirr = aOutSz.
Width() < 0;
646 const bool bVMirr = aOutSz.
Height() < 0;
654 aOutPt.AdjustX( -(aOutSz.
Width() - 1) );
661 aOutPt.AdjustY( -(aOutSz.
Height() - 1) );
671 rSrcPtPixel.X(), rSrcPtPixel.Y(),
673 aRelPt.X(), aRelPt.Y(),
680 bitmap.Mirror(mirrorFlags);
681 alpha.
Mirror(mirrorFlags);
683 SalBitmap* pSalSrcBmp = bitmap.ImplGetSalBitmap().get();
693 if (
SalBitmap* pSalAlphaBmp2 = aAlphaBitmap.ImplGetSalBitmap().get())
713 if (!aBmpRect.Intersection(
tools::Rectangle(rSrcPtPixel, rSrcSizePixel)).IsEmpty())
723 bitmap.
Mirror(mirrorFlags);
724 alpha.
Mirror(mirrorFlags);
735 struct LinearScaleContext
737 std::unique_ptr<tools::Long[]> mpMapX;
738 std::unique_ptr<tools::Long[]> mpMapY;
740 std::unique_ptr<tools::Long[]> mpMapXOffset;
741 std::unique_ptr<tools::Long[]> mpMapYOffset;
746 : mpMapX(new
tools::
Long[aDstRect.GetWidth()])
747 , mpMapY(new
tools::
Long[aDstRect.GetHeight()])
748 , mpMapXOffset(new
tools::
Long[aDstRect.GetWidth()])
749 , mpMapYOffset(new
tools::
Long[aDstRect.GetHeight()])
756 aOutSize.
Width(), nOffX, mpMapX.get(), mpMapXOffset.get());
760 aOutSize.
Height(), nOffY, mpMapY.get(), mpMapYOffset.get());
769 const double fReverseScale = (std::abs(nOutDimension) > 1) ? (nSrcDimension - 1) / double(std::abs(nOutDimension) - 1) : 0.0;
775 double fTemp = std::abs((nOffset + i) * fReverseScale);
778 pMapOffset[
i] =
static_cast<tools::Long>((fTemp - pMap[
i]) * 128.0);
790 if (pSource && pSourceAlpha && pDestination)
795 switch (nSourceFormat)
803 blendBitmap24(pDestination, pSource, pSourceAlpha, nDstWidth, nDstHeight);
823 Scanline pColorSample1, pColorSample2;
826 tools::Long nColor1Line1, nColor2Line1, nColor3Line1;
827 tools::Long nColor1Line2, nColor2Line2, nColor3Line2;
830 sal_uInt8 nColor1, nColor2, nColor3, nAlpha;
839 pLine1 = (nMapY + 1 < pSource->
Height()) ? pSource->
GetScanline(nMapY + 1) : pLine0;
843 pLineAlpha1 = (nMapY + 1 < pSourceAlpha->
Height()) ? pSourceAlpha->
GetScanline(nMapY + 1) : pLineAlpha0;
852 pColorSample1 = pLine0 + 3 * nMapX;
853 pColorSample2 = (nMapX + 1 < pSource->
Width()) ? pColorSample1 + 3 : pColorSample1;
854 nColor1Line1 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
858 nColor2Line1 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
862 nColor3Line1 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
864 pColorSample1 = pLine1 + 3 * nMapX;
865 pColorSample2 = (nMapX + 1 < pSource->
Width()) ? pColorSample1 + 3 : pColorSample1;
866 nColor1Line2 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
870 nColor2Line2 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
874 nColor3Line2 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
876 pColorSample1 = pLineAlpha0 + nMapX;
877 pColorSample2 = (nMapX + 1 < pSourceAlpha->
Width()) ? pColorSample1 + 1 : pColorSample1;
878 nAlphaLine1 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
880 pColorSample1 = pLineAlpha1 + nMapX;
881 pColorSample2 = (nMapX + 1 < pSourceAlpha->
Width()) ? pColorSample1 + 1 : pColorSample1;
882 nAlphaLine2 = (
static_cast<tools::Long>(*pColorSample1) << 7) + nMapFX * (static_cast<tools::Long>(*pColorSample2) - *pColorSample1);
884 nColor1 = (nColor1Line1 + nMapFY * ((nColor1Line2 >> 7) - (nColor1Line1 >> 7))) >> 7;
885 nColor2 = (nColor2Line1 + nMapFY * ((nColor2Line2 >> 7) - (nColor2Line1 >> 7))) >> 7;
886 nColor3 = (nColor3Line1 + nMapFY * ((nColor3Line2 >> 7) - (nColor3Line1 >> 7))) >> 7;
888 nAlpha = (nAlphaLine1 + nMapFY * ((nAlphaLine2 >> 7) - (nAlphaLine1 >> 7))) >> 7;
902 struct TradScaleContext
904 std::unique_ptr<tools::Long[]> mpMapX;
905 std::unique_ptr<tools::Long[]> mpMapY;
910 : mpMapX(new
tools::
Long[aDstRect.GetWidth()])
911 , mpMapY(new
tools::
Long[aDstRect.GetHeight()])
916 const bool bHMirr = aOutSize.
Width() < 0;
917 const bool bVMirr = aOutSize.
Height() < 0;
921 aOutSize.
Width(), nOffX, bHMirr, mpMapX.get());
925 aOutSize.
Height(), nOffY, bVMirr, mpMapY.get());
936 nMirrorOffset = (nDstLocation << 1) + nSrcDimension - 1;
940 pMap[
i] = nDstLocation + nOffset * nSrcDimension / nOutDimension;
942 pMap[
i] = nMirrorOffset - pMap[
i];
957 const bool bHMirr = aOutSize.
Width() < 0;
958 const bool bVMirr = aOutSize.
Height() < 0;
963 const bool bOldMap =
mbMap;
991 : aDstRect.
Left() - aOutPoint.X();
995 TradScaleContext aTradContext(aDstRect, aBmpRect, aOutSize, nOffX, nOffY);
1001 "OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer supported!" );
1011 aBmp, pBitmapReadAccess.
get(), pAlphaReadAccess.
get(),
1015 aTradContext.mpMapX.get(), aTradContext.mpMapY.get() );
1019 LinearScaleContext aLinearContext(aDstRect, aBmpRect, aOutSize, nOffX, nOffY);
1022 nDstWidth, nDstHeight))
1029 aBmp, pBitmapReadAccess.
get(), pAlphaReadAccess.
get(),
1034 aTradContext.mpMapX.get(), aTradContext.mpMapY.get() );
1073 aAlphaBitmap = rBitmapEx.
GetAlpha();
1077 aAlphaBitmap = rBitmapEx.
GetMask();
1101 aAlpha.
Erase( ( 1 - fAlpha ) * 255 );
1111 double &fMaximumArea)
1117 aFullPixelRange.
transform(aFullTransform);
1153 if(!aOutPixel.
isInside(aFullPixelRange))
1155 aVisiblePixelRange.
intersect(aOutPixel);
1157 if(aVisiblePixelRange.
isEmpty())
1168 aVisibleRange = aVisiblePixelRange;
1172 aMakeVisibleRangeRelative.
scale(
1175 aVisibleRange.
transform(aMakeVisibleRangeRelative);
1182 const double fNewMaxArea(aVisiblePixelRange.
getWidth() * aVisiblePixelRange.
getHeight());
1184 fMaximumArea = std::min(4096000.0, fNewMaxArea + 1.0);
1195 struct LocalTimeTest
1197 const sal_uInt64 nStartTime;
1198 LocalTimeTest() : nStartTime(
tools::
Time::GetSystemTicks()) {}
1202 const sal_uInt64 nDiffTime(nEndTime - nStartTime);
1206 OStringBuffer aOutput(
"Time: ");
1207 OString aNumber(OString::number(nDiffTime));
1208 aOutput.append(aNumber);
1209 OSL_FAIL(aOutput.getStr());
1228 if(rtl::math::approxEqual( fAlpha, 0.0 ))
1255 static const char* pEnableBitmapDrawTimerTimer(getenv(
"SAL_ENABLE_TIMER_BITMAPDRAW"));
1256 static bool bUseTimer(
nullptr != pEnableBitmapDrawTimerTimer);
1257 std::unique_ptr<LocalTimeTest> aTimeTest(
1259 ?
new LocalTimeTest()
1267 const bool bTryDirectPaint(!bInvert && !bBitmapChangedColor && !bMetafile);
1274 if(!rtl::math::approxEqual( fAlpha, 1.0 ))
1286 AlphaMask aAlpha( bitmapEx.GetSizePixel(), &nColor );
1287 if( bitmapEx.IsTransparent())
1289 bitmapEx =
BitmapEx( bitmapEx.GetBitmap(), aAlpha );
1291 if(rtl::math::approxEqual( fAlpha, 1.0 ))
1299 double fRotate, fShearX;
1300 rTransformation.
decompose(aScale, aTranslate, fRotate, fShearX);
1306 if(!bRotated && !bSheared && !bMirroredX && !bMirroredY)
1312 const Size aDestSize(
1318 aDestPt.Move(aOrigin.getX(), aOrigin.getY());
1326 aDestPt.Move(-aOrigin.getX(), -aOrigin.getY());
1338 if(!bRotated && !bSheared)
1344 const Size aDestSize(
1353 assert(bSheared || bRotated);
1363 const Size& rOriginalSizePixel(bitmapEx.GetSizePixel());
1364 const double fOrigArea(rOriginalSizePixel.Width() * rOriginalSizePixel.Height() * 0.5);
1365 const double fOrigAreaScaled(fOrigArea * 1.44);
1366 double fMaximumArea(std::clamp(fOrigAreaScaled, 1000000.0, 4500000.0));
1387 AlphaMask aMaskBmp(aContent.GetSizePixel());
1390 aTransformed =
BitmapEx(aContent, aMaskBmp);
1396 double fFullRotate, fFullShearX;
1397 aFullTransform.
decompose(aFullScale, aFullTranslate, fFullRotate, fFullShearX);
1399 if (aFullScale.
getX() > 0 && aFullScale.
getY() > 0)
1402 rOriginalSizePixel.getWidth() / aFullScale.
getX(),
1403 rOriginalSizePixel.getHeight() / aFullScale.
getY());
1404 aFullTransform *= aTransform;
1407 double fSourceRatio = 1.0;
1408 if (rOriginalSizePixel.getHeight() != 0)
1410 fSourceRatio = rOriginalSizePixel.getWidth() / rOriginalSizePixel.getHeight();
1412 double fTargetRatio = 1.0;
1413 if (aFullScale.
getY() != 0)
1415 fTargetRatio = aFullScale.
getX() / aFullScale.
getY();
1417 bool bAspectRatioKept = rtl::math::approxEqual(fSourceRatio, fTargetRatio);
1418 if (bSheared || !bAspectRatioKept)
1429 fFullRotate = fmod(fFullRotate * -1,
F_2PI);
1430 if (fFullRotate < 0)
1432 fFullRotate +=
F_2PI;
1440 aTargetRange.
transform(rTransformation);
1451 const Size aDestSize(
1481 bool bIsSizeValid = !rSize.
IsEmpty();
1485 Image& rNonConstImage =
const_cast<Image&
>(rImage);
1487 rNonConstImage.
Draw(
this, rPos, nStyle, &rSize);
1489 rNonConstImage.
Draw(
this, rPos, nStyle);
1500 int c = nResAlpha ? (
static_cast<int>(nSourceAlpha)*nSourceColor + static_cast<int>(nDstAlpha)*nDestColor -
1501 static_cast<int>(nDstAlpha)*nDestColor*nSourceAlpha/255 ) /
static_cast<int>(nResAlpha) : 0;
1515 aSrcCol = pP->
GetColor( nMapY, nMapX );
1526 nResAlpha =
static_cast<int>(nSrcAlpha) + static_cast<int>(nDstAlpha) -
static_cast<int>(nDstAlpha)*nSrcAlpha/255;
1528 aDstCol.
SetRed( CalcColor( aSrcCol.
GetRed(), nSrcAlpha, nDstAlpha, nResAlpha, aDstCol.
GetRed() ) );
1529 aDstCol.
SetBlue( CalcColor( aSrcCol.
GetBlue(), nSrcAlpha, nDstAlpha, nResAlpha, aDstCol.
GetBlue() ) );
1548 const sal_Int32 nOffY,
1549 const sal_Int32 nDstHeight,
1550 const sal_Int32 nOffX,
1551 const sal_Int32 nDstWidth,
1561 SAL_WARN_IF( !
mpAlphaVDev,
"vcl.gdi",
"BlendBitmapWithAlpha(): call me only with valid alpha VirtualDevice!" );
1576 if (pB && pP && pA && pW && pAlphaW)
1580 for( nY = 0, nOutY = nOffY; nY < nDstHeight; nY++, nOutY++ )
1588 for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
1593 aDstCol = AlphaBlend( nX, nY, nMapX, nMapY, pP, pA, pB.
get(), pAlphaW.
get(), nResAlpha );
1600 aIndex.SetIndex( static_cast<sal_uInt8>(
nVCLRLut[ (
nVCLLut[ 255-nResAlpha ] + nD ) >> 16 ] +
1614 if (pB && pP && pA && pAlphaW)
1616 for( nY = 0; nY < nDstHeight; nY++ )
1622 for( nX = 0; nX < nDstWidth; nX++ )
1625 aDstCol = AlphaBlend( nX, nY, nMapX, nMapY, pP, pA, pB.
get(), pAlphaW.
get(), nResAlpha );
1647 const sal_Int32 nOffY,
1648 const sal_Int32 nDstHeight,
1649 const sal_Int32 nOffX,
1650 const sal_Int32 nDstWidth,
1669 if( pB && pP && pA && pW )
1673 for( nY = 0, nOutY = nOffY; nY < nDstHeight; nY++, nOutY++ )
1678 nMapY = aBmpRect.
Bottom() - nMapY;
1685 for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ )
1690 nMapX = aBmpRect.
Right() - nMapX;
1696 aIndex.SetIndex( static_cast<sal_uInt8>(
nVCLRLut[ (
nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16 ] +
1712 bool bFastBlend =
false;
1713 if( pP && pA && pB && !bHMirr && !bVMirr )
1721 if( pP && pA && pB && !bFastBlend )
1727 for( nY = 0; nY < nDstHeight; nY++ )
1732 nMapY = aBmpRect.
Bottom() - nMapY;
1738 for( nX = 0; nX < nDstWidth; nX++ )
1744 nMapX = aBmpRect.
Right() - nMapX;
1757 for( nY = 0; nY < nDstHeight; nY++ )
1763 nMapY = aBmpRect.
Bottom() - nMapY;
1767 for( nX = 0; nX < nDstWidth; nX++ )
1773 nMapX = aBmpRect.
Right() - nMapX;
1776 aDstCol.
Merge( pP->
GetColor( nMapY, nMapX ), pAScan[ nMapX ] );
sal_uInt8 GetIndexFromData(const sal_uInt8 *pData, tools::Long nX) const
tools::Long Height() const
sal_uInt8 GetPixelIndex(tools::Long nY, tools::Long nX) const
bool BlendBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice &rOutDev)
SAL_DLLPRIVATE bool ImplIsRecordLayout() const
virtual bool DrawTransformBitmapExDirect(const basegfx::B2DHomMatrix &aFullTransform, const BitmapEx &rBitmapEx, double fAlpha=1.0)
Transform and draw a bitmap directly.
void SetBlue(sal_uInt8 nBlue)
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool HasFastDrawTransformedBitmap() const
void setWidth(tools::Long nWidth)
virtual void ClipToPaintRegion(tools::Rectangle &rDstRect)
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const std::shared_ptr< SalBitmap > & ImplGetSalBitmap() const
Bitmap const & GetBitmap() const
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
std::enable_if< std::is_signed< T >::value||std::is_floating_point< T >::value, long >::type MinMax(T nVal, tools::Long nMin, tools::Long nMax)
bool IsMapModeEnabled() const
BitmapEx getTransformed(const basegfx::B2DHomMatrix &rTransformation, const basegfx::B2DRange &rVisibleRange, double fMaximumArea) const
Create transformed Bitmap.
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
SAL_DLLPRIVATE bool is_double_buffered_window() const
const MapMode & GetMapMode() const
B2DVector getRange() const
void EnableMapMode(bool bEnable=true)
Size GetSizePixel() const
SAL_DLLPRIVATE Bitmap GetDownsampledBitmap(const Size &rDstSz, const Point &rSrcPt, const Size &rSrcSz, const Bitmap &rBmp, tools::Long nMaxBmpDPIX, tools::Long nMaxBmpDPIY)
Retrieve downsampled and cropped bitmap.
constexpr double rad2deg(double v)
bool Convert(BmpConversion eConversion)
Convert bitmap format.
bool DrawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, double fAlpha, const OutputDevice &rOutDev)
void Draw(OutputDevice *pOutDev, const Point &rPos, DrawImageFlags nStyle, const Size *pSize=nullptr)
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
void SetPixelOnData(sal_uInt8 *pData, tools::Long nX, const BitmapColor &rBitmapColor)
SAL_DLLPRIVATE void DrawDeviceAlphaBitmapSlowPath(const Bitmap &rBitmap, const AlphaMask &rAlpha, tools::Rectangle aDstRect, tools::Rectangle aBmpRect, Size const &aOutSz, Point const &aOutPt)
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
SAL_DLLPRIVATE tools::Long ImplLogicXToDevicePixel(tools::Long nX) const
Convert a logical X coordinate to a device pixel's X coordinate.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool isInside(const B2DTuple &rTuple) const
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
Scanline GetScanline(tools::Long nY) const
virtual bool CanSubsampleBitmap() const
SAL_DLLPRIVATE void BlendBitmap(const SalTwoRect &rPosAry, const Bitmap &rBmp)
void DrawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice &rOutDev)
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
const sal_uLong nVCLLut[256]
SAL_DLLPRIVATE Bitmap BlendBitmapWithAlpha(Bitmap &aBmp, BitmapReadAccess const *pP, BitmapReadAccess const *pA, const tools::Rectangle &aDstRect, const sal_Int32 nOffY, const sal_Int32 nDstHeight, const sal_Int32 nOffX, const sal_Int32 nDstWidth, const tools::Long *pMapX, const tools::Long *pMapY)
sal_uInt8 GetBlue() const
B2IRange fround(const B2DRange &rRange)
bool BlendAlphaBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalSrcBitmap, const SalBitmap &rSalMaskBitmap, const SalBitmap &rSalAlphaBitmap, const OutputDevice &rOutDev)
void DrawRect(const tools::Rectangle &rRect)
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
SalGraphics * mpGraphics
Graphics context to draw on.
SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const
Get device transformation.
void DrawTransformedBitmapEx(const basegfx::B2DHomMatrix &rTransformation, const BitmapEx &rBitmapEx, double fAlpha=1.0)
Draw BitmapEx transformed.
void BlendWith(const Bitmap &rOther)
const sal_uLong nVCLBLut[6]
bool IsRTLEnabled() const
#define DBG_ASSERT(sCon, aError)
void Erase(sal_uInt8 cTransparency)
bool IsClipRegion() const
ScanlineFormat GetScanlineFormat() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
tools::Long FRound(double fVal)
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
BitmapColor GetColor(tools::Long nY, tools::Long nX) const
tools::Long Width() const
tools::Long Width() const
SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel(tools::Long nWidth) const
Convert a logical width to a width in units of device pixels.
SAL_DLLPRIVATE void ImplFillOpaqueRectangle(const tools::Rectangle &rRect)
Used for alpha VDev, to set areas to opaque.
sal_uLong GetSizeBytes() const
void SetRed(sal_uInt8 nRed)
TransparentType GetTransparentType() const
void scale(double fX, double fY)
bool ImplFastBitmapBlending(BitmapWriteAccess const &rDstWA, const BitmapReadAccess &rSrcRA, const BitmapReadAccess &rMskRA, const SalTwoRect &rTR)
Size GetOutputSizePixel() const
virtual sal_uInt16 GetBitCount() const
bool IsTransparent() const
void DrawBitmap(const Point &rDestPt, const Bitmap &rBitmap)
This is an overloaded member function, provided for convenience. It differs from the above function o...
SAL_DLLPRIVATE void DrawDeviceAlphaBitmap(const Bitmap &rBmp, const AlphaMask &rAlpha, const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel)
bool Rotate(Degree10 nAngle10, const Color &rFillColor)
Rotate bitmap by the specified angle.
void intersect(const B2DRange &rRange)
bool DrawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap, const OutputDevice &rOutDev)
void SetIndex(sal_uInt8 cIndex)
SAL_DLLPRIVATE std::shared_ptr< SalBitmap > const & ImplGetMaskSalBitmap() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
SAL_DLLPRIVATE std::shared_ptr< SalBitmap > const & ImplGetBitmapSalBitmap() const
const sal_uLong nVCLGLut[6]
sal_uInt8 GetGreen() const
VclPtr< VirtualDevice > mpAlphaVDev
SAL_DLLPRIVATE vcl::Region ImplPixelToDevicePixel(const vcl::Region &rRegion) const
Convert a region in pixel units to a region in device pixel units and coords.
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
AlphaMask GetAlpha() const
std::deque< AttacherIndex_Impl > aIndex
#define SAL_WARN_IF(condition, area, stream)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
bool Convert(BmpConversion eConversion)
Convert bitmap format.
constexpr sal_uInt8 ColorChannelMerge(sal_uInt8 nDst, sal_uInt8 nSrc, sal_uInt8 nSrcTrans)
void SetGreen(sal_uInt8 nGreen)
virtual vcl::Region GetActiveClipRegion() const
virtual void DrawDeviceBitmap(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPtPixel, const Size &rSrcSizePixel, BitmapEx &rBitmapEx)
tools::Long Height() const
B2DPoint getMinimum() const
virtual void InitClipRegion()
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
const Point & GetOrigin() const
void translate(double fX, double fY)
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
void setHeight(tools::Long nHeight)
BitmapEx GetBitmapEx(const Point &rSrcPt, const Size &rSize) const
Query extended bitmap (with alpha channel, if available).
virtual bool TransformAndReduceBitmapExToTargetRange(const basegfx::B2DHomMatrix &aFullTransform, basegfx::B2DRange &aVisibleRange, double &fMaximumArea)
Transform and reduce the area that needs to be drawn of the bitmap and return the new visible range a...
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
const sal_uLong nVCLRLut[6]
const BitmapColor & GetPaletteColor(sal_uInt16 nColor) const
SAL_DLLPRIVATE tools::Long ImplLogicYToDevicePixel(tools::Long nY) const
Convert a logical Y coordinate to a device pixel's Y coordinate.
const sal_uLong nVCLDitherLut[256]
const Size & GetSizePixel() const
bool IsDeviceOutputNecessary() const
void Push(PushFlags nFlags=PushFlags::ALL)
SAL_DLLPRIVATE tools::Long ImplLogicHeightToDevicePixel(tools::Long nHeight) const
Convert a logical height to a height in units of device pixels.
BitmapColor GetBestMatchingColor(const BitmapColor &rBitmapColor)
bool HasFastDrawTransformedBitmap() const
Return true if DrawTransformedBitmapEx() is fast.
std::shared_ptr< SalBitmap > GetBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice &rOutDev)
SAL_DLLPRIVATE void ImplSetSalBitmap(const std::shared_ptr< SalBitmap > &xImpBmp)