ScummVM API documentation
SourceScaler Class Referenceabstract

#include <scalerplugin.h>

Inheritance diagram for SourceScaler:
Scaler EdgeScaler

Public Member Functions

 SourceScaler (const Graphics::PixelFormat &format)
 
virtual void setSource (const byte *src, uint pitch, int width, int height, int padding) final
 
virtual void enableSource (bool enable) final
 
virtual uint setFactor (uint factor) final
 
- Public Member Functions inherited from Scaler
 Scaler (const Graphics::PixelFormat &format)
 
void scale (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y)
 
virtual uint increaseFactor ()=0
 
virtual uint decreaseFactor ()=0
 
virtual uint getFactor () const
 

Protected Member Functions

virtual void scaleIntern (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) final
 
virtual void internScale (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, const uint8 *oldSrcPtr, uint32 oldSrcPitch, int width, int height, const uint8 *buffer, uint32 bufferPitch)=0
 

Additional Inherited Members

- Protected Attributes inherited from Scaler
uint _factor
 
Graphics::PixelFormat _format
 

Detailed Description

Convenience class that implements some bookkeeping for keeping track of old source images.

Member Function Documentation

◆ setSource()

virtual void SourceScaler::setSource ( const byte *  src,
uint  pitch,
int  width,
int  height,
int  padding 
)
finalvirtual

Set the source to be used when scaling and copying to the old buffer.

Parameters
paddingThe number of pixels on the border (Used to prevent memory access crashes)
typeThe surface type. This source will only be used when calling oldSrcScale with the same type.

Reimplemented from Scaler.

◆ enableSource()

virtual void SourceScaler::enableSource ( bool  enable)
inlinefinalvirtual

Enable or disable the old Source functionality. It is initially disabled. When disabled, the old source data is preserved until re-enabled.

Useful for scaling a different surface (e.g. the cursor).

Reimplemented from Scaler.

◆ setFactor()

virtual uint SourceScaler::setFactor ( uint  factor)
finalvirtual

Set the scaling factor. Intended to be used with GUI to set a known valid factor. Plugins should override if they require additional state changes.

Parameters
factorA valid scaling factor for the plugin
Returns
The old factor.

Reimplemented from Scaler.

◆ scaleIntern()

virtual void SourceScaler::scaleIntern ( const uint8 *  srcPtr,
uint32  srcPitch,
uint8 *  dstPtr,
uint32  dstPitch,
int  width,
int  height,
int  x,
int  y 
)
finalprotectedvirtual
See also
scale

Implements Scaler.

◆ internScale()

virtual void SourceScaler::internScale ( const uint8 *  srcPtr,
uint32  srcPitch,
uint8 *  dstPtr,
uint32  dstPitch,
const uint8 *  oldSrcPtr,
uint32  oldSrcPitch,
int  width,
int  height,
const uint8 *  buffer,
uint32  bufferPitch 
)
protectedpure virtual

Scalers must implement this function. It will be called by oldSrcScale. If by comparing the src and oldsrc images it is discovered that no change is necessary, do not write a pixel.

If oldSrcPtr is NULL, do not read from it. Scale every pixel.

Implemented in EdgeScaler.


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