GRAPHICS: add static methods for 1x and 1.5x scale

This commit is contained in:
Eric Culp 2012-05-30 13:48:34 -04:00 committed by Filippos Karapetis
parent d350e2c7a8
commit d56a7d610c
5 changed files with 34 additions and 7 deletions

View file

@ -26,6 +26,7 @@ void InitLUT(Graphics::PixelFormat format);
void HQPlugin::initialize(Graphics::PixelFormat format) {
//InitLUT(format);
_format = format;
}
void HQPlugin::deinitialize() {
@ -35,12 +36,12 @@ void HQPlugin::deinitialize() {
void HQPlugin::scale(const uint8 *srcPtr, uint32 srcPitch,
uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) {
if (!_doScale) {
Normal1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
scale1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height, _format.bytesPerPixel);
return;
}
switch (_factor) {
case 1:
Normal1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
scale1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height, _format.bytesPerPixel);
break;
case 2:
HQ2x(srcPtr, srcPitch, dstPtr, dstPitch, width, height);