GRAPHICS: adds comments for scalers and clean up

This commit is contained in:
Eric Culp 2012-05-24 15:59:28 -04:00 committed by Filippos Karapetis
parent 739c75c869
commit 0d103d01c4
3 changed files with 26 additions and 21 deletions

View File

@ -24,7 +24,6 @@
void NormalPlugin::initialize(Graphics::PixelFormat format) {}
void NormalPlugin::scale(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) {
if (!_doScale) {
@ -60,17 +59,5 @@ const char *NormalPlugin::getName() const {
return "Normal";
}
int NormalPlugin::getFactor() {
return _factor;
}
bool NormalPlugin::canDrawCursor() {
return true;
}
int NormalPlugin::extraPixels() {
return 0;
}
REGISTER_PLUGIN_STATIC(NORMAL, PLUGIN_TYPE_SCALER, NormalPlugin);

View File

@ -32,9 +32,9 @@ public:
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y);
virtual int increaseFactor();
virtual int decreaseFactor();
virtual int getFactor();
virtual bool canDrawCursor();
virtual int extraPixels();
virtual int getFactor() { return _factor; }
virtual bool canDrawCursor() { return true; }
virtual int extraPixels() { return 0; }
virtual const char *getName() const;
};

View File

@ -32,29 +32,47 @@ public:
virtual ~ScalerPluginObject() {}
/**
* This function will be called before any scaler is used.
* Precomputed data should be generated here.
* @param format The pixel format to scale.
*/
virtual void initialize(Graphics::PixelFormat format) = 0;
/**
* This is called when the plugin is not needed. It should clean
* up memory from the initialize method.
*/
virtual void deinitialize() {}
virtual void scale(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) = 0;
virtual void scale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
uint32 dstPitch, int width, int height, int x, int y) = 0;
virtual int getFactor() = 0;
/**
* Increase the factor of scaling.
* @return the new factor
* @return The new factor
*/
virtual int increaseFactor() = 0;
/**
* Decrease the factor of scaling.
* @return the new factor
* @return The new factor
*/
virtual int decreaseFactor() = 0;
virtual int getFactor() = 0;
/**
* Indicates how far outside the scaling region this scaler "looks"
* @return The number of pixels in any direction
*/
virtual int extraPixels() = 0;
/**
* Some scalers are not suitable for scaling the cursor.
* Blurring scalers should return false.
*/
virtual bool canDrawCursor() = 0;
// temporary HACK