LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
BitmapEx Class Reference

#include <bitmapex.hxx>

Collaboration diagram for BitmapEx:
[legend]

Public Member Functions

 BitmapEx ()
 
 BitmapEx (const OUString &rIconName)
 
 BitmapEx (const BitmapEx &rBitmapEx)
 
 BitmapEx (const BitmapEx &rBitmapEx, Point aSrc, Size aSize)
 
 BitmapEx (Size aSize, sal_uInt16 nBitCount)
 
 BitmapEx (const Bitmap &rBmp)
 
 BitmapEx (const Bitmap &rBmp, const Bitmap &rMask)
 
 BitmapEx (const Bitmap &rBmp, const AlphaMask &rAlphaMask)
 
 BitmapEx (const Bitmap &rBmp, const Color &rTransparentColor)
 
BitmapExoperator= (const BitmapEx &rBitmapEx)
 
BitmapExoperator= (const Bitmap &rBitmap)
 
bool operator== (const BitmapEx &rBitmapEx) const
 
bool operator!= (const BitmapEx &rBitmapEx) const
 
bool operator! () const
 
bool IsEmpty () const
 
void SetEmpty ()
 
void Clear ()
 
void Draw (OutputDevice *pOutDev, const Point &rDestPt) const
 
void Draw (OutputDevice *pOutDev, const Point &rDestPt, const Size &rDestSize) const
 
bool IsTransparent () const
 
TransparentType GetTransparentType () const
 
Bitmap GetBitmap (const Color *pTransReplaceColor=nullptr) const
 
const BitmapGetBitmapRef () const
 Gives direct access to the contained bitmap. More...
 
Bitmap GetMask () const
 
bool IsAlpha () const
 
AlphaMask GetAlpha () const
 
const SizeGetSizePixel () const
 
void SetSizePixel (const Size &rNewSize)
 
const SizeGetPrefSize () const
 
void SetPrefSize (const Size &rPrefSize)
 
const MapModeGetPrefMapMode () const
 
void SetPrefMapMode (const MapMode &rPrefMapMode)
 
const ColorGetTransparentColor () const
 
sal_uInt16 GetBitCount () const
 
sal_uLong GetSizeBytes () const
 
BitmapChecksum GetChecksum () const
 
void GetSplitData (std::vector< sal_uInt8 > &rvColorData, std::vector< sal_uInt8 > &rvAlphaData) const
 extract the bitmap and alpha data separately. More...
 
bool Convert (BmpConversion eConversion)
 Convert bitmap format. More...
 
bool Crop (const tools::Rectangle &rRectPixel)
 Crop the bitmap. More...
 
void Expand (sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent=false)
 Expand the bitmap by pixel padding. More...
 
bool CopyPixel (const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const BitmapEx *pBmpExSrc)
 Copy a rectangular area from another bitmap. More...
 
bool Erase (const Color &rFillColor)
 Fill the entire bitmap with the given color. More...
 
bool Invert ()
 Perform the Invert operation on every pixel. More...
 
bool Mirror (BmpMirrorFlags nMirrorFlags)
 Mirror the bitmap. More...
 
