40#include <com/sun/star/beans/PropertyValue.hpp>
41#include <com/sun/star/io/XSeekable.hpp>
42#include <com/sun/star/graphic/GraphicProvider.hpp>
43#include <com/sun/star/graphic/XGraphicProvider.hpp>
44#include <com/sun/star/beans/XMaterialHolder.hpp>
70 playMetafile( aTmpMtf,
nullptr, i_rContext, i_pDummyVDev );
81 Point aPoint( i_rPoint );
82 Size aSize( i_rSize );
88 if( aSize.
Width() < 0 )
103 aBitmapEx.
Mirror( nMirrorFlags );
106 bool bIsJpeg =
false, bIsPng =
false;
121 const double fBmpPixelX = aBmpSize.
Width();
122 const double fBmpPixelY = aBmpSize.
Height();
123 const double fMaxPixelX
126 const double fMaxPixelY
131 if( ( ( fBmpPixelX > ( fMaxPixelX + 4 ) ) ||
132 ( fBmpPixelY > ( fMaxPixelY + 4 ) ) ) &&
133 ( fBmpPixelY > 0.0 ) && ( fMaxPixelY > 0.0 ) )
137 const double fBmpWH = fBmpPixelX / fBmpPixelY;
138 const double fMaxWH = fMaxPixelX / fMaxPixelY;
140 if( fBmpWH < fMaxWH )
145 else if( fBmpWH > 0.0 )
164 if ( !(aSizePixel.
Width() && aSizePixel.
Height()) )
170 if ( bIsPng || ( aSizePixel.
Width() < 32 ) || ( aSizePixel.
Height() < 32 ) )
171 bUseJPGCompression =
false;
173 auto pStrm=std::make_shared<SvMemoryStream>();
176 bool bTrueColorJPG =
true;
177 if ( bUseJPGCompression )
192 sal_uInt32 nZippedFileSize = 0;
199 nZippedFileSize = aTemp.
TellEnd();
213 uno::Reference< io::XSeekable > xSeekable(
xStream, UNO_QUERY_THROW );
215 uno::Reference< graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create(xContext) );
216 uno::Reference< graphic::XGraphic > xGraphic( aGraphic.
GetXGraphic() );
217 uno::Reference < io::XOutputStream > xOut(
xStream->getOutputStream() );
218 uno::Sequence< beans::PropertyValue > aOutMediaProperties{
223 xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties );
225 if ( !bIsJpeg && xSeekable->getLength() > nZippedFileSize )
227 bUseJPGCompression =
false;
233 xSeekable->seek( 0 );
236 uno::Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) );
239 sal_Int16 nBitsPerPixel = 24;
240 if ( xPropSet->getPropertyValue(
"BitsPerPixel") >>= nBitsPerPixel )
242 bTrueColorJPG = nBitsPerPixel != 8;
247 catch( uno::Exception& )
249 bUseJPGCompression =
false;
252 if ( bUseJPGCompression )
255 if (!aBitmapEx.
IsAlpha() && bTrueColorJPG)
262 else if ( aBitmapEx.
IsAlpha() )
271 bool bAssertionFired(
false );
277 pDummyVDev = xPrivateDevice.
get();
437 const sal_uInt16 nTransPercent = aTransCol.
GetLuminance() * 100 / 255;
442 if (rPos != aMtfOrigin)
443 aTmpMtf.
Move(rPos.
X() - aMtfOrigin.
X(), rPos.
Y() - aMtfOrigin.
Y());
445 playMetafile( aTmpMtf,
nullptr, i_rContext, pDummyVDev );
454 sal_Int32 nMaxBmpDPI(300);
463 if ( nPixelX && nPixelY )
465 Size aDstSizePixel( nPixelX, nPixelY );
467 if( xVDev->SetOutputSizePixel( aDstSizePixel,
true,
true ) )
473 xVDev->SetMapMode( aMapMode );
474 const bool bVDevOldMap = xVDev->IsMapModeEnabled();
475 Size aDstSize( xVDev->PixelToLogic( aDstSizePixel ) );
478 if ( aMtfOrigin.
X() || aMtfOrigin.
Y() )
479 aTmpMtf.
Move( -aMtfOrigin.
X(), -aMtfOrigin.
Y() );
480 double fScaleX =
static_cast<double>(aDstSize.
Width()) /
static_cast<double>(aTmpMtf.
GetPrefSize().
Width());
482 if( fScaleX != 1.0 || fScaleY != 1.0 )
483 aTmpMtf.
Scale( fScaleX, fScaleY );
488 aTmpMtf.
Play(*xVDev, aPoint, aDstSize);
490 xVDev->EnableMapMode(
false );
491 BitmapEx aPaint = xVDev->GetBitmapEx(aPoint, xVDev->GetOutputSizePixel());
492 xVDev->EnableMapMode( bVDevOldMap );
496 xVDev->DrawGradient(
tools::Rectangle( aPoint, aDstSize ), rTransparenceGradient );
498 xVDev->EnableMapMode(
false );
500 AlphaMask aAlpha(xVDev->GetBitmap(
Point(), xVDev->GetOutputSizePixel()));
548 playMetafile( aSubstitute,
nullptr, i_rContext, pDummyVDev );
559 if( pA->
GetComment().equalsIgnoreAsciiCase(
"XGRAD_SEQ_BEGIN"))
564 while( !bDone && ( ++
i <
nCount ) )
571 (
static_cast<const MetaCommentAction*
>(pAction)->GetComment().equalsIgnoreAsciiCase(
"XGRAD_SEQ_END")) )
595 bool bSkipSequence =
false;
598 if( pA->
GetComment() ==
"XPATHSTROKE_SEQ_BEGIN" )
600 sSeqEnd = OString(
"XPATHSTROKE_SEQ_END");
617 bSkipSequence =
true;
618 if ( aStartArrow.
Count() || aEndArrow.
Count() )
619 bSkipSequence =
false;
620 if ( !aDashArray.empty() && ( fStrokeWidth != 0.0 ) && ( fTransparency == 0.0 ) )
621 bSkipSequence =
false;
649 && fStrokeWidth > 0.0)
652 const sal_uInt16 nPoints(aPath.
GetSize());
653 const bool bCurve(aPath.
HasFlags());
655 for(sal_uInt16
a(0);
a + 1 < nPoints;
a++)
658 && PolyFlags::Normal != aPath.
GetFlags(
a + 1)
660 && PolyFlags::Normal != aPath.
GetFlags(
a + 2)
683 else if ( pA->
GetComment() ==
"XPATHFILL_SEQ_BEGIN" )
685 sSeqEnd = OString(
"XPATHFILL_SEQ_END");
692 if ( fTransparency == 0.0 )
697 bSkipSequence =
true;
700 else if ( fTransparency == 1.0 )
701 bSkipSequence =
true;
711 OString sComment(
static_cast<const MetaCommentAction*
>(pAction)->GetComment() );
712 if (sComment == sSeqEnd)
830 SAL_WARN(
"vcl",
"MetaMask...Action not supported yet" );
1047 if( !bAssertionFired )
1049 bAssertionFired =
true;
1050 SAL_WARN(
"vcl",
"PDFExport::ImplWriteActions: deprecated and unsupported MetaAction encountered " <<
static_cast<int>(
nType) );
1079 maID =
reinterpret_cast< sal_IntPtr
>(
this);
1080 while( sTransporters.find( maID ) != sTransporters.end() )
1082 sTransporters[ maID ] =
this;
1087 sTransporters.erase( maID );
1088 SAL_INFO(
"vcl",
"EncHashTransporter freed" );
1101 return uno::Any( sal_Int64(maID) );
1104 static EncHashTransporter* getEncHashTransporter(
const uno::Reference< beans::XMaterialHolder >& );
1115 uno::Any aMat( xRef->getMaterial() );
1119 std::map< sal_IntPtr, EncHashTransporter* >::iterator it = sTransporters.find(
static_cast<sal_IntPtr
>(nMat) );
1120 if( it != sTransporters.end() )
1121 pResult = it->second;
1171 const OUString& i_rUserPassword
1174 uno::Reference< beans::XMaterialHolder > xResult;
1175 if( !i_rOwnerPassword.isEmpty() || !i_rUserPassword.isEmpty() )
1178 xResult = pTransporter;
1182 padPassword( i_rOwnerPassword.isEmpty() ? i_rUserPassword : i_rOwnerPassword, aPadOPW );
1193 rtl_secureZeroMemory (aPadOPW,
sizeof(aPadOPW));
1194 rtl_secureZeroMemory (aPadUPW,
sizeof(aPadUPW));
1201 bool bSuccess =
false;
1205 sal_Int32 nKeyLength = 0, nRC4KeyLength = 0;
1220 sal_Int32& o_rKeyLength, sal_Int32& o_rRC4KeyLength )
1229 sal_Int32 nAccessPermissions = 0xfffff0c0;
1232 o_rRC4KeyLength = 16;
1238 nAccessPermissions |= ( i_rProperties.
CanAddOrModify ) ? 1 << 5 : 0;
1241 nAccessPermissions |= ( i_rProperties.
CanAssemble ) ? 1 << 10 : 0;
1242 nAccessPermissions |= ( i_rProperties.
CanPrintFull ) ? 1 << 11 : 0;
1243 return nAccessPermissions;
1258 sal_Int32 nCurrentChar;
1260 for( nCurrentChar = 0; nCurrentChar < nToCopy; nCurrentChar++ )
1261 o_pPaddedPW[nCurrentChar] =
static_cast<sal_uInt8>( aString[nCurrentChar] );
1281 bool bSuccess =
true;
1282 ::std::vector<unsigned char> nMD5Sum;
1289 if( ! io_rProperties.
OValue.empty() )
1296 nPerm[0] =
static_cast<sal_uInt8>(i_nAccessPermissions);
1297 nPerm[1] =
static_cast<sal_uInt8>( i_nAccessPermissions >> 8 );
1298 nPerm[2] =
static_cast<sal_uInt8>( i_nAccessPermissions >> 16 );
1299 nPerm[3] =
static_cast<sal_uInt8>( i_nAccessPermissions >> 24 );
1301 pDigest->
update(nPerm,
sizeof(nPerm));
1309 for (sal_Int32
i = 0;
i < 50;
i++)
1338 std::vector< sal_uInt8 >& io_rOValue,
1339 sal_Int32 i_nKeyLength
1342 bool bSuccess =
true;
1346 rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
1358 for (
i = 0;
i < 50;
i++)
1366 if (rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1367 nMD5Sum.data(), i_nKeyLength ,
nullptr, 0 )
1368 == rtl_Cipher_E_None)
1372 io_rOValue.data(), sal_Int32(io_rOValue.size()) );
1380 for(
i = 1;
i <= 19;
i++ )
1382 for(
y = 0;
y <
sizeof( nLocalKey );
y++ )
1383 nLocalKey[
y] =
static_cast<sal_uInt8>( nMD5Sum[
y] ^
i );
1385 if (rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1387 != rtl_Cipher_E_None)
1392 rtl_cipher_encodeARCFOUR( aCipher, io_rOValue.data(), sal_Int32(io_rOValue.size()),
1393 io_rOValue.data(), sal_Int32(io_rOValue.size()) );
1405 rtl_cipher_destroyARCFOUR( aCipher );
1417 sal_Int32 i_nKeyLength,
1418 sal_Int32 i_nAccessPermissions
1421 bool bSuccess =
true;
1426 rtlCipher aCipher = rtl_cipher_createARCFOUR( rtl_Cipher_ModeStream );
1433 for( sal_Int32
i = i_nKeyLength,
y = 0;
y < 5 ;
y++ )
1444 ::std::vector<unsigned char>
const nMD5Sum(aDigest.
finalize());
1446 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1448 rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum.data(), nMD5Sum.size(),
1455 for(
i = 1;
i <= 19;
i++ )
1457 for(
y = 0;
y <
sizeof( nLocalKey ) ;
y++ )
1460 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
1474 rtl_cipher_destroyARCFOUR( aCipher );
1477 io_rProperties.
UValue.clear();
1485 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
1486 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1489 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1490 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1491 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1492 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1493 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1497 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1498 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1500 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1508 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1509 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1510 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1511 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1512 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1513 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1514 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1515 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1516 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1519 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1520 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,
1525 return (i_pLine[ i_nIndex/8 ] & (0x80 >> (i_nIndex&7))) != 0;
1541 while( nBitInByte != 8 )
1543 if( (nByte & nMask) != (i_bSet ? nMask : 0) )
1544 return std::min(
nIndex, i_nW);
1571 while( nByte == nRunByte )
1585 nIndex += pRunTable[nByte];
1588 return std::min(
nIndex, i_nW);
1593 if (i_nStartIndex < 0)
1601 if (i_nStartIndex < 0)
1604 const bool bSet = i_nStartIndex < i_nW &&
isSet(i_pLine, i_nStartIndex);
1621 void flush() { mnNextBitPos = 8; mnBuffer = 0; }
1633 assert(i_nLength < 9);
1634 static const unsigned int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
1648 sal_uInt32 mnEncodedPixels;
1649 sal_uInt32 mnCodeBits;
1875 while( i_nSpan > 2623 )
1878 putG4Bits( pTable[103].mnCodeBits, pTable[103].mnCode, io_rState );
1879 i_nSpan -= pTable[103].mnEncodedPixels;
1884 sal_uInt32 nTabIndex = 63 + (i_nSpan >> 6);
1885 OSL_ASSERT( pTable[nTabIndex].mnEncodedPixels ==
static_cast<sal_uInt32
>(64*(i_nSpan >> 6)) );
1886 putG4Bits( pTable[nTabIndex].mnCodeBits, pTable[nTabIndex].mnCode, io_rState );
1887 i_nSpan -= pTable[nTabIndex].mnEncodedPixels;
1889 putG4Bits( pTable[i_nSpan].mnCodeBits, pTable[i_nSpan].mnCode, io_rState );
1896 if( nW <= 0 || nH <= 0 )
1904 std::unique_ptr<sal_uInt8[]> pFirstRefLine(
new sal_uInt8[nW/8 + 1]);
1905 memset(pFirstRefLine.get(), 0, nW/8 + 1);
1906 Scanline pRefLine = pFirstRefLine.get();
1911 bool bRunSet = (*pCurLine & 0x80) != 0;
1912 bool bRefSet = (*pRefLine & 0x80) != 0;
1915 for( ; nLineIndex < nW; )
1918 if( nRefIndex2 >= nRunIndex1 )
1921 if( -3 <= nDiff && nDiff <= 3 )
1925 sal_uInt32 mnCodeBits;
1927 } VerticalCodes[7] = {
1940 putG4Bits( VerticalCodes[nDiff].mnCodeBits, VerticalCodes[nDiff].mnCode, aBitState );
1941 nLineIndex = nRunIndex1;
1948 bool bWhiteFirst = ( nLineIndex + nRunIndex1 == 0 || !
isSet( pCurLine, nLineIndex ) );
1949 putG4Span( nRunIndex1 - nLineIndex, bWhiteFirst, aBitState );
1950 putG4Span( nRunIndex2 - nRunIndex1, ! bWhiteFirst, aBitState );
1951 nLineIndex = nRunIndex2;
1957 nLineIndex = nRefIndex2;
1959 if( nLineIndex < nW )
1961 bool bSet =
isSet( pCurLine, nLineIndex );
1962 nRunIndex1 =
findBitRun( pCurLine, nLineIndex, nW, bSet );
1963 nRefIndex1 =
findBitRun( pRefLine, nLineIndex, nW, ! bSet );
1964 nRefIndex1 =
findBitRun( pRefLine, nRefIndex1, nW, bSet );
1969 pRefLine = pCurLine;
1989 case css::awt::GradientStyle_LINEAR:
1990 case css::awt::GradientStyle_AXIAL:
void BlendWith(const AlphaMask &rOther)
const AlphaMask & GetAlphaMask() const
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
bool Convert(BmpConversion eConversion)
Convert bitmap format.
BitmapChecksum GetChecksum() const
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
Bitmap GetBitmap(Color aTransparentReplaceColor) const
const MapMode & GetPrefMapMode() const
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
const Size & GetPrefSize() const
const Size & GetSizePixel() const
tools::Long Height() const
tools::Long Width() const
sal_uInt16 GetBitCount() const
Scanline GetScanline(tools::Long nY) const
bool Invert()
Perform the Invert operation on every pixel.
sal_uInt8 GetLuminance() const
static std::map< sal_IntPtr, EncHashTransporter * > sTransporters
virtual uno::Any SAL_CALL getMaterial() override
std::vector< sal_uInt8 > maOValue
virtual ~EncHashTransporter() override
::std::unique_ptr<::comphelper::Hash > m_pDigest
static EncHashTransporter * getEncHashTransporter(const uno::Reference< beans::XMaterialHolder > &)
std::vector< sal_uInt8 > & getOValue()
::comphelper::Hash * getUDigest()
GfxLinkType GetType() const
void AddGradientActions(tools::Rectangle const &rRect, GDIMetaFile &rMetaFile)
const Color & GetEndColor() const
const Color & GetStartColor() const
css::awt::GradientStyle GetStyle() const
sal_uInt16 GetSteps() const
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
GraphicType GetType() const
GfxLink GetGfxLink() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void SetOrigin(const Point &rOrigin)
void SetScaleY(const Fraction &rScaleY)
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
TextAlign GetTextAlign() const
sal_Int32 GetIndex() const
const KernArray & GetDXArray() const
const OUString & GetText() const
const Point & GetPoint() const
const std::vector< sal_Bool > & GetKashidaArray() const
const Color & GetColor() const
const Color & GetColor() const
LanguageType GetTextLanguage() const
const Point & GetStartPoint() const
tools::Long GetWidth() const
FontLineStyle GetUnderline() const
FontLineStyle GetOverline() const
FontStrikeout GetStrikeout() const
const Color & GetColor() const
DrawTextFlags GetStyle() const
const tools::Rectangle & GetRect() const
const OUString & GetText() const
void EnableOutput(bool bEnable=true)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void ReleaseFontCollection()
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual void ImplClearFontData(bool bNewFontLists)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void SetFontCollectionFromSVData()
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void disposeAndReset(reference_type *pBody)
Assignment that releases the last reference.
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual sal_uInt64 TellEnd() override
void SetCompressMode(SvStreamCompressFlags nNewMode)
SvStreamCompressFlags GetCompressMode() const
void SetVersion(sal_Int32 n)
Encapsulates geometry and associated attributes of a filled area.
FillRule getFillRule() const
Get fill rule used.
@ fillEvenOdd
Even-odd fill rule.
double getTransparency() const
Get stroke transparency.
FillType getFillType() const
Get fill type used.
void getPath(tools::PolyPolygon &) const
Query path to fill.
@ fillSolid
Fill with a specified solid color.
Encapsulates geometry and associated attributes of a graphical 'pen stroke'.
double getMiterLimit() const
Get the maximum length of mitered joins.
void getPath(tools::Polygon &) const
Query path to stroke.
void getStartArrow(tools::PolyPolygon &) const
Get the polygon that is put at the start of the line.
JoinType getJoinType() const
Get the style in which the stroke segments are joined.
void getEndArrow(tools::PolyPolygon &) const
Get the polygon that is put at the end of the line.
void getDashArray(DashArray &) const
Get an array of "on" and "off" lengths for stroke dashing.
@ capRound
Half-round cap at the line end, the center lying at the end point.
@ capButt
No additional cap.
@ capSquare
Half-square cap at the line end, the center lying at the end point.
double getTransparency() const
Get stroke transparency.
CapType getCapType() const
Get the style in which open stroke ends are drawn.
double getStrokeWidth() const
Get width of the stroke.
::std::vector< double > DashArray
@ joinBevel
Connect segments by a direct straight line.
@ joinNone
Perform no join, leads to visible gaps between thick line segments.
@ joinRound
Connect segments by a filled round arc.
@ joinMiter
Extend segment edges, until they cross.
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
reference_type * get() const
Get the body.
virtual bool AcquireGraphics() const override
Acquire a graphics device that the output device uses to draw on.
std::vector< unsigned char > finalize()
static std::vector< unsigned char > calculateHash(const unsigned char *pInput, size_t length, HashType eType)
void update(const unsigned char *pInput, size_t length)
void insert(key_value_pair_t &rPair)
list_const_iterator_t end() const
list_const_iterator_t find(const Key &key)
bool PlaySyncPageAct(PDFWriter &rWriter, sal_uInt32 &rCurGDIMtfAction, const GDIMetaFile &rMtf)
const Graphic & GetCurrentGraphic() const
static bool computeODictionaryValue(const sal_uInt8 *i_pPaddedOwnerPassword, const sal_uInt8 *i_pPaddedUserPassword, std::vector< sal_uInt8 > &io_rOValue, sal_Int32 i_nKeyLength)
void putG4Bits(sal_uInt32 i_nLength, sal_uInt32 i_nCode, BitStreamState &io_rState)
void enableStringEncryption(sal_Int32 nObject)
void ImplRefreshFontData(bool bNewFontLists) override
static css::uno::Reference< css::beans::XMaterialHolder > initEncryption(const OUString &i_rOwnerPassword, const OUString &i_rUserPassword)
static void padPassword(std::u16string_view i_rPassword, sal_uInt8 *o_pPaddedPW)
sal_Int32 m_nRC4KeyLength
static sal_Int32 computeAccessPermissions(const vcl::PDFWriter::PDFEncryptionProperties &i_rProperties, sal_Int32 &o_rKeyLength, sal_Int32 &o_rRC4KeyLength)
static bool computeEncryptionKey(EncHashTransporter *, vcl::PDFWriter::PDFEncryptionProperties &io_rProperties, sal_Int32 i_nAccessPermissions)
void DrawHatchLine_DrawLine(const Point &rStartPoint, const Point &rEndPoint) override
void writeG4Stream(BitmapReadAccess const *i_pBitmap)
PDFWriter::PDFWriterContext m_aContext
void checkAndEnableStreamEncryption(sal_Int32 nObject) override
void ImplClearFontData(bool bNewFontLists) override
bool m_bEncryptThisStream
bool writeBufferBytes(const void *pBuffer, sal_uInt64 nBytes) override
See vcl::PDFObjectContainer::writeBuffer().
o3tl::lru_map< BitmapChecksum, std::shared_ptr< SvMemoryStream > > m_aPDFBmpCache
Cache some most recent bitmaps we've exported, in case we encounter them again..
void playMetafile(const GDIMetaFile &, vcl::PDFExtOutDevData *, const vcl::PDFWriter::PlayMetafileContext &, VirtualDevice *pDummyDev=nullptr)
void implWriteGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient, VirtualDevice *pDummyVDev, const vcl::PDFWriter::PlayMetafileContext &)
void drawLine(const Point &rStart, const Point &rStop)
void putG4Span(tools::Long i_nSpan, bool i_bWhitePixel, BitStreamState &io_rState)
bool prepareEncryption(const css::uno::Reference< css::beans::XMaterialHolder > &)
vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override
Perform actual rect clip against outdev dimensions, to generate empty clips whenever one of the value...
void implWriteBitmapEx(const Point &rPoint, const Size &rSize, const BitmapEx &rBitmapEx, const Graphic &i_pGraphic, VirtualDevice const *pDummyVDev, const vcl::PDFWriter::PlayMetafileContext &)
static bool computeUDictionaryValue(EncHashTransporter *i_pTransporter, vcl::PDFWriter::PDFEncryptionProperties &io_rProperties, sal_Int32 i_nKeyLength, sal_Int32 i_nAccessPermissions)
static const sal_uInt8 s_nPadString[ENCRYPTED_PWD_SIZE]
void DrawPolygon(const tools::Polygon &rPoly)
void DrawEllipse(const tools::Rectangle &rRect)
void SetFillColor(const Color &rColor)
void DrawPie(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void DrawChord(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void SetFont(const vcl::Font &rNewFont)
void DrawHatch(const tools::PolyPolygon &rPolyPoly, const Hatch &rHatch)
void SetTextAlign(::TextAlign eAlign)
void SetTextColor(const Color &rColor)
void DrawTextLine(const Point &rPos, tools::Long nWidth, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline)
void DrawStretchText(const Point &rStartPt, sal_Int32 nWidth, const OUString &rStr, sal_Int32 nIndex, sal_Int32 nLen)
void Push(PushFlags nFlags=PushFlags::ALL)
void DrawPolyLine(const tools::Polygon &rPoly)
void SetDigitLanguage(LanguageType eLang)
void BeginTransparencyGroup()
Start a transparency group.
void DrawTextArray(const Point &rStartPt, const OUString &rStr, KernArraySpan aKernArray, o3tl::span< const sal_Bool > pKashidaAry, sal_Int32 nIndex, sal_Int32 nLen)
void DrawTransparent(const tools::PolyPolygon &rPolyPoly, sal_uInt16 nTransparencePercent)
void DrawJPGBitmap(SvStream &rJPGData, bool bIsTrueColor, const Size &rSrcSizePixel, const tools::Rectangle &rTargetArea, const AlphaMask &rAlphaMask, const Graphic &rGraphic)
Insert a JPG encoded image (optionally with mask)
void DrawText(const Point &rPos, const OUString &rText)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void IntersectClipRegion(const tools::Rectangle &rRect)
void DrawPixel(const Point &rPt, const Color &rColor)
void DrawBitmapEx(const Point &rDestPt, const Size &rDestSize, const BitmapEx &rBitmapEx)
void SetMapMode(const MapMode &rNewMapMode)
void DrawRect(const tools::Rectangle &rRect)
void SetLineColor(const Color &rColor)
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nMode)
void EndTransparencyGroup(const tools::Rectangle &rBoundRect, sal_uInt16 nTransparencePercent)
End a transparency group with constant transparency factor.
void DrawBitmap(const Point &rDestPt, const Size &rDestSize, const Bitmap &rBitmap, const Graphic &rGraphic)
void DrawGradient(const tools::Rectangle &rRect, const Gradient &rGradient)
void MoveClipRegion(tools::Long nHorzMove, tools::Long nVertMove)
void DrawPolyPolygon(const tools::PolyPolygon &rPolyPoly)
void DrawArc(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
void DrawWallpaper(const tools::Rectangle &rRect, const Wallpaper &rWallpaper)
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
GfxLinkType
GfxLink graphic types that are supported by GfxLink.
tools::Long FRound(double fVal)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
Reference< XComponentContext > getProcessComponentContext()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const PixelCode WhitePixelCodes[]
const PixelCode BlackPixelCodes[]
static bool lcl_canUsePDFAxialShading(const Gradient &rGradient)
static tools::Long findBitRun(const Scanline i_pLine, tools::Long i_nStartIndex, tools::Long i_nW, bool i_bSet)
static tools::Long findBitRunImpl(const Scanline i_pLine, tools::Long i_nStartIndex, tools::Long i_nW, bool i_bSet)
const tools::Long setRun[256]
const tools::Long unsetRun[256]
static bool isSet(const Scanline i_pLine, tools::Long i_nIndex)
constexpr sal_Int32 MAXIMUM_RC4_KEY_LENGTH
constexpr sal_Int32 MD5_DIGEST_SIZE
constexpr sal_Int32 ENCRYPTED_PWD_SIZE
constexpr sal_Int32 SECUR_128BIT_KEY
#define STREAM_SEEK_TO_END
const sal_uInt8 & getByte() const
std::vector< double > m_aDashArray
std::vector< sal_uInt8 > UValue
std::vector< sal_uInt8 > DocumentIdentifier
std::vector< sal_uInt8 > EncryptionKey
std::vector< sal_uInt8 > OValue
bool CanExtractForAccessibility
PDFWriter::PDFEncryptionProperties Encryption
PDFWriter::ColorMode ColorMode
Play a metafile like an outputdevice would do.
int m_nMaxImageResolution
bool m_bTransparenciesWereRemoved
bool m_bOnlyLosslessCompression