A basic graphics package for the LPC4088 Display Module.

Dependents:   lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more

Fork of DMBasicGUI by EmbeddedArtists AB

Revision:
7:4ba7bd9d32ef
Parent:
0:4977187e90c7
Child:
11:265884fa7fdd
--- a/lpc_swim/lpc_swim_image.c	Thu Jan 08 11:14:56 2015 +0100
+++ b/lpc_swim/lpc_swim_image.c	Thu Jan 08 19:28:22 2015 +0100
@@ -81,6 +81,41 @@
 	}
 }
 
+/* Puts a raw image into a window at a specific position*/
+void swim_put_image_xy(SWIM_WINDOW_T *win,                       
+					   const COLOR_T *image,
+					   int32_t xsize,
+					   int32_t ysize,
+                       int32_t x1,
+                       int32_t y1)
+{
+	int32_t x, y;
+
+	/* Unknown values of rtype will do no rotation */
+	y = win->ypvmin + y1;
+
+	xsize = xsize + win->xpvmin + x1;
+	ysize = ysize + win->ypvmin + y1;
+
+	/* Move image to window pixel by pixel */
+	while ((y <= win->ypvmax) && (y < ysize)) {
+		/* Set physical frame buffer address */
+		x = win->xpvmin + x1;
+
+		/* Render a single line */
+		while ((x <= win->xpvmax) && (x < xsize)) {
+			swim_put_pixel_physical(win, x, y, *image);
+			image++;
+			x++;
+		}
+
+		/* Adjust to end of line if the image was clipped */
+		image = image + (xsize - x);
+
+		y++;
+	}
+}
+
 /* Puts a raw image into a window inverted */
 void swim_put_invert_image(SWIM_WINDOW_T *win,
 						   const COLOR_T *image,