Sensorian  1.0
C API Reference Guide Library
GFX.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (C) 2015 Sensorian
3  * *
4  * This file is part of Sensorian. *
5  * *
6  * Sensorian is free software: you can redistribute it and/or modify it *
7  * under the terms of the GNU Lesser General Public License as published *
8  * by the Free Software Foundation, either version 3 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * Sensorian is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with Sensorian. *
18  * If not, see <http://www.gnu.org/licenses/>. *
19  ****************************************************************************/
20 
28 #ifndef __GFX_H__
29 #define __GFX_H__
30 
31 #include "TFT.h"
32 
33 /***********************************************************************************/
34 //helper functions
35 
36 #define absDiff(x,y) ((x>y) ? (x-y) : (y-x))
37 #define swap(a,b) \
38 do\
39 {\
40 unsigned char t;\
41  t=a;\
42  a=b;\
43  b=t;\
44 } while(0)
45 
46 /**************************************************************************************/
47 
48 void TFT_HorizontalLine(unsigned int Xaxis, unsigned int Yaxis,unsigned int width ,unsigned int color);
49 void TFT_VerticalLine(unsigned int Xaxis,unsigned int Yaxis, unsigned int height ,unsigned int color);
50 void TFT_Line(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, unsigned int color);
51 void TFT_SlantyLine(unsigned int lX1, unsigned int lY1, unsigned int lX2,unsigned int lY2,unsigned int color);
52 double inline TFT_dfloor( double value );
53 
54 void TFT_FullRectangle(unsigned int Xaxis1, unsigned int Yaxis1, unsigned int Xaxis2 ,unsigned int Yaxis2,unsigned int color);
55 void TFT_EmptyRectangle(unsigned int Xaxis1,unsigned int Yaxis1, unsigned int Xaxis2,unsigned int Yaxis2,unsigned int color);
56 void TFT_RoundRectangle(unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int radius, unsigned int color);
57 
58 void TFT_Circle(unsigned int CenterX, unsigned int CenterY, unsigned int Radius,unsigned int color);
59 void TFT_DrawCircle(unsigned int CenterX, unsigned int CenterY, unsigned int Radius,unsigned int color);
60 void TFT_Disk(unsigned int CenterX, unsigned int CenterY, unsigned int Radius,unsigned int color);
61 void TFT_Ellipse(long CX, long CY, long XRadius,long YRadius, unsigned int color);
62 void inline Plot4EllipsePoints(long CX,long CY, long X, long Y, unsigned int color);
63 
64 void TFT_RightTriangle ( int topx, int topy, int rightx, int righty,unsigned int color);
65 
66 #endif
double TFT_dfloor(double value)
Helper funrtion for truncating the double values.
Definition: GFX.c:109
void TFT_EmptyRectangle(unsigned int Xaxis1, unsigned int Yaxis1, unsigned int Xaxis2, unsigned int Yaxis2, unsigned int color)
This function paints an empty rectangle on the screen. The width of the contour is 1 pixel...
Definition: GFX.c:227
void TFT_DrawCircle(unsigned int CenterX, unsigned int CenterY, unsigned int Radius, unsigned int color)
This function draws a circle centered a x,y with radius R and specific color.
Definition: GFX.c:370
void TFT_VerticalLine(unsigned int Xaxis, unsigned int Yaxis, unsigned int height, unsigned int color)
Draw a vertical line on the display.
Definition: GFX.c:53
void TFT_SlantyLine(unsigned int lX1, unsigned int lY1, unsigned int lX2, unsigned int lY2, unsigned int color)
Plot a slanty line from x1,y1 to x2,y2 on the display.
Definition: GFX.c:126
void TFT_Disk(unsigned int CenterX, unsigned int CenterY, unsigned int Radius, unsigned int color)
This function plots a full disk on the display.
Definition: GFX.c:332
void TFT_RightTriangle(int topx, int topy, int rightx, int righty, unsigned int color)
This function paints a right angled triangle.
Definition: GFX.c:482
void Plot4EllipsePoints(long CX, long CY, long X, long Y, unsigned int color)
Helper function for plotting an ellipse.
Definition: GFX.c:465
TFT Driver.
void TFT_Ellipse(long CX, long CY, long XRadius, long YRadius, unsigned int color)
This function paints a.
Definition: GFX.c:399
void TFT_FullRectangle(unsigned int Xaxis1, unsigned int Yaxis1, unsigned int Xaxis2, unsigned int Yaxis2, unsigned int color)
This function paints a filled rectangle on the screen.
Definition: GFX.c:205
void TFT_HorizontalLine(unsigned int Xaxis, unsigned int Yaxis, unsigned int width, unsigned int color)
Draw a horizontal line on the display.
Definition: GFX.c:40
void TFT_RoundRectangle(unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int radius, unsigned int color)
This function draws a rectangle with round corners.
Definition: GFX.c:256
void TFT_Line(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, unsigned int color)
This function paints a.
Definition: GFX.c:67
void TFT_Circle(unsigned int CenterX, unsigned int CenterY, unsigned int Radius, unsigned int color)
This function draws a circle centered a x,y with radius R and specific color.
Definition: GFX.c:297