21 #include <rtl/math.hxx>
23 #include <osl/diagnose.h>
44 #include <com/sun/star/beans/XFastPropertySet.hpp>
77 CopyPixel( aDestRect, aSrcRect, &rBitmapEx );
110 SAL_WARN_IF( !bSuccess,
"vcl",
"BitmapEx::BitmapEx(): could not load image " << rIconName <<
" via icon theme " << aIconTheme);
115 maBitmapSize ( maBitmap.GetSizePixel() ),
124 maBitmapSize ( maBitmap.GetSizePixel() ),
132 SAL_WARN(
"vcl",
"BitmapEx: forced mask to monochrome");
140 OSL_ENSURE(
false,
"Mask size differs from Bitmap size, corrected Mask (!)");
147 maMask ( rAlphaMask.ImplGetBitmap() ),
148 maBitmapSize ( maBitmap.GetSizePixel() ),
150 mbAlpha ( !rAlphaMask.IsEmpty() )
154 OSL_ENSURE(
false,
"Alpha size differs from Bitmap size, corrected Mask (!)");
161 maBitmapSize ( maBitmap.GetSizePixel() ),
162 maTransparentColor ( rTransparentColor ),
169 "BitmapEx::BitmapEx(): size mismatch for bitmap and alpha mask.");
245 aRetBmp.
Replace( aTempMask, aTransparentReplaceColor );
295 UInt32ToSVBT32( sal_uInt32(
mbAlpha), aBT32 );
359 "BitmapEx::Scale(): size mismatch for bitmap and alpha mask." );
423 "BitmapEx::Rotate(): size mismatch for bitmap and alpha mask.");
443 "BitmapEx::Crop(): size mismatch for bitmap and alpha mask.");
472 "BitmapEx::Expand(): size mismatch for bitmap and alpha mask.");
480 if( !pBmpExSrc || pBmpExSrc->
IsEmpty() )
507 maMask = pAlpha->ImplGetBitmap();
517 maMask = pAlpha->ImplGetBitmap();
600 maBitmap.
Replace( pSearchColors, pReplaceColors, nColorCount,
nullptr );
604 short nChannelRPercent,
short nChannelGPercent,
short nChannelBPercent,
605 double fGamma,
bool bInvert,
bool msoBrightness )
608 nChannelRPercent, nChannelGPercent, nChannelBPercent,
609 fGamma, bInvert, msoBrightness );
618 const Point& rDestPt,
const Size& rDestSize )
const
625 Point aEmptyPoint(0,0);
632 if (imgOldWidth >= aStandardSize || imgOldHeight >= aStandardSize)
634 sal_Int32 imgNewWidth = 0;
635 sal_Int32 imgNewHeight = 0;
636 if (imgOldWidth >= imgOldHeight)
638 imgNewWidth = aStandardSize;
639 imgNewHeight = sal_Int32(imgOldHeight / (imgOldWidth / aStandardSize) + 0.5);
641 imgposY = (aStandardSize - (imgOldHeight / (imgOldWidth / aStandardSize) + 0.5)) / 2 + 0.5;
645 imgNewHeight = aStandardSize;
646 imgNewWidth = sal_Int32(imgOldWidth / (imgOldHeight / aStandardSize) + 0.5);
648 imgposX = (aStandardSize - (imgOldWidth / (imgOldHeight / aStandardSize) + 0.5)) / 2 + 0.5;
651 Size aScaledSize( imgNewWidth, imgNewHeight );
656 imgposX = (aStandardSize - imgOldWidth) / 2 + 0.5;
657 imgposY = (aStandardSize - imgOldHeight) / 2 + 0.5;
660 Size aStdSize( aStandardSize, aStandardSize );
665 aVirDevice->SetOutputSizePixel( aStdSize );
670 aVirDevice->DrawRect( aRect );
671 Point aPointPixel( static_cast<tools::Long>(imgposX), static_cast<tools::Long>(imgposY) );
672 aVirDevice->DrawBitmapEx( aPointPixel, aRet );
673 aRet = aVirDevice->GetBitmapEx( aEmptyPoint, aStdSize );
725 nAlpha = 255 - aBitmapColor.
GetIndex();
729 if(0x00 == aBitmapColor.GetIndex())
757 aColor.
SetAlpha(255 - pAlphaReadAccess->GetPixel(nY, nX).GetIndex());
768 bool BitmapEx::Create(
const css::uno::Reference< css::rendering::XBitmapCanvas > &xBitmapCanvas,
771 uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
772 if( xFastPropertySet )
775 uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
776 std::unique_ptr<BitmapEx> xBitmapEx(reinterpret_cast<BitmapEx*>(*o3tl::doAccess<sal_Int64>(aAny)));
784 std::shared_ptr<SalBitmap> pSalBmp;
785 std::shared_ptr<SalBitmap> pSalMask;
789 Size aLocalSize(rSize);
790 if( pSalBmp->Create( xBitmapCanvas, aLocalSize ) )
793 if ( pSalMask->Create( xBitmapCanvas, aLocalSize,
true ) )
810 Bitmap impTransformBitmap(
812 const Size& rDestinationSize,
816 Bitmap aDestination(rDestinationSize, 24);
825 const Size aDestinationSizePixel(aDestination.GetSizePixel());
830 Scanline pScanline = xWrite->GetScanline( y );
837 xWrite->SetPixelOnData(
840 xRead->GetInterpolatedColorWithFallback(
849 xWrite->SetPixelOnData(
852 xRead->GetColorWithFallback(
872 double fRotate, fShearX;
873 rTransformation.
decompose(aScale, aTranslate, fRotate, fShearX);
879 fRotate = fmod( fRotate, F_2PI );
884 if (!rtl::math::approxEqual(fRotate, 0)
885 && !rtl::math::approxEqual(fRotate, F_PI2)
886 && !rtl::math::approxEqual(fRotate, F_PI)
887 && !rtl::math::approxEqual(fRotate, 3 * F_PI2))
892 if (!rtl::math::approxEqual(fShearX, 0))
906 if(fWidth <= 1 || fHeight <= 1)
911 bool bSmooth = implTransformNeedsSmooth(rTransformation);
912 const Bitmap aDestination(impTransformBitmap(
GetBitmap(), aDestinationSize, rTransformation, bSmooth));
924 const Bitmap aLclMask(impTransformBitmap(
GetMask(), aDestinationSize, rTransformation,
false));
925 return BitmapEx(aDestination, aLclMask);
935 double fMaximumArea)
const
945 if(!nSourceWidth || !nSourceHeight)
951 aOutlineRange.
transform(rTransformation);
962 double fWidth(aVisibleRange.
getWidth());
963 double fHeight(aVisibleRange.
getHeight());
965 if(fWidth < 1.0 || fHeight < 1.0)
971 const double fArea(fWidth * fHeight);
973 double fReduceFactor(1.0);
977 fReduceFactor = sqrt(fMaximumArea / fArea);
978 fWidth *= fReduceFactor;
979 fHeight *= fReduceFactor;
987 1.0 / nSourceHeight));
991 aTransform = rTransformation * aTransform;
1001 aTransform.scale(fReduceFactor, fReduceFactor);
1005 aTransform.invert();
1018 for(sal_uInt32
a(rBColorModifierStack.count());
a && !bDone; )
1021 const basegfx::BColorModifier_replace* pReplace =
dynamic_cast< const basegfx::BColorModifier_replace*
>(rModifier.get());
1035 OSL_ENSURE(xReadAccess,
"Got no Bitmap ReadAccess ?!?");
1047 aChangedBitmap.
Erase(
Color(pReplace->getBColor()));
1063 const double fConvertColor(1.0 / 255.0);
1069 for(sal_uInt16 b(0); b <
nCount; b++)
1073 rCol.
GetRed() * fConvertColor,
1075 rCol.
GetBlue() * fConvertColor);
1089 *(pScan + 2)* fConvertColor,
1090 *(pScan + 1) * fConvertColor,
1091 *pScan * fConvertColor);
1093 *pScan++ =
static_cast< sal_uInt8 >(aBDest.getBlue() * 255.0);
1094 *pScan++ =
static_cast< sal_uInt8 >(aBDest.getGreen() * 255.0);
1095 *pScan++ =
static_cast< sal_uInt8 >(aBDest.getRed() * 255.0);
1108 *pScan * fConvertColor,
1109 *(pScan + 1) * fConvertColor,
1110 *(pScan + 2) * fConvertColor);
1112 *pScan++ =
static_cast< sal_uInt8 >(aBDest.getRed() * 255.0);
1113 *pScan++ =
static_cast< sal_uInt8 >(aBDest.getGreen() * 255.0);
1114 *pScan++ =
static_cast< sal_uInt8 >(aBDest.getBlue() * 255.0);
1127 static_cast<double>(aBMCol.GetRed()) * fConvertColor,
1128 static_cast<double>(aBMCol.GetGreen()) * fConvertColor,
1129 static_cast<double>(aBMCol.GetBlue()) * fConvertColor);
1167 Color aColorTopLeft,
1168 Color aColorBottomRight)
1170 const sal_uInt32 nW(rSize.
Width());
1171 const sal_uInt32 nH(rSize.
Height());
1175 Color aColTopRight(aColorTopLeft);
1176 Color aColBottomLeft(aColorTopLeft);
1177 const sal_uInt32 nDE(nW + nH);
1179 aColTopRight.
Merge(aColorBottomRight, 255 -
sal_uInt8((nW * 255) / nDE));
1180 aColBottomLeft.
Merge(aColorBottomRight, 255 -
sal_uInt8((nH * 255) / nDE));
1182 return createBlendFrame(rSize, nAlpha, aColorTopLeft, aColTopRight, aColorBottomRight, aColBottomLeft);
1191 Color aColorTopLeft,
1192 Color aColorTopRight,
1193 Color aColorBottomRight,
1194 Color aColorBottomLeft)
1219 if(nW > 1 && nH > 1)
1222 Bitmap aContent(rSize, 24);
1230 if(pContent && pAlpha)
1242 for(x = 1; x < nW - 1; x++)
1244 Color aMix(aColorTopLeft);
1260 for(y = 1; y < nH - 1; y++)
1264 Color aMixA(aColorTopLeft);
1273 Color aMixB(aColorTopRight);
1289 for(x = 1; x < nW - 1; x++)
1291 Color aMix(aColorBottomLeft);
1293 aMix.
Merge(aColorBottomRight, 255 -
sal_uInt8(((x - 0)* 255) / nW));
1318 const Color& rReplaceColor,
1325 const Color* pReplaceColors,
1329 maBitmap.
Replace( pSearchColors, pReplaceColors, nColorCount, pTols );
1347 constexpr
sal_uInt8 cEdgeDetectThreshold = 128;
1351 if( ( aSize.Width() > 2 ) && ( aSize.Height() > 2 ) )
1360 pVirDev->SetOutputSizePixel(aSize);
1376 pVirDev->DrawLine(
Point(),
Point( nWidth - 1, 0L ) );
1377 pVirDev->DrawLine(
Point( nWidth - 1, 0L ),
Point( nWidth - 1, nHeight - 1 ) );
1378 pVirDev->DrawLine(
Point( nWidth - 1, nHeight - 1 ),
Point( 0L, nHeight - 1 ) );
1379 pVirDev->DrawLine(
Point( 0, nHeight - 1 ),
Point() );
1381 for(
tools::Long nY = 0, nY1 = 1, nY2 = 2; nY < nHeight2; nY++, nY1++, nY2++ )
1386 for(
tools::Long nX = 0, nXDst = 1, nXTmp; nX < nWidth2; nX++, nXDst++ )
1409 if( ( nSum1 * nSum1 + nSum2 * nSum2 ) < lThres2 )
1422 aRetBmp = pVirDev->GetBitmap(
Point(0,0), aSize);
1445 if( pWorkRectPixel )
1450 if( ( aWorkRect.GetWidth() > 4 ) && ( aWorkRect.GetHeight() > 4 ) )
1453 if( bContourEdgeDetect )
1463 if (pAcc && nWidth && nHeight)
1466 const double fFactorX =
static_cast<double>(rPrefSize.
Width()) / nWidth;
1467 const double fFactorY =
static_cast<double>(rPrefSize.
Height()) / nHeight;
1468 const tools::Long nStartX1 = aWorkRect.Left() + 1;
1473 std::unique_ptr<Point[]> pPoints1;
1474 std::unique_ptr<Point[]> pPoints2;
1476 sal_uInt16 nPolyPos = 0;
1479 pPoints1.reset(
new Point[ nHeight ]);
1480 pPoints2.reset(
new Point[ nHeight ]);
1482 for ( nY = nStartY1; nY < nEndY1; nY++ )
1488 while( nX < nEndX1 )
1492 pPoints1[ nPolyPos ] =
Point( nX, nY );
1500 pPoints2[ nPolyPos ] =
Point( nX, nY );
1515 const sal_uInt16 nNewSize1 = nPolyPos << 1;
1518 aRetPoly.
SetSize( nNewSize1 + 1 );
1519 aRetPoly[ nNewSize1 ] = aRetPoly[ 0 ];
1521 for( sal_uInt16 j = nPolyPos; nPolyPos < nNewSize1; )
1522 aRetPoly[ nPolyPos++ ] = pPoints2[ --j ];
1524 if( ( fFactorX != 0. ) && ( fFactorY != 0. ) )
1525 aRetPoly.
Scale( fFactorX, fFactorY );
1540 if ( !(pReadAccess.
get() && pWriteAccess.
get()) )
1550 if ( cIndex == cIndexFrom )
1590 nNewTrans = nTrans + *pAScan;
1591 *pAScan++ =
static_cast<sal_uInt8>( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans );
1605 aAlphaValue.
SetIndex( static_cast<sal_uInt8>( ( nNewTrans & 0xffffff00 ) ? 255 : nNewTrans ) );
1627 sal_uInt32& rnRedMask, sal_uInt32& rnGreenMask, sal_uInt32& rnBlueMask, sal_uInt32& rnAlphaMask, sal_uInt32& rnTransparencyIndex,
1628 sal_uInt32& rnWidth, sal_uInt32& rnHeight,
sal_uInt8& rnBitCount)
1639 rRGBPalette = css::uno::Sequence< sal_Int32 >( nPalCount + 1 );
1641 sal_Int32* pTmp = rRGBPalette.getArray();
1643 for( sal_uInt32
i = 0;
i < nPalCount;
i++, pTmp++ )
1647 *pTmp =
static_cast<sal_Int32
>(rCol.
GetRed()) << sal_Int32(24);
1648 *pTmp |=
static_cast<sal_Int32
>(rCol.
GetGreen()) << sal_Int32(16);
1649 *pTmp |=
static_cast<sal_Int32
>(rCol.
GetBlue()) << sal_Int32(8);
1650 *pTmp |= sal_Int32(0x000000ffL);
1656 *pTmp = sal_Int32(0xffffff00L);
1657 rnTransparencyIndex = nPalCount;
1661 rnTransparencyIndex = 0;
1666 rnRedMask = 0xff000000UL;
1667 rnGreenMask = 0x00ff0000UL;
1668 rnBlueMask = 0x0000ff00UL;
1669 rnAlphaMask = 0x000000ffUL;
1670 rnTransparencyIndex = 0;
1673 rnWidth = pReadAccess->
Width();
1674 rnHeight = pReadAccess->
Height();
bool operator==(const BitmapEx &rBitmapEx) const
Color m_aLastColorBottomLeft
void Replace(const Bitmap &rMask, sal_uInt8 rReplaceTransparency)
sal_uInt8 GetIndexFromData(const sal_uInt8 *pData, tools::Long nX) const
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
sal_uInt64 BitmapChecksum
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.
sal_uInt8 GetIndex() const
tools::Long Height() const
BitmapEx TransformBitmapEx(double fWidth, double fHeight, const basegfx::B2DHomMatrix &rTransformation) const
Create transformed Bitmap.
sal_uInt8 GetAlpha() const
void SetAlpha(sal_uInt8 nAlpha)
void SetSizePixel(const Size &rNewSize)
OUString DetermineIconTheme() const
Determine which icon theme should be used.
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.
void Replace(const Color &rSearchColor, const Color &rReplaceColor)
Replace all pixel having the search color with the specified color.
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
BitmapEx createBlendFrame(const Size &rSize, sal_uInt8 nAlpha, Color aColorTopLeft, Color aColorBottomRight)
Create a blend frame as BitmapEx.
bool IsTransparent() const
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
Gets the application's settings.
tools::Polygon GetContour(bool bContourEdgeDetect, const tools::Rectangle *pWorkRect)
Get contours in image.
void Expand(sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent=false)
Expand the bitmap by pixel padding.
BitmapEx getTransformed(const basegfx::B2DHomMatrix &rTransformation, const basegfx::B2DRange &rVisibleRange, double fMaximumArea) const
Create transformed Bitmap.
constexpr std::underlying_type_t< T > underlyingEnumValue(T e)
sal_uInt16 GetBitCount() const
B2DVector getRange() const
BitmapChecksum vcl_get_checksum(BitmapChecksum Checksum, const void *Data, sal_uInt32 DatLen)
BitmapReadAccess * AcquireReadAccess()
SAL_DLLPRIVATE void ImplSetBitmap(const Bitmap &rBitmap)
Size GetSizePixel() const
bool Expand(sal_uLong nDX, sal_uLong nDY, const Color *pInitColor=nullptr)
Expand the bitmap by pixel padding.
BlendFrameCache * ImplGetBlendFrameCache()
bool Convert(BmpConversion eConversion)
Convert bitmap format.
BitmapChecksum GetChecksum() const
static Bitmap DetectEdges(const Bitmap &rBmp)
const Size & GetPrefSize() const
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
void SetPixelOnData(sal_uInt8 *pData, tools::Long nX, const BitmapColor &rBitmapColor)
static VCL_DLLPUBLIC ImageTree & get()
bool CombineSimple(const Bitmap &rMask, BmpCombine eCombine)
Perform boolean operations with another bitmap.
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
BitmapEx & operator=(const BitmapEx &rBitmapEx)
class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_black_and_white final class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_gamma final class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_RGBLuminanceContrast final typedef std::shared_ptr< BColorModifier > BColorModifierSharedPtr
bool HasGreyPalette8Bit() const
B2DHomMatrix createScaleB2DHomMatrix(double fScaleX, double fScaleY)
Scanline GetScanline(tools::Long nY) const
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
void loadFromIconTheme(const OUString &rIconName)
sal_uInt8 GetBlue() const
B2IRange fround(const B2DRange &rRange)
bool Mirror(BmpMirrorFlags nMirrorFlags)
Mirror the bitmap.
void CombineMaskOr(Color maskColor, sal_uInt8 nTol)
BitmapEx ModifyBitmapEx(const basegfx::BColorModifierStack &rBColorModifierStack) const
Create ColorStack-modified version of this BitmapEx.
Color m_aLastColorTopRight
void AdjustTransparency(sal_uInt8 cTrans)
ImplSVData * ImplGetSVData()
const MapMode & GetPrefMapMode() const
VCL_DLLPUBLIC bool loadImage(OUString const &name, OUString const &style, BitmapEx &bitmap, bool localized, const ImageLoadFlags eFlags=ImageLoadFlags::NONE)
void SetPrefMapMode(const MapMode &rMapMode)
bool Create(const css::uno::Reference< css::rendering::XBitmapCanvas > &xBitmapCanvas, const Size &rSize)
populate from a canvas implementation
#define BITMAP_CHECKSUM_SIZE
static BitmapEx AutoScaleBitmap(BitmapEx const &aBitmap, const tools::Long aStandardSize)
Color m_aLastColorTopLeft
bool Rotate(Degree10 nAngle10, const Color &rFillColor)
Rotate bitmap by the specified angle.
ScanlineFormat GetScanlineFormat() const
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
Color m_aLastColorBottomRight
BitmapChecksum GetChecksum() const
bool Invert()
Perform the Invert operation on every pixel.
BitmapColor GetColor(tools::Long nY, tools::Long nX) const
sal_uLong GetSizeBytes() const
tools::Long Width() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
tools::Long Width() const
sal_uLong GetSizeBytes() const
::rtl::Reference< Content > pContent
bool Invert()
Perform the Invert operation on every pixel.
static void ReleaseAccess(BitmapInfoAccess *pAccess)
::Color GetPixelColor(sal_Int32 nX, sal_Int32 nY) const
Get pixel color (including alpha) at given position.
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const BitmapEx *pBmpExSrc)
Copy a rectangular area from another bitmap.
bool IsTransparent() const
const Bitmap & GetBitmap() const
Gives direct access to the contained bitmap.
bool CopyPixel_AlphaOptimized(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc)
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
bool Rotate(Degree10 nAngle10, const Color &rFillColor)
Rotate bitmap by the specified angle.
sal_uInt16 GetPaletteEntryCount() const
void SetIndex(sal_uInt8 cIndex)
Bitmap GetBitmap(Color aTransparentReplaceColor) const
sal_uInt8 GetGreen() const
SAL_DLLPRIVATE const Bitmap & ImplGetBitmap() const
virtual std::shared_ptr< SalBitmap > CreateSalBitmap()=0
AlphaMask GetAlpha() const
#define SAL_WARN_IF(condition, area, stream)
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
Scale the bitmap.
void BCToBCOA(BitmapChecksum n, BitmapChecksumOctetArray p)
bool Convert(BmpConversion eConversion)
Convert bitmap format.
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
const BitmapPalette & GetPalette() const
tools::Long Height() const
B2DPoint getMinimum() 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.
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
BitmapColor GetPixelFromData(const sal_uInt8 *pData, tools::Long nX) const
void translate(double fX, double fY)
void AdaptBitCount(Bitmap &rNew) const
TransparentType meTransparent
bool Erase(const Color &rFillColor)
Fill the entire bitmap with the given color.
uno::Reference< ucb::XContent > xContent
void setAlphaFrom(sal_uInt8 cIndexFrom, sal_Int8 nAlphaTo)
#define SAL_WARN(area, stream)
sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE]
const BitmapColor & GetPaletteColor(sal_uInt16 nColor) const
void ReplaceTransparency(const Color &rColor)
Replace transparency with given color.
sal_uInt16 GetBitCount() const
bool CopyPixel(const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc=nullptr)
Copy a rectangular area from another bitmap.
bool Replace(const Bitmap &rMask, const Color &rReplaceColor)
Replace all pixel where the given mask is on with the specified color.
const Size & GetSizePixel() const
BitmapColor GetPixel(tools::Long nY, tools::Long nX) const
BitmapColor GetBestMatchingColor(const BitmapColor &rBitmapColor)
bool Crop(const tools::Rectangle &rRectPixel)
Crop the bitmap.
Bitmap CreateMask(const Color &rTransColor, sal_uInt8 nTol=0) const
Create on-off mask from bitmap.
void SetPaletteColor(sal_uInt16 nColor, const BitmapColor &rBitmapColor)