diff options
author | Nicolas Bacca | 2004-05-09 14:51:08 +0000 |
---|---|---|
committer | Nicolas Bacca | 2004-05-09 14:51:08 +0000 |
commit | b3ed0f2029538ee66505f8490efd84deb202058e (patch) | |
tree | 32cb5a20c5fc466fe973badafabc817b7f62203c /backends/wince/CEScaler.cpp | |
parent | 03956df17f7f2efc3474c3ca29ea64475e5348b2 (diff) | |
download | scummvm-rg350-b3ed0f2029538ee66505f8490efd84deb202058e.tar.gz scummvm-rg350-b3ed0f2029538ee66505f8490efd84deb202058e.tar.bz2 scummvm-rg350-b3ed0f2029538ee66505f8490efd84deb202058e.zip |
Add Zoom scaler and Smartphone scaler
svn-id: r13824
Diffstat (limited to 'backends/wince/CEScaler.cpp')
-rw-r--r-- | backends/wince/CEScaler.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/backends/wince/CEScaler.cpp b/backends/wince/CEScaler.cpp index 6b6cd07623..189abe0134 100644 --- a/backends/wince/CEScaler.cpp +++ b/backends/wince/CEScaler.cpp @@ -95,3 +95,61 @@ void PocketPCHalf(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 ds } } + +void PocketPCHalfZoom(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + uint8 *work; + int i; + uint16 srcPitch16 = (uint16)(srcPitch / sizeof(uint16)); + + if (!height) + return; + + while (height--) { + i = 0; + work = dstPtr; + + for (int i=0; i<width; i+=2) { + uint16 color1 = *(((const uint16 *)srcPtr) + i); + uint16 color2 = *(((const uint16 *)srcPtr) + (i + 1)); + *(((uint16 *)work) + 0) = CEinterpolate16_2(color1, 1, color2, 1); + + work += sizeof(uint16); + } + srcPtr += srcPitch; + dstPtr += dstPitch; + } +} + +#ifdef WIN32_PLATFORM_WFSP +void SmartphoneLandscape(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { + uint8 *work; + int i; + int line = 0; + + while (height--) { + i = 0; + work = dstPtr; + + for (int i=0; i<width; i+=3) { + // Filter 2/3 + uint16 color1 = *(((const uint16 *)srcPtr) + i); + uint16 color2 = *(((const uint16 *)srcPtr) + (i + 1)); + uint16 color3 = *(((const uint16 *)srcPtr) + (i + 2)); + + *(((uint16 *)work) + 0) = CEinterpolate16_2(color1, 3, color2, 1); + *(((uint16 *)work) + 1) = CEinterpolate16_2(color2, 1, color3, 1); + + work += 2 * sizeof(uint16); + } + srcPtr += srcPitch; + dstPtr += dstPitch; + line++; + if (line == 7) { + line = 0; + srcPtr += srcPitch; + height--; + } + } +} +#endif + |