59 int nNumTilesX,
int nNumTilesY,
60 const Size& rTileSizePixel,
64 const int nExponent = 2;
68 while( nNumTilesX / nMSBFactor != 0 ||
69 nNumTilesY / nMSBFactor != 0 )
71 nMSBFactor *= nExponent;
77 nMSBFactor /= nExponent;
87 nNumTilesX, nNumTilesY, rTileSizePixel, pAttr, aTileInfo ) );
102 int nNumOrigTilesX,
int nNumOrigTilesY,
103 int nRemainderTilesX,
int nRemainderTilesY,
108 std::unique_ptr<GraphicObject> xTmpGraphic;
116 bool bNoFirstTileDraw(
false );
119 const int nNewRemainderX( nRemainderTilesX % nMSBFactor );
120 const int nNewRemainderY( nRemainderTilesY % nMSBFactor );
127 if( nMSBFactor == 1 )
137 nNumOrigTilesX, nNumOrigTilesY,
138 nNewRemainderX, nNewRemainderY,
139 rTileSizePixel, pAttr, aTileInfo ) )
145 pTileGraphic = xTmpGraphic.get();
170 for (
int nX=0; nX < aTileInfo.
nTilesEmptyX; nX += nMSBFactor)
181 rVDev.
SetLineColor(
Color( 255 * nExponent / nMSBFactor, 255 - 255 * nExponent / nMSBFactor, 128 - 255 * nExponent / nMSBFactor ) );
191 for (
int nY=0; nY < aTileInfo.
nTilesEmptyY; nY += nMSBFactor)
215 bNoFirstTileDraw =
true;
225 nRemainderTilesX -= nNewRemainderX;
226 nRemainderTilesY -= nNewRemainderY;
233 rTileSizePixel.
Height()*nMSBFactor*nExponent );
245 for (
int nY=0; nY < aTileInfo.
nTilesEmptyY && nY < nExponent*nMSBFactor; nY += nMSBFactor)
249 for (
int nX=0; nX < aTileInfo.
nTilesEmptyX && nX < nExponent*nMSBFactor; nX += nMSBFactor)
251 if( bNoFirstTileDraw )
252 bNoFirstTileDraw =
false;
265 rVDev.
SetLineColor(
Color( 255 * nExponent / nMSBFactor, 255 - 255 * nExponent / nMSBFactor, 128 - 255 * nExponent / nMSBFactor ) );
279 const MapMode aMapMode( aOutMapMode.GetMapUnit(),
Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() );
285 static_cast<sal_Int64>(rSizePixel.
Width()) * rSizePixel.
Height() <
286 static_cast<sal_Int64
>(nTileCacheSize1D)*nTileCacheSize1D )
292 const int nNumTilesInCacheX( (nTileCacheSize1D + rSizePixel.
Width()-1) / rSizePixel.
Width() );
293 const int nNumTilesInCacheY( (nTileCacheSize1D + rSizePixel.
Height()-1) / rSizePixel.
Height() );
295 aVDev->SetOutputSizePixel(
Size( nNumTilesInCacheX*rSizePixel.
Width(),
296 nNumTilesInCacheY*rSizePixel.
Height() ) );
297 aVDev->SetMapMode( aMapMode );
301 nNumTilesInCacheY, rSizePixel, pAttr ) )
303 BitmapEx aTileBitmap( aVDev->GetBitmap(
Point(0,0), aVDev->GetOutputSize() ) );
316 nNumTilesInCacheY, rSizePixel, pAttr ) )
321 AlphaMask( aVDev->GetBitmap(
Point(0,0), aVDev->GetOutputSize() ) ) );
324 aVDev->GetBitmap(
Point(0,0), aVDev->GetOutputSize() ).CreateMask(
COL_WHITE ) );
332 rOffset, pAttr, nTileCacheSize1D );
341 int nInvisibleTilesX;
342 int nInvisibleTilesY;
345 if( aOutOffset.Width() < 0 )
346 nInvisibleTilesX = (aOutOffset.Width() - rSizePixel.
Width() + 1) / rSizePixel.
Width();
348 nInvisibleTilesX = aOutOffset.Width() / rSizePixel.
Width();
351 if( aOutOffset.Height() < 0 )
352 nInvisibleTilesY = (aOutOffset.Height() - rSizePixel.
Height() + 1) / rSizePixel.
Height();
354 nInvisibleTilesY = aOutOffset.Height() / rSizePixel.
Height();
360 const Point aOutStart( aOutOrigin.X() + nInvisibleTilesX*rSizePixel.
Width(),
361 aOutOrigin.Y() + nInvisibleTilesY*rSizePixel.
Height() );
370 (aOutArea.GetWidth() + aOutArea.Left() - aOutStart.X() + rSizePixel.
Width() - 1) / rSizePixel.
Width(),
371 (aOutArea.GetHeight() + aOutArea.Top() - aOutStart.Y() + rSizePixel.
Height() - 1) / rSizePixel.
Height(),
381 int nNumTilesX,
int nNumTilesY,
384 Point aCurrPos( rPosPixel );
399 for( nY=0; nY < nNumTilesY; ++nY )
401 aCurrPos.setX( rPosPixel.X() );
403 for( nX=0; nX < nNumTilesX; ++nX )
412 bDrawInPixel ? aCurrPos : rOut.
PixelToLogic( aCurrPos ),
413 bDrawInPixel ? rTileSizePixel : aTileSizeLogic,
416 aCurrPos.AdjustX(rTileSizePixel.
Width() );
419 aCurrPos.AdjustY(rTileSizePixel.
Height() );
430 const Size& rCropLeftTop,
431 const Size& rCropRightBottom,
433 const Size& rDstSize,
434 bool bEnlarge )
const
441 rBmpEx.
Crop( rCropRect );
445 rCropLeftTop.
Width() < 0 ||
446 rCropLeftTop.
Height() < 0 ||
447 rCropRightBottom.
Width() < 0 ||
448 rCropRightBottom.
Height() < 0 ) )
451 sal_Int32 nPadLeft( rCropLeftTop.
Width() < 0 ? -rCropLeftTop.
Width() : 0 );
452 sal_Int32 nPadTop( rCropLeftTop.
Height() < 0 ? -rCropLeftTop.
Height() : 0 );
453 sal_Int32 nPadTotalWidth( aBmpSize.Width() + nPadLeft + (rCropRightBottom.
Width() < 0 ? -rCropRightBottom.
Width() : 0) );
454 sal_Int32 nPadTotalHeight( aBmpSize.Height() + nPadTop + (rCropRightBottom.
Height() < 0 ? -rCropRightBottom.
Height() : 0) );
468 Bitmap aMask( aBmpSize, 1 );
478 aBmpEx2.
Scale(
Size(nPadTotalWidth, nPadTotalHeight));
490 if( !(aSizePixel.Width() && aSizePixel.Height() && rDstSize.
Width() && rDstSize.
Height()) )
493 double fSrcWH =
static_cast<double>(aSizePixel.Width()) / aSizePixel.
Height();
494 double fDstWH =
static_cast<double>(rDstSize.
Width()) / rDstSize.
Height();
495 double fScaleX = 1.0, fScaleY = 1.0;
498 if( fSrcWH < fDstWH )
499 fScaleY = aSizePixel.Width() / ( fDstWH * aSizePixel.Height() );
501 fScaleX = fDstWH * aSizePixel.Height() / aSizePixel.Width();
503 rBmpEx.
Scale( fScaleX, fScaleY );
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
bool Draw(OutputDevice *pOut, const Point &rPt, const Size &rSz, const GraphicAttr *pAttr=nullptr)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
bool IsMapModeEnabled() const
const MapMode & GetMapMode() const
void IntersectClipRegion(const tools::Rectangle &rRect)
GDIMetaFile * GetConnectMetaFile() const
void EnableMapMode(bool bEnable=true)
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
bool VCL_DLLPRIVATE ImplRenderTileRecursive(VirtualDevice &rVDev, int nExponent, int nMSBFactor, int nNumOrigTilesX, int nNumOrigTilesY, int nRemainderTilesX, int nRemainderTilesY, const Size &rTileSizePixel, const GraphicAttr *pAttr, ImplTileInfo &rTileInfo)
internally called by ImplRenderTempTile()
void DrawRect(const tools::Rectangle &rRect)
bool VCL_DLLPRIVATE ImplRenderTempTile(VirtualDevice &rVDev, int nNumTilesX, int nNumTilesY, const Size &rTileSizePixel, const GraphicAttr *pAttr)
Render a given number of tiles in an optimized way.
tools::Long Width() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const BitmapEx *pBmpExSrc)
Copy a rectangular area from another bitmap.
bool IsTransparent() const
GraphicType GetType() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
AlphaMask GetAlpha() const
const Graphic & GetGraphic() const
void SetGraphic(const Graphic &rGraphic)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
tools::Long Height() const
bool VCL_DLLPRIVATE ImplDrawTiled(OutputDevice *pOut, const tools::Rectangle &rArea, const Size &rSizePixel, const Size &rOffset, const GraphicAttr *pAttr, int nTileCacheSize1D)
void DrawEllipse(const tools::Rectangle &rRect)
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
void VCL_DLLPRIVATE ImplTransformBitmap(BitmapEx &rBmpEx, const GraphicAttr &rAttr, const Size &rCropLeftTop, const Size &rCropRightBottom, const tools::Rectangle &rCropRect, const Size &rDstSize, bool bEnlarge) const
const Size & GetSizePixel() const
void Push(PushFlags nFlags=PushFlags::ALL)
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
bool IsTransparent() const
Degree10 GetRotation() const