ScummVM API documentation
Scaler Class Referenceabstract
Inheritance diagram for Scaler:
AdvMameScaler DotMatrixScaler HQScaler NormalScaler PMScaler SAIScaler SourceScaler SuperEagleScaler SuperSAIScaler TVScaler

Public Member Functions

 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
 
virtual uint setFactor (uint factor)
 
virtual void setSource (const byte *src, uint pitch, int width, int height, int padding)
 
virtual void enableSource (bool enable)
 

Protected Member Functions

virtual void scaleIntern (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y)=0
 

Protected Attributes

uint _factor
 
Graphics::PixelFormat _format
 

Member Function Documentation

◆ scale()

void Scaler::scale ( const uint8 *  srcPtr,
uint32  srcPitch,
uint8 *  dstPtr,
uint32  dstPitch,
int  width,
int  height,
int  x,
int  y 
)

Scale a rect.

Parameters
srcPtrPointer to the source buffer.
srcPitchThe number of bytes in a scanline of the source.
dstPtrPointer to the destination buffer.
dstPitchThe number of bytes in a scanline of the destination.
widthThe width of the source rect to scale.
heightThe height of the source rect to scale.
xThe x position of the source rect.
yThe y position of the source rect.

◆ increaseFactor()

virtual uint Scaler::increaseFactor ( )
pure virtual

Increase the factor of scaling.

Returns
The new factor

Implemented in SuperEagleScaler, AdvMameScaler, SuperSAIScaler, HQScaler, EdgeScaler, DotMatrixScaler, NormalScaler, PMScaler, SAIScaler, and TVScaler.

◆ decreaseFactor()

virtual uint Scaler::decreaseFactor ( )
pure virtual

Decrease the factor of scaling.

Returns
The new factor

Implemented in SuperEagleScaler, AdvMameScaler, SuperSAIScaler, HQScaler, EdgeScaler, DotMatrixScaler, NormalScaler, PMScaler, SAIScaler, and TVScaler.

◆ setFactor()

virtual uint Scaler::setFactor ( uint  factor)
inlinevirtual

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 in SourceScaler.

◆ setSource()

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

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 in SourceScaler.

◆ enableSource()

virtual void Scaler::enableSource ( bool  enable)
inlinevirtual

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 in SourceScaler.

◆ scaleIntern()

virtual void Scaler::scaleIntern ( const uint8 *  srcPtr,
uint32  srcPitch,
uint8 *  dstPtr,
uint32  dstPitch,
int  width,
int  height,
int  x,
int  y 
)
protectedpure virtual

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