aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorMax Horn2009-10-04 22:33:15 +0000
committerMax Horn2009-10-04 22:33:15 +0000
commit8e73622d134e73b24157d2a58cbbe10099d40f94 (patch)
tree3bb68c865084ee564824e28a4c54e7094cf52738 /backends/platform
parent71ebd67331c3eaf5100cbf71a917ee69fb2b186b (diff)
downloadscummvm-rg350-8e73622d134e73b24157d2a58cbbe10099d40f94.tar.gz
scummvm-rg350-8e73622d134e73b24157d2a58cbbe10099d40f94.tar.bz2
scummvm-rg350-8e73622d134e73b24157d2a58cbbe10099d40f94.zip
Add some doxygen comments to WinCE scalers. Somebody should verify those. Also note how SmartphoneLandscape's ARM asm version seems to do something different compared to the C version
svn-id: r44642
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/wince/CEScaler.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp
index 0a71fda167..7239d18753 100644
--- a/backends/platform/wince/CEScaler.cpp
+++ b/backends/platform/wince/CEScaler.cpp
@@ -25,6 +25,10 @@
#include "graphics/scaler/intern.h"
#include "CEScaler.h"
+/**
+ * This filter (down)scales the source image horizontally by a factor of 3/4.
+ * For example, a 320x200 image is scaled to 240x200.
+ */
template<int bitFormat>
void PocketPCPortraitTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint16 *work;
@@ -53,9 +57,14 @@ void PocketPCPortraitTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPt
}
MAKE_WRAPPER(PocketPCPortrait)
-// Our version of an aspect scaler. Main difference is the out-of-place
-// operation, omitting a straight blit step the sdl backend does. Also,
-// tests show unaligned access errors with the stock aspect scaler.
+/**
+ * This filter (up)scales the source image vertically by a factor of 6/5.
+ * For example, a 320x200 image is scaled to 320x240.
+ *
+ * The main difference to the code in graphics/scaler/aspect.cpp is the
+ * out-of-place operation, omitting a straight blit step the sdl backend
+ * does. Also, tests show unaligned access errors with the stock aspect scaler.
+ */
void PocketPCLandscapeAspect(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
const int redblueMasks[] = { 0x7C1F, 0xF81F };
@@ -150,10 +159,14 @@ void PocketPCHalfTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, u
}
}
+/**
+ * This filter (down)scales the source image by a factor of 1/2.
+ * For example, a 320x200 image is scaled to 160x100.
+ */
void PocketPCHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
#ifdef ARM
int maskUsed = (gBitFormat == 565);
- PocketPCHalfARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed],roundingconstants[maskUsed]);
+ PocketPCHalfARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed], roundingconstants[maskUsed]);
#else
if (gBitFormat == 565)
PocketPCHalfTemplate<565>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
@@ -162,6 +175,10 @@ void PocketPCHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 ds
#endif
}
+/**
+ * This filter (down)scales the source image horizontally by a factor of 1/2.
+ * For example, a 320x200 image is scaled to 160x200.
+ */
template<int bitFormat>
void PocketPCHalfZoomTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint16 *work;
@@ -215,6 +232,13 @@ void SmartphoneLandscapeTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *ds
}
}
+/**
+ * This filter (down)scales the source image horizontally by a factor of 2/3
+ * and vertically by 7/8. For example, a 320x200 image is scaled to 213x175.
+ *
+ * @note The ARM asm version seems to work differently ?!? It apparently scales
+ * horizontally by 11/16. Thus a 320x200 image is scaled to 220x175.
+ */
void SmartphoneLandscape(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
#ifdef ARM
int maskUsed = (gBitFormat == 565);