bool Scale (const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
 Scale the bitmap. More...
 
bool Scale (const double &rScaleX, const double &rScaleY, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
 Scale the bitmap. More...
 
bool Rotate (long nAngle10, const Color &rFillColor)
 Rotate bitmap by the specified angle. More...
 
void Replace (const Color &rSearchColor, const Color &rReplaceColor)
 Replace all pixel having the search color with the specified color. More...
 
void Replace (const Color &rSearchColor, const Color &rReplaceColor, sal_uInt8 nTolerance)
 Replace all pixel having the search color with the specified color. More...
 
void Replace (const Color *pSearchColors, const Color *pReplaceColors, sal_uLong nColorCount)
 Replace all pixel having one the search colors with the corresponding replace color. More...
 
void Replace (const Color *pSearchColors, const Color *pReplaceColors, sal_uLong nColorCount, sal_uInt8 const *pTols)
 Replace all pixel having one the search colors with the corresponding replace color. More...
 
void ReplaceTransparency (const Color &rColor)
 Replace transparency with given color. More...
 
tools::Polygon GetContour (bool bContourEdgeDetect, const tools::Rectangle *pWorkRect)
 Get contours in image. More...
 
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. More...
 
sal_uInt8 GetTransparency (sal_Int32 nX, sal_Int32 nY) const
 Get transparency at given position. More...
 
::Color GetPixelColor (sal_Int32 nX, sal_Int32 nY) const
 Get pixel color (including alpha) at given position. More...
 
BitmapEx TransformBitmapEx (double fWidth, double fHeight, const basegfx::B2DHomMatrix &rTransformation) const
 Create transformed Bitmap. More...
 
BitmapEx getTransformed (const basegfx::B2DHomMatrix &rTransformation, const basegfx::B2DRange &rVisibleRange, double fMaximumArea) const
 Create transformed Bitmap. More...
 
BitmapEx ModifyBitmapEx (const basegfx::BColorModifierStack &rBColorModifierStack) const
 Create ColorStack-modified version of this BitmapEx. More...
 
bool Create (const css::uno::Reference< css::rendering::XBitmapCanvas > &xBitmapCanvas, const Size &rSize)
 populate from a canvas implementation More...
 
void setAlphaFrom (sal_uInt8 cIndexFrom, sal_Int8 nAlphaTo)
 
void AdjustTransparency (sal_uInt8 cTrans)
 
void CombineMaskOr (Color maskColor, sal_uInt8 nTol)
 
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. More...
 
SAL_DLLPRIVATE std::shared_ptr< SalBitmap > const & ImplGetBitmapSalBitmap () const
 
SAL_DLLPRIVATE std::shared_ptr< SalBitmap > const & ImplGetMaskSalBitmap () const
 

Static Public Member Functions

static BitmapEx AutoScaleBitmap (BitmapEx const &aBitmap, const long aStandardSize)
 

Private Member Functions

void loadFromIconTheme (const OUString &rIconName)
 

Private Attributes

Bitmap maBitmap
 
Bitmap maMask
 
Size maBitmapSize
 
Color maTransparentColor
 
TransparentType meTransparent
 
bool mbAlpha
 

Friends

class ImpGraphic
 
class OutputDevice
 
bool VCL_DLLPUBLIC WriteDIBBitmapEx (const BitmapEx &rSource, SvStream &rOStm)
 
bool VCL_DLLPUBLIC ReadRawDIB (BitmapEx &rTarget, const unsigned char *pBuf, const ScanlineFormat nFormat, const int nHeight, const int nStride)
 

Detailed Description

Definition at line 43 of file bitmapex.hxx.

Constructor & Destructor Documentation

BitmapEx::BitmapEx ( )

Definition at line 50 of file bitmapex.cxx.

References NONE.

Referenced by AdjustTransparency(), Create(), ModifyBitmapEx(), and TransformBitmapEx().

BitmapEx::BitmapEx ( const OUString &  rIconName)
explicit

Definition at line 88 of file bitmapex.cxx.

References loadFromIconTheme(), and NONE.

BitmapEx::BitmapEx ( const BitmapEx rBitmapEx)
default
BitmapEx::BitmapEx ( const BitmapEx rBitmapEx,
Point  aSrc,
Size  aSize 
)
BitmapEx::BitmapEx ( Size  aSize,
sal_uInt16  nBitCount 
)

Definition at line 80 of file bitmapex.cxx.

References maBitmap, NONE, and SetSizePixel().

BitmapEx::BitmapEx ( const Bitmap rBmp)
explicit

Definition at line 113 of file bitmapex.cxx.

References NONE.

BitmapEx::BitmapEx ( const Bitmap rBmp,
const Bitmap rMask 
)
BitmapEx::BitmapEx ( const Bitmap rBmp,
const AlphaMask rAlphaMask 
)
BitmapEx::BitmapEx ( const Bitmap rBmp,
const Color rTransparentColor 
)

Member Function Documentation

bool BitmapEx::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.

Parameters
nLuminancePercentPercent of luminance change, valid range [-100,100]. Values outside this range are clipped to the valid range.
nContrastPercentPercent of contrast change, valid range [-100,100]. Values outside this range are clipped to the valid range.
nChannelRPercentPercent of red channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
nChannelGPercentPercent of green channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
nChannelBPercentPercent of blue channel change, valid range [-100,100]. Values outside this range are clipped to the valid range.
fGammaExponent of the gamma function applied to the bitmap. The value 1.0 results in no change, the valid range is (0.0,10.0]. Values outside this range are regarded as 1.0.
bInvertIf true, invert the channel values with the logical 'not' operator
msoBrightnessUse the same formula for brightness as used by MSOffice.
Returns
true, if the operation was completed successfully.

Definition at line 608 of file bitmapex.cxx.

References Bitmap::Adjust(), and maBitmap.

Referenced by Animation::Adjust(), unographic::GraphicTransformer::applyBrightnessContrast(), and GDIMetaFile::ImplBmpAdjustFnc().

void BitmapEx::AdjustTransparency ( sal_uInt8  cTrans)
BitmapEx BitmapEx::AutoScaleBitmap ( BitmapEx const &  aBitmap,
const long  aStandardSize 
)
static
void BitmapEx::Clear ( )
void BitmapEx::CombineMaskOr ( Color  maskColor,
sal_uInt8  nTol 
)
bool BitmapEx::Convert ( BmpConversion  eConversion)

Convert bitmap format.

Parameters
eConversionThe format this bitmap should be converted to.
Returns
true, if the conversion was completed successfully.

Definition at line 454 of file bitmapex.cxx.

References Bitmap::Convert(), and maBitmap.

Referenced by Animation::Convert(), vcl::PDFWriterImpl::createBitmapEmit(), GDIMetaFile::CreateThumbnail(), OutputDevice::DrawBitmapEx(), ImpGetScaledGraphic(), GDIMetaFile::ImplBmpConvertFnc(), and vcl::PDFWriterImpl::implWriteBitmapEx().

bool BitmapEx::CopyPixel ( const tools::Rectangle rRectDst,
const tools::Rectangle rRectSrc,
const BitmapEx pBmpExSrc 
)

Copy a rectangular area from another bitmap.

Parameters
rRectDstDestination rectangle in this bitmap. This is clipped to the bitmap dimensions.
rRectSrcSource rectangle in pBmpSrc. This is clipped to the source bitmap dimensions. Note further that no scaling takes place during this copy operation, i.e. only the minimum of source and destination rectangle's width and height are used.
pBmpExSrcThe source bitmap to copy from. If this argument is NULL, or equal to the object this method is called on, copying takes place within the same bitmap.
Returns
true, if the operation completed successfully. false is not only returned when the operation failed, but also if nothing had to be done, e.g. because one of the rectangles are empty.

Definition at line 480 of file bitmapex.cxx.

References Bitmap, COL_BLACK(), Bitmap::CopyPixel(), Bitmap::CopyPixel_AlphaOptimized(), Bitmap::Erase(), GetSizePixel(), AlphaMask::ImplGetBitmap(), IsAlpha(), IsEmpty(), Bitmap::IsEmpty(), IsTransparent(), maBitmap, maMask, mbAlpha, and meTransparent.

Referenced by BitmapEx(), and GraphicObject::ImplTransformBitmap().

bool BitmapEx::Create ( const css::uno::Reference< css::rendering::XBitmapCanvas > &  xBitmapCanvas,
const Size rSize 
)

populate from a canvas implementation

Definition at line 774 of file bitmapex.cxx.

References BitmapEx(), SalInstance::CreateSalBitmap(), ImplGetSVData(), and ImplSVData::mpDefInst.

Referenced by GDIMetaFile::ImplPlayWithRenderer().

bool BitmapEx::Crop ( const tools::Rectangle rRectPixel)

Crop the bitmap.

Parameters
rRectPixelA rectangle specifying the crop amounts on all four sides of the bitmap. If the upper left corner of the bitmap is assigned (0,0), then this method cuts out the given rectangle from the bitmap. Note that the rectangle is clipped to the bitmap's dimension, i.e. negative left,top rectangle coordinates or exceeding width or height is ignored.
Returns
true, if cropping was performed successfully. If nothing had to be cropped, because e.g. the crop rectangle included the bitmap, false is returned, too!

Definition at line 434 of file bitmapex.cxx.

References Bitmap, Bitmap::Crop(), Bitmap::GetSizePixel(), maBitmap, maMask, meTransparent, SAL_WARN_IF, and SetSizePixel().

Referenced by clipMetafileContentAgainstOwnRegions(), GraphicObject::ImplTransformBitmap(), EMFWriter::ImplWrite(), vcl::PDFWriterImpl::playMetafile(), GDIMetaFile::Rotate(), and WMFWriter::WriteRecords().

void BitmapEx::Draw ( OutputDevice pOutDev,
const Point rDestPt 
) const

Definition at line 617 of file bitmapex.cxx.

References OutputDevice::DrawBitmapEx().

Referenced by Animation::Draw(), and ImpGraphic::ImplDraw().

void BitmapEx::Draw ( OutputDevice pOutDev,
const Point rDestPt,
const Size rDestSize 
) const

Definition at line 622 of file bitmapex.cxx.

References OutputDevice::DrawBitmapEx().

bool BitmapEx::Erase ( const Color rFillColor)

Fill the entire bitmap with the given color.

Parameters
rFillColorColor value to use for filling. Set the transparency part of the color to fill the mask.
Returns
true, if the operation was completed successfully.

Definition at line 569 of file bitmapex.cxx.

References Bitmap, COL_BLACK(), Bitmap::Erase(), Color::GetTransparency(), maBitmap, maMask, and meTransparent.

Referenced by GraphicObject::ImplTransformBitmap().

void BitmapEx::Expand ( sal_uLong  nDX,
sal_uLong  nDY,
bool  bExpandTransparent = false 
)

Expand the bitmap by pixel padding.

Parameters
nDXNumber of pixel to pad at the right border of the bitmap
nDYNumber of scanlines to pad at the bottom border of the bitmap
bExpandTransparentWhether to expand the transparency color or not.

Definition at line 459 of file bitmapex.cxx.

References Bitmap, COL_BLACK(), COL_WHITE(), Bitmap::Expand(), Bitmap::GetSizePixel(), maBitmap, maMask, meTransparent, SAL_WARN_IF, and SetSizePixel().

AlphaMask BitmapEx::GetAlpha ( ) const
sal_uInt16 BitmapEx::GetBitCount ( ) const
inline
Bitmap BitmapEx::GetBitmap ( const Color pTransReplaceColor = nullptr) const

Definition at line 236 of file bitmapex.cxx.

References Color, Bitmap::CreateMask(), GetAlpha(), IsAlpha(), maBitmap, maMask, maTransparentColor, meTransparent, NONE, and Bitmap::Replace().

Referenced by BitmapEx(), vcl::bitmap::CanvasExtractBitmapData(), vcl::bitmap::CanvasTransformBitmap(), Bitmap::Convert(), vcl::bitmap::convertBitmap32To24Plus8(), vcl::PDFWriterImpl::createBitmapEmit(), Image::Draw(), vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapEx(), OutputDevice::DrawBitmapWallpaper(), Printer::DrawDeviceBitmap(), OutputDevice::DrawDeviceBitmap(), vcl::PDFWriterImpl::drawJPGBitmap(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), BitmapLightenFilter::execute(), BitmapDisabledImageFilter::execute(), BitmapPopArtFilter::execute(), BitmapSobelGreyFilter::execute(), BitmapMedianFilter::execute(), BitmapColorizeFilter::execute(), BitmapFastScaleFilter::execute(), BitmapInterpolateScaleFilter::execute(), BitmapAlphaClampFilter::execute(), BitmapSolarizeFilter::execute(), BitmapDuoToneFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapColorQuantizationFilter::execute(), BitmapSeparableUnsharpenFilter::execute(), BitmapSepiaFilter::execute(), BitmapScaleSuperFilter::execute(), BitmapMosaicFilter::execute(), BitmapGaussianSeparableBlurFilter::execute(), BitmapMonochromeFilter::execute(), vcl::BitmapScaleConvolutionFilter::execute(), GetMask(), GraphicObject::ImplDrawTiled(), ImpGraphic::ImplGetBitmap(), ImpGraphic::ImplGetGDIMetaFile(), GraphicObject::ImplTransformBitmap(), ImplWheelWindow::ImplWheelWindow(), EMFWriter::ImplWrite(), vcl::PDFWriterImpl::implWriteBitmapEx(), vcl::bitmap::isHistorical8x8(), vcl::PNGWriterImpl::PNGWriterImpl(), TransferableHelper::SetBitmapEx(), TransformBitmapEx(), JPEGWriter::Write(), MetaBmpExAction::Write(), MetaBmpExScaleAction::Write(), MetaBmpExScalePartAction::Write(), WriteAnimation(), vcl::PDFWriterImpl::writeBitmapObject(), WriteDIBBitmapEx(), WMFWriter::WriteRecords(), and MetafileXmlDump::writeXml().

const Bitmap & BitmapEx::GetBitmapRef ( ) const

Gives direct access to the contained bitmap.

Definition at line 231 of file bitmapex.cxx.

References maBitmap.

Referenced by AdjustTransparency(), GraphicFilter::ImportGraphic(), ModifyBitmapEx(), Bitmap::Scale(), TransformBitmapEx(), and WriteDIB().

BitmapChecksum BitmapEx::GetChecksum ( ) const
void BitmapEx::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 
)
tools::Polygon BitmapEx::GetContour ( bool  bContourEdgeDetect,
const tools::Rectangle pWorkRect 
)
Bitmap BitmapEx::GetMask ( ) const
Color BitmapEx::GetPixelColor ( sal_Int32  nX,
sal_Int32  nY 
) const

Get pixel color (including alpha) at given position.

Parameters
nXinteger X-Position in Bitmap
nYinteger Y-Position in Bitmap

Definition at line 752 of file bitmapex.cxx.

References GetAlpha(), Bitmap::GetBitCount(), BitmapReadAccess::GetColor(), IsAlpha(), maBitmap, and Color::SetTransparency().

Referenced by GetTransparency().

const MapMode& BitmapEx::GetPrefMapMode ( ) const
inline
const Size& BitmapEx::GetPrefSize ( ) const
inline
sal_uLong BitmapEx::GetSizeBytes ( ) const
const Size& BitmapEx::GetSizePixel ( ) const
inline
void BitmapEx::GetSplitData ( std::vector< sal_uInt8 > &  rvColorData,
std::vector< sal_uInt8 > &  rvAlphaData 
) const

extract the bitmap and alpha data separately.

Used by the SWF filter.

Definition at line 1624 of file bitmapex.cxx.

References GetAlpha(), BitmapReadAccess::GetColor(), GetMask(), Color::GetRed(), Bitmap::GetSizePixel(), BitmapInfoAccess::Height(), IsAlpha(), IsEmpty(), IsTransparent(), maBitmap, p, and BitmapInfoAccess::Width().

BitmapEx BitmapEx::getTransformed ( const basegfx::B2DHomMatrix rTransformation,
const basegfx::B2DRange rVisibleRange,
double  fMaximumArea 
) const

Create transformed Bitmap.

Parameters
rTransformationThe transformation from unit coordinates to the unit range
rVisibleRangeThe relative visible range in unit coordinates, relative to (0,0,1,1) which defines the whole target area
fMaximumAreaA limitation for the maximum size of pixels to use for the result

The traget size of the result bitmap is defined by transforming the given rTargetRange with the given rTransformation; the area of the result is linearly scaled to not exceed the given fMaximumArea

Returns
The transformed bitmap

Definition at line 937 of file bitmapex.cxx.

References basegfx::utils::createScaleB2DHomMatrix(), basegfx::utils::createScaleTranslateB2DHomMatrix(), basegfx::B2DRange::getHeight(), basegfx::B2DRange::getMinimum(), basegfx::B2DRange::getMinX(), basegfx::B2DRange::getMinY(), basegfx::B2DRange::getRange(), GetSizePixel(), basegfx::B2DRange::getWidth(), Height, IsEmpty(), basegfx::fTools::more(), basegfx::B2DRange::transform(), TransformBitmapEx(), basegfx::B2DHomMatrix::translate(), and Width.

Referenced by OutputDevice::DrawTransformedBitmapEx().

sal_uInt8 BitmapEx::GetTransparency ( sal_Int32  nX,
sal_Int32  nY 
) const

Get transparency at given position.

Parameters
nXinteger X-Position in Bitmap
nYinteger Y-Position in Bitmap
Returns
transparency value in the range of [0 .. 255] where 0 is not transparent, 255 is fully transparent

Definition at line 684 of file bitmapex.cxx.

References Bitmap, Color, Bitmap::GetBitCount(), BitmapReadAccess::GetColor(), BitmapColor::GetIndex(), BitmapReadAccess::GetPixel(), GetPixelColor(), GetSizePixel(), Color::GetTransparency(), Size::Height(), Bitmap::IsEmpty(), maBitmap, maMask, maTransparentColor, mbAlpha, meTransparent, NONE, and Size::Width().

const Color& BitmapEx::GetTransparentColor ( ) const
inline
TransparentType BitmapEx::GetTransparentType ( ) const
inline
SAL_DLLPRIVATE std::shared_ptr<SalBitmap> const& BitmapEx::ImplGetBitmapSalBitmap ( ) const
inline

Definition at line 464 of file bitmapex.hxx.

Referenced by OutputDevice::DrawDeviceBitmap().

SAL_DLLPRIVATE std::shared_ptr<SalBitmap> const& BitmapEx::ImplGetMaskSalBitmap ( ) const
inline

Definition at line 465 of file bitmapex.hxx.

Referenced by OutputDevice::DrawDeviceBitmap().

bool BitmapEx::Invert ( )

Perform the Invert operation on every pixel.

Returns
true, if the operation was completed successfully.

Definition at line 318 of file bitmapex.cxx.

References Color, Color::Invert(), Bitmap::Invert(), maBitmap, maTransparentColor, and meTransparent.

Referenced by Animation::Invert().

bool BitmapEx::IsAlpha ( ) const
bool BitmapEx::IsEmpty ( ) const
bool BitmapEx::IsTransparent ( ) const

Definition at line 221 of file bitmapex.cxx.

References meTransparent, and NONE.

Referenced by AdjustTransparency(), BitmapEx(), vcl::bitmap::CanvasCairoExtractBitmapData(), vcl::bitmap::CanvasTransformBitmap(), CombineMaskOr(), vcl::bitmap::convertBitmap32To24Plus8(), vcl::unotools::VclCanvasBitmap::convertIntegerFromARGB(), vcl::unotools::VclCanvasBitmap::convertIntegerFromPARGB(), vcl::unotools::VclCanvasBitmap::convertIntegerFromRGB(), vcl::unotools::VclCanvasBitmap::convertIntegerToARGB(), vcl::unotools::VclCanvasBitmap::convertIntegerToPARGB(), vcl::unotools::VclCanvasBitmap::convertIntegerToRGB(), CopyPixel(), Image::Draw(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapWallpaper(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), vcl::PDFWriterImpl::drawWallpaper(), BitmapDisabledImageFilter::execute(), BitmapAlphaClampFilter::execute(), GetColorModel(), vcl::unotools::VclCanvasBitmap::getData(), vcl::bitmap::GetMaskDIB(), vcl::unotools::VclCanvasBitmap::getPixel(), GetSplitData(), vcl::unotools::VclCanvasBitmap::hasAlpha(), GDIMetaFile::ImplBmpMonoFnc(), ImpGraphic::ImplGetGDIMetaFile(), ImpGraphic::ImplIsTransparent(), GraphicObject::ImplTransformBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), IsAlpha(), vcl::bitmap::isHistorical8x8(), Animation::IsTransparent(), ModifyBitmapEx(), vcl::PNGWriterImpl::PNGWriterImpl(), ReplaceTransparency(), SvtIconChoiceCtrl::SetBackground(), TransformBitmapEx(), and vcl::unotools::VclCanvasBitmap::VclCanvasBitmap().

void BitmapEx::loadFromIconTheme ( const OUString &  rIconName)
private
bool BitmapEx::Mirror ( BmpMirrorFlags  nMirrorFlags)

Mirror the bitmap.

Parameters
nMirrorFlagsAbout which axis (horizontal, vertical, or both) to mirror
Returns
true, if the operation was completed successfully.

Definition at line 333 of file bitmapex.cxx.

References Bitmap, maBitmap, maMask, meTransparent, and Bitmap::Mirror().

Referenced by OutputDevice::DrawDeviceBitmap(), ImplMirrorImage(), vcl::PDFWriterImpl::implWriteBitmapEx(), and Animation::Mirror().

BitmapEx BitmapEx::ModifyBitmapEx ( const basegfx::BColorModifierStack rBColorModifierStack) const
bool BitmapEx::operator! ( ) const
inline

Definition at line 61 of file bitmapex.hxx.

bool BitmapEx::operator!= ( const BitmapEx rBitmapEx) const
inline

Definition at line 60 of file bitmapex.hxx.

BitmapEx & BitmapEx::operator= ( const BitmapEx rBitmapEx)
default
BitmapEx& BitmapEx::operator= ( const Bitmap rBitmap)
inline

Definition at line 58 of file bitmapex.hxx.

References operator=().

Referenced by operator=().

bool BitmapEx::operator== ( const BitmapEx rBitmapEx) const

Definition at line 179 of file bitmapex.cxx.

References Color, GetSizePixel(), maBitmap, maMask, maTransparentColor, mbAlpha, and meTransparent.

void BitmapEx::Replace ( const Color rSearchColor,
const Color rReplaceColor 
)

Replace all pixel having the search color with the specified color.

Parameters
rSearchColorColor specifying which pixel should be replaced
rReplaceColorColor to be placed in all changed pixel

Definition at line 596 of file bitmapex.cxx.

References maBitmap, and Bitmap::Replace().

Referenced by GDIMetaFile::ImplBmpReplaceFnc(), and LoadThemedImageList().

void BitmapEx::Replace ( const Color rSearchColor,
const Color rReplaceColor,
sal_uInt8  nTolerance 
)

Replace all pixel having the search color with the specified color.

Parameters
rSearchColorColor specifying which pixel should be replaced
rReplaceColorColor to be placed in all changed pixel
nToleranceTolerance value. Specifies the maximal difference between rSearchColor and the individual pixel values, such that the corresponding pixel is still regarded a match.

Definition at line 1325 of file bitmapex.cxx.

References maBitmap, and Bitmap::Replace().

void BitmapEx::Replace ( const Color pSearchColors,
const Color pReplaceColors,
sal_uLong  nColorCount 
)

Replace all pixel having one the search colors with the corresponding replace color.

Parameters
pSearchColorsArray of colors specifying which pixel should be replaced
pReplaceColorsArray of colors to be placed in all changed pixel
nColorCountSize of the aforementioned color arrays
pTolsTolerance value. Specifies the maximal difference between pSearchColor colors and the individual pixel values, such that the corresponding pixel is still regarded a match.

Definition at line 602 of file bitmapex.cxx.

References maBitmap, and Bitmap::Replace().

void BitmapEx::Replace ( const Color pSearchColors,
const Color pReplaceColors,
sal_uLong  nColorCount,
sal_uInt8 const *  pTols 
)

Replace all pixel having one the search colors with the corresponding replace color.

Parameters
pSearchColorsArray of colors specifying which pixel should be replaced
rReplaceColorsArray of colors to be placed in all changed pixel
nColorCountSize of the aforementioned color arrays
pTolsTolerance value. Specifies the maximal difference between pSearchColor colors and the individual pixel values, such that the corresponding pixel is still regarded a match.
Returns
true, if the operation was completed successfully.

Definition at line 1332 of file bitmapex.cxx.

References maBitmap, and Bitmap::Replace().

void BitmapEx::ReplaceTransparency ( const Color rColor)

Replace transparency with given color.

Definition at line 1340 of file bitmapex.cxx.

References GetMask(), Bitmap::GetSizePixel(), IsTransparent(), maBitmap, maBitmapSize, maMask, maTransparentColor, mbAlpha, meTransparent, NONE, and Bitmap::Replace().

bool BitmapEx::Rotate ( long  nAngle10,
const Color rFillColor 
)

Rotate bitmap by the specified angle.

Parameters
nAngle10The rotation angle in tenth of a degree. The bitmap is always rotated around its center.
rFillColorThe color to use for filling blank areas. During rotation, the bitmap is enlarged such that the whole rotation result fits in. The empty spaces around that rotated original bitmap are then filled with this color.
Returns
true, if the operation was completed successfully.

Definition at line 390 of file bitmapex.cxx.

References Bitmap, COL_BLACK(), COL_TRANSPARENT(), COL_WHITE(), Color, Bitmap::Erase(), GetSizePixel(), Bitmap::GetSizePixel(), maBitmap, maMask, maTransparentColor, meTransparent, NONE, Bitmap::Rotate(), SAL_WARN_IF, and SetSizePixel().

Referenced by OutputDevice::DrawTransformedBitmapEx(), ImplRotImage(), GDIMetaFile::Rotate(), GraphicNativeTransform::rotateBitmapOnly(), and GraphicNativeTransform::rotateGeneric().

bool BitmapEx::Scale ( const Size rNewSize,
BmpScaleFlag  nScaleFlag = BmpScaleFlag::Default 
)

Scale the bitmap.

Parameters
rNewSizeThe resulting size of the scaled bitmap
nScaleFlagThe algorithm to be used for scaling
Returns
true, if the operation was completed successfully.

Definition at line 370 of file bitmapex.cxx.

References GetSizePixel(), Size::Height(), Height, Size::Width(), and Width.

Referenced by AutoScaleBitmap(), GDIMetaFile::CreateThumbnail(), OutputDevice::DrawBitmapWallpaper(), vcl::unotools::VclCanvasBitmap::getScaledBitmap(), ImpGraphic::ImplGetBitmapEx(), GraphicObject::ImplTransformBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), ImplImage::loadStockAtScale(), and vcl::PrintDialog::PrintPreviewWindow::Paint().

bool BitmapEx::Scale ( const double &  rScaleX,
const double &  rScaleY,
BmpScaleFlag  nScaleFlag = BmpScaleFlag::Default 
)

Scale the bitmap.

Parameters
rScaleXThe scale factor in x direction.
rScaleYThe scale factor in y direction.
nScaleFlagThe algorithm to be used for scaling
Returns
true, if the operation was completed successfully.

Definition at line 348 of file bitmapex.cxx.

References Bitmap, Bitmap::GetSizePixel(), maBitmap, maMask, meTransparent, SAL_WARN_IF, Bitmap::Scale(), and SetSizePixel().

void BitmapEx::setAlphaFrom ( sal_uInt8  cIndexFrom,
sal_Int8  nAlphaTo 
)
void BitmapEx::SetEmpty ( )
void BitmapEx::SetPrefMapMode ( const MapMode rPrefMapMode)
inline
void BitmapEx::SetPrefSize ( const Size rPrefSize)
inline
void BitmapEx::SetSizePixel ( const Size rNewSize)

Definition at line 313 of file bitmapex.cxx.

References maBitmapSize.

Referenced by BitmapEx(), Crop(), Expand(), ImpGraphic::ImplReadEmbedded(), Rotate(), and Scale().

BitmapEx BitmapEx::TransformBitmapEx ( double  fWidth,
double  fHeight,
const basegfx::B2DHomMatrix rTransformation 
) const

Create transformed Bitmap.

Parameters
fWidthThe target width in pixels
fHeightThe target height in pixels
rTransformationThe back transformation for each pixel in (0 .. fWidth),(0 .. fHeight) to local pixel coordinates

Definition at line 906 of file bitmapex.cxx.

References BitmapEx(), basegfx::fround(), GetAlpha(), GetBitmap(), GetBitmapRef(), GetMask(), IsAlpha(), and IsTransparent().

Referenced by getTransformed().

Friends And Related Function Documentation

friend class ImpGraphic
friend

Definition at line 469 of file bitmapex.hxx.

friend class OutputDevice
friend

Definition at line 470 of file bitmapex.hxx.

bool VCL_DLLPUBLIC ReadRawDIB ( BitmapEx rTarget,
const unsigned char *  pBuf,
const ScanlineFormat  nFormat,
const int  nHeight,
const int  nStride 
)
friend

Definition at line 1838 of file dibtools.cxx.

bool VCL_DLLPUBLIC WriteDIBBitmapEx ( const BitmapEx rSource,
SvStream rOStm 
)
friend

Definition at line 1871 of file dibtools.cxx.

Member Data Documentation

Bitmap BitmapEx::maBitmap
private
Size BitmapEx::maBitmapSize
private

Definition at line 481 of file bitmapex.hxx.

Referenced by ReplaceTransparency(), and SetSizePixel().

Bitmap BitmapEx::maMask
private
Color BitmapEx::maTransparentColor
private
bool BitmapEx::mbAlpha
private
TransparentType BitmapEx::meTransparent
private

The documentation for this class was generated from the following files: