[Scummvm-cvs-logs] CVS: scummvm/backends/wince CEScaler.cpp,1.5,1.6 CEScaler.h,1.2,1.3

Nicolas Bacca arisme at users.sourceforge.net
Sun May 9 07:52:02 CEST 2004


Update of /cvsroot/scummvm/scummvm/backends/wince
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28134

Modified Files:
	CEScaler.cpp CEScaler.h 
Log Message:
Add Zoom scaler and Smartphone scaler

Index: CEScaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEScaler.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CEScaler.cpp	13 Feb 2004 14:18:24 -0000	1.5
+++ CEScaler.cpp	9 May 2004 14:51:08 -0000	1.6
@@ -95,3 +95,61 @@
 	}
 }
 
+
+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
+

Index: CEScaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEScaler.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CEScaler.h	13 Feb 2004 14:18:24 -0000	1.2
+++ CEScaler.h	9 May 2004 14:51:08 -0000	1.3
@@ -30,6 +30,10 @@
 
 DECLARE_SCALER(PocketPCPortrait);
 DECLARE_SCALER(PocketPCHalf);
+DECLARE_SCALER(PocketPCHalfZoom);
+#ifdef WIN32_PLATFORM_WFSP
+DECLARE_SCALER(SmartphoneLandscape);
+#endif
 
 void initCEScaler(void);
 





More information about the Scummvm-git-logs mailing list