24 #include <rtl/math.hxx>
48 if (0.0 < fW && 0.0 < fH && (fW <= 1.0 || fH <= 1.0))
53 double nW = std::max<double>(1.0, rtl::math::round(fW));
54 double nH = std::max<double>(1.0, rtl::math::round(fH));
58 aTarget.Insert(1,
Point(nX+nW, nY));
59 aTarget.Insert(2,
Point(nX+nW, nY+nH));
60 aTarget.Insert(3,
Point(nX, nY+nH));
61 aTarget.Insert(4,
Point(nX, nY));
70 for (
auto const& rB2DPolygon : rPolyPoly)
71 aTarget.
Insert(toPolygon(rB2DPolygon));
79 Color aColor( rColor );
99 aColor =
Color( cLum, cLum, cLum );
117 double fTransparency)
122 if(!rB2DPolyPoly.
count())
158 const double fAdjustedTransparency =
mpAlphaVDev ? 0 : fTransparency;
166 fAdjustedTransparency,
174 for(
auto const& rPolygon : aB2DPolyPolygon)
179 fAdjustedTransparency,
183 css::drawing::LineCap_BUTT,
196 aB2DPolyPoly.
transform(rObjectTransform);
200 static_cast< sal_uInt16 >(fTransparency * 100.0)));
213 aB2DPolyPoly.
transform(rObjectTransform);
215 toPolyPolygon(aB2DPolyPoly),
216 static_cast<sal_uInt16>(fTransparency * 100.0));
235 sal_uInt16 nTransparencePercent )
242 #if defined UNX && ! defined MACOSX && ! defined IOS
268 const double fTransparency = 0.01 * nTransparencePercent;
295 for(
auto const& rPolygon : aB2DPolyPolygon)
304 css::drawing::LineCap_BUTT,
319 sal_uInt16 nTransparencePercent )
335 aDstRect.Intersection( aPolyRect );
339 if( !aDstRect.IsEmpty() )
370 aPixelRect.getWidth(), aPixelRect.getHeight(),
371 sal::static_int_cast<
sal_uInt8>(nTransparencePercent),
383 const Size aDstSz( aDstRect.GetSize() );
386 if( aDstRect.Left() || aDstRect.Top() )
387 aPolyPoly.
Move( -aDstRect.Left(), -aDstRect.Top() );
389 if( aVDev->SetOutputSizePixel( aDstSz ) )
391 const bool bOldMap =
mbMap;
397 aVDev->DrawPolyPolygon( aPolyPoly );
400 Bitmap aPolyMask( aVDev->GetBitmap(
Point(), aDstSz ) );
403 if( !!aPaint && !!aPolyMask )
426 for( sal_uInt16
i = 0;
i < nCount;
i++ )
429 aCol.
Merge( aFillCol, cTrans );
436 const sal_uInt8 cBlack = aBlack.GetIndex();
438 for( nY = 0; nY < nHeight; nY++ )
444 for( nX = 0; nX < nWidth; nX++, cBit >>= 1, pWScan++ )
451 if( ( *pRScan & cBit ) == cBlack )
453 *pWScan = pMap[ *pWScan ].
GetIndex();
460 for( nY = 0; nY < nHeight; nY++ )
464 for( nX = 0; nX < nWidth; nX++ )
473 delete[]
reinterpret_cast<sal_uInt8*
>(pMap);
480 const sal_uInt8 cBlack = aBlack.GetIndex();
482 for( nY = 0; nY < nHeight; nY++ )
488 for( nX = 0; nX < nWidth; nX++, cBit >>= 1, pWScan += 3 )
495 if( ( *pRScan & cBit ) == cBlack )
506 for( nY = 0; nY < nHeight; nY++ )
510 for( nX = 0; nX < nWidth; nX++ )
515 aPixCol.
Merge(aFillCol, cTrans);
554 sal_uInt16 nTransparencePercent )
566 if( !
mbFillColor || (nTransparencePercent >= 100) )
595 sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100),
596 sal::static_int_cast<sal_uInt8>(255*nTransparencePercent/100)) );
605 const Size& rSize,
const Gradient& rTransparenceGradient )
647 if( xVDev->SetOutputSizePixel( aDstRect.
GetSize() ) )
662 xVDev->SetMapMode(aMap);
669 const bool bBufferMapModeEnabled(xVDev->IsMapModeEnabled());
670 xVDev->EnableMapMode(
false);
673 xVDev->DrawOutDev( aPoint, xVDev->GetOutputSizePixel(),
674 aDstRect.
TopLeft(), xVDev->GetOutputSizePixel(),
678 xVDev->EnableMapMode(bBufferMapModeEnabled);
684 xVDev->EnableMapMode(
false);
686 const Bitmap aPaint(xVDev->GetBitmap(aPoint, xVDev->GetOutputSizePixel()));
689 xVDev->EnableMapMode(bBufferMapModeEnabled);
693 xVDev->EnableMapMode(
false);
695 const AlphaMask aAlpha(xVDev->GetBitmap(aPoint, xVDev->GetOutputSizePixel()));
707 const bool bOldMap =
mbMap;
710 xVDev->SetMapMode( aMap );
711 const bool bVDevOldMap = xVDev->IsMapModeEnabled();
717 xVDev->EnableMapMode(
false );
718 BitmapEx aPaint = xVDev->GetBitmapEx(
Point(), xVDev->GetOutputSizePixel());
719 xVDev->EnableMapMode( bVDevOldMap );
723 xVDev->DrawGradient(
tools::Rectangle( rPos, rSize ), rTransparenceGradient );
725 xVDev->EnableMapMode(
false );
727 AlphaMask aAlpha(xVDev->GetBitmap(
Point(), xVDev->GetOutputSizePixel()));
sal_uInt8 GetIndexFromData(const sal_uInt8 *pData, tools::Long nX) const
sal_uInt8 GetIndex() const
tools::Long Height() const
SAL_DLLPRIVATE bool ImplIsRecordLayout() const
virtual void ClipToPaintRegion(tools::Rectangle &rDstRect)
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
bool IsTransparent() const
void setClosed(bool bNew)
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool supportsOperation(OutDevSupportType) const =0
const StyleSettings & GetStyleSettings() const
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)
sal_uInt8 GetLuminance() const
bool IsMapModeEnabled() const
void DrawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry, const OutputDevice &rOutDev)
SAL_DLLPRIVATE bool is_double_buffered_window() const
const MapMode & GetMapMode() const
bool DrawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency, const OutputDevice &rOutDev)
SAL_DLLPRIVATE Color ImplDrawModeToColor(const Color &rColor) const
void EnableMapMode(bool bEnable=true)
AntialiasingFlags GetAntialiasing() const
HashMap_OWString_Interface aMap
void SetPixelOnData(sal_uInt8 *pData, tools::Long nX, const BitmapColor &rBitmapColor)
SAL_DLLPRIVATE void InitLineColor()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
Scanline GetScanline(tools::Long nY) const
AntialiasingFlags mnAntialiasing
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
void DrawInvisiblePolygon(const tools::PolyPolygon &rPolyPoly)
sal_uInt8 GetBlue() const
SalGraphics * mpGraphics
Graphics context to draw on.
SAL_DLLPRIVATE bool DrawTransparentNatively(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const
Get device transformation.
virtual void SetFillColor()=0
void BlendWith(const Bitmap &rOther)
sal_uInt16 GetEntryCount() const
virtual void EmulateDrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
SAL_DLLPRIVATE void InitFillColor()
ScanlineFormat GetScanlineFormat() 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
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
void SetOrigin(const Point &rOrigin)
const Color & GetFontColor() const
tools::Long Width() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
void DrawPolyLine(sal_uInt32 nPoints, Point const *pPtAry, const OutputDevice &rOutDev)
constexpr double deg2rad(double v)
const AllSettings & GetSettings() const
Size GetOutputSizePixel() const
virtual sal_uInt16 GetBitCount() const
DrawModeFlags GetDrawMode() 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_uInt16 GetBestIndex(const BitmapColor &rCol) const
const Color & GetStartColor() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
sal_uInt8 GetGreen() const
B2DRange const & getB2DRange() const
VclPtr< VirtualDevice > mpAlphaVDev
AlphaMask GetAlpha() const
constexpr sal_uInt8 ColorChannelMerge(sal_uInt8 nDst, sal_uInt8 nSrc, sal_uInt8 nSrcTrans)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
const BitmapPalette & GetPalette() const
const Color & GetEndColor() const
void DrawPolyPolygon(const tools::PolyPolygon &rPolyPoly)
Render the given poly-polygon.
virtual void InitClipRegion()
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
RasterOp GetRasterOp() const
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
reference_type * get() const
Get the body.
sal_uInt16 GetBitCount() const
bool IsDeviceOutputNecessary() const
void Push(PushFlags nFlags=PushFlags::ALL)
BitmapColor GetBestMatchingColor(const BitmapColor &rBitmapColor)
const Color & GetFillColor() const