20#ifndef INCLUDED_VCL_INC_SKIA_SALBMP_H
21#define INCLUDED_VCL_INC_SKIA_SALBMP_H
26#include <boost/shared_ptr.hpp>
45 virtual bool Create(
const css::uno::Reference<css::rendering::XBitmapCanvas>& rBitmapCanvas,
46 Size& rSize,
bool bMask =
false)
override;
50 virtual
Size GetSize() const override;
51 virtual sal_uInt16 GetBitCount() const override;
58 virtual
bool ScalingSupported() const override;
59 virtual
bool Scale(const
double& rScaleX, const
double& rScaleY,
61 virtual
bool Replace(const
Color& rSearchColor, const
Color& rReplaceColor,
63 virtual
bool InterpretAs8Bit() override;
64 virtual
bool ConvertToGreyscale() override;
66 virtual
bool AlphaBlendWith(const
SalBitmap& rSalBmp) override;
67 virtual
bool Invert() override;
68#if defined MACOSX || defined IOS
69 virtual CGImageRef CreateWithMask(
const SalBitmap& rMask,
int nX,
int nY,
int nWidth,
70 int nHeight)
const override;
71 virtual CGImageRef CreateColorMask(
int nX,
int nY,
int nWidth,
int nHeight,
72 Color nMaskColor)
const override;
73 virtual CGImageRef CreateCroppedImage(
int nX,
int nY,
int nWidth,
int nHeight)
const override;
86 sk_sp<SkShader>
GetSkShader(
const SkSamplingOptions& samplingOptions,
107 void dump(
const char* file)
const;
160 template <
typename charT,
typename traits>
161 friend std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& stream,
164 if (bitmap ==
nullptr)
165 return stream <<
"(null)";
172 stream << static_cast<const void*>(bitmap) <<
" " << bitmap->
GetSize() <<
"x"
179 stream << (bitmap->
mImage->isTextureBacked() ?
"I" :
"i");
220 bool mEraseColorSet =
false;
222 int mReadAccessCount = 0;
224 int mWriteAccessCount = 0;
bool IsGreyPalette8Bit() const
Returns true if the palette is 8-bit grey palette.
const SkImage * unittestGetImage() const
boost::shared_ptr< sal_uInt8[]> mBuffer
void ResetToSkImage(sk_sp< SkImage > image)
virtual sal_uInt16 GetBitCount() const override
void unittestResetToImage()
const SkImage * unittestGetAlphaImage() const
const sk_sp< SkImage > & GetSkImage(DirectImage direct=DirectImage::No) const
bool PreferSkShader() const
bool ComputeScanlineSize()
virtual ~SkiaSalBitmap() override
bool unittestHasBuffer() const
virtual Size GetSize() const override
bool unittestHasAlphaImage() const
const sk_sp< SkImage > & GetAlphaSkImage(DirectImage direct=DirectImage::No) const
virtual bool Create(const css::uno::Reference< css::rendering::XBitmapCanvas > &rBitmapCanvas, Size &rSize, bool bMask=false) override
SkAlphaType alphaType() const
SkiaSalBitmap(const sk_sp< SkImage > &image)
sk_sp< SkShader > GetAlphaSkShader(const SkSamplingOptions &samplingOptions, DirectImage direct=DirectImage::No) const
virtual bool Create(const SalBitmap &rSalBmp) override
friend std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const SkiaSalBitmap *bitmap)
const BitmapPalette & Palette() const
SkBitmap GetAsSkBitmap() const
void dump(const char *file) const
void ResetPendingScaling()
bool unittestHasEraseColor() const
sk_sp< SkShader > GetSkShader(const SkSamplingOptions &samplingOptions, DirectImage direct=DirectImage::No) const
const sal_uInt8 * unittestGetBuffer() const
OString GetImageKey(DirectImage direct=DirectImage::No) const
bool IsFullyOpaqueAsAlpha() const
sk_sp< SkImage > mAlphaImage
bool unittestHasImage() const
void TryDirectConvertToAlphaNoScaling()
void EnsureBitmapUniqueData()
void EraseInternal(const Color &color)
virtual bool Create(const Size &rSize, vcl::PixelFormat ePixelFormat, const BitmapPalette &rPal) override
OString GetAlphaImageKey(DirectImage direct=DirectImage::No) const
virtual bool Create(const SalBitmap &rSalBmp, SalGraphics *pGraphics) override
virtual bool Create(const SalBitmap &rSalBmp, vcl::PixelFormat eNewPixelFormat) override
void ReleaseBuffer(BitmapBuffer *pBuffer, BitmapAccessMode nMode, bool dontChangeToErase)
virtual void Destroy() final override
void EnsureBitmapData() const
bool ConserveMemory() const
bool unittestHasPendingScale() const
#define VCL_PLUGIN_PUBLIC
Reference< XOutputStream > stream
Size imageSize(const sk_sp< SkImage > &image)
PixelFormat
Pixel format of the bitmap in bits per pixel.