LibreOffice Module vcl (master) 1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SkiaSalBitmap Class Referencefinal

#include <salbmp.hxx>

Inheritance diagram for SkiaSalBitmap:
[legend]
Collaboration diagram for SkiaSalBitmap:
[legend]

Public Types

using DirectImage = SkiaHelper::DirectImage
 

Public Member Functions

 SkiaSalBitmap ()
 
 SkiaSalBitmap (const sk_sp< SkImage > &image)
 
virtual ~SkiaSalBitmap () override
 
virtual bool Create (const Size &rSize, vcl::PixelFormat ePixelFormat, const BitmapPalette &rPal) override
 
virtual bool Create (const SalBitmap &rSalBmp) override
 
virtual bool Create (const SalBitmap &rSalBmp, SalGraphics *pGraphics) override
 
virtual bool Create (const SalBitmap &rSalBmp, vcl::PixelFormat eNewPixelFormat) override
 
virtual bool Create (const css::uno::Reference< css::rendering::XBitmapCanvas > &rBitmapCanvas, Size &rSize, bool bMask=false) override
 
virtual void Destroy () final override
 
virtual Size GetSize () const override
 
virtual sal_uInt16 GetBitCount () const override
 
virtual BitmapBufferAcquireBuffer (BitmapAccessMode nMode) override
 
virtual void ReleaseBuffer (BitmapBuffer *pBuffer, BitmapAccessMode nMode) override
 
virtual bool GetSystemData (BitmapSystemData &rData) override
 
virtual bool ScalingSupported () const override
 
virtual bool Scale (const double &rScaleX, const double &rScaleY, BmpScaleFlag nScaleFlag) override
 
virtual bool Replace (const Color &rSearchColor, const Color &rReplaceColor, sal_uInt8 nTol) override
 
virtual bool InterpretAs8Bit () override
 
virtual bool ConvertToGreyscale () override
 
virtual bool Erase (const Color &color) override
 
virtual bool AlphaBlendWith (const SalBitmap &rSalBmp) override
 
const BitmapPalettePalette () const
 
bool PreferSkShader () const
 
const sk_sp< SkImage > & GetSkImage (DirectImage direct=DirectImage::No) const
 
sk_sp< SkShader > GetSkShader (const SkSamplingOptions &samplingOptions, DirectImage direct=DirectImage::No) const
 
const sk_sp< SkImage > & GetAlphaSkImage (DirectImage direct=DirectImage::No) const
 
sk_sp< SkShader > GetAlphaSkShader (const SkSamplingOptions &samplingOptions, DirectImage direct=DirectImage::No) const
 
OString GetImageKey (DirectImage direct=DirectImage::No) const
 
OString GetAlphaImageKey (DirectImage direct=DirectImage::No) const
 
bool IsFullyOpaqueAsAlpha () const
 
SkAlphaType alphaType () const
 
void TryDirectConvertToAlphaNoScaling ()
 
void dump (const char *file) const
 
bool unittestHasBuffer () const
 
bool unittestHasImage () const
 
bool unittestHasAlphaImage () const
 
bool unittestHasEraseColor () const
 
bool unittestHasPendingScale () const
 
const sal_uInt8unittestGetBuffer () const
 
const SkImage * unittestGetImage () const
 
const SkImage * unittestGetAlphaImage () const
 
void unittestResetToImage ()
 
- Public Member Functions inherited from SalBitmap
 SalBitmap ()
 
virtual ~SalBitmap ()
 
virtual bool Create (const Size &rSize, vcl::PixelFormat ePixelFormat, const BitmapPalette &rPal)=0
 
virtual bool Create (const SalBitmap &rSalBmp)=0
 
virtual bool Create (const SalBitmap &rSalBmp, SalGraphics *pGraphics)=0
 
virtual bool Create (const SalBitmap &rSalBmp, vcl::PixelFormat eNewPixelFormat)=0
 
virtual bool Create (const css::uno::Reference< css::rendering::XBitmapCanvas > &rBitmapCanvas, Size &rSize, bool bMask=false)=0
 
virtual void Destroy ()=0
 
virtual Size GetSize () const =0
 
virtual sal_uInt16 GetBitCount () const =0
 
virtual BitmapBufferAcquireBuffer (BitmapAccessMode nMode)=0
 
virtual void ReleaseBuffer (BitmapBuffer *pBuffer, BitmapAccessMode nMode)=0
 
virtual bool GetSystemData (BitmapSystemData &rData)=0
 
virtual bool ScalingSupported () const =0
 
virtual bool Scale (const double &rScaleX, const double &rScaleY, BmpScaleFlag nScaleFlag)=0
 
void DropScaledCache ()
 
virtual bool Replace (const Color &rSearchColor, const Color &rReplaceColor, sal_uInt8 nTol)=0
 
virtual bool ConvertToGreyscale ()
 
virtual bool InterpretAs8Bit ()
 
virtual bool Erase (const Color &)
 
virtual bool AlphaBlendWith (const SalBitmap &)
 
BitmapChecksum GetChecksum () const
 
void InvalidateChecksum ()
 

Private Member Functions

void DataChanged ()
 
void ResetToBuffer ()
 
void ResetToSkImage (sk_sp< SkImage > image)
 
void ResetAllData ()
 
void EnsureBitmapData ()
 
void EnsureBitmapData () const
 
void EnsureBitmapUniqueData ()
 
void CreateBitmapData ()
 
bool ComputeScanlineSize ()
 
void ResetPendingScaling ()
 
void EraseInternal (const Color &color)
 
void PerformErase ()
 
bool IsAllBlack () const
 
void ReleaseBuffer (BitmapBuffer *pBuffer, BitmapAccessMode nMode, bool dontChangeToErase)
 
SkBitmap GetAsSkBitmap () const
 
bool ConserveMemory () const
 
void verify () const
 

Private Attributes

BitmapPalette mPalette
 
int mBitCount = 0
 
Size mSize
 
boost::shared_ptr< sal_uInt8[]> mBuffer
 
int mScanlineSize
 
sk_sp< SkImage > mImage
 
sk_sp< SkImage > mAlphaImage
 
Size mPixelsSize
 
BmpScaleFlag mScaleQuality = BmpScaleFlag::BestQuality
 
bool mEraseColorSet = false
 
Color mEraseColor
 
int mAnyAccessCount = 0
 
int mWriteAccessCount = 0
 

Friends

template<typename charT , typename traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &stream, const SkiaSalBitmap *bitmap)
 

Additional Inherited Members

- Protected Types inherited from SalBitmap
enum class  BitConvert {
  A8 ,
  RGBA ,
  BGRA ,
  LAST = BGRA
}
 
- Protected Member Functions inherited from SalBitmap
void updateChecksum () const
 
- Static Protected Member Functions inherited from SalBitmap
static std::unique_ptr< sal_uInt8[] > convertDataBitCount (const sal_uInt8 *src, int width, int height, int bitCount, int bytesPerRow, const BitmapPalette &palette, BitConvert type)
 
- Protected Attributes inherited from SalBitmap
BitmapChecksum mnChecksum
 
bool mbChecksumValid
 

Detailed Description

Definition at line 32 of file skia/salbmp.hxx.

Member Typedef Documentation

◆ DirectImage

Definition at line 75 of file skia/salbmp.hxx.

Constructor & Destructor Documentation

◆ SkiaSalBitmap() [1/2]

SkiaSalBitmap::SkiaSalBitmap ( )

◆ SkiaSalBitmap() [2/2]

SkiaSalBitmap::SkiaSalBitmap ( const sk_sp< SkImage > &  image)

◆ ~SkiaSalBitmap()

virtual SkiaSalBitmap::~SkiaSalBitmap ( )
overridevirtual

Member Function Documentation

◆ AcquireBuffer()

virtual BitmapBuffer * SkiaSalBitmap::AcquireBuffer ( BitmapAccessMode  nMode)
overridevirtual

Implements SalBitmap.

◆ AlphaBlendWith()

virtual bool SkiaSalBitmap::AlphaBlendWith ( const SalBitmap rSalBmp)
overridevirtual

Reimplemented from SalBitmap.

◆ alphaType()

SkAlphaType SkiaSalBitmap::alphaType ( ) const

◆ ComputeScanlineSize()

bool SkiaSalBitmap::ComputeScanlineSize ( )
private

◆ ConserveMemory()

bool SkiaSalBitmap::ConserveMemory ( ) const
private

◆ ConvertToGreyscale()

virtual bool SkiaSalBitmap::ConvertToGreyscale ( )
overridevirtual

Reimplemented from SalBitmap.

◆ Create() [1/5]

virtual bool SkiaSalBitmap::Create ( const css::uno::Reference< css::rendering::XBitmapCanvas > &  rBitmapCanvas,
Size rSize,
bool  bMask = false 
)
overridevirtual

Implements SalBitmap.

◆ Create() [2/5]

virtual bool SkiaSalBitmap::Create ( const SalBitmap rSalBmp)
overridevirtual

Implements SalBitmap.

◆ Create() [3/5]

virtual bool SkiaSalBitmap::Create ( const SalBitmap rSalBmp,
SalGraphics pGraphics 
)
overridevirtual

Implements SalBitmap.

◆ Create() [4/5]

virtual bool SkiaSalBitmap::Create ( const SalBitmap rSalBmp,
vcl::PixelFormat  eNewPixelFormat 
)
overridevirtual

Implements SalBitmap.

◆ Create() [5/5]

virtual bool SkiaSalBitmap::Create ( const Size rSize,
vcl::PixelFormat  ePixelFormat,
const BitmapPalette rPal 
)
overridevirtual

Implements SalBitmap.

◆ CreateBitmapData()

void SkiaSalBitmap::CreateBitmapData ( )
private

◆ DataChanged()

void SkiaSalBitmap::DataChanged ( )
private

◆ Destroy()

virtual void SkiaSalBitmap::Destroy ( )
finaloverridevirtual

Implements SalBitmap.

◆ dump()

void SkiaSalBitmap::dump ( const char *  file) const

◆ EnsureBitmapData() [1/2]

void SkiaSalBitmap::EnsureBitmapData ( )
private

◆ EnsureBitmapData() [2/2]

void SkiaSalBitmap::EnsureBitmapData ( ) const
inlineprivate

Definition at line 124 of file skia/salbmp.hxx.

References EnsureBitmapData().

Referenced by EnsureBitmapData().

◆ EnsureBitmapUniqueData()

void SkiaSalBitmap::EnsureBitmapUniqueData ( )
private

◆ Erase()

virtual bool SkiaSalBitmap::Erase ( const Color color)
overridevirtual

Reimplemented from SalBitmap.

◆ EraseInternal()

void SkiaSalBitmap::EraseInternal ( const Color color)
private

◆ GetAlphaImageKey()

OString SkiaSalBitmap::GetAlphaImageKey ( DirectImage  direct = DirectImage::No) const

◆ GetAlphaSkImage()

const sk_sp< SkImage > & SkiaSalBitmap::GetAlphaSkImage ( DirectImage  direct = DirectImage::No) const

◆ GetAlphaSkShader()

sk_sp< SkShader > SkiaSalBitmap::GetAlphaSkShader ( const SkSamplingOptions &  samplingOptions,
DirectImage  direct = DirectImage::No 
) const

◆ GetAsSkBitmap()

SkBitmap SkiaSalBitmap::GetAsSkBitmap ( ) const
private

◆ GetBitCount()

virtual sal_uInt16 SkiaSalBitmap::GetBitCount ( ) const
overridevirtual

Implements SalBitmap.

◆ GetImageKey()

OString SkiaSalBitmap::GetImageKey ( DirectImage  direct = DirectImage::No) const

◆ GetSize()

virtual Size SkiaSalBitmap::GetSize ( ) const
overridevirtual

Implements SalBitmap.

◆ GetSkImage()

const sk_sp< SkImage > & SkiaSalBitmap::GetSkImage ( DirectImage  direct = DirectImage::No) const

◆ GetSkShader()

sk_sp< SkShader > SkiaSalBitmap::GetSkShader ( const SkSamplingOptions &  samplingOptions,
DirectImage  direct = DirectImage::No 
) const

◆ GetSystemData()

virtual bool SkiaSalBitmap::GetSystemData ( BitmapSystemData rData)
overridevirtual

Implements SalBitmap.

◆ InterpretAs8Bit()

virtual bool SkiaSalBitmap::InterpretAs8Bit ( )
overridevirtual

Reimplemented from SalBitmap.

◆ IsAllBlack()

bool SkiaSalBitmap::IsAllBlack ( ) const
private

◆ IsFullyOpaqueAsAlpha()

bool SkiaSalBitmap::IsFullyOpaqueAsAlpha ( ) const

◆ Palette()

const BitmapPalette & SkiaSalBitmap::Palette ( ) const
inline

Definition at line 68 of file skia/salbmp.hxx.

◆ PerformErase()

void SkiaSalBitmap::PerformErase ( )
private

◆ PreferSkShader()

bool SkiaSalBitmap::PreferSkShader ( ) const

◆ ReleaseBuffer() [1/2]

virtual void SkiaSalBitmap::ReleaseBuffer ( BitmapBuffer pBuffer,
BitmapAccessMode  nMode 
)
overridevirtual

Implements SalBitmap.

◆ ReleaseBuffer() [2/2]

void SkiaSalBitmap::ReleaseBuffer ( BitmapBuffer pBuffer,
BitmapAccessMode  nMode,
bool  dontChangeToErase 
)
private

◆ Replace()

virtual bool SkiaSalBitmap::Replace ( const Color rSearchColor,
const Color rReplaceColor,
sal_uInt8  nTol 
)
overridevirtual

Implements SalBitmap.

◆ ResetAllData()

void SkiaSalBitmap::ResetAllData ( )
private

◆ ResetPendingScaling()

void SkiaSalBitmap::ResetPendingScaling ( )
private

◆ ResetToBuffer()

void SkiaSalBitmap::ResetToBuffer ( )
private

◆ ResetToSkImage()

void SkiaSalBitmap::ResetToSkImage ( sk_sp< SkImage >  image)
private

◆ Scale()

virtual bool SkiaSalBitmap::Scale ( const double &  rScaleX,
const double &  rScaleY,
BmpScaleFlag  nScaleFlag 
)
overridevirtual

Implements SalBitmap.

◆ ScalingSupported()

virtual bool SkiaSalBitmap::ScalingSupported ( ) const
overridevirtual

Implements SalBitmap.

◆ TryDirectConvertToAlphaNoScaling()

void SkiaSalBitmap::TryDirectConvertToAlphaNoScaling ( )

◆ unittestGetAlphaImage()

const SkImage * SkiaSalBitmap::unittestGetAlphaImage ( ) const
inline

Definition at line 109 of file skia/salbmp.hxx.

◆ unittestGetBuffer()

const sal_uInt8 * SkiaSalBitmap::unittestGetBuffer ( ) const
inline

Definition at line 107 of file skia/salbmp.hxx.

◆ unittestGetImage()

const SkImage * SkiaSalBitmap::unittestGetImage ( ) const
inline

Definition at line 108 of file skia/salbmp.hxx.

◆ unittestHasAlphaImage()

bool SkiaSalBitmap::unittestHasAlphaImage ( ) const
inline

Definition at line 104 of file skia/salbmp.hxx.

◆ unittestHasBuffer()

bool SkiaSalBitmap::unittestHasBuffer ( ) const
inline

Definition at line 102 of file skia/salbmp.hxx.

◆ unittestHasEraseColor()

bool SkiaSalBitmap::unittestHasEraseColor ( ) const
inline

Definition at line 105 of file skia/salbmp.hxx.

◆ unittestHasImage()

bool SkiaSalBitmap::unittestHasImage ( ) const
inline

Definition at line 103 of file skia/salbmp.hxx.

◆ unittestHasPendingScale()

bool SkiaSalBitmap::unittestHasPendingScale ( ) const
inline

Definition at line 106 of file skia/salbmp.hxx.

◆ unittestResetToImage()

void SkiaSalBitmap::unittestResetToImage ( )
inline

Definition at line 110 of file skia/salbmp.hxx.

◆ verify()

void SkiaSalBitmap::verify ( ) const
private

Friends And Related Function Documentation

◆ operator<<

template<typename charT , typename traits >
std::basic_ostream< charT, traits > & operator<< ( std::basic_ostream< charT, traits > &  stream,
const SkiaSalBitmap bitmap 
)
friend

Definition at line 153 of file skia/salbmp.hxx.

Member Data Documentation

◆ mAlphaImage

sk_sp<SkImage> SkiaSalBitmap::mAlphaImage
private

Definition at line 206 of file skia/salbmp.hxx.

◆ mAnyAccessCount

int SkiaSalBitmap::mAnyAccessCount = 0
private

Definition at line 214 of file skia/salbmp.hxx.

◆ mBitCount

int SkiaSalBitmap::mBitCount = 0
private

Definition at line 193 of file skia/salbmp.hxx.

◆ mBuffer

boost::shared_ptr<sal_uInt8[]> SkiaSalBitmap::mBuffer
private

Definition at line 203 of file skia/salbmp.hxx.

◆ mEraseColor

Color SkiaSalBitmap::mEraseColor
private

Definition at line 213 of file skia/salbmp.hxx.

◆ mEraseColorSet

bool SkiaSalBitmap::mEraseColorSet = false
private

Definition at line 212 of file skia/salbmp.hxx.

◆ mImage

sk_sp<SkImage> SkiaSalBitmap::mImage
private

Definition at line 205 of file skia/salbmp.hxx.

◆ mPalette

BitmapPalette SkiaSalBitmap::mPalette
private

Definition at line 192 of file skia/salbmp.hxx.

◆ mPixelsSize

Size SkiaSalBitmap::mPixelsSize
private

Definition at line 209 of file skia/salbmp.hxx.

◆ mScaleQuality

BmpScaleFlag SkiaSalBitmap::mScaleQuality = BmpScaleFlag::BestQuality
private

Definition at line 210 of file skia/salbmp.hxx.

◆ mScanlineSize

int SkiaSalBitmap::mScanlineSize
private

Definition at line 204 of file skia/salbmp.hxx.

◆ mSize

Size SkiaSalBitmap::mSize
private

Definition at line 194 of file skia/salbmp.hxx.

◆ mWriteAccessCount

int SkiaSalBitmap::mWriteAccessCount = 0
private

Definition at line 216 of file skia/salbmp.hxx.


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