LibreOffice Module vcl (master) 1
|
#include <bitmapex.hxx>
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) | |
BitmapEx & | operator= (const BitmapEx &rBitmapEx) |
BitmapEx & | operator= (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 Bitmap & | GetBitmap () const |
Gives direct access to the contained bitmap. More... | |
bool | IsAlpha () const |
const AlphaMask & | GetAlphaMask () const |
const Size & | GetSizePixel () const |
void | SetSizePixel (const Size &rNewSize) |
const Size & | GetPrefSize () const |
void | SetPrefSize (const Size &rPrefSize) |
const MapMode & | GetPrefMapMode () 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) |
Definition at line 37 of file bitmapex.hxx.
BitmapEx::BitmapEx | ( | ) |
Definition at line 53 of file BitmapEx.cxx.
Referenced by AdjustTransparency(), ChangeColorAlpha(), Create(), ModifyBitmapEx(), and TransformBitmapEx().
|
explicit |
Definition at line 80 of file BitmapEx.cxx.
References loadFromIconTheme().
|
default |
Definition at line 59 of file BitmapEx.cxx.
References CopyPixel(), Bitmap::getPixelFormat(), AlphaMask::ImplGetBitmap(), IsAlpha(), Size::IsEmpty(), IsEmpty(), maAlphaMask, maBitmap, and SetSizePixel().
BitmapEx::BitmapEx | ( | Size | aSize, |
vcl::PixelFormat | ePixelFormat | ||
) |
Definition at line 74 of file BitmapEx.cxx.
References maBitmap, and SetSizePixel().
|
explicit |
Definition at line 103 of file BitmapEx.cxx.
Definition at line 109 of file BitmapEx.cxx.
References Fast, BitmapFilter::Filter(), GetBitmap(), Bitmap::getPixelFormat(), Bitmap::GetSizePixel(), Bitmap::HasGreyPalette8Bit(), Bitmap::Invert(), Invert(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, vcl::N8_BPP, SAL_WARN, and Bitmap::Scale().
Definition at line 149 of file BitmapEx.cxx.
References Fast, Bitmap::GetSizePixel(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, and Bitmap::Scale().
Definition at line 162 of file BitmapEx.cxx.
References Bitmap::CreateAlphaMask(), Bitmap::GetSizePixel(), maAlphaMask, maBitmap, and SAL_WARN_IF.
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.
nLuminancePercent | Percent of luminance change, valid range [-100,100]. Values outside this range are clipped to the valid range. |
nContrastPercent | Percent of contrast change, valid range [-100,100]. Values outside this range are clipped to the valid range. |
nChannelRPercent | Percent of red channel change, valid range [-100,100]. Values outside this range are clipped to the valid range. |
nChannelGPercent | Percent of green channel change, valid range [-100,100]. Values outside this range are clipped to the valid range. |
nChannelBPercent | Percent of blue channel change, valid range [-100,100]. Values outside this range are clipped to the valid range. |
fGamma | Exponent 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. |
bInvert | If true, invert the channel values with the logical 'not' operator |
msoBrightness | Use the same formula for brightness as used by MSOffice. |
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().
void BitmapEx::AdjustTransparency | ( | sal_uInt8 | cTrans | ) |
Definition at line 1388 of file BitmapEx.cxx.
References BitmapEx(), GetAlphaMask(), GetBitmap(), GetSizePixel(), IsAlpha(), N8BitPal, and BitmapColor::SetIndex().
|
static |
Definition at line 514 of file BitmapEx.cxx.
References BestQuality, COL_TRANSPARENT(), Application::GetDefaultDevice(), GetSizePixel(), Size::Height(), Scale(), and Size::Width().
Definition at line 1365 of file BitmapEx.cxx.
References BitmapEx(), vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::get(), GetAlphaMask(), GetBitmap(), BitmapColor::GetIndex(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), BitmapInfoAccess::Height(), maBitmap, and BitmapInfoAccess::Width().
Referenced by unographic::Graphic::colorChange().
void BitmapEx::Clear | ( | ) |
Definition at line 197 of file BitmapEx.cxx.
References SetEmpty().
Referenced by ImpGraphic::clearGraphics(), and createBlendFrame().
void BitmapEx::ClearAlpha | ( | ) |
Definition at line 202 of file BitmapEx.cxx.
References maAlphaMask, and Bitmap::SetEmpty().
Referenced by vcl::pngWrite().
Definition at line 1445 of file BitmapEx.cxx.
References Bitmap::CombineOr(), Bitmap::CreateMask(), IsAlpha(), maAlphaMask, and maBitmap.
bool BitmapEx::Convert | ( | BmpConversion | eConversion | ) |
Convert bitmap format.
eConversion | The format this bitmap should be converted to. |
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().
bool BitmapEx::CopyPixel | ( | const tools::Rectangle & | rRectDst, |
const tools::Rectangle & | rRectSrc, | ||
const BitmapEx * | pBmpExSrc | ||
) |
Copy a rectangular area from another bitmap.
rRectDst | Destination rectangle in this bitmap. This is clipped to the bitmap dimensions. |
rRectSrc | Source 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. |
pBmpExSrc | The 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. |
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().
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().
bool BitmapEx::Crop | ( | const tools::Rectangle & | rRectPixel | ) |
Crop the bitmap.
rRectPixel | A 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. |
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().
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().
void BitmapEx::Draw | ( | OutputDevice * | pOutDev, |
const Point & | rDestPt, | ||
const Size & | rDestSize | ||
) | const |
Definition at line 508 of file BitmapEx.cxx.
References OutputDevice::DrawBitmapEx().
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().
bool BitmapEx::Erase | ( | const Color & | rFillColor | ) |
Fill the entire bitmap with the given color.
rFillColor | Color value to use for filling. Set the transparency part of the color to fill the mask. |
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().
void BitmapEx::Expand | ( | sal_Int32 | nDX, |
sal_Int32 | nDY, | ||
bool | bExpandTransparent = false |
||
) |
Expand the bitmap by pixel padding.
nDX | Number of pixel to pad at the right border of the bitmap |
nDY | Number of scanlines to pad at the bottom border of the bitmap |
bExpandTransparent | Whether 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().
sal_uInt8 BitmapEx::GetAlpha | ( | sal_Int32 | nX, |
sal_Int32 | nY | ||
) | const |
Get alpha at given position.
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.
|
inline |
Definition at line 71 of file bitmapex.hxx.
Referenced by AdjustTransparency(), unographic::Graphic::applyDuotone(), vcl::bitmap::CanvasCairoExtractBitmapData(), vcl::bitmap::CanvasExtractBitmapData(), vcl::bitmap::CanvasTransformBitmap(), ChangeColorAlpha(), vcl::bitmap::convertBitmap32To24Plus8(), vcl::PDFWriterImpl::createBitmapEmit(), Image::Draw(), vcl::bitmap::DrawAlphaBitmapAndAlphaGradient(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapWallpaper(), OutputDevice::DrawDeviceBitmapEx(), Printer::DrawDeviceBitmapEx(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), OutputDevice::DrawTransparent(), OutputDevice::DrawWaveLine(), BitmapBasicMorphologyFilter::execute(), BitmapFilterStackBlur::execute(), BitmapAlphaClampFilter::execute(), BitmapDisabledImageFilter::execute(), BitmapFastScaleFilter::execute(), BitmapLightenFilter::execute(), vcl::drawmode::GetBitmapEx(), vcl::bitmap::GetMaskDIB(), GetPixelColor(), GDIMetaFile::ImplBmpMonoFnc(), GraphicObject::ImplTransformBitmap(), EMFWriter::ImplWrite(), vcl::PDFWriterImpl::implWriteBitmapEx(), GraphicFilter::ImportGraphics(), ModifyBitmapEx(), vcl::PDFWriterImpl::playMetafile(), vcl::pngWrite(), ReplaceTransparency(), OutputDevice::SetBackground(), TransformBitmapEx(), vcl::unotools::VclCanvasBitmap::VclCanvasBitmap(), vcl::PDFWriterImpl::writeBitmapObject(), WMFWriter::WriteRecords(), and writeWebp().
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().
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().
BitmapChecksum BitmapEx::GetChecksum | ( | ) | const |
Definition at line 239 of file BitmapEx.cxx.
References BCToBCOA(), BITMAP_CHECKSUM_SIZE, Bitmap::GetChecksum(), AlphaMask::IsEmpty(), maAlphaMask, maBitmap, and vcl_get_checksum().
Referenced by ImplImage::getBitmapEx(), Animation::GetChecksum(), AnimationFrame::GetChecksum(), ImpGraphic::getChecksum(), SvmWriter::GetChecksum(), vcl::PDFWriterImpl::implWriteBitmapEx(), and MetafileXmlDump::writeXml().
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 | ||
) |
Retrieves the color model data we need for the XImageConsumer stuff.
Definition at line 1456 of file BitmapEx.cxx.
References BitmapInfoAccess::GetBitCount(), Color::GetBlue(), Color::GetGreen(), BitmapInfoAccess::GetPaletteColor(), BitmapInfoAccess::GetPaletteEntryCount(), Color::GetRed(), BitmapInfoAccess::HasPalette(), BitmapInfoAccess::Height(), i, IsAlpha(), maBitmap, and BitmapInfoAccess::Width().
tools::Polygon BitmapEx::GetContour | ( | bool | bContourEdgeDetect, |
const tools::Rectangle * | pWorkRect | ||
) |
Get contours in image.
Definition at line 1269 of file BitmapEx.cxx.
References Bitmap::AcquireReadAccess(), tools::Rectangle::Bottom(), COL_BLACK(), DetectEdges(), BitmapInfoAccess::GetBestMatchingColor(), tools::Rectangle::GetHeight(), BitmapReadAccess::GetPixelFromData(), Bitmap::GetPrefSize(), BitmapReadAccess::GetScanline(), Bitmap::GetSizePixel(), tools::Rectangle::GetWidth(), Size::Height(), BitmapInfoAccess::Height(), tools::Rectangle::Intersection(), tools::Rectangle::Left(), maBitmap, tools::Rectangle::Normalize(), Bitmap::ReleaseAccess(), tools::Rectangle::Right(), tools::Polygon::Scale(), tools::Polygon::SetSize(), tools::Rectangle::Top(), Size::Width(), and BitmapInfoAccess::Width().
Color BitmapEx::GetPixelColor | ( | sal_Int32 | nX, |
sal_Int32 | nY | ||
) | const |
Get pixel color (including alpha) at given position.
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().
|
inline |
Definition at line 82 of file bitmapex.hxx.
Referenced by BitmapDisabledImageFilter::execute(), and vcl::PageSyncData::PlaySyncPageAct().
|
inline |
Definition at line 79 of file bitmapex.hxx.
Referenced by clipMetafileContentAgainstOwnRegions(), vcl::PDFWriterImpl::drawWallpaper(), ImpGraphic::getGDIMetaFile(), ImpGraphic::getPrefMapMode(), vcl::PDFWriterImpl::playMetafile(), and vcl::pngWrite().
|
inline |
Definition at line 76 of file bitmapex.hxx.
Referenced by clipMetafileContentAgainstOwnRegions(), vcl::PDFWriterImpl::drawWallpaper(), ImpGraphic::getGDIMetaFile(), ImpGraphic::getPrefMapMode(), ImpGraphic::getPrefSize(), vcl::PDFWriterImpl::playMetafile(), and vcl::pngWrite().
sal_Int64 BitmapEx::GetSizeBytes | ( | ) | const |
Definition at line 229 of file BitmapEx.cxx.
References Bitmap::GetSizeBytes(), AlphaMask::IsEmpty(), maAlphaMask, and maBitmap.
Referenced by OutputDevice::DrawTransformedBitmapEx(), Animation::GetSizeBytes(), GDIMetaFile::GetSizeBytes(), and ImpGraphic::getSizeBytes().
|
inline |
Definition at line 73 of file bitmapex.hxx.
Referenced by AdjustTransparency(), AutoScaleBitmap(), vcl::bitmap::CanvasTransformBitmap(), CopyPixel(), vcl::PDFWriterImpl::createBitmapEmit(), ImpGraphic::createSwapInfo(), GDIMetaFile::CreateThumbnail(), Image::Draw(), vcl::bitmap::DrawAndClipBitmap(), OutputDevice::DrawBitmapEx(), OutputDevice::DrawBitmapWallpaper(), OutputDevice::DrawDeviceBitmapEx(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawTransformedBitmapEx(), OutputDevice::DrawWaveLine(), BitmapScaleSuperFilter::execute(), BitmapAlphaClampFilter::execute(), BitmapDisabledImageFilter::execute(), BitmapLightenFilter::execute(), BitmapMaskToAlphaFilter::execute(), MetaBmpExScaleAction::Execute(), GetAlpha(), vcl::drawmode::GetBitmapEx(), ImplImage::getBitmapEx(), ImplImage::getBitmapExForHiDPI(), GDIMetaFile::GetBoundRect(), ImpGraphic::getPrefSize(), ImplImage::getSizePixel(), ImpGraphic::getSizePixel(), getTransformed(), GraphicObject::GetTransformedGraphic(), GraphicID::GraphicID(), ImpGetScaledGraphic(), GDIMetaFile::ImplBmpMonoFnc(), FixedBitmap::ImplDraw(), GraphicObject::ImplDrawTiled(), GraphicObject::ImplTransformBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), ImportTiffGraphicImport(), operator==(), vcl::PDFWriterImpl::playMetafile(), vcl::pngWrite(), Rotate(), GraphicNativeTransform::rotateJPEG(), Scale(), writeWebp(), and MetafileXmlDump::writeXml().
BitmapEx BitmapEx::getTransformed | ( | const basegfx::B2DHomMatrix & | rTransformation, |
const basegfx::B2DRange & | rVisibleRange, | ||
double | fMaximumArea | ||
) | const |
Create transformed Bitmap.
rTransformation | The transformation from unit coordinates to the unit range |
rVisibleRange | The relative visible range in unit coordinates, relative to (0,0,1,1) which defines the whole target area |
fMaximumArea | A 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
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().
|
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.
Definition at line 258 of file BitmapEx.cxx.
References Bitmap::Invert(), Bitmap::IsEmpty(), and maBitmap.
Referenced by BitmapEx(), vcl::drawmode::GetBitmapEx(), and Animation::Invert().
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().
bool BitmapEx::IsEmpty | ( | ) | const |
Definition at line 186 of file BitmapEx.cxx.
References AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, and maBitmap.
Referenced by NotebookbarPopup::ApplyBackground(), MenuBarWindow::ApplySettings(), BitmapEx(), clipMetafileContentAgainstOwnRegions(), CopyPixel(), ImpGraphic::createSwapInfo(), GDIMetaFile::CreateThumbnail(), ImplImageTree::doLoadImage(), ImpGraphic::draw(), OutputDevice::DrawDeviceBitmapEx(), ImplWin::DrawEntry(), ImplListBoxWindow::DrawEntry(), OutputDevice::DrawTransformedBitmapEx(), VectorGraphicData::ensurePdfReplacement(), VectorGraphicData::ensureReplacement(), BitmapFilter::Filter(), ImpGraphic::getBitmap(), vcl::drawmode::GetBitmapEx(), ImpGraphic::getBitmapEx(), ImpGraphic::getGDIMetaFile(), ImpGraphic::getPrefMapMode(), ImpGraphic::getPrefSize(), ImplImage::getSizePixel(), getTransformed(), FixedBitmap::ImplDraw(), ToolBox::ImplDrawBackground(), Wallpaper::ImplGetCachedBitmap(), Image::ImplInit(), vcl::PDFWriterImpl::implWriteBitmapEx(), Wallpaper::IsBitmap(), Wallpaper::IsFixed(), Wallpaper::IsScrollable(), NotebookbarPopup::NotebookbarPopup(), MenuBarWindow::Paint(), vcl::pngWrite(), GraphicFilter::readPNG(), ImplBorderWindow::Resize(), TransferableHelper::SetBitmapEx(), setupPersonaHeaderFooter(), ImpGraphic::setValuesForPrefSize(), and NotebookBar::UpdateBackground().
|
private |
Definition at line 85 of file BitmapEx.cxx.
References StyleSettings::DetermineIconTheme(), ImageTree::get(), Application::GetSettings(), AllSettings::GetStyleSettings(), ImageTree::loadImage(), and SAL_WARN_IF.
Referenced by BitmapEx().
bool BitmapEx::Mirror | ( | BmpMirrorFlags | nMirrorFlags | ) |
Mirror the bitmap.
nMirrorFlags | About which axis (horizontal, vertical, or both) to mirror |
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().
BitmapEx BitmapEx::ModifyBitmapEx | ( | const basegfx::BColorModifierStack & | rBColorModifierStack | ) | const |
Create ColorStack-modified version of this BitmapEx.
rBColorModifierStack | A ColrModifierStack which defines how each pixel has to be modified |
Definition at line 859 of file BitmapEx.cxx.
References a, BitmapEx(), basegfx::BColorModifierStack::count(), Bitmap::Erase(), GetAlphaMask(), basegfx::BColorModifier_replace::getBColor(), basegfx::BColorModifierStack::getBColorModifier(), GetBitmap(), basegfx::BColor::getBlue(), Color::GetBlue(), basegfx::BColor::getGreen(), Color::GetGreen(), BitmapInfoAccess::GetPalette(), Bitmap::getPixelFormat(), basegfx::BColor::getRed(), Color::GetRed(), Bitmap::GetSizePixel(), IsAlpha(), Bitmap::IsEmpty(), vcl::isPalettePixelFormat(), N24BitTcBgr, N24BitTcRgb, nCount, Bitmap::SetEmpty(), x, and y.
|
inline |
Definition at line 54 of file bitmapex.hxx.
bool BitmapEx::operator== | ( | const BitmapEx & | rBitmapEx | ) | const |
Definition at line 175 of file BitmapEx.cxx.
References GetSizePixel(), maAlphaMask, and maBitmap.
Replace all pixel having the search color with the specified color.
rSearchColor | Color specifying which pixel should be replaced |
rReplaceColor | Color 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().
void BitmapEx::Replace | ( | const Color & | rSearchColor, |
const Color & | rReplaceColor, | ||
sal_uInt8 | nTolerance | ||
) |
Replace all pixel having the search color with the specified color.
rSearchColor | Color specifying which pixel should be replaced |
rReplaceColor | Color to be placed in all changed pixel |
nTolerance | Tolerance 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().
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.
pSearchColors | Array of colors specifying which pixel should be replaced |
pReplaceColors | Array of colors to be placed in all changed pixel |
nColorCount | Size of the aforementioned color arrays |
pTols | Tolerance 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().
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.
pSearchColors | Array of colors specifying which pixel should be replaced |
rReplaceColors | Array of colors to be placed in all changed pixel |
nColorCount | Size of the aforementioned color arrays |
pTols | Tolerance 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 1165 of file BitmapEx.cxx.
References maBitmap, and Bitmap::Replace().
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 bitmap by the specified angle.
nAngle10 | The rotation angle in tenth of a degree. The bitmap is always rotated around its center. |
rFillColor | The 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. |
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().
bool BitmapEx::Scale | ( | const double & | rScaleX, |
const double & | rScaleY, | ||
BmpScaleFlag | nScaleFlag = BmpScaleFlag::Default |
||
) |
Scale the bitmap.
rScaleX | The scale factor in x direction. |
rScaleY | The scale factor in y direction. |
nScaleFlag | The algorithm to be used for scaling |
Definition at line 283 of file BitmapEx.cxx.
References Bitmap::GetSizePixel(), AlphaMask::IsEmpty(), Bitmap::IsEmpty(), maAlphaMask, maBitmap, SAL_WARN_IF, Bitmap::Scale(), and SetSizePixel().
bool BitmapEx::Scale | ( | const Size & | rNewSize, |
BmpScaleFlag | nScaleFlag = BmpScaleFlag::Default |
||
) |
Scale the bitmap.
rNewSize | The resulting size of the scaled bitmap |
nScaleFlag | The algorithm to be used for scaling |
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().
void BitmapEx::SetEmpty | ( | ) |
Definition at line 191 of file BitmapEx.cxx.
References maAlphaMask, maBitmap, and Bitmap::SetEmpty().
Referenced by Animation::Clear(), Clear(), GDIMetaFile::CreateThumbnail(), ImplImageTree::doLoadImage(), Wallpaper::ImplReleaseCachedBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), Wallpaper::SetBitmap(), Wallpaper::SetColor(), and Wallpaper::SetGradient().
|
inline |
Definition at line 80 of file bitmapex.hxx.
Referenced by ImportTiffGraphicImport(), and ImpGraphic::setValuesForPrefMapMod().
|
inline |
Definition at line 77 of file bitmapex.hxx.
Referenced by ImpGraphic::getVectorGraphicReplacement(), ImportTiffGraphicImport(), and ImpGraphic::setValuesForPrefSize().
void BitmapEx::SetSizePixel | ( | const Size & | rNewSize | ) |
Definition at line 253 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.
fWidth | The target width in pixels |
fHeight | The target height in pixels |
rTransformation | The 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().
|
friend |
Definition at line 457 of file bitmapex.hxx.
|
friend |
Definition at line 458 of file bitmapex.hxx.
|
friend |
Definition at line 1709 of file dibtools.cxx.
|
friend |
Definition at line 1742 of file dibtools.cxx.
|
private |
Definition at line 468 of file bitmapex.hxx.
Referenced by BitmapEx(), ClearAlpha(), CombineMaskOr(), CopyPixel(), Crop(), OutputDevice::DrawDeviceBitmapEx(), Erase(), Expand(), GetAlpha(), GetBitmap(), GetChecksum(), GetSizeBytes(), IsAlpha(), IsEmpty(), Mirror(), operator==(), ReplaceTransparency(), Rotate(), Scale(), and SetEmpty().
|
private |
Definition at line 467 of file bitmapex.hxx.
Referenced by Adjust(), BitmapEx(), ChangeColorAlpha(), CombineMaskOr(), Convert(), CopyPixel(), Crop(), Erase(), Expand(), GetAlpha(), GetBitmap(), GetChecksum(), GetColorModel(), GetContour(), GetPixelColor(), GetSizeBytes(), Invert(), IsEmpty(), Mirror(), operator==(), Replace(), ReplaceTransparency(), Rotate(), Scale(), and SetEmpty().
|
private |
Definition at line 469 of file bitmapex.hxx.
Referenced by ReplaceTransparency(), and SetSizePixel().