36#define WIN_EMR_POLYGON 3
37#define WIN_EMR_POLYLINE 4
38#define WIN_EMR_POLYBEZIERTO 5
39#define WIN_EMR_POLYLINETO 6
40#define WIN_EMR_POLYPOLYGON 8
41#define WIN_EMR_SETWINDOWEXTEX 9
42#define WIN_EMR_SETWINDOWORGEX 10
43#define WIN_EMR_SETVIEWPORTEXTEX 11
44#define WIN_EMR_SETVIEWPORTORGEX 12
46#define WIN_EMR_SETPIXELV 15
47#define WIN_EMR_SETMAPMODE 17
48#define WIN_EMR_SETBKMODE 18
49#define WIN_EMR_SETROP2 20
50#define WIN_EMR_SETTEXTALIGN 22
51#define WIN_EMR_SETTEXTCOLOR 24
52#define WIN_EMR_MOVETOEX 27
53#define WIN_EMR_INTERSECTCLIPRECT 30
54#define WIN_EMR_SAVEDC 33
55#define WIN_EMR_RESTOREDC 34
56#define WIN_EMR_SELECTOBJECT 37
57#define WIN_EMR_CREATEPEN 38
58#define WIN_EMR_CREATEBRUSHINDIRECT 39
59#define WIN_EMR_DELETEOBJECT 40
60#define WIN_EMR_ELLIPSE 42
61#define WIN_EMR_RECTANGLE 43
62#define WIN_EMR_ROUNDRECT 44
63#define WIN_EMR_LINETO 54
64#define WIN_EMR_BEGINPATH 59
65#define WIN_EMR_ENDPATH 60
66#define WIN_EMR_CLOSEFIGURE 61
67#define WIN_EMR_FILLPATH 62
68#define WIN_EMR_STROKEPATH 64
70#define WIN_EMR_GDICOMMENT 70
71#define WIN_EMR_STRETCHDIBITS 81
72#define WIN_EMR_EXTCREATEFONTINDIRECTW 82
73#define WIN_EMR_EXTTEXTOUTW 84
75#define WIN_SRCCOPY 0x00CC0020L
76#define WIN_SRCPAINT 0x00EE0086L
77#define WIN_SRCAND 0x008800C6L
78#define WIN_SRCINVERT 0x00660046L
79#define WIN_EMR_COMMENT_EMFPLUS 0x2B464D45L
81#define HANDLE_INVALID 0xffffffff
82#define MAXHANDLES 65000
84#define LINE_SELECT 0x00000001
85#define FILL_SELECT 0x00000002
86#define TEXT_SELECT 0x00000004
94#define TA_RTLREADING 256
96#define MM_ANISOTROPIC 8
169 sal_Int32 nDPIX = rMtfSizePix.
Width()*25;
170 sal_Int32 nDivX = rMtfSizeLog.
Width()/100;
174 sal_Int32 nDPIY = rMtfSizePix.
Height()*25;
175 sal_Int32 nDivY = rMtfSizeLog.
Height()/100;
208 sal_uInt32 nAlpha = ((100-nTrans)*0xFF)/100;
209 sal_uInt32 nCol = rColor.
GetBlue();
211 nCol |=
static_cast<sal_uInt32
>(rColor.
GetGreen()) << 8;
212 nCol |=
static_cast<sal_uInt32
>(rColor.
GetRed()) << 16;
213 nCol |= ( nAlpha << 24 );
232 for( sal_uInt16
i = 0;
i < rPoly.
GetSize();
i++ )
243 maVDev->EnableOutput(
false );
369 sal_Int32 nFillBytes, nActPos =
m_rStm.
Tell();
377 while( nFillBytes-- )
388 sal_uInt32 nStockObject = 0x80000000;
391 nStockObject |= 0x00000007;
393 nStockObject |= 0x00000001;
395 nStockObject |= 0x0000000a;
421 sal_uInt32 nStyle =
maVDev->IsLineColor() ? 0 : 5;
438 sal_uInt32 nStyle =
maVDev->IsFillColor() ? 0 : 1;
468 const bool bFontScaledHorizontally(nFontWidth != 0 && nFontWidth != nFontHeight);
470 if(bFontScaledHorizontally)
479 const double fScaleFactor(
static_cast<double>(nAverageFontWidth) /
static_cast<double>(nFontHeight));
480 nFontWidth =
static_cast<tools::Long>(
static_cast<double>(nFontWidth) * fScaleFactor);
503 default: nWeight = 0;
break;
517 default: nPitchAndFamily = 0x00;
break;
532 for(
i = 0;
i < 32;
i++ )
536 for(
i = 0;
i < 64;
i++ )
540 for(
i = 0;
i < 32;
i++ )
561 sal_uInt32 nTextAlign;
588 sal_uInt32 nCol = rColor.
GetRed();
590 nCol |=
static_cast<sal_uInt32
>(rColor.
GetGreen()) << 8;
591 nCol |=
static_cast<sal_uInt32
>(rColor.
GetBlue()) << 16;
604 default: nROP2 = 13;
break;
660 for( sal_uInt16
i = 0;
i < rPoly.
GetSize();
i++ )
669 sal_uInt16
n,
i, nPolyCount = rPolyPoly.
Count();
674 if( 1 == nPolyCount )
678 bool bHasFlags =
false;
679 sal_uInt32 nTotalPoints = 0;
681 for(
i = 0;
i < nPolyCount;
i++ )
683 nTotalPoints += rPolyPoly[
i ].GetSize();
684 if ( rPolyPoly[
i ].HasFlags() )
700 for(
i = 0;
i < nPolyCount;
i++ )
703 for(
i = 0;
i < nPolyCount;
i++ )
725 sal_uInt16
i,
n, o, nPolyCount = rPolyPoly.
Count();
726 for (
i = 0;
i < nPolyCount;
i++ )
741 sal_uInt16 nBezPoints = 0;
743 while ( ( ( nBezPoints +
n + 2 ) < rPoly.
GetSize() ) && ( rPoly.
GetFlags( nBezPoints +
n ) == PolyFlags::Control ) )
750 aNewPoly[ 0 ] = rPoly[
n - 1 ];
751 for ( o = 0; o < nBezPoints; o++ )
752 aNewPoly[ o + 1 ] = rPoly[
n + o ];
755 for( o = 1; o < aNewPoly.
GetSize(); o++ )
762 sal_uInt16 nPoints = 1;
763 while( ( nPoints +
n ) < rPoly.
GetSize() && ( rPoly.
GetFlags( nPoints +
n ) != PolyFlags::Control ) )
770 aNewPoly[ 0 ] = rPoly[
n - 1];
771 for ( o = 1; o <= nPoints; o++ )
772 aNewPoly[ o ] = rPoly[
n - 1 + o ];
775 for( o = 1; o < aNewPoly.
GetSize(); o++ )
787 if ( bClosed && (
n == rPoly.
GetSize() ) )
802 const Size& rSz, sal_uInt32 nROP )
822 WriteDIB(rBmp, aMemStm,
true,
false);
824 sal_uInt32 nDIBSize = aMemStm.
Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize;
838 nPalCount = nColsUsed;
840 nPalCount = 1 <<
static_cast<sal_uInt32
>(
nBitCount);
850 sal_uInt32 nPalSize = nPalCount * 4;
866 sal_Int32 nLen = rText.getLength(),
i;
871 sal_uInt32 nNormWidth;
876 if( !pDXArray.
empty() )
878 nNormWidth =
maVDev->GetTextWidth( rText );
883 nNormWidth =
maVDev->GetTextArray( rText, &aOwnArray );
889 nNormWidth = pDX[ nLen - 2 ] +
maVDev->GetTextWidth( OUString(rText[ nLen - 1 ]) );
891 if( nWidth && nNormWidth && ( nWidth != nNormWidth ) )
893 if (!pDXArray.
empty())
895 aOwnArray.
assign(pDXArray);
898 const double fFactor =
static_cast<double>(nWidth) / nNormWidth;
900 for(
i = 0;
i < ( nLen - 1 );
i++ )
917 for(
i = 0;
i < nLen;
i++ )
929 for(
i = 1;
i < ( nLen - 1 );
i++ )
941 if(!rLinePolygon.
count())
947 rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon);
949 if(aLinePolyPolygon.
count())
951 for(
auto const& rB2DPolygon : std::as_const(aLinePolyPolygon))
957 if(!aFillPolyPolygon.
count())
964 maVDev->SetFillColor(aOldLineColor);
966 for(
auto const& rB2DPolygon : std::as_const(aFillPolyPolygon))
971 maVDev->SetLineColor(aOldLineColor);
972 maVDev->SetFillColor(aOldFillColor);
977 for(
size_t j = 0, nActionCount = rMtf.
GetActionSize(); j < nActionCount; j++ )
998 if(
maVDev->IsLineColor() )
1013 if(
maVDev->IsLineColor() )
1140 if(
maVDev->IsLineColor() )
1192 if( rPolyPoly.
Count() )
1213 const double fScaleX = aSrcSize.
Width() ?
static_cast<double>(aDestSize.
Width()) / aSrcSize.
Width() : 1.0;
1214 const double fScaleY = aSrcSize.
Height() ?
static_cast<double>(aDestSize.
Height()) / aSrcSize.
Height() : 1.0;
1217 if( fScaleX != 1.0 || fScaleY != 1.0 )
1219 aTmpMtf.
Scale( fScaleX, fScaleY );
1224 nMoveX = aDestPt.
X() - aSrcPt.
X();
1225 nMoveY = aDestPt.
Y() - aSrcPt.
Y();
1227 if( nMoveX || nMoveY )
1228 aTmpMtf.
Move( nMoveX, nMoveY );
1256 maVDev->SetMapMode( aMapMode );
1359 const OUString& aText( pA->
GetText() );
1482 if (pCommentAction->
GetComment() ==
"EMF_PLUS")
const AlphaMask & GetAlphaMask() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
bool Replace(const AlphaMask &rAlpha, const Color &rMergeColor)
Merge bitmap with given background color according to specified alpha mask.
Size GetSizePixel() const
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
void ImplWritePlusColor(const Color &rColor, sal_uInt32 nTrans)
void ImplWritePath(const tools::PolyPolygon &rPolyPoly, bool bClose)
void ImplWriteExtent(tools::Long nExtent)
void ImplPlusRecord(EmfPlusRecordType nType, sal_uInt16 nFlags)
void ImplWrite(const GDIMetaFile &rMtf)
void ImplWritePoint(const Point &rPoint)
sal_uLong mnRecordPlusPos
void ImplWritePolygonRecord(const tools::Polygon &rPoly, bool bClose)
void ImplBeginPlusRecord(EmfPlusRecordType nType, sal_uInt16 nFlags)
void ImplWriteTextRecord(const Point &rPos, const OUString &rText, KernArraySpan pDXArray, sal_uInt32 nWidth)
bool ImplPrepareHandleSelect(sal_uInt32 &rHandle, sal_uLong nSelectType)
void ImplBeginCommentRecord(sal_Int32 nCommentType)
void ImplWritePlusFillPolygonRecord(const tools::Polygon &rPoly, sal_uInt32 nTrans)
void ImplWriteRect(const tools::Rectangle &rRect)
void ImplBeginRecord(sal_uInt32 nType)
void ImplWriteRasterOp(RasterOp eRop)
void ImplWritePlusPoint(const Point &rPoint)
void ImplWritePolyPolygonRecord(const tools::PolyPolygon &rPolyPoly)
void ImplReleaseHandle(sal_uLong nHandle)
sal_uInt32 mnHorTextAlign
void Impl_handleLineInfoPolyPolygons(const LineInfo &rInfo, const basegfx::B2DPolygon &rLinePolygon)
void ImplWriteSize(const Size &rSize)
void WriteEMFPlusHeader(const Size &rMtfSizePix, const Size &rMtfSizeLog)
std::vector< bool > mHandlesUsed
sal_uLong ImplAcquireHandle()
void ImplEndCommentRecord()
void ImplWriteBmpRecord(const Bitmap &rBmp, const Point &rPt, const Size &rSz, sal_uInt32 nROP)
bool WriteEMF(const GDIMetaFile &rMtf)
void ImplWriteColor(const Color &rColor)
ScopedVclPtr< VirtualDevice > maVDev
void AddGradientActions(tools::Rectangle const &rRect, GDIMetaFile &rMetaFile)
void assign(KernArraySpan other)
void set(size_t nIndex, sal_Int32 nValue)
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
void SetMapUnit(MapUnit eUnit)
const Point & GetOrigin() const
void SetScaleX(const Fraction &rScaleX)
sal_uInt32 GetWidth() const
sal_Int32 GetIndex() const
const OUString & GetText() const
const Point & GetPoint() const
const Point & GetPoint() const
const OUString & GetText() const
sal_Int32 GetIndex() const
sal_Int32 GetIndex() const
const KernArray & GetDXArray() const
const OUString & GetText() const
const Point & GetPoint() const
const tools::Rectangle & GetRect() const
const OUString & GetText() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvStream & WriteInt32(sal_Int32 nInt32)
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUChar(unsigned char nChar)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
FontFamily GetFamilyType()
FontStrikeout GetStrikeout() const
tools::Long GetOrCalculateAverageFontWidth() const
const OUString & GetFamilyName() const
TextAlign GetAlignment() const
const Size & GetFontSize() const
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
Degree10 GetOrientation() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
#define WIN_EMR_SETPIXELV
#define WIN_EMR_SETBKMODE
#define WIN_EMR_SETWINDOWORGEX
#define WIN_EMR_STROKEPATH
#define WIN_EMR_DELETEOBJECT
#define WIN_EMR_SETMAPMODE
#define WIN_EMR_CREATEBRUSHINDIRECT
#define WIN_EMR_CLOSEFIGURE
#define WIN_EMR_POLYPOLYGON
#define WIN_EMR_BEGINPATH
#define WIN_EMR_SELECTOBJECT
#define WIN_EMR_POLYBEZIERTO
#define WIN_EMR_COMMENT_EMFPLUS
#define WIN_EMR_STRETCHDIBITS
#define WIN_EMR_ROUNDRECT
#define WIN_EMR_INTERSECTCLIPRECT
#define WIN_EMR_CREATEPEN
#define WIN_EMR_RECTANGLE
#define WIN_EMR_SETVIEWPORTORGEX
#define WIN_EMR_EXTCREATEFONTINDIRECTW
#define WIN_EMR_POLYLINETO
#define WIN_EMR_SETWINDOWEXTEX
#define WIN_EMR_SETVIEWPORTEXTEX
#define WIN_EMR_GDICOMMENT
#define WIN_EMR_SETTEXTCOLOR
#define WIN_EMR_EXTTEXTOUTW
#define WIN_EMR_RESTOREDC
#define WIN_EMR_SETTEXTALIGN
tools::Long FRound(double fVal)
#define SAL_WARN_IF(condition, area, stream)
UNDERLYING_TYPE get() const