LibreOffice Module sd (master) 1
Classes | Public Member Functions | Static Private Attributes | List of all members
sd::slidesorter::cache::ResolutionReduction Class Reference

Compress a preview bitmap by reducing its resolution. More...

#include <SlsBitmapCompressor.hxx>

Inheritance diagram for sd::slidesorter::cache::ResolutionReduction:
[legend]
Collaboration diagram for sd::slidesorter::cache::ResolutionReduction:
[legend]

Classes

class  ResolutionReducedReplacement
 Store a scaled down bitmap together with the original size. More...
 

Public Member Functions

virtual ~ResolutionReduction ()
 
virtual std::shared_ptr< BitmapReplacementCompress (const BitmapEx &rpBitmap) const override
 Compress the given bitmap into a replacement format that is specific to the compressor class. More...
 
virtual BitmapEx Decompress (const BitmapReplacement &rBitmapData) const override
 Scale the replacement bitmap up to the original size. More...
 
virtual bool IsLossless () const override
 Return whether the compression and decompression is lossless. More...
 
virtual std::shared_ptr< BitmapReplacementCompress (const BitmapEx &rBitmap) const =0
 Compress the given bitmap into a replacement format that is specific to the compressor class. More...
 
virtual BitmapEx Decompress (const BitmapReplacement &rBitmapData) const =0
 Decompress the given replacement data into a preview bitmap. More...
 
virtual bool IsLossless () const =0
 Return whether the compression and decompression is lossless. More...
 

Static Private Attributes

static const sal_Int32 mnWidth = 100
 

Additional Inherited Members

- Protected Member Functions inherited from sd::slidesorter::cache::BitmapCompressor
 ~BitmapCompressor ()
 

Detailed Description

Compress a preview bitmap by reducing its resolution.

While the aspect ratio is maintained the horizontal resolution is scaled down to 100 pixels. This compressor is not lossless.

Definition at line 108 of file SlsBitmapCompressor.hxx.

Constructor & Destructor Documentation

◆ ~ResolutionReduction()

virtual sd::slidesorter::cache::ResolutionReduction::~ResolutionReduction ( )
inlinevirtual

Definition at line 114 of file SlsBitmapCompressor.hxx.

Member Function Documentation

◆ Compress()

std::shared_ptr< BitmapReplacement > sd::slidesorter::cache::ResolutionReduction::Compress ( const BitmapEx rBitmap) const
overridevirtual

Compress the given bitmap into a replacement format that is specific to the compressor class.

Implements sd::slidesorter::cache::BitmapCompressor.

Definition at line 102 of file SlsBitmapCompressor.cxx.

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

◆ Decompress()

BitmapEx sd::slidesorter::cache::ResolutionReduction::Decompress ( const BitmapReplacement rBitmapData) const
overridevirtual

Scale the replacement bitmap up to the original size.

Implements sd::slidesorter::cache::BitmapCompressor.

Definition at line 118 of file SlsBitmapCompressor.cxx.

References mnWidth, pData, and BitmapEx::Scale().

◆ IsLossless()

bool sd::slidesorter::cache::ResolutionReduction::IsLossless ( ) const
overridevirtual

Return whether the compression and decompression is lossless.

This value is used by the caller of Decompress() to decide whether to use the returned bitmap as is or if a new preview has to be created.

Implements sd::slidesorter::cache::BitmapCompressor.

Definition at line 135 of file SlsBitmapCompressor.cxx.

Member Data Documentation

◆ mnWidth

const sal_Int32 sd::slidesorter::cache::ResolutionReduction::mnWidth = 100
staticprivate

Definition at line 111 of file SlsBitmapCompressor.hxx.

Referenced by Compress(), and Decompress().


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