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 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
 
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)
 
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 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
 

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

Constructor & Destructor Documentation

BitmapEx::BitmapEx ( )
BitmapEx::BitmapEx ( const OUString &  rIconName)
explicit

Definition at line 78 of file BitmapEx.cxx.

References loadFromIconTheme().

BitmapEx::BitmapEx ( const BitmapEx rBitmapEx)
default
BitmapEx::BitmapEx ( const BitmapEx rBitmapEx,
Point  aSrc,
Size  aSize 
)
BitmapEx::BitmapEx ( Size  aSize,
vcl::PixelFormat  ePixelFormat 
)

Definition at line 72 of file BitmapEx.cxx.

References maBitmap, and SetSizePixel().

BitmapEx::BitmapEx ( const Bitmap rBmp)
explicit

Definition at line 101 of file BitmapEx.cxx.

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

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

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

void BitmapEx::AdjustTransparency ( sal_uInt8  cTrans)
BitmapEx BitmapEx::AutoScaleBitmap ( BitmapEx const &  aBitmap,
const tools::Long  aStandardSize 
)
static
void BitmapEx::Clear ( )

Definition at line 188 of file BitmapEx.cxx.

References SetEmpty().

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

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

Definition at line 1442 of file BitmapEx.cxx.

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

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 374 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().

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

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

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

References Bitmap::Crop(), Bitmap::GetSizePixel(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, 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 500 of file BitmapEx.cxx.

References OutputDevice::DrawBitmapEx().

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

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

Definition at line 505 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 452 of file BitmapEx.cxx.

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

Referenced by GraphicObject::ImplTransformBitmap().

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

References COL_BLACK, COL_WHITE, Bitmap::Expand(), Bitmap::GetSizePixel(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, SAL_WARN_IF, and SetSizePixel().

AlphaMask BitmapEx::GetAlpha ( ) const
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 565 of file BitmapEx.cxx.

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

Bitmap BitmapEx::GetBitmap ( Color  aTransparentReplaceColor) const

Definition at line 203 of file BitmapEx.cxx.

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

Referenced by BitmapEx(), SvmWriter::BmpExHandler(), SvmWriter::BmpExScaleHandler(), 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::DrawDeviceBitmapEx(), OutputDevice::DrawDeviceBitmapEx(), vcl::PDFWriterImpl::drawJPGBitmap(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), OutputDevice::DrawTransparent(), OutputDevice::DrawWaveLine(), BitmapMaskToAlphaFilter::execute(), BitmapLightenFilter::execute(), BitmapDisabledImageFilter::execute(), BitmapSobelGreyFilter::execute(), BitmapPopArtFilter::execute(), BitmapMedianFilter::execute(), BitmapShadowFilter::execute(), BitmapAlphaClampFilter::execute(), BitmapSolarizeFilter::execute(), BitmapFastScaleFilter::execute(), BitmapFilterStackBlur::execute(), BitmapInterpolateScaleFilter::execute(), BitmapColorizeFilter::execute(), BitmapDuoToneFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapSeparableUnsharpenFilter::execute(), BitmapColorQuantizationFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapSepiaFilter::execute(), BitmapMosaicFilter::execute(), BitmapScaleSuperFilter::execute(), BitmapBasicMorphologyFilter::execute(), BitmapGaussianSeparableBlurFilter::execute(), BitmapMonochromeFilter::execute(), vcl::BitmapScaleConvolutionFilter::execute(), ImpGraphic::getBitmap(), unographic::Graphic::getDIB(), ImpGraphic::getGDIMetaFile(), GraphicObject::ImplDrawTiled(), GraphicObject::ImplTransformBitmap(), ImplWheelWindow::ImplWheelWindow(), EMFWriter::ImplWrite(), vcl::PDFWriterImpl::implWriteBitmapEx(), GraphicFilter::ImportGraphics(), vcl::bitmap::isHistorical8x8(), vcl::PNGWriterImpl::PNGWriterImpl(), GraphicFilter::readJPEG(), Bitmap::Scale(), TransferableHelper::SetBitmapEx(), JPEGWriter::Write(), WriteAnimation(), vcl::PDFWriterImpl::writeBitmapObject(), WriteDIB(), WriteDIBBitmapEx(), WMFWriter::WriteRecords(), and MetafileXmlDump::writeXml().

const Bitmap & BitmapEx::GetBitmap ( ) const

Gives direct access to the contained bitmap.

Definition at line 198 of file BitmapEx.cxx.

References maBitmap.

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

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

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

Referenced by GetAlpha().

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

Definition at line 82 of file bitmapex.hxx.

Referenced by BitmapDisabledImageFilter::execute().

const MapMode& BitmapEx::GetPrefMapMode ( ) const
inline
const Size& BitmapEx::GetPrefSize ( ) const
inline
sal_Int64 BitmapEx::GetSizeBytes ( ) const
const Size& BitmapEx::GetSizePixel ( ) const
inline
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 775 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_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().

bool BitmapEx::Invert ( )

Perform the Invert operation on every pixel.

Returns
true, if the operation was completed successfully.

Definition at line 249 of file BitmapEx.cxx.

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

Referenced by Animation::Invert().

bool BitmapEx::IsAlpha ( ) const

Definition at line 193 of file BitmapEx.cxx.

References Bitmap::IsEmpty(), and maAlphaMask.

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(), vcl::PDFWriterImpl::createBitmapEmit(), Image::Draw(), vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapEx(), OutputDevice::DrawBitmapWallpaper(), Printer::DrawDeviceBitmapEx(), OutputDevice::DrawDeviceBitmapEx(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), vcl::PDFWriterImpl::drawWallpaper(), BitmapDisabledImageFilter::execute(), BitmapAlphaClampFilter::execute(), vcl::drawmode::GetBitmapEx(), GetColorModel(), vcl::unotools::VclCanvasBitmap::getData(), ImpGraphic::getGDIMetaFile(), vcl::bitmap::GetMaskDIB(), vcl::unotools::VclCanvasBitmap::getPixel(), GetPixelColor(), 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(), ModifyBitmapEx(), vcl::PNGWriterImpl::PNGWriterImpl(), ReplaceTransparency(), SvtIconChoiceCtrl::SetBackground(), OutputDevice::SetBackground(), TransformBitmapEx(), vcl::unotools::VclCanvasBitmap::VclCanvasBitmap(), vcl::PDFWriterImpl::writeBitmapObject(), and WriteDIBBitmapEx().

bool BitmapEx::IsEmpty ( ) const
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 259 of file BitmapEx.cxx.

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

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

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

Definition at line 55 of file bitmapex.hxx.

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

Definition at line 53 of file bitmapex.hxx.

References operator=().

Referenced by operator=().

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

Definition at line 166 of file BitmapEx.cxx.

References GetSizePixel(), maAlphaMask, and maBitmap.

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

References Bitmap::IsEmpty(), 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 1153 of file BitmapEx.cxx.

References maBitmap, and Bitmap::Replace().

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

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

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

References maBitmap, and Bitmap::Replace().

void BitmapEx::ReplaceTransparency ( const Color rColor)

Replace transparency with given color.

Definition at line 1168 of file BitmapEx.cxx.

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

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

References COL_BLACK, COL_TRANSPARENT(), COL_WHITE, Bitmap::Erase(), Bitmap::GetGreyPalette(), GetSizePixel(), Bitmap::GetSizePixel(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, vcl::N8_BPP, 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 296 of file BitmapEx.cxx.

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

Referenced by AutoScaleBitmap(), GDIMetaFile::CreateThumbnail(), OutputDevice::DrawBitmapWallpaper(), ImpGraphic::getBitmapEx(), vcl::unotools::VclCanvasBitmap::getScaledBitmap(), GraphicObject::ImplTransformBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), 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 274 of file BitmapEx.cxx.

References Bitmap::GetSizePixel(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, 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

Definition at line 80 of file bitmapex.hxx.

Referenced by ImpGraphic::setValuesForPrefMapMod().

void BitmapEx::SetPrefSize ( const Size rPrefSize)
inline
void BitmapEx::SetSizePixel ( const Size rNewSize)

Definition at line 244 of file BitmapEx.cxx.

References maBitmapSize.

Referenced by BitmapEx(), Crop(), Expand(), 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 752 of file BitmapEx.cxx.

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

Referenced by getTransformed().

Friends And Related Function Documentation

friend class ImpGraphic
friend

Definition at line 455 of file bitmapex.hxx.

friend class OutputDevice
friend

Definition at line 456 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 1802 of file dibtools.cxx.

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

Definition at line 1835 of file dibtools.cxx.

Member Data Documentation

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

Definition at line 467 of file bitmapex.hxx.

Referenced by ReplaceTransparency(), and SetSizePixel().


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