Sensorian  1.0
C API Reference Guide Library
GFX.c File Reference

GFX library. More...

#include "GFX.h"
#include <stdio.h>
#include <math.h>

Go to the source code of this file.

Functions

void TFT_HorizontalLine (unsigned int Xaxis, unsigned int Yaxis, unsigned int width, unsigned int color)
 Draw a horizontal line on the display. More...
 
void TFT_VerticalLine (unsigned int Xaxis, unsigned int Yaxis, unsigned int height, unsigned int color)
 Draw a vertical line on the display. More...
 
void TFT_Line (unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, unsigned int color)
 This function paints a. More...
 
double TFT_dfloor (double value)
 Helper funrtion for truncating the double values. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void TFT_Disk (unsigned int CenterX, unsigned int CenterY, unsigned int Radius, unsigned int color)
 This function plots a full disk on the display. More...
 
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. More...
 
void TFT_Ellipse (long CX, long CY, long XRadius, long YRadius, unsigned int color)
 This function paints a. More...
 
void Plot4EllipsePoints (long CX, long CY, long X, long Y, unsigned int color)
 Helper function for plotting an ellipse. More...
 
void TFT_RightTriangle (int topx, int topy, int rightx, int righty, unsigned int color)
 This function paints a right angled triangle. More...
 

Detailed Description

GFX library.

Author
D.Qendri
Date
30 May 2015

Definition in file GFX.c.

Function Documentation

void Plot4EllipsePoints ( long  CX,
long  CY,
long  X,
long  Y,
unsigned int  color 
)
inline

Helper function for plotting an ellipse.

Parameters
CXx coordinate of one side
CYy coordinate of one side
Xx coordinate of other side
Yy coordinate of other side
colorEllipse color
Returns
none

Definition at line 465 of file GFX.c.

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.

Parameters
CenterXCenter x coordinate
CenterYCenter y coordinate
RadiusCircle radius
colorCircle's color.
Returns
none

Definition at line 297 of file GFX.c.

double TFT_dfloor ( double  value)
inline

Helper funrtion for truncating the double values.

Parameters
valueDouble value to be truncated
Returns
value Ceiling or floor value of the floating point number

Definition at line 109 of file GFX.c.

void TFT_Disk ( unsigned int  CenterX,
unsigned int  CenterY,
unsigned int  Radius,
unsigned int  color 
)

This function plots a full disk on the display.

Parameters
CenterXCenter x coordinate
CenterYCenter y coordinate
RadiusDisk radius
colorDisk Color
Returns
none

Definition at line 332 of file GFX.c.

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.

Parameters
CenterXCenter x coordinate
CenterYCenter y coordinate
RadiusCircle radius
colorCircle's color.
Returns
none

Definition at line 370 of file GFX.c.

void TFT_Ellipse ( long  CX,
long  CY,
long  XRadius,
long  YRadius,
unsigned int  color 
)

This function paints a.

Parameters
CXx coordinate of one side
CYy coordinate of one side
XRadiusx coordinate of other side
YRadiusy coordinate of other side
colorEllipse color
Returns
none

Definition at line 399 of file GFX.c.

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.

Parameters
Xaxis1Starting point x coordinate.
Yaxis1Starting point y coordinate.
Xaxis2Finish point x coordinate.
Yaxis2Finish point y coordinate.
colorContour color.

Definition at line 227 of file GFX.c.

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.

Parameters
Xaxis1x coordinate of upper point
Yaxis1y coordinate of upper point
Xaxis2x coordinate of lower point
Yaxis2y coordinate of lower point
colorRectangle plot
Returns
none

Definition at line 205 of file GFX.c.

void TFT_HorizontalLine ( unsigned int  Xaxis,
unsigned int  Yaxis,
unsigned int  width,
unsigned int  color 
)

Draw a horizontal line on the display.

Parameters
XaxisThe x coordinate of the origin
YaxisThe y coordinate of the origin
widthWidth of the segment.
colorColor of the line.
Returns
none

Definition at line 40 of file GFX.c.

void TFT_Line ( unsigned int  x1,
unsigned int  y1,
unsigned int  x2,
unsigned int  y2,
unsigned int  color 
)

This function paints a.

Parameters
x1Starting point x coordinate.
y1Starting point y coordinate.
x2Finish point x coordinate.
y2Finish point y coordinate.
colorColor of the line.
Returns
none

Definition at line 67 of file GFX.c.

void TFT_RightTriangle ( int  topx,
int  topy,
int  rightx,
int  righty,
unsigned int  color 
)

This function paints a right angled triangle.

Parameters
topxx coordinate
topyy coordinate
rightxx coordinate
rightyy coordinate
colorTriangle color
Returns
none

Definition at line 482 of file GFX.c.

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.

Parameters
xTop left point X coordinate
yTop left pointy Y coordinate
widthRectangle width
heightRectangle height
radiusRadius of the edges
colorRecatngle color
Returns
none

Definition at line 256 of file GFX.c.

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.

Parameters
lX1Starting point x coordinate.
lY1Starting point y coordinate.
lX2Finish point x coordinate.
lY2Finish point y coordinate.
color
Returns
none

Definition at line 126 of file GFX.c.

void TFT_VerticalLine ( unsigned int  Xaxis,
unsigned int  Yaxis,
unsigned int  height,
unsigned int  color 
)

Draw a vertical line on the display.

Parameters
XaxisThe x coordinate of the origin.
YaxisThe y coordinate of the origin.
heightHeight of the line.
colorColor of the line.
Returns
none

Definition at line 53 of file GFX.c.