LibreOffice Module vcl (master) 1
|
#include <bitmap.hxx>
Public Types | |
typedef vcl::ScopedBitmapAccess< BitmapReadAccess, Bitmap, &Bitmap::AcquireReadAccess > | ScopedReadAccess |
typedef vcl::ScopedBitmapAccess< BitmapInfoAccess, Bitmap, &Bitmap::AcquireInfoAccess > | ScopedInfoAccess |
Public Member Functions | |
Bitmap () | |
Bitmap (const Bitmap &rBitmap) | |
Bitmap (const Size &rSizePixel, vcl::PixelFormat ePixelFormat, const BitmapPalette *pPal=nullptr) | |
Bitmap (std::shared_ptr< SalBitmap > const &xSalBitmap) | |
virtual | ~Bitmap () |
Bitmap & | operator= (const Bitmap &rBitmap) |
Bitmap & | operator= (Bitmap &&rBitmap) noexcept |
bool | operator== (const Bitmap &rBitmap) const |
bool | operator!= (const Bitmap &rBitmap) const |
bool | IsEmpty () const |
void | SetEmpty () |
const MapMode & | GetPrefMapMode () const |
void | SetPrefMapMode (const MapMode &rMapMode) |
const Size & | GetPrefSize () const |
void | SetPrefSize (const Size &rSize) |
Size | GetSizePixel () const |
vcl::PixelFormat | getPixelFormat () const |
sal_Int64 | GetSizeBytes () const |
bool | HasGreyPalette8Bit () const |
bool | HasGreyPaletteAny () const |
bool | GetSystemData (BitmapSystemData &rData) const |
get system dependent bitmap data More... | |
BitmapChecksum | GetChecksum () const |
Bitmap | CreateDisplayBitmap (OutputDevice *pDisplay) const |
bool | Convert (BmpConversion eConversion) |
Convert bitmap format. More... | |
bool | Dither () |
Apply a Floyd dither algorithm to the bitmap. More... | |
bool | Crop (const tools::Rectangle &rRectPixel) |
Crop the bitmap. More... | |
bool | Expand (sal_Int32 nDX, sal_Int32 nDY, const Color *pInitColor=nullptr) |
Expand the bitmap by pixel padding. More... | |
bool | CopyPixel (const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc=nullptr) |
Copy a rectangular area from another bitmap. More... | |
bool | CopyPixel_AlphaOptimized (const tools::Rectangle &rRectDst, const tools::Rectangle &rRectSrc, const Bitmap *pBmpSrc) |
bool | CombineOr (const Bitmap &rMask) |
Perform boolean OR operation with another bitmap. More... | |
bool | Blend (const AlphaMask &rAlpha, const Color &rBackgroundColor) |
Alpha-blend the given bitmap against a specified uniform background color. 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... | |
void | AdaptBitCount (Bitmap &rNew) const |
bool | Rotate (Degree10 nAngle10, const Color &rFillColor) |
Rotate bitmap by the specified angle. More... | |
Bitmap | CreateMask (const Color &rTransColor, sal_uInt8 nTol=0) const |
Create on-off mask from bitmap. More... | |
vcl::Region | CreateRegion (const Color &rColor, const tools::Rectangle &rRect) const |
Create region of similar colors in a given rectangle. More... | |
bool | Replace (const Bitmap &rMask, const Color &rReplaceColor) |
Replace all pixel where the given mask is on with the specified color. More... | |
bool | Replace (const AlphaMask &rAlpha, const Color &rMergeColor) |
Merge bitmap with given background color according to specified alpha mask. More... | |
bool | Replace (const Color &rSearchColor, const Color &rReplaceColor, sal_uInt8 nTol=0) |
Replace all pixel having the search color with the specified color. More... | |
bool | Replace (const Color *pSearchColors, const Color *rReplaceColors, size_t nColorCount, sal_uInt8 const *pTols) |
Replace all pixel having one the search colors with the corresponding replace color. More... | |
void | Vectorize (GDIMetaFile &rMtf, sal_uInt8 cReduce, const Link< tools::Long, void > *pProgress) |
Convert the bitmap to a meta file. More... | |
bool | Adjust (short nLuminancePercent, short nContrastPercent=0, short nChannelRPercent=0, short nChannelGPercent=0, short nChannelBPercent=0, double fGamma=1.0, bool bInvert=false, bool msoBrightness=false) |
Change various global color characteristics. More... | |
SAL_DLLPRIVATE void | ReassignWithSize (const Bitmap &rBitmap) |
ReassignWithSize and recalculate bitmap. More... | |
SAL_DLLPRIVATE void | ImplMakeUnique () |
const std::shared_ptr< SalBitmap > & | ImplGetSalBitmap () const |
SAL_DLLPRIVATE void | ImplSetSalBitmap (const std::shared_ptr< SalBitmap > &xImpBmp) |
SAL_DLLPRIVATE bool | ImplMakeGreyscales () |
BitmapInfoAccess * | AcquireInfoAccess () |
BitmapReadAccess * | AcquireReadAccess () |
BitmapWriteAccess * | AcquireWriteAccess () |
Static Public Member Functions | |
static const BitmapPalette & | GetGreyPalette (int nEntries) |
static bool | HasFastScale () |
Returns true if bitmap scaling is considered to be fast. More... | |
static void | ReleaseAccess (BitmapInfoAccess *pAccess) |
Private Member Functions | |
SAL_DLLPRIVATE bool | ImplConvertUp (vcl::PixelFormat ePixelFormat, Color const *pExtColor=nullptr) |
SAL_DLLPRIVATE bool | ImplConvertDown8BPP (Color const *pExtColor=nullptr) |
Private Attributes | |
std::shared_ptr< SalBitmap > | mxSalBmp |
MapMode | maPrefMapMode |
Size | maPrefSize |
Definition at line 103 of file include/vcl/bitmap.hxx.
typedef vcl::ScopedBitmapAccess<BitmapInfoAccess, Bitmap, &Bitmap::AcquireInfoAccess> Bitmap::ScopedInfoAccess |
Definition at line 523 of file include/vcl/bitmap.hxx.
typedef vcl::ScopedBitmapAccess<BitmapReadAccess, Bitmap, &Bitmap::AcquireReadAccess> Bitmap::ScopedReadAccess |
Definition at line 522 of file include/vcl/bitmap.hxx.
Bitmap::Bitmap | ( | ) |
Definition at line 59 of file bitmap/bitmap.cxx.
Referenced by CreateMask().
Bitmap::Bitmap | ( | const Bitmap & | rBitmap | ) |
Definition at line 63 of file bitmap/bitmap.cxx.
Bitmap::Bitmap | ( | const Size & | rSizePixel, |
vcl::PixelFormat | ePixelFormat, | ||
const BitmapPalette * | pPal = nullptr |
||
) |
Definition at line 77 of file bitmap/bitmap.cxx.
References COL_BLACK(), COL_BLUE(), COL_BROWN(), COL_CYAN(), COL_GRAY(), COL_GREEN(), COL_LIGHTBLUE(), COL_LIGHTCYAN(), COL_LIGHTGRAY(), COL_LIGHTGREEN(), COL_LIGHTMAGENTA(), COL_LIGHTRED(), COL_MAGENTA(), COL_RED(), COL_WHITE(), COL_YELLOW(), SalInstance::CreateSalBitmap(), Size::Height(), ImplGetSVData(), vcl::isPalettePixelFormat(), ImplSVData::mpDefInst, mxSalBmp, vcl::N1_BPP, vcl::N8_BPP, BitmapPalette::SetEntryCount(), and Size::Width().
|
explicit |
Definition at line 70 of file bitmap/bitmap.cxx.
References MapPixel.
|
virtual |
Definition at line 152 of file bitmap/bitmap.cxx.
BitmapInfoAccess * Bitmap::AcquireInfoAccess | ( | ) |
Definition at line 392 of file bitmap/bitmap.cxx.
BitmapReadAccess * Bitmap::AcquireReadAccess | ( | ) |
Definition at line 404 of file bitmap/bitmap.cxx.
Referenced by AlphaMask::AcquireAlphaReadAccess(), vcl::bitmap::CanvasCairoExtractBitmapData(), vcl::bitmap::CanvasExtractBitmapData(), vcl::bitmap::CanvasTransformBitmap(), BitmapMosaicFilter::execute(), BitmapEx::GetContour(), vcl::bitmap::isHistorical8x8(), and vcl::PNGWriterImpl::PNGWriterImpl().
BitmapWriteAccess * Bitmap::AcquireWriteAccess | ( | ) |
Definition at line 416 of file bitmap/bitmap.cxx.
Referenced by AlphaMask::AcquireAlphaWriteAccess(), vcl::unotools::bitmapExFromXBitmap(), and BitmapMosaicFilter::execute().
void Bitmap::AdaptBitCount | ( | Bitmap & | rNew | ) | const |
Definition at line 1444 of file bitmap/bitmap.cxx.
References Convert(), getPixelFormat(), HasGreyPaletteAny(), vcl::INVALID, vcl::N1_BPP, N1BitThreshold, vcl::N24_BPP, N24Bit, vcl::N32_BPP, N32Bit, vcl::N8_BPP, N8BitColors, N8BitGreys, and SAL_WARN.
Referenced by BitmapScaleSuperFilter::execute(), and BitmapInterpolateScaleFilter::execute().
bool Bitmap::Adjust | ( | short | nLuminancePercent, |
short | nContrastPercent = 0 , |
||
short | nChannelRPercent = 0 , |
||
short | nChannelGPercent = 0 , |
||
short | nChannelBPercent = 0 , |
||
double | fGamma = 1.0 , |
||
bool | bInvert = false , |
||
bool | msoBrightness = false |
||
) |
Change various global color characteristics.
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 1590 of file bitmap/bitmap.cxx.
References FRound(), GAMMA, Color::GetBlue(), Color::GetGreen(), Color::GetRed(), i, MinMax(), N24BitTcBgr, N24BitTcRgb, nCount, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), Color::SetBlue(), Color::SetGreen(), and Color::SetRed().
Referenced by BitmapEx::Adjust(), and Image::Draw().
Alpha-blend the given bitmap against a specified uniform background color.
rAlpha | Alpha mask to blend with |
rBackgroundColor | Background color to use for every pixel during alpha blending |
Definition at line 1087 of file bitmappaint.cxx.
References Convert(), getPixelFormat(), vcl::isPalettePixelFormat(), Color::Merge(), and N24Bit.
Referenced by Printer::DrawDeviceBitmapEx().
bool Bitmap::CombineOr | ( | const Bitmap & | rMask | ) |
Perform boolean OR operation with another bitmap.
rMask | The mask bitmap in the selected combine operation |
Definition at line 1046 of file bitmappaint.cxx.
References COL_BLACK(), COL_WHITE(), BitmapInfoAccess::GetBestMatchingColor(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), BitmapInfoAccess::Height(), and BitmapInfoAccess::Width().
Referenced by BitmapEx::CombineMaskOr().
bool Bitmap::Convert | ( | BmpConversion | eConversion | ) |
Convert bitmap format.
eConversion | The format this bitmap should be converted to. |
Definition at line 899 of file bitmap/bitmap.cxx.
References BMP_COL_TRANS, BitmapFilter::Filter(), BitmapEx::GetBitmap(), getPixelFormat(), HasGreyPalette8Bit(), ImplConvertDown8BPP(), ImplConvertUp(), ImplGetSVData(), ImplMakeGreyscales(), ImplSetSalBitmap(), mxSalBmp, N1BitThreshold, vcl::N24_BPP, N24Bit, vcl::N32_BPP, N32Bit, vcl::N8_BPP, N8BitColors, N8BitGreys, N8BitNoConversion, N8BitTrans, nBitCount, vcl::pixelFormatBitCount(), and SAL_INFO.
Referenced by AdaptBitCount(), AlphaMask::AlphaMask(), Blend(), BitmapEx::Convert(), CopyPixel(), DetectEdges(), OutputDevice::DrawBitmap(), Printer::DrawDeviceMask(), BitmapPopArtFilter::execute(), OutputDevice::GetBitmapEx(), Printer::ImplPrintTransparent(), AlphaMask::operator=(), vcl::PNGWriterImpl::PNGWriterImpl(), AlphaMask::ReleaseAccess(), Replace(), JPEGWriter::Write(), and vcl::PDFWriterImpl::writeBitmapObject().
bool Bitmap::CopyPixel | ( | const tools::Rectangle & | rRectDst, |
const tools::Rectangle & | rRectSrc, | ||
const Bitmap * | pBmpSrc = nullptr |
||
) |
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. |
pBmpSrc | 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 480 of file bitmap/bitmap.cxx.
References Convert(), tools::Rectangle::GetHeight(), BitmapReadAccess::GetIndexFromData(), BitmapInfoAccess::GetPaletteColor(), BitmapInfoAccess::GetPaletteEntryCount(), getPixelFormat(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), GetSizePixel(), tools::Rectangle::GetWidth(), BitmapInfoAccess::HasPalette(), i, tools::Rectangle::Intersection(), tools::Rectangle::IsEmpty(), tools::Rectangle::Left(), mxSalBmp, N24Bit, N8BitColors, nCount, vcl::pixelFormatBitCount(), Point, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and tools::Rectangle::Top().
Referenced by BitmapEx::CopyPixel().
bool Bitmap::CopyPixel_AlphaOptimized | ( | const tools::Rectangle & | rRectDst, |
const tools::Rectangle & | rRectSrc, | ||
const Bitmap * | pBmpSrc | ||
) |
Definition at line 684 of file bitmap/bitmap.cxx.
References tools::Rectangle::GetHeight(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), GetSizePixel(), tools::Rectangle::GetWidth(), tools::Rectangle::Intersection(), tools::Rectangle::IsEmpty(), tools::Rectangle::Left(), mxSalBmp, Point, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and tools::Rectangle::Top().
Referenced by BitmapEx::CopyPixel().
Bitmap Bitmap::CreateDisplayBitmap | ( | OutputDevice * | pDisplay | ) | const |
Definition at line 877 of file bitmap/bitmap.cxx.
References OutputDevice::GetGraphics(), ImplGetSVData(), ImplSetSalBitmap(), and mxSalBmp.
Referenced by OutputDevice::DrawBitmapWallpaper().
Create on-off mask from bitmap.
This method creates a bitmask from the bitmap, where every pixel that equals rTransColor is set transparent, the rest opaque.
rTransColor | Color value where the bitmask should be transparent |
nTol | Tolerance value. Specifies the maximal difference between rTransColor and the individual pixel values, such that the corresponding pixel is still regarded as transparent. |
Definition at line 436 of file bitmappaint.cxx.
References Bitmap(), COL_BLACK(), COL_WHITE(), BitmapInfoAccess::GetBestMatchingColor(), Color::GetBlue(), Color::GetGreen(), GetGreyPalette(), BitmapColor::GetIndex(), BitmapReadAccess::GetIndexFromData(), BitmapInfoAccess::GetPaletteColor(), BitmapReadAccess::GetPixelFromData(), Color::GetRed(), BitmapReadAccess::GetScanline(), BitmapInfoAccess::GetScanlineFormat(), BitmapInfoAccess::GetScanlineSize(), GetSizePixel(), BitmapInfoAccess::HasPalette(), BitmapInfoAccess::Height(), maPrefMapMode, maPrefSize, vcl::N1_BPP, N1BitLsbPal, N1BitMsbPal, vcl::N8_BPP, N8BitPal, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and BitmapInfoAccess::Width().
Referenced by BitmapEx::BitmapEx(), unographic::Graphic::colorChange(), BitmapEx::CombineMaskOr(), and OutputDevice::DrawDeviceMask().
vcl::Region Bitmap::CreateRegion | ( | const Color & | rColor, |
const tools::Rectangle & | rRect | ||
) | const |
Create region of similar colors in a given rectangle.
rColor | All pixel which have this color are included in the calculated region |
rRect | The rectangle within which matching pixel are looked for. This rectangle is always clipped to the bitmap dimensions. |
Definition at line 644 of file bitmappaint.cxx.
References a, tools::Rectangle::Bottom(), BitmapInfoAccess::GetBestMatchingColor(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), GetSizePixel(), tools::Rectangle::Intersection(), tools::Rectangle::Justify(), tools::Rectangle::Left(), Point, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), tools::Rectangle::Right(), tools::Rectangle::SetBottom(), tools::Rectangle::SetLeft(), tools::Rectangle::SetRight(), tools::Rectangle::SetTop(), tools::Rectangle::Top(), and vcl::Region::Union().
Referenced by Printer::DrawDeviceMask(), Printer::ImplPrintTransparent(), and ImplWheelWindow::ImplSetRegion().
bool Bitmap::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 433 of file bitmap/bitmap.cxx.
References tools::Rectangle::GetHeight(), BitmapInfoAccess::GetPalette(), getPixelFormat(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), tools::Rectangle::GetSize(), GetSizePixel(), tools::Rectangle::GetWidth(), tools::Rectangle::Intersection(), tools::Rectangle::IsEmpty(), tools::Rectangle::Left(), Point, ReassignWithSize(), vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and tools::Rectangle::Top().
Referenced by clipMetafileContentAgainstOwnRegions(), BitmapEx::Crop(), Printer::DrawDeviceMask(), BitmapScaleSuperFilter::execute(), vcl::bitmap::GetDownsampledBitmap(), Printer::ImplPrintTransparent(), EMFWriter::ImplWrite(), and WMFWriter::WriteRecords().
bool Bitmap::Dither | ( | ) |
Apply a Floyd dither algorithm to the bitmap.
This method dithers the bitmap inplace, i.e. a true color bitmap is converted to a paletted bitmap, reducing the color deviation by error diffusion.
Definition at line 1503 of file bitmap/bitmap.cxx.
References aMap, CALC_ERRORS, CALC_TABLES3, CALC_TABLES5, CALC_TABLES7, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::get(), getColor(), GetSizePixel(), Size::Height(), BitmapInfoAccess::Height(), maPrefMapMode, maPrefSize, vcl::N8_BPP, nVCLBLut, nVCLGLut, nVCLRLut, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), shiftColor(), Size::Width(), and BitmapInfoAccess::Width().
bool Bitmap::Erase | ( | const Color & | rFillColor | ) |
Fill the entire bitmap with the given color.
rFillColor | Color value to use for filling |
Definition at line 34 of file bitmappaint.cxx.
References ImplGetSVData(), ImplSetSalBitmap(), IsEmpty(), maPrefMapMode, maPrefSize, and mxSalBmp.
Referenced by AlphaMask::AlphaMask(), createBlendFrame(), OutputDevice::DrawTransformBitmapExDirect(), OutputDevice::DrawWaveLine(), BitmapEx::Erase(), AlphaMask::Erase(), vcl::drawmode::GetBitmapEx(), GDIMetaFile::ImplBmpMonoFnc(), Printer::ImplPrintTransparent(), GraphicObject::ImplTransformBitmap(), BitmapEx::ModifyBitmapEx(), and BitmapEx::Rotate().
bool Bitmap::Expand | ( | sal_Int32 | nDX, |
sal_Int32 | nDY, | ||
const Color * | pInitColor = nullptr |
||
) |
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 |
pInitColor | Color to use for padded pixel |
Definition at line 812 of file bitmap/bitmap.cxx.
References BitmapInfoAccess::GetPalette(), getPixelFormat(), GetSizePixel(), Size::Height(), ReassignWithSize(), vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and Size::Width().
Referenced by BitmapEx::Expand().
BitmapChecksum Bitmap::GetChecksum | ( | ) | const |
Definition at line 327 of file bitmap/bitmap.cxx.
References getPixelFormat(), ImplGetSVData(), and mxSalBmp.
Referenced by vcl::PDFWriterImpl::createBitmapEmit(), vcl::PDFWriterImpl::drawJPGBitmap(), BitmapEx::GetChecksum(), and SvmWriter::GetChecksum().
|
static |
Definition at line 168 of file bitmap/bitmap.cxx.
References GetGreyPalette(), and i.
Referenced by vcl::unotools::bitmapExFromXBitmap(), CreateMask(), BitmapDisabledImageFilter::execute(), BitmapMaskToAlphaFilter::execute(), GetGreyPalette(), ImplMakeGreyscales(), GraphicObject::ImplTransformBitmap(), BitmapPalette::IsGreyPaletteAny(), and BitmapEx::Rotate().
vcl::PixelFormat Bitmap::getPixelFormat | ( | ) | const |
Definition at line 282 of file bitmap/bitmap.cxx.
References vcl::INVALID, mxSalBmp, vcl::N1_BPP, vcl::N24_BPP, vcl::N32_BPP, vcl::N8_BPP, and nBitCount.
Referenced by AdaptBitCount(), BitmapEx::BitmapEx(), BitmapInfoAccess::BitmapInfoAccess(), Blend(), vcl::bitmap::CanvasTransformBitmap(), Convert(), vcl::bitmap::convertBitmap32To24Plus8(), CopyPixel(), vcl::PDFWriterImpl::createBitmapEmit(), Crop(), Printer::DrawDeviceMask(), OutputDevice::EmulateDrawTransparent(), BitmapScaleSuperFilter::execute(), BitmapColorQuantizationFilter::execute(), BitmapMosaicFilter::execute(), BitmapPopArtFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapFastScaleFilter::execute(), Expand(), BitmapEx::GetAlpha(), OutputDevice::GetBitmapEx(), GetChecksum(), BitmapEx::GetPixelColor(), GetSizeBytes(), HasGreyPaletteAny(), ImplConvertDown8BPP(), ImplConvertUp(), Printer::ImplPrintTransparent(), AlphaMask::ImplSetBitmap(), vcl::PDFWriterImpl::implWriteBitmapEx(), vcl::bitmap::isHistorical8x8(), BitmapEx::ModifyBitmapEx(), vcl::PNGWriterImpl::PNGWriterImpl(), Replace(), Rotate(), Scale(), vcl::PDFWriterImpl::writeBitmapObject(), and MetafileXmlDump::writeXml().
|
inline |
Definition at line 540 of file include/vcl/bitmap.hxx.
References maPrefMapMode.
Referenced by clipMetafileContentAgainstOwnRegions(), DetectEdges(), BitmapColorQuantizationFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapMedianFilter::execute(), BitmapMonochromeFilter::execute(), BitmapMosaicFilter::execute(), BitmapSepiaFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), and BitmapSobelGreyFilter::execute().
|
inline |
Definition at line 550 of file include/vcl/bitmap.hxx.
References maPrefSize.
Referenced by clipMetafileContentAgainstOwnRegions(), DetectEdges(), BitmapColorQuantizationFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapMedianFilter::execute(), BitmapMonochromeFilter::execute(), BitmapMosaicFilter::execute(), BitmapSepiaFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapSobelGreyFilter::execute(), and BitmapEx::GetContour().
|
inline |
Definition at line 560 of file include/vcl/bitmap.hxx.
References getPixelFormat(), GetSizePixel(), and vcl::pixelFormatBitCount().
Referenced by BitmapEx::GetSizeBytes().
Size Bitmap::GetSizePixel | ( | ) | const |
Definition at line 277 of file bitmap/bitmap.cxx.
References mxSalBmp.
Referenced by BitmapEx::BitmapEx(), OutputDevice::BlendBitmap(), OutputDevice::BlendBitmapWithAlpha(), vcl::bitmap::CanvasExtractBitmapData(), vcl::bitmap::convertBitmap32To24Plus8(), BitmapGaussianSeparableBlurFilter::convolutionPass(), CopyPixel(), CopyPixel_AlphaOptimized(), CreateMask(), CreateRegion(), Crop(), BitmapEx::Crop(), DetectEdges(), Dither(), OutputDevice::DrawBitmap(), OutputDevice::DrawDeviceAlphaBitmap(), OutputDevice::DrawDeviceAlphaBitmapSlowPath(), Printer::DrawDeviceMask(), vcl::PDFWriterImpl::drawJPGBitmap(), OutputDevice::DrawMask(), OutputDevice::DrawTransformedBitmapEx(), BitmapWriteAccess::Erase(), BitmapScaleSuperFilter::execute(), BitmapColorQuantizationFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapDuoToneFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapGaussianSeparableBlurFilter::execute(), BitmapMedianFilter::execute(), BitmapMonochromeFilter::execute(), BitmapMosaicFilter::execute(), BitmapSeparableUnsharpenFilter::execute(), BitmapSepiaFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapSobelGreyFilter::execute(), BitmapFastScaleFilter::execute(), BitmapInterpolateScaleFilter::execute(), MetaBmpScaleAction::Execute(), BitmapEx::Expand(), Expand(), BitmapWriteAccess::FillRect(), GDIMetaFile::GetBoundRect(), BitmapEx::GetContour(), vcl::bitmap::GetDownsampledBitmap(), vcl::unotools::VclCanvasBitmap::getSize(), GetSizeBytes(), ImplConvertDown8BPP(), ImplConvertUp(), ImplMakeGreyscales(), Printer::ImplPrintTransparent(), ImplWheelWindow::ImplSetRegion(), EMFWriter::ImplWrite(), EMFWriter::ImplWriteBmpRecord(), vcl::bitmap::isHistorical8x8(), BitmapEx::ModifyBitmapEx(), ReassignWithSize(), OutputDevice::RemoveTransparenciesFromMetaFile(), Replace(), BitmapEx::ReplaceTransparency(), Rotate(), BitmapEx::Rotate(), Scale(), BitmapEx::Scale(), vcl::unotools::VclCanvasBitmap::VclCanvasBitmap(), WMFWriter::WMFRecord_StretchDIB(), vcl::PDFWriterImpl::writeBitmapObject(), vcl::PDFWriterImpl::writeGradientFunction(), and WMFWriter::WriteRecords().
bool Bitmap::GetSystemData | ( | BitmapSystemData & | rData | ) | const |
get system dependent bitmap data
rData | The system dependent BitmapSystemData structure to be filled |
Definition at line 893 of file bitmap/bitmap.cxx.
|
static |
Returns true if bitmap scaling is considered to be fast.
Currently this returns true if OpenGL is used for scaling, otherwise false (CPU scaling is slower).
Definition at line 1435 of file bitmap/bitmap.cxx.
References SkiaHelper::isVCLSkiaEnabled().
bool Bitmap::HasGreyPalette8Bit | ( | ) | const |
Definition at line 314 of file bitmap/bitmap.cxx.
References BitmapInfoAccess::GetPalette(), BitmapInfoAccess::HasPalette(), and BitmapPalette::IsGreyPalette8Bit().
Referenced by BitmapEx::BitmapEx(), Convert(), AlphaMask::ImplSetBitmap(), and JPEGWriter::Write().
bool Bitmap::HasGreyPaletteAny | ( | ) | const |
Definition at line 300 of file bitmap/bitmap.cxx.
References BitmapInfoAccess::GetPalette(), getPixelFormat(), BitmapInfoAccess::HasPalette(), BitmapPalette::IsGreyPaletteAny(), and vcl::N1_BPP.
Referenced by AdaptBitCount(), and vcl::PDFWriterImpl::writeBitmapObject().
|
private |
Definition at line 1202 of file bitmap/bitmap.cxx.
References aMap, COL_BLACK(), COL_WHITE(), InverseColorMap::GetBestPaletteIndex(), BitmapPalette::GetEntryCount(), BitmapReadAccess::GetIndexFromData(), Octree::GetPalette(), BitmapInfoAccess::GetPaletteColor(), getPixelFormat(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), GetSizePixel(), BitmapInfoAccess::HasPalette(), ImpErrorQuad::ImplAddColorError1(), ImpErrorQuad::ImplAddColorError3(), ImpErrorQuad::ImplAddColorError5(), ImpErrorQuad::ImplAddColorError7(), ImpErrorQuad::ImplGetColor(), maPrefMapMode, maPrefSize, vcl::N8_BPP, nCount, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), SAL_WARN_IF, and BitmapPalette::SetEntryCount().
Referenced by Convert().
|
private |
Definition at line 1113 of file bitmap/bitmap.cxx.
References aMap, BitmapPalette::GetEntryCount(), BitmapReadAccess::GetIndexFromData(), BitmapInfoAccess::GetPalette(), BitmapInfoAccess::GetPaletteColor(), getPixelFormat(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), GetSizePixel(), BitmapInfoAccess::HasPalette(), i, maPrefMapMode, maPrefSize, vcl::pixelFormatBitCount(), SAL_WARN_IF, and BitmapPalette::SetEntryCount().
Referenced by Convert().
|
inline |
Definition at line 510 of file include/vcl/bitmap.hxx.
Referenced by BitmapInfoAccess::BitmapInfoAccess(), BitmapReadAccess::BitmapReadAccess(), OutputDevice::BlendBitmap(), AlphaMask::BlendWith(), OutputDevice::DrawBitmap(), OutputDevice::DrawDeviceAlphaBitmap(), OutputDevice::DrawDeviceAlphaBitmapSlowPath(), OutputDevice::DrawDeviceBitmapEx(), OutputDevice::DrawDeviceMask(), OutputDevice::DrawTransformBitmapExDirect(), BitmapScaleSuperFilter::execute(), and BitmapInfoAccess::~BitmapInfoAccess().
bool Bitmap::ImplMakeGreyscales | ( | ) |
Definition at line 996 of file bitmap/bitmap.cxx.
References aMap, BitmapPalette::GetEntryCount(), GetGreyPalette(), BitmapReadAccess::GetIndexFromData(), Color::GetLuminance(), BitmapInfoAccess::GetPalette(), BitmapInfoAccess::GetPaletteColor(), BitmapInfoAccess::GetPaletteEntryCount(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), BitmapInfoAccess::GetScanlineFormat(), GetSizePixel(), BitmapInfoAccess::HasPalette(), maPrefMapMode, maPrefSize, N24BitTcBgr, N24BitTcRgb, vcl::N8_BPP, N8BitPal, and vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset().
Referenced by Convert(), BitmapEmbossGreyFilter::execute(), and BitmapSobelGreyFilter::execute().
void Bitmap::ImplMakeUnique | ( | ) |
Definition at line 354 of file bitmap/bitmap.cxx.
References SalInstance::CreateSalBitmap(), ImplGetSVData(), ImplSVData::mpDefInst, and mxSalBmp.
Referenced by BitmapInfoAccess::BitmapInfoAccess().
void Bitmap::ImplSetSalBitmap | ( | const std::shared_ptr< SalBitmap > & | xImpBmp | ) |
Definition at line 387 of file bitmap/bitmap.cxx.
References mxSalBmp.
Referenced by BitmapInfoAccess::BitmapInfoAccess(), AlphaMask::BlendWith(), Convert(), CreateDisplayBitmap(), Erase(), OutputDevice::GetBitmap(), Replace(), and Scale().
bool Bitmap::Invert | ( | ) |
Perform the Invert operation on every pixel.
Definition at line 61 of file bitmappaint.cxx.
References BitmapPalette::GetEntryCount(), i, Color::Invert(), mxSalBmp, nCount, and vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset().
Referenced by EMFWriter::ImplWrite(), BitmapEx::Invert(), and WMFWriter::WriteRecords().
|
inline |
Definition at line 535 of file include/vcl/bitmap.hxx.
References mxSalBmp.
Referenced by BitmapEx::Adjust(), AlphaMask::AlphaMask(), BitmapEx::BitmapEx(), SvmWriter::BmpExHandler(), SvmWriter::BmpExScaleHandler(), SvmWriter::BmpHandler(), SvmWriter::BmpScaleHandler(), vcl::bitmap::CanvasExtractBitmapData(), clipMetafileContentAgainstOwnRegions(), BitmapEx::Convert(), BitmapEx::CopyPixel(), BitmapEx::Crop(), DetectEdges(), OutputDevice::DrawBitmap(), Printer::DrawDeviceMask(), OutputDevice::EmulateDrawTransparent(), Erase(), BitmapEx::Erase(), BitmapEx::Expand(), BitmapEx::GetAlpha(), BitmapEx::GetBitmap(), ImpGraphic::getBitmap(), BitmapEx::GetChecksum(), vcl::bitmap::GetDownsampledBitmap(), BitmapEx::GetSizeBytes(), OutputDevice::ImplDrawRotateText(), Printer::ImplPrintTransparent(), EMFWriter::ImplWrite(), EMFWriter::ImplWriteBmpRecord(), BitmapEx::Invert(), BitmapEx::IsAlpha(), BitmapEx::IsEmpty(), SvmWriter::MaskHandler(), SvmWriter::MaskScaleHandler(), SvmWriter::MaskScalePartHandler(), BitmapEx::Mirror(), BitmapEx::ModifyBitmapEx(), AlphaMask::operator=(), BitmapEx::Replace(), Rotate(), BitmapEx::Rotate(), BitmapEx::Scale(), and WMFWriter::WriteRecords().
bool Bitmap::Mirror | ( | BmpMirrorFlags | nMirrorFlags | ) |
Mirror the bitmap.
nMirrorFlags | About which axis (horizontal, vertical, or both) to mirror |
Definition at line 127 of file bitmappaint.cxx.
References vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::get(), Horizontal, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and Vertical.
Referenced by OutputDevice::DrawBitmap(), OutputDevice::DrawDeviceAlphaBitmap(), OutputDevice::DrawDeviceMask(), Printer::DrawDeviceMask(), Printer::ImplPrintTransparent(), BitmapEx::Mirror(), and Rotate().
|
inline |
Definition at line 116 of file include/vcl/bitmap.hxx.
References operator==().
Referenced by AlphaMask::operator!=().
Definition at line 244 of file bitmap/bitmap.cxx.
Definition at line 232 of file bitmap/bitmap.cxx.
References maPrefMapMode, maPrefSize, and mxSalBmp.
Referenced by AlphaMask::operator=().
bool Bitmap::operator== | ( | const Bitmap & | rBitmap | ) | const |
Definition at line 253 of file bitmap/bitmap.cxx.
References mxSalBmp.
Referenced by AlphaMask::operator==().
void Bitmap::ReassignWithSize | ( | const Bitmap & | rBitmap | ) |
ReassignWithSize and recalculate bitmap.
ReassignWithSizes the bitmap, and recalculates the bitmap size based on the new bitmap.
rBitmap | Bitmap to reassign and use for size calculation |
Definition at line 364 of file bitmap/bitmap.cxx.
References FRound(), GetSizePixel(), Size::Height(), maPrefMapMode, maPrefSize, Size::setHeight(), Size::setWidth(), and Size::Width().
Referenced by Crop(), BitmapDuoToneFilter::execute(), BitmapGaussianSeparableBlurFilter::execute(), BitmapSeparableUnsharpenFilter::execute(), BitmapFastScaleFilter::execute(), Expand(), and Rotate().
|
static |
Definition at line 428 of file bitmap/bitmap.cxx.
Referenced by vcl::bitmap::CanvasCairoExtractBitmapData(), BitmapMosaicFilter::execute(), BitmapEx::GetContour(), vcl::bitmap::isHistorical8x8(), AlphaMask::ReleaseAccess(), vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::~ScopedBitmapAccess().
Merge bitmap with given background color according to specified alpha mask.
rAlpha | Alpha mask specifying the amount of background color to merge in |
rMergeColor | Background color to be used for merging |
Definition at line 820 of file bitmappaint.cxx.
References aMap, BitmapReadAccess::GetColor(), GetSizePixel(), BitmapInfoAccess::Height(), maPrefMapMode, maPrefSize, Color::Merge(), vcl::N24_BPP, vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), and BitmapInfoAccess::Width().
Replace all pixel where the given mask is on with the specified color.
rMask | Mask specifying which pixel should be replaced |
rReplaceColor | Color to be placed in all changed pixel |
Definition at line 742 of file bitmappaint.cxx.
References COL_WHITE(), BitmapInfoAccess::GetBestMatchingColor(), BitmapColor::GetIndex(), BitmapReadAccess::GetPixelFromData(), BitmapReadAccess::GetScanline(), BitmapInfoAccess::Height(), i, and BitmapInfoAccess::Width().
Referenced by unographic::Graphic::colorChange(), BitmapEx::GetBitmap(), EMFWriter::ImplWrite(), BitmapEx::Replace(), BitmapEx::ReplaceTransparency(), and WMFWriter::WriteRecords().
bool Bitmap::Replace | ( | const Color & | rSearchColor, |
const Color & | rReplaceColor, | ||
sal_uInt8 | nTol = 0 |
||
) |
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 |
nTol | 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 867 of file bitmappaint.cxx.
References Convert(), Color::GetBlue(), Color::GetGreen(), getPixelFormat(), Color::GetRed(), i, ImplGetSVData(), ImplSetSalBitmap(), maPrefMapMode, maPrefSize, mxSalBmp, vcl::N1_BPP, N8BitColors, and vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset().
bool Bitmap::Replace | ( | const Color * | pSearchColors, |
const Color * | rReplaceColors, | ||
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 942 of file bitmappaint.cxx.
References Convert(), Color::GetBlue(), Color::GetGreen(), getPixelFormat(), Color::GetRed(), i, vcl::N1_BPP, N8BitColors, and vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset().
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 285 of file bitmappaint.cxx.
References tools::Polygon::GetBoundRect(), BitmapInfoAccess::GetPalette(), BitmapReadAccess::GetPixel(), getPixelFormat(), tools::Rectangle::GetSize(), GetSizePixel(), Size::Height(), Horizontal, IsEmpty(), tools::Rectangle::Left(), Mirror(), Point, ReassignWithSize(), vcl::ScopedBitmapAccess< Access, Bitmap, Acquire >::reset(), tools::Polygon::Rotate(), tools::Rectangle::Top(), toRadians(), Vertical, and Size::Width().
Referenced by OutputDevice::ImplDrawRotateText(), and BitmapEx::Rotate().
bool Bitmap::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 | Method of scaling - it is recommended that either BmpScaleFlag::Default or BmpScaleFlag::BestQuality be used. |
Definition at line 1330 of file bitmap/bitmap.cxx.
References BestQuality, BiCubic, BiLinear, Default, basegfx::fTools::equal(), basegfx::fTools::equalZero(), Fast, BitmapFilter::Filter(), BitmapEx::GetBitmap(), getPixelFormat(), GetSizePixel(), Height, ImplGetSVData(), ImplSetSalBitmap(), Interpolate, Lanczos, maPrefMapMode, maPrefSize, mxSalBmp, vcl::N1_BPP, NearestNeighbor, SAL_INFO, and Width.
bool Bitmap::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 1418 of file bitmap/bitmap.cxx.
References GetSizePixel(), Size::Height(), Scale(), and Size::Width().
Referenced by BitmapEx::BitmapEx(), OutputDevice::DrawBitmap(), BitmapFastScaleFilter::execute(), ImpGraphic::getBitmap(), vcl::bitmap::GetDownsampledBitmap(), BitmapEx::Scale(), and Scale().
void Bitmap::SetEmpty | ( | ) |
Definition at line 270 of file bitmap/bitmap.cxx.
References maPrefMapMode, maPrefSize, and mxSalBmp.
Referenced by vcl::bitmap::GetDownsampledBitmap(), BitmapEx::ModifyBitmapEx(), and BitmapEx::SetEmpty().
|
inline |
Definition at line 545 of file include/vcl/bitmap.hxx.
References maPrefMapMode.
Referenced by DetectEdges(), BitmapColorQuantizationFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapMedianFilter::execute(), BitmapMonochromeFilter::execute(), BitmapMosaicFilter::execute(), BitmapSepiaFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapSobelGreyFilter::execute(), and ImpGraphic::getBitmap().
|
inline |
Definition at line 555 of file include/vcl/bitmap.hxx.
References maPrefSize.
Referenced by DetectEdges(), BitmapColorQuantizationFilter::execute(), BitmapConvolutionMatrixFilter::execute(), BitmapEmbossGreyFilter::execute(), BitmapMedianFilter::execute(), BitmapMonochromeFilter::execute(), BitmapMosaicFilter::execute(), BitmapSepiaFilter::execute(), BitmapSimpleColorQuantizationFilter::execute(), BitmapSobelGreyFilter::execute(), and ImpGraphic::getBitmap().
void Bitmap::Vectorize | ( | GDIMetaFile & | rMtf, |
sal_uInt8 | cReduce, | ||
const Link< tools::Long, void > * | pProgress | ||
) |
Convert the bitmap to a meta file.
This works by putting continuous areas of the same color into polygons painted in this color, by tracing the area's bounding line.
rMtf | The resulting meta file |
cReduce | If non-null, minimal size of bound rects for individual polygons. Smaller ones are ignored. |
pProgress | A callback for showing the progress of the vectorization |
Definition at line 1585 of file bitmap/bitmap.cxx.
References ImplVectorizer::ImplVectorize().
|
private |
Definition at line 531 of file include/vcl/bitmap.hxx.
Referenced by CreateMask(), Dither(), Erase(), GetPrefMapMode(), ImplConvertDown8BPP(), ImplConvertUp(), ImplMakeGreyscales(), operator=(), ReassignWithSize(), Replace(), Scale(), SetEmpty(), and SetPrefMapMode().
|
private |
Definition at line 532 of file include/vcl/bitmap.hxx.
Referenced by CreateMask(), Dither(), Erase(), GetPrefSize(), ImplConvertDown8BPP(), ImplConvertUp(), ImplMakeGreyscales(), operator=(), ReassignWithSize(), Replace(), Scale(), SetEmpty(), and SetPrefSize().
|
private |
Definition at line 530 of file include/vcl/bitmap.hxx.
Referenced by Bitmap(), Convert(), CopyPixel(), CopyPixel_AlphaOptimized(), CreateDisplayBitmap(), Erase(), GetChecksum(), getPixelFormat(), GetSizePixel(), GetSystemData(), ImplMakeUnique(), ImplSetSalBitmap(), Invert(), IsEmpty(), operator=(), operator==(), Replace(), Scale(), and SetEmpty().