Fork of Silabs MemoryLCD library

Dependents:   demoUI whrmDemoUI Host_Software_MAX32664GWEB_HR_EXTENDED Host_Software_MAX32664GWEC_SpO2_HR-_EXTE ... more

C++ library for Sharp Microelectronics 1.28 inch LCD TFT, LS013B7DH03, SPI bus. Forked from Silicon Labs MemoryLCD display driver.

Files at this revision

API Documentation at this revision

Comitter:
srodk
Date:
Tue Jun 09 14:48:20 2015 +0000
Parent:
4:b02dfd360729
Child:
6:fe04073fe90c
Commit message:
Added circle function

Changed in this revision

GraphicsDisplay.cpp Show annotated file Show diff for this revision Revisions of this file
GraphicsDisplay.h Show annotated file Show diff for this revision Revisions of this file
--- a/GraphicsDisplay.cpp	Thu May 28 16:05:09 2015 +0000
+++ b/GraphicsDisplay.cpp	Tue Jun 09 14:48:20 2015 +0000
@@ -152,6 +152,28 @@
         putp(colour);
     }
 }
+
+void GraphicsDisplay::circle(int x, int y, int r,int colour){
+	int ce = -r;
+	int cx = r;
+	int cy = 0;
+	while(cx >= cy){
+		pixel(x+cx,y+cy,colour);
+		pixel(x-cx,y-cy,colour);
+		pixel(x-cx,y+cy,colour);
+		pixel(x+cx,y-cy,colour);
+		pixel(x+cy,y+cx,colour);
+		pixel(x-cy,y+cx,colour);
+		pixel(x-cy,y-cx,colour);
+		pixel(x+cy,y-cx,colour);
+		ce += 2*cy++ + 1;
+		if(ce >= 0){
+			ce -= 2*cx---1;	
+		}
+		
+	}
+
+}
     
 void GraphicsDisplay::cls() {
     fill(0, 0, width(), height(), _background);
--- a/GraphicsDisplay.h	Thu May 28 16:05:09 2015 +0000
+++ b/GraphicsDisplay.h	Tue Jun 09 14:48:20 2015 +0000
@@ -31,6 +31,7 @@
     
     virtual void cls();
     virtual void fill(int x, int y, int w, int h, int colour);
+    virtual void circle(int x, int y, int r, int colour);
     virtual void blit(int x, int y, int w, int h, const int *colour);    
     virtual void blitbit(int x, int y, int w, int h, const char* colour);