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, vcl::PixelFormat ePixelFormat)
 
 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 IsEmpty () const
 
void SetEmpty ()
 
void Clear ()
 
void ClearAlpha ()
 
void Draw (OutputDevice *pOutDev, const Point &rDestPt) const
 
void Draw (OutputDevice *pOutDev, const Point &rDestPt, const Size &rDestSize) const
 
Bitmap GetBitmap (Color aTransparentReplaceColor) const
 
const BitmapGetBitmap () const
 Gives direct access to the contained bitmap. More...
 
bool IsAlpha () const
 
const AlphaMaskGetAlphaMask () 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)
 
vcl::PixelFormat getPixelFormat () const
 
sal_Int64 GetSizeBytes () const
 
BitmapChecksum GetChecksum () const
 
bool Convert (BmpConversion eConversion)
 Convert bitmap format. More...
 
bool Crop (const tools::Rectangle &rRectPixel)
 Crop the bitmap. More...
 
void Expand (sal_Int32 nDX, sal_Int32 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 (Degree10 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, size_t nColorCount)
 Replace all pixel having one the search colors with the corresponding replace color. More...
 
void Replace (const Color *pSearchColors, const Color *pReplaceColors, size_t 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 GetAlpha (sal_Int32 nX, sal_Int32 nY) const
 Get alpha 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 ChangeColorAlpha (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
 
void DumpAsPng (const char *pFileName=nullptr) const
 Dumps the pixels as PNG in bitmap.png. More...
 

Static Public Member Functions

static BitmapEx AutoScaleBitmap (BitmapEx const &aBitmap, const tools::Long aStandardSize)
 

Private Member Functions

void loadFromIconTheme (const OUString &rIconName)
 

Private Attributes

Bitmap maBitmap
 
AlphaMask maAlphaMask
 
Size maBitmapSize
 

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 37 of file bitmapex.hxx.

Constructor & Destructor Documentation

◆ BitmapEx() [1/9]

BitmapEx::BitmapEx ( )

◆ BitmapEx() [2/9]

BitmapEx::BitmapEx ( const OUString &  rIconName)
explicit

Definition at line 80 of file BitmapEx.cxx.

References loadFromIconTheme().

◆ BitmapEx() [3/9]

BitmapEx::BitmapEx ( const BitmapEx rBitmapEx)
default

◆ BitmapEx() [4/9]

BitmapEx::BitmapEx ( const BitmapEx rBitmapEx,
Point  aSrc,
Size  aSize 
)

◆ BitmapEx() [5/9]

BitmapEx::BitmapEx ( Size  aSize,
vcl::PixelFormat  ePixelFormat 
)

Definition at line 74 of file BitmapEx.cxx.

References maBitmap, and SetSizePixel().

◆ BitmapEx() [6/9]

BitmapEx::BitmapEx ( const Bitmap rBmp)
explicit

Definition at line 103 of file BitmapEx.cxx.

◆ BitmapEx() [7/9]

BitmapEx::BitmapEx ( const Bitmap rBmp,
const Bitmap rMask 
)

◆ BitmapEx() [8/9]

BitmapEx::BitmapEx ( const Bitmap rBmp,
const AlphaMask rAlphaMask 
)

◆ BitmapEx() [9/9]

BitmapEx::BitmapEx ( const Bitmap rBmp,
const Color rTransparentColor 
)

Member Function Documentation

◆ Adjust()

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 494 of file BitmapEx.cxx.

References Bitmap::Adjust(), Bitmap::IsEmpty(), and maBitmap.

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

◆ AdjustTransparency()

void BitmapEx::AdjustTransparency ( sal_uInt8  cTrans)

◆ AutoScaleBitmap()

BitmapEx BitmapEx::AutoScaleBitmap ( BitmapEx const &  aBitmap,
const tools::Long  aStandardSize 
)
static

◆ ChangeColorAlpha()

void BitmapEx::ChangeColorAlpha ( sal_uInt8  cIndexFrom,
sal_Int8  nAlphaTo 
)

◆ Clear()

void BitmapEx::Clear ( )

Definition at line 197 of file BitmapEx.cxx.

References SetEmpty().

Referenced by ImpGraphic::clearGraphics(), and createBlendFrame().

◆ ClearAlpha()

void BitmapEx::ClearAlpha ( )

Definition at line 202 of file BitmapEx.cxx.

References maAlphaMask, and Bitmap::SetEmpty().

Referenced by vcl::pngWrite().

◆ CombineMaskOr()

void BitmapEx::CombineMaskOr ( Color  maskColor,
sal_uInt8  nTol 
)

Definition at line 1445 of file BitmapEx.cxx.

References Bitmap::CombineOr(), Bitmap::CreateMask(), IsAlpha(), maAlphaMask, and maBitmap.

◆ Convert()

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 383 of file BitmapEx.cxx.

References Bitmap::Convert(), Bitmap::IsEmpty(), and maBitmap.

Referenced by BmpWriter(), Animation::Convert(), vcl::PDFWriterImpl::createBitmapEmit(), GDIMetaFile::CreateThumbnail(), vcl::drawmode::GetBitmapEx(), ImpGetScaledGraphic(), GDIMetaFile::ImplBmpConvertFnc(), and vcl::PDFWriterImpl::implWriteBitmapEx().

◆ CopyPixel()

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 409 of file BitmapEx.cxx.

References Bitmap::CopyPixel(), Bitmap::CopyPixel_AlphaOptimized(), GetSizePixel(), AlphaMask::ImplGetBitmap(), IsAlpha(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), IsEmpty(), maAlphaMask, and maBitmap.

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

◆ Create()

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

populate from a canvas implementation

Definition at line 622 of file BitmapEx.cxx.

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

Referenced by GDIMetaFile::ImplPlayWithRenderer().

◆ Crop()

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 363 of file BitmapEx.cxx.

References Bitmap::Crop(), Bitmap::GetSizePixel(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, SAL_WARN_IF, and SetSizePixel().

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

◆ Draw() [1/2]

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

Definition at line 503 of file BitmapEx.cxx.

References OutputDevice::DrawBitmapEx().

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

◆ Draw() [2/2]

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

Definition at line 508 of file BitmapEx.cxx.

References OutputDevice::DrawBitmapEx().

◆ DumpAsPng()

void BitmapEx::DumpAsPng ( const char *  pFileName = nullptr) const

Dumps the pixels as PNG in bitmap.png.

Definition at line 1508 of file BitmapEx.cxx.

References SvStream::good(), and vcl::PngImageWriter::write().

◆ Erase()

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 461 of file BitmapEx.cxx.

References Bitmap::Erase(), AlphaMask::Erase(), Color::GetAlpha(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), Color::IsTransparent(), maAlphaMask, and maBitmap.

Referenced by GraphicObject::ImplTransformBitmap(), and DecoToolBox::SetImages().

◆ Expand()

void BitmapEx::Expand ( sal_Int32  nDX,
sal_Int32  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 388 of file BitmapEx.cxx.

References COL_ALPHA_OPAQUE(), COL_ALPHA_TRANSPARENT(), Bitmap::Expand(), Bitmap::GetSizePixel(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, SAL_WARN_IF, and SetSizePixel().

◆ GetAlpha()

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

Get alpha at given position.

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

Definition at line 568 of file BitmapEx.cxx.

References Color::GetAlpha(), BitmapColor::GetIndex(), BitmapReadAccess::GetPixel(), GetPixelColor(), Bitmap::getPixelFormat(), GetSizePixel(), Height, AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, vcl::N32_BPP, and Width.

◆ GetAlphaMask()

const AlphaMask & BitmapEx::GetAlphaMask ( ) const
inline

◆ GetBitmap() [1/2]

const Bitmap & BitmapEx::GetBitmap ( ) const

Gives direct access to the contained bitmap.

Definition at line 212 of file BitmapEx.cxx.

References maBitmap.

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

◆ GetBitmap() [2/2]

Bitmap BitmapEx::GetBitmap ( Color  aTransparentReplaceColor) const

Definition at line 217 of file BitmapEx.cxx.

References AlphaMask::IsEmpty(), maAlphaMask, maBitmap, and Bitmap::Replace().

Referenced by unographic::Graphic::applyDuotone(), BitmapEx(), SvmWriter::BmpExHandler(), SvmWriter::BmpExScaleHandler(), SvmWriter::BmpExScalePartHandler(), vcl::bitmap::CanvasExtractBitmapData(), vcl::bitmap::CanvasTransformBitmap(), unographic::Graphic::colorChange(), Bitmap::Convert(), vcl::bitmap::convertBitmap32To24Plus8(), vcl::PDFWriterImpl::createBitmapEmit(), Image::Draw(), vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapEx(), OutputDevice::DrawBitmapWallpaper(), OutputDevice::DrawDeviceBitmapEx(), Printer::DrawDeviceBitmapEx(), vcl::PDFWriterImpl::drawJPGBitmap(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), OutputDevice::DrawTransparent(), OutputDevice::DrawWaveLine(), BitmapBasicMorphologyFilter::execute(), BitmapFilterStackBlur::execute(), vcl::BitmapScaleConvolutionFilter::execute(), BitmapScaleSuperFilter::execute(), BitmapAlphaClampFilter::execute(), BitmapColorQuantizationFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapDuoToneFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapGaussianSeparableBlurFilter::execute(), BitmapMedianFilter::execute(), BitmapMonochromeFilter::execute(), BitmapMosaicFilter::execute(), BitmapPopArtFilter::execute(), BitmapSeparableUnsharpenFilter::execute(), BitmapSepiaFilter::execute(), BitmapShadowFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapSobelGreyFilter::execute(), BitmapSolarizeFilter::execute(), BitmapColorizeFilter::execute(), BitmapDisabledImageFilter::execute(), BitmapFastScaleFilter::execute(), BitmapInterpolateScaleFilter::execute(), BitmapLightenFilter::execute(), BitmapMaskToAlphaFilter::execute(), ImpGraphic::getBitmap(), vcl::drawmode::GetBitmapEx(), ImpGraphic::getGDIMetaFile(), GraphicObject::ImplDrawTiled(), GraphicObject::ImplTransformBitmap(), ImplWheelWindow::ImplWheelWindow(), EMFWriter::ImplWrite(), vcl::PDFWriterImpl::implWriteBitmapEx(), GraphicFilter::ImportGraphics(), vcl::bitmap::isHistorical8x8(), vcl::PDFWriterImpl::playMetafile(), vcl::pngWrite(), GraphicFilter::readJPEG(), Bitmap::Scale(), TransferableHelper::SetBitmapEx(), JPEGWriter::Write(), vcl::PDFWriterImpl::writeBitmapObject(), WriteDIB(), WMFWriter::WriteRecords(), writeWebp(), and MetafileXmlDump::writeXml().

◆ GetChecksum()

BitmapChecksum BitmapEx::GetChecksum ( ) const

◆ GetColorModel()

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 
)

◆ GetContour()

tools::Polygon BitmapEx::GetContour ( bool  bContourEdgeDetect,
const tools::Rectangle pWorkRect 
)

◆ GetPixelColor()

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 600 of file BitmapEx.cxx.

References GetAlphaMask(), BitmapReadAccess::GetColor(), Bitmap::getPixelFormat(), IsAlpha(), maBitmap, vcl::N32_BPP, and Color::SetAlpha().

Referenced by GetAlpha().

◆ getPixelFormat()

vcl::PixelFormat BitmapEx::getPixelFormat ( ) const
inline

◆ GetPrefMapMode()

const MapMode & BitmapEx::GetPrefMapMode ( ) const
inline

◆ GetPrefSize()

const Size & BitmapEx::GetPrefSize ( ) const
inline

◆ GetSizeBytes()

sal_Int64 BitmapEx::GetSizeBytes ( ) const

◆ GetSizePixel()

const Size & BitmapEx::GetSizePixel ( ) const
inline

◆ getTransformed()

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 target 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 778 of file BitmapEx.cxx.

References basegfx::utils::createScaleB2DHomMatrix(), basegfx::utils::createScaleTranslateB2DHomMatrix(), basegfx::Range2D< typename TYPE, typename TRAITS >::getHeight(), basegfx::B2DRange::getMinimum(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinY(), basegfx::B2DRange::getRange(), GetSizePixel(), basegfx::Range2D< typename TYPE, typename TRAITS >::getWidth(), Height, basegfx::B2DHomMatrix::invert(), IsEmpty(), basegfx::fTools::more(), basegfx::B2DHomMatrix::scale(), basegfx::B2DRange::transform(), TransformBitmapEx(), basegfx::B2DHomMatrix::translate(), and Width.

Referenced by OutputDevice::DrawTransformedBitmapEx().

◆ ImplGetBitmapSalBitmap()

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

Definition at line 451 of file bitmapex.hxx.

Referenced by OutputDevice::DrawDeviceBitmapEx(), and OutputDevice::DrawWaveLine().

◆ Invert()

bool BitmapEx::Invert ( )

Perform the Invert operation on every pixel.

Returns
true, if the operation was completed successfully.

Definition at line 258 of file BitmapEx.cxx.

References Bitmap::Invert(), Bitmap::IsEmpty(), and maBitmap.

Referenced by BitmapEx(), vcl::drawmode::GetBitmapEx(), and Animation::Invert().

◆ IsAlpha()

bool BitmapEx::IsAlpha ( ) const

Definition at line 207 of file BitmapEx.cxx.

References AlphaMask::IsEmpty(), and maAlphaMask.

Referenced by AdjustTransparency(), BitmapEx(), vcl::bitmap::CanvasCairoExtractBitmapData(), vcl::bitmap::CanvasTransformBitmap(), unographic::Graphic::colorChange(), 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(), vcl::PDFWriterImpl::createBitmapEmit(), Image::Draw(), vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapEx(), OutputDevice::DrawBitmapWallpaper(), OutputDevice::DrawDeviceBitmapEx(), Printer::DrawDeviceBitmapEx(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), vcl::PDFWriterImpl::drawWallpaper(), BitmapAlphaClampFilter::execute(), BitmapDisabledImageFilter::execute(), vcl::drawmode::GetBitmapEx(), GetColorModel(), vcl::unotools::VclCanvasBitmap::getData(), ImpGraphic::getGDIMetaFile(), vcl::bitmap::GetMaskDIB(), vcl::unotools::VclCanvasBitmap::getPixel(), GetPixelColor(), GraphicID::GraphicID(), vcl::unotools::VclCanvasBitmap::hasAlpha(), GDIMetaFile::ImplBmpMonoFnc(), GraphicObject::ImplTransformBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), GraphicFilter::ImportGraphics(), ImpGraphic::isAlpha(), vcl::bitmap::isHistorical8x8(), Animation::IsTransparent(), ImpGraphic::isTransparent(), MetaBmpExAction::IsTransparent(), MetaBmpExScaleAction::IsTransparent(), MetaBmpExScalePartAction::IsTransparent(), ModifyBitmapEx(), vcl::PDFWriterImpl::playMetafile(), ReplaceTransparency(), OutputDevice::SetBackground(), SvtIconChoiceCtrl::SetBackground(), TransformBitmapEx(), vcl::unotools::VclCanvasBitmap::VclCanvasBitmap(), vcl::PDFWriterImpl::writeBitmapObject(), and writeWebp().

◆ IsEmpty()

bool BitmapEx::IsEmpty ( ) const

◆ loadFromIconTheme()

void BitmapEx::loadFromIconTheme ( const OUString &  rIconName)
private

◆ Mirror()

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 268 of file BitmapEx.cxx.

References AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, and Bitmap::Mirror().

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

◆ ModifyBitmapEx()

BitmapEx BitmapEx::ModifyBitmapEx ( const basegfx::BColorModifierStack rBColorModifierStack) const

◆ operator!=()

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

Definition at line 54 of file bitmapex.hxx.

◆ operator=() [1/2]

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

Definition at line 52 of file bitmapex.hxx.

References operator=().

Referenced by operator=().

◆ operator=() [2/2]

BitmapEx & BitmapEx::operator= ( const BitmapEx rBitmapEx)
default

◆ operator==()

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

Definition at line 175 of file BitmapEx.cxx.

References GetSizePixel(), maAlphaMask, and maBitmap.

◆ Replace() [1/4]

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 482 of file BitmapEx.cxx.

References Bitmap::IsEmpty(), maBitmap, and Bitmap::Replace().

Referenced by unographic::Graphic::colorChange(), GDIMetaFile::ImplBmpReplaceFnc(), and LoadThemedImageList().

◆ Replace() [2/4]

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 1158 of file BitmapEx.cxx.

References maBitmap, and Bitmap::Replace().

◆ Replace() [3/4]

void BitmapEx::Replace ( const Color pSearchColors,
const Color pReplaceColors,
size_t  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 488 of file BitmapEx.cxx.

References Bitmap::IsEmpty(), maBitmap, and Bitmap::Replace().

◆ Replace() [4/4]

void BitmapEx::Replace ( const Color pSearchColors,
const Color pReplaceColors,
size_t  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 1165 of file BitmapEx.cxx.

References maBitmap, and Bitmap::Replace().

◆ ReplaceTransparency()

void BitmapEx::ReplaceTransparency ( const Color rColor)

Replace transparency with given color.

Definition at line 1173 of file BitmapEx.cxx.

References GetAlphaMask(), Bitmap::GetSizePixel(), IsAlpha(), maAlphaMask, maBitmap, maBitmapSize, and Bitmap::Replace().

◆ Rotate()

bool BitmapEx::Rotate ( Degree10  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 325 of file BitmapEx.cxx.

References COL_ALPHA_TRANSPARENT(), COL_BLACK(), COL_TRANSPARENT(), AlphaMask::Erase(), Bitmap::GetGreyPalette(), Bitmap::GetSizePixel(), GetSizePixel(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, vcl::N8_BPP, Bitmap::Rotate(), SAL_WARN_IF, and SetSizePixel().

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

◆ Scale() [1/2]

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 283 of file BitmapEx.cxx.

References Bitmap::GetSizePixel(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, SAL_WARN_IF, Bitmap::Scale(), and SetSizePixel().

◆ Scale() [2/2]

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 305 of file BitmapEx.cxx.

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

Referenced by AutoScaleBitmap(), GDIMetaFile::CreateThumbnail(), OutputDevice::DrawBitmapWallpaper(), VclDrawingArea::DumpAsPropertyTree(), ImpGraphic::getBitmapEx(), vcl::unotools::VclCanvasBitmap::getScaledBitmap(), GraphicObject::ImplTransformBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), vcl::PrintDialog::PrintPreviewWindow::Paint(), Scale(), and DecoToolBox::SetImages().

◆ SetEmpty()

void BitmapEx::SetEmpty ( )

◆ SetPrefMapMode()

void BitmapEx::SetPrefMapMode ( const MapMode rPrefMapMode)
inline

Definition at line 80 of file bitmapex.hxx.

Referenced by ImportTiffGraphicImport(), and ImpGraphic::setValuesForPrefMapMod().

◆ SetPrefSize()

void BitmapEx::SetPrefSize ( const Size rPrefSize)
inline

◆ SetSizePixel()

void BitmapEx::SetSizePixel ( const Size rNewSize)

Definition at line 253 of file BitmapEx.cxx.

References maBitmapSize.

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

◆ TransformBitmapEx()

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 755 of file BitmapEx.cxx.

References BitmapEx(), basegfx::fround(), GetAlphaMask(), GetBitmap(), and IsAlpha().

Referenced by getTransformed().

Friends And Related Function Documentation

◆ ImpGraphic

friend class ImpGraphic
friend

Definition at line 457 of file bitmapex.hxx.

◆ OutputDevice

friend class OutputDevice
friend

Definition at line 458 of file bitmapex.hxx.

◆ ReadRawDIB

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

Definition at line 1709 of file dibtools.cxx.

◆ WriteDIBBitmapEx

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

Definition at line 1742 of file dibtools.cxx.

Member Data Documentation

◆ maAlphaMask

AlphaMask BitmapEx::maAlphaMask
private

◆ maBitmap

Bitmap BitmapEx::maBitmap
private

◆ maBitmapSize

Size BitmapEx::maBitmapSize
private

Definition at line 469 of file bitmapex.hxx.

Referenced by ReplaceTransparency(), and SetSizePixel().


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