21#include <rtl/math.hxx>
23#include <osl/diagnose.h>
47#include <com/sun/star/beans/XFastPropertySet.hpp>
71 CopyPixel( aDestRect, aSrcRect, &rBitmapEx );
100 SAL_WARN_IF( !bSuccess,
"vcl",
"BitmapEx::BitmapEx(): could not load image " << rIconName <<
" via icon theme " << aIconTheme);
105 maBitmapSize ( maBitmap.GetSizePixel() )
111 maBitmapSize ( maBitmap.GetSizePixel() )
116 assert(
typeid(rMask) !=
typeid(
AlphaMask)
117 &&
"If this mask is actually an AlphaMask, then it will be inverted unnecessarily "
118 "and the alpha channel will be wrong");
135 SAL_WARN(
"vcl",
"BitmapEx: forced mask to monochrome");
144 OSL_ENSURE(
false,
"Mask size differs from Bitmap size, corrected Mask (!)");
151 maAlphaMask ( rAlphaMask.ImplGetBitmap() ),
152 maBitmapSize ( maBitmap.GetSizePixel() )
156 OSL_ENSURE(
false,
"Alpha size differs from Bitmap size, corrected Mask (!)");
164 maBitmapSize ( maBitmap.GetSizePixel() )
169 "BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask.");
299 "BitmapEx::Scale(): size mismatch for bitmap and alpha mask." );
357 "BitmapEx::Rotate(): size mismatch for bitmap and alpha mask.");
377 "BitmapEx::Crop(): size mismatch for bitmap and alpha mask.");
406 "BitmapEx::Expand(): size mismatch for bitmap and alpha mask.");
414 if( !pBmpExSrc || pBmpExSrc->
IsEmpty() )
440 std::optional<AlphaMask> pAlpha(std::in_place,
GetSizePixel(), &nTransparencyOpaque);
491 maBitmap.
Replace( pSearchColors, pReplaceColors, nColorCount,
nullptr );
495 short nChannelRPercent,
short nChannelGPercent,
short nChannelBPercent,
496 double fGamma,
bool bInvert,
bool msoBrightness )
499 nChannelRPercent, nChannelGPercent, nChannelBPercent,
500 fGamma, bInvert, msoBrightness );
509 const Point& rDestPt,
const Size& rDestSize )
const
516 Point aEmptyPoint(0,0);
523 if (imgOldWidth >= aStandardSize || imgOldHeight >= aStandardSize)
525 sal_Int32 imgNewWidth = 0;
526 sal_Int32 imgNewHeight = 0;
527 if (imgOldWidth >= imgOldHeight)
529 imgNewWidth = aStandardSize;
530 imgNewHeight = sal_Int32(imgOldHeight / (imgOldWidth / aStandardSize) + 0.5);
532 imgposY = (aStandardSize - (imgOldHeight / (imgOldWidth / aStandardSize) + 0.5)) / 2 + 0.5;
536 imgNewHeight = aStandardSize;
537 imgNewWidth = sal_Int32(imgOldWidth / (imgOldHeight / aStandardSize) + 0.5);
539 imgposX = (aStandardSize - (imgOldWidth / (imgOldHeight / aStandardSize) + 0.5)) / 2 + 0.5;
542 Size aScaledSize( imgNewWidth, imgNewHeight );
547 imgposX = (aStandardSize - imgOldWidth) / 2 + 0.5;
548 imgposY = (aStandardSize - imgOldHeight) / 2 + 0.5;
551 Size aStdSize( aStandardSize, aStandardSize );
555 aVirDevice->SetOutputSizePixel( aStdSize );
560 aVirDevice->DrawRect( aRect );
562 aVirDevice->DrawBitmapEx( aPointPixel, aRet );
563 aRet = aVirDevice->GetBitmapEx( aEmptyPoint, aStdSize );
611 aColor.
SetAlpha(pAlphaReadAccess->GetPixel(nY, nX).GetIndex());
622bool BitmapEx::Create(
const css::uno::Reference< css::rendering::XBitmapCanvas > &xBitmapCanvas,
625 uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
626 if( xFastPropertySet )
629 uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
630 std::unique_ptr<BitmapEx> xBitmapEx(
reinterpret_cast<BitmapEx*
>(*o3tl::doAccess<sal_Int64>(aAny)));
638 std::shared_ptr<SalBitmap> pSalBmp;
639 std::shared_ptr<SalBitmap> pSalMask;
643 Size aLocalSize(rSize);
644 if( pSalBmp->Create( xBitmapCanvas, aLocalSize ) )
647 if ( pSalMask->Create( xBitmapCanvas, aLocalSize,
true ) )
664 Bitmap impTransformBitmap(
666 const Size& rDestinationSize,
679 const Size aDestinationSizePixel(aDestination.GetSizePixel());
684 Scanline pScanline = xWrite->GetScanline( y );
691 xWrite->SetPixelOnData(
694 xRead->GetInterpolatedColorWithFallback(
703 xWrite->SetPixelOnData(
706 xRead->GetColorWithFallback(
726 double fRotate, fShearX;
727 rTransformation.
decompose(aScale, aTranslate, fRotate, fShearX);
733 fRotate = fmod( fRotate, 2 * M_PI );
738 if (!rtl::math::approxEqual(fRotate, 0)
739 && !rtl::math::approxEqual(fRotate, M_PI_2)
740 && !rtl::math::approxEqual(fRotate, M_PI)
741 && !rtl::math::approxEqual(fRotate, 3 * M_PI_2))
746 if (!rtl::math::approxEqual(fShearX, 0))
760 if(fWidth <= 1 || fHeight <= 1)
765 bool bSmooth = implTransformNeedsSmooth(rTransformation);
766 const Bitmap aDestination(impTransformBitmap(
GetBitmap(), aDestinationSize, rTransformation, bSmooth));
781 double fMaximumArea)
const
791 if(!nSourceWidth || !nSourceHeight)
797 aOutlineRange.
transform(rTransformation);
808 double fWidth(aVisibleRange.
getWidth());
809 double fHeight(aVisibleRange.
getHeight());
811 if(fWidth < 1.0 || fHeight < 1.0)
817 const double fArea(fWidth * fHeight);
819 double fReduceFactor(1.0);
823 fReduceFactor = sqrt(fMaximumArea / fArea);
824 fWidth *= fReduceFactor;
825 fHeight *= fReduceFactor;
833 1.0 / nSourceHeight));
837 aTransform = rTransformation * aTransform;
847 aTransform.
scale(fReduceFactor, fReduceFactor);
864 for(sal_uInt32
a(rBColorModifierStack.
count());
a && !bDone; )
881 OSL_ENSURE(xReadAccess,
"Got no Bitmap ReadAccess ?!?");
909 const double fConvertColor(1.0 / 255.0);
911 if(xContent->HasPalette())
913 const sal_uInt16
nCount(xContent->GetPaletteEntryCount());
915 for(sal_uInt16 b(0); b <
nCount; b++)
917 const BitmapColor& rCol = xContent->GetPaletteColor(b);
919 rCol.
GetRed() * fConvertColor,
921 rCol.
GetBlue() * fConvertColor);
930 Scanline pScan = xContent->GetScanline(
y);
935 *(pScan + 2)* fConvertColor,
936 *(pScan + 1) * fConvertColor,
937 *pScan * fConvertColor);
949 Scanline pScan = xContent->GetScanline(
y);
954 *pScan * fConvertColor,
955 *(pScan + 1) * fConvertColor,
956 *(pScan + 2) * fConvertColor);
968 Scanline pScanline = xContent->GetScanline(
y );
973 static_cast<double>(aBMCol.
GetRed()) * fConvertColor,
974 static_cast<double>(aBMCol.
GetGreen()) * fConvertColor,
975 static_cast<double>(aBMCol.
GetBlue()) * fConvertColor);
1006 Color aColorTopLeft,
1007 Color aColorBottomRight)
1009 const sal_uInt32 nW(rSize.
Width());
1010 const sal_uInt32 nH(rSize.
Height());
1014 Color aColTopRight(aColorTopLeft);
1015 Color aColBottomLeft(aColorTopLeft);
1016 const sal_uInt32 nDE(nW + nH);
1018 aColTopRight.
Merge(aColorBottomRight, 255 -
sal_uInt8((nW * 255) / nDE));
1019 aColBottomLeft.
Merge(aColorBottomRight, 255 -
sal_uInt8((nH * 255) / nDE));
1021 return createBlendFrame(rSize, nAlpha, aColorTopLeft, aColTopRight, aColorBottomRight, aColBottomLeft);
1030 Color aColorTopLeft,
1031 Color aColorTopRight,
1032 Color aColorBottomRight,
1033 Color aColorBottomLeft)
1036 nAlpha = 255 - nAlpha;
1060 if(nW > 1 && nH > 1)
1071 if(pContent && pAlpha)
1075 Scanline pScanContent = pContent->GetScanline( 0 );
1076 Scanline pScanAlpha = pContent->GetScanline( 0 );
1079 pContent->SetPixelOnData(pScanContent, 0, aColorTopLeft);
1080 pAlpha->SetPixelOnData(pScanAlpha, 0,
BitmapColor(nAlpha));
1083 for(
x = 1;
x < nW - 1;
x++)
1085 Color aMix(aColorTopLeft);
1088 pContent->SetPixelOnData(pScanContent,
x, aMix);
1089 pAlpha->SetPixelOnData(pScanAlpha,
x,
BitmapColor(nAlpha));
1096 pContent->SetPixelOnData(pScanContent,
x, aColorTopRight);
1097 pAlpha->SetPixelOnData(pScanAlpha,
x,
BitmapColor(nAlpha));
1101 for(
y = 1;
y < nH - 1;
y++)
1103 pScanContent = pContent->GetScanline(
y );
1104 pScanAlpha = pContent->GetScanline(
y );
1105 Color aMixA(aColorTopLeft);
1108 pContent->SetPixelOnData(pScanContent, 0, aMixA);
1109 pAlpha->SetPixelOnData(pScanAlpha, 0,
BitmapColor(nAlpha));
1114 Color aMixB(aColorTopRight);
1117 pContent->SetPixelOnData(pScanContent,
x, aMixB);
1118 pAlpha->SetPixelOnData(pScanAlpha,
x,
BitmapColor(nAlpha));
1126 pContent->SetPixelOnData(pScanContent, 0, aColorBottomLeft);
1127 pAlpha->SetPixelOnData(pScanAlpha, 0,
BitmapColor(nAlpha));
1130 for(
x = 1;
x < nW - 1;
x++)
1132 Color aMix(aColorBottomLeft);
1135 pContent->SetPixelOnData(pScanContent,
x, aMix);
1136 pAlpha->SetPixelOnData(pScanAlpha,
x,
BitmapColor(nAlpha));
1143 pContent->SetPixelOnData(pScanContent,
x, aColorBottomRight);
1144 pAlpha->SetPixelOnData(pScanAlpha,
x,
BitmapColor(nAlpha));
1159 const Color& rReplaceColor,
1166 const Color* pReplaceColors,
1170 maBitmap.
Replace( pSearchColors, pReplaceColors, nColorCount, pTols );
1185 constexpr sal_uInt8 cEdgeDetectThreshold = 128;
1188 if( ( aSize.
Width() <= 2 ) || ( aSize.
Height() <= 2 ) )
1197 pVirDev->SetOutputSizePixel(aSize);
1213 pVirDev->DrawLine(
Point(),
Point( nWidth - 1, 0L ) );
1214 pVirDev->DrawLine(
Point( nWidth - 1, 0L ),
Point( nWidth - 1, nHeight - 1 ) );
1215 pVirDev->DrawLine(
Point( nWidth - 1, nHeight - 1 ),
Point( 0L, nHeight - 1 ) );
1216 pVirDev->DrawLine(
Point( 0, nHeight - 1 ),
Point() );
1218 for(
tools::Long nY = 0, nY1 = 1, nY2 = 2; nY < nHeight2; nY++, nY1++, nY2++ )
1223 for(
tools::Long nX = 0, nXDst = 1, nXTmp; nX < nWidth2; nX++, nXDst++ )
1246 if( ( nSum1 * nSum1 + nSum2 * nSum2 ) < lThres2 )
1255 Bitmap aRetBmp = pVirDev->GetBitmap(
Point(0,0), aSize);
1276 if( pWorkRectPixel )
1284 if( bContourEdgeDetect )
1294 if (pAcc && nWidth && nHeight)
1297 const double fFactorX =
static_cast<double>(rPrefSize.
Width()) / nWidth;
1298 const double fFactorY =
static_cast<double>(rPrefSize.
Height()) / nHeight;
1304 std::unique_ptr<Point[]> pPoints1;
1305 std::unique_ptr<Point[]> pPoints2;
1307 sal_uInt16 nPolyPos = 0;
1310 pPoints1.reset(
new Point[ nHeight ]);
1311 pPoints2.reset(
new Point[ nHeight ]);
1313 for ( nY = nStartY1; nY < nEndY1; nY++ )
1319 while( nX < nEndX1 )
1323 pPoints1[ nPolyPos ] =
Point( nX, nY );
1331 pPoints2[ nPolyPos ] =
Point( nX, nY );
1346 const sal_uInt16 nNewSize1 = nPolyPos << 1;
1349 aRetPoly.
SetSize( nNewSize1 + 1 );
1350 aRetPoly[ nNewSize1 ] = aRetPoly[ 0 ];
1352 for( sal_uInt16 j = nPolyPos; nPolyPos < nNewSize1; )
1353 aRetPoly[ nPolyPos++ ] = pPoints2[ --j ];
1355 if( ( fFactorX != 0. ) && ( fFactorY != 0. ) )
1356 aRetPoly.
Scale( fFactorX, fFactorY );
1370 assert( pReadAccess.
get() && pAlphaWriteAccess.
get() );
1371 if ( !(pReadAccess.
get() && pAlphaWriteAccess.
get()) )
1376 Scanline pScanline = pAlphaWriteAccess->GetScanline( nY );
1381 if ( cIndex == cIndexFrom )
1382 pAlphaWriteAccess->SetPixelOnData( pScanline, nX,
BitmapColor(nAlphaTo) );
1406 const tools::Long nWidth = pA->Width(), nHeight = pA->Height();
1412 Scanline pAScan = pA->GetScanline( nY );
1416 sal_uLong nNewTrans = nTrans + (255 - *pAScan);
1418 nNewTrans = ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans;
1419 *pAScan++ =
static_cast<sal_uInt8>( 255 - nNewTrans );
1429 Scanline pScanline = pA->GetScanline( nY );
1432 sal_uLong nNewTrans = nTrans + (255 - pA->GetIndexFromData( pScanline, nX ));
1434 nNewTrans = ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans;
1437 pA->SetPixelOnData( pScanline, nX, aAlphaValue );
1457 sal_uInt32& rnRedMask, sal_uInt32& rnGreenMask, sal_uInt32& rnBlueMask, sal_uInt32& rnAlphaMask, sal_uInt32& rnTransparencyIndex,
1458 sal_uInt32& rnWidth, sal_uInt32& rnHeight,
sal_uInt8& rnBitCount)
1461 assert( pReadAccess );
1469 rRGBPalette = css::uno::Sequence< sal_Int32 >( nPalCount + 1 );
1471 sal_Int32* pTmp = rRGBPalette.getArray();
1473 for( sal_uInt32
i = 0;
i < nPalCount;
i++, pTmp++ )
1477 *pTmp =
static_cast<sal_Int32
>(rCol.
GetRed()) << sal_Int32(24);
1478 *pTmp |=
static_cast<sal_Int32
>(rCol.
GetGreen()) << sal_Int32(16);
1479 *pTmp |=
static_cast<sal_Int32
>(rCol.
GetBlue()) << sal_Int32(8);
1480 *pTmp |= sal_Int32(0x000000ffL);
1486 *pTmp = sal_Int32(0xffffff00L);
1487 rnTransparencyIndex = nPalCount;
1491 rnTransparencyIndex = 0;
1496 rnRedMask = 0xff000000UL;
1497 rnGreenMask = 0x00ff0000UL;
1498 rnBlueMask = 0x0000ff00UL;
1499 rnAlphaMask = 0x000000ffUL;
1500 rnTransparencyIndex = 0;
1503 rnWidth = pReadAccess->
Width();
1504 rnHeight = pReadAccess->
Height();
1513 sPath = OUString::fromUtf8(pFileName);
1515 else if (
const char* pEnv = std::getenv(
"VCL_DUMP_BMP_PATH"))
1517 sPath = OUString::fromUtf8(pEnv);
1521 sPath =
"file:///tmp/bitmap.png";
1523 SvFileStream aStream(sPath, StreamMode::STD_READWRITE | StreamMode::TRUNC);
1524 assert(aStream.
good());
1526 aWriter.
write(*
this);
static Bitmap DetectEdges(const Bitmap &rBmp)
BitmapEx createBlendFrame(const Size &rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorBottomRight)
Create a blend frame as BitmapEx.
#define BITMAP_CHECKSUM_SIZE
sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE]
sal_uInt64 BitmapChecksum
void BCToBCOA(BitmapChecksum n, BitmapChecksumOctetArray p)
BitmapChecksum vcl_get_checksum(BitmapChecksum Checksum, const void *Data, sal_uInt32 DatLen)
const StyleSettings & GetStyleSettings() const
SAL_DLLPRIVATE const Bitmap & ImplGetBitmap() const
void Erase(sal_uInt8 cTransparency)
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
static const AllSettings & GetSettings()
Gets the application's settings.
sal_uInt8 GetIndex() const
void SetIndex(sal_uInt8 cIndex)
tools::Polygon GetContour(bool bContourEdgeDetect, const tools::Rectangle *pWorkRect)
Get contours in image.
bool Invert()
Perform the Invert operation on every pixel.
const AlphaMask & GetAlphaMask() const
sal_Int64 GetSizeBytes() const
BitmapEx & operator=(const BitmapEx &rBitmapEx)
BitmapEx getTransformed(const basegfx::B2DHomMatrix &rTransformation, const basegfx::B2DRange &rVisibleRange, double fMaximumArea) const
Create transformed Bitmap.
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
void ChangeColorAlpha(sal_uInt8 cIndexFrom, sal_Int8 nAlphaTo)
void ReplaceTransparency(const Color &rColor)
Replace transparency with given color.
static BitmapEx AutoScaleBitmap(BitmapEx const &aBitmap, const tools::Long aStandardSize)
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
bool Convert(BmpConversion eConversion)
Convert bitmap format.
::Color GetPixelColor(sal_Int32 nX, sal_Int32 nY) const
Get pixel color (including alpha) at given position.
void Expand(sal_Int32 nDX, sal_Int32 nDY, bool bExpandTransparent=false)
Expand the bitmap by pixel padding.
bool Rotate(Degree10 nAngle10, const Color &rFillColor)
Rotate bitmap by the specified angle.
BitmapChecksum GetChecksum() const
BitmapEx TransformBitmapEx(double fWidth, double fHeight, const basegfx::B2DHomMatrix &rTransformation) const
Create transformed Bitmap.
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const BitmapEx *pBmpExSrc)
Copy a rectangular area from another bitmap.
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
bool operator==(const BitmapEx &rBitmapEx) const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
sal_uInt8 GetAlpha(sal_Int32 nX, sal_Int32 nY) const
Get alpha at given position.
void Replace(const Color &rSearchColor, const Color &rReplaceColor)
Replace all pixel having the search color with the specified color.
void CombineMaskOr(Color maskColor, sal_uInt8 nTol)
void loadFromIconTheme(const OUString &rIconName)
bool Create(const css::uno::Reference< css::rendering::XBitmapCanvas > &xBitmapCanvas, const Size &rSize)
populate from a canvas implementation
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
void AdjustTransparency(sal_uInt8 cTrans)
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
const Bitmap & GetBitmap() const
Gives direct access to the contained bitmap.
void SetSizePixel(const Size &rNewSize)
bool Adjust(short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma=1.0, bool bInvert=false, bool msoBrightness=false)
Change various global color characteristics.
BitmapEx ModifyBitmapEx(const basegfx::BColorModifierStack &rBColorModifierStack) const
Create ColorStack-modified version of this BitmapEx.
const Size & GetSizePixel() const
void GetColorModel(css::uno::Sequence< sal_Int32 > &rRGBPalette, sal_uInt32 &rnRedMask, sal_uInt32 &rnGreenMask, sal_uInt32 &rnBlueMask, sal_uInt32 &rnAlphaMask, sal_uInt32 &rnTransparencyIndex, sal_uInt32 &rnWidth, sal_uInt32 &rnHeight, sal_uInt8 &rnBitCount)
Retrieves the color model data we need for the XImageConsumer stuff.
void DumpAsPng(const char *pFileName=nullptr) const
Dumps the pixels as PNG in bitmap.png.
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
tools::Long Height() const
tools::Long Width() const
const BitmapPalette & GetPalette() const
BitmapColor GetBestMatchingColor(const BitmapColor &rBitmapColor) const
sal_uInt16 GetPaletteEntryCount() const
sal_uInt16 GetBitCount() const
const BitmapColor & GetPaletteColor(sal_uInt16 nColor) const
BitmapColor GetPixel(tools::Long nY, tools::Long nX) const
BitmapColor GetColor(tools::Long nY, tools::Long nX) const
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
sal_uInt8 GetIndexFromData(const sal_uInt8 *pData, tools::Long nX) const
Scanline GetScanline(tools::Long nY) const
bool CombineOr(const Bitmap &rMask)
Perform boolean OR operation with another bitmap.
sal_Int64 GetSizeBytes() const
void SetPrefMapMode(const MapMode &rMapMode)
bool Rotate(Degree10 nAngle10, const Color &rFillColor)
Rotate bitmap by the specified angle.
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
bool HasGreyPalette8Bit() const
Bitmap CreateMask(const Color &rTransColor) const
Create on-off mask from bitmap.
bool Convert(BmpConversion eConversion)
Convert bitmap format.
static const BitmapPalette & GetGreyPalette(int nEntries)
BitmapChecksum GetChecksum() const
bool Replace(const AlphaMask &rAlpha, const Color &rMergeColor)
Merge bitmap with given background color according to specified alpha mask.
const MapMode & GetPrefMapMode() const
Size GetSizePixel() const
static void ReleaseAccess(BitmapInfoAccess *pAccess)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
bool CopyPixel_AlphaOptimized(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc)
BitmapReadAccess * AcquireReadAccess()
bool Adjust(short nLuminancePercent, short nContrastPercent=0, short nChannelRPercent=0, short nChannelGPercent=0, short nChannelBPercent=0, double fGamma=1.0, bool bInvert=false, bool msoBrightness=false)
Change various global color characteristics.
void SetPrefSize(const Size &rSize)
bool Invert()
Perform the Invert operation on every pixel.
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc=nullptr)
Copy a rectangular area from another bitmap.
const Size & GetPrefSize() const
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
void AdaptBitCount(Bitmap &rNew) const
bool Expand(sal_Int32 nDX, sal_Int32 nDY, const Color *pInitColor=nullptr)
Expand the bitmap by pixel padding.
vcl::PixelFormat getPixelFormat() const
AlphaMask CreateAlphaMask(const Color &rTransColor) const
Create on-off alpha mask from bitmap.
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
sal_uInt8 GetBlue() const
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
sal_uInt8 GetAlpha() const
bool IsTransparent() const
sal_uInt8 GetGreen() const
void SetAlpha(sal_uInt8 nAlpha)
static VCL_DLLPUBLIC ImageTree & get()
VCL_DLLPUBLIC bool loadImage(OUString const &name, OUString const &style, BitmapEx &bitmap, bool localized, const ImageLoadFlags eFlags=ImageLoadFlags::NONE)
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
virtual std::shared_ptr< SalBitmap > CreateSalBitmap()=0
constexpr tools::Long Height() const
constexpr tools::Long Width() const
OUString DetermineIconTheme() const
Determine which icon theme should be used.
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void translate(double fX, double fY)
void scale(double fX, double fY)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
B2DVector getRange() const
B2DPoint getMinimum() const
const BColorModifierSharedPtr & getBColorModifier(sal_uInt32 nIndex) const
const ::basegfx::BColor & getBColor() const
bool write(const BitmapEx &rBitmap)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_ALPHA_OPAQUE(0xff, 0xff, 0xff)
constexpr ::Color COL_ALPHA_TRANSPARENT(0x00, 0x00, 0x00)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
std::shared_ptr< BColorModifier > BColorModifierSharedPtr
B2IRange fround(const B2DRange &rRange)
constexpr bool isPalettePixelFormat(PixelFormat ePixelFormat)
Is it a pixel format that forces creation of a palette.
PixelFormat
Pixel format of the bitmap in bits per pixel.
Color m_aLastColorTopLeft
Color m_aLastColorBottomRight
Color m_aLastColorTopRight
Color m_aLastColorBottomLeft
ImplSVData * ImplGetSVData()
BlendFrameCache * ImplGetBlendFrameCache()