upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members
GFX Class Reference

GFX helper class. More...

Detailed Description

This file is used by the screen.

Public Member Functions

synchronized void delete ()
 
void setAddrWindow (short x0, short y0, short x1, short y1)
 
void drawPixel (short x, short y, int color)
 
void refresh ()
 
void drawChar (short x, short y, short data, int color, int bg, short size)
 
void print (String msg)
 
int setPixel (int x, int y, int color)
 
void fillScreen (int color)
 
void fillRect (short x, short y, short w, short h, int color)
 
void drawFastVLine (short x, short y, short h, int color)
 
void drawLine (short x0, short y0, short x1, short y1, int color)
 
void drawTriangle (short x0, short y0, short x1, short y1, short x2, short y2, int color)
 
void drawCircle (short x, short y, short r, int color)
 
void setCursor (short x, short y)
 
void setTextColor (int textColor, int textBGColor)
 
void setTextSize (short size)
 
void setTextWrap (short wrap)
 
void setM_height (int value)
 
int getM_height ()
 
void setM_width (int value)
 
int getM_width ()
 
void setM_textSize (int value)
 
int getM_textSize ()
 
void setM_textColor (int value)
 
int getM_textColor ()
 
void setM_textBGColor (int value)
 
int getM_textBGColor ()
 
void setM_cursorX (int value)
 
int getM_cursorX ()
 
void setM_cursorY (int value)
 
int getM_cursorY ()
 
void setM_wrap (int value)
 
int getM_wrap ()
 

Member Function Documentation

void drawChar ( short  x,
short  y,
short  data,
int  color,
int  bg,
short  size 
)
Parameters
xAxis on the horizontal scale
yAxis on the vertical scale
dataCharacter to write
colorCharacter color
bgCharacter background color
sizeSize of the font
void drawCircle ( short  x,
short  y,
short  r,
int  color 
)

Draws a circle

Parameters
xCenter of the circle on the horizontal scale
yCenter of the circle on the vertical scale
rRadius of the circle
colorColor of the circle
void drawFastVLine ( short  x,
short  y,
short  h,
int  color 
)

Draws a line on the vertical scale

Parameters
xAxis on the horizontal scale
yAxis on the vertical scale
hDistanse from y
colorSelected color
void drawLine ( short  x0,
short  y0,
short  x1,
short  y1,
int  color 
)

Draws a line from coordinate C0 to coordinate C1

Parameters
x0First coordinate
y0First coordinate
x1Second coordinate
y1Second coordinate
colorselected color
void drawPixel ( short  x,
short  y,
int  color 
)

Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.

Parameters
xAxis on the horizontal scale
yAxis on the vertical scale
colorRGB value
void drawTriangle ( short  x0,
short  y0,
short  x1,
short  y1,
short  x2,
short  y2,
int  color 
)

Draws a triangle

Parameters
x0First coordinate
y0First coordinate
x1Second coordinate
y1Second coordinate
x2Third coordinate
y2Third coordinate
colorSelected color
void fillRect ( short  x,
short  y,
short  w,
short  h,
int  color 
)

Fills a rectangle with a selected color

Parameters
xAxis on the horizontal scale (top-left corner)
yAxis on the vertical scale (top-left corner)
wDistanse from x
hDistanse from y
colorSelected color
void fillScreen ( int  color)

Fills the screen with a selected color

Parameters
colorSelected color
void print ( String  msg)

Prints a message on the screen

Parameters
msgMessage to print
void refresh ( )

Copies the buffer to the chip via the SPI.

void setAddrWindow ( short  x0,
short  y0,
short  x1,
short  y1 
)

Sets the window address

Parameters
x0First coordinate
y0First coordinate
x1Second coordinate
y1Second coordinate
void setCursor ( short  x,
short  y 
)

Sets the cursor for a text message

Parameters
xAxis on the horizontal scale
yAxis on the vertical scale
int setPixel ( int  x,
int  y,
int  color 
)

Prints a message on the screen

Parameters
xAxis on the horizontal scale
yAxis on the vertical scale
colorPixel color
void setTextColor ( int  textColor,
int  textBGColor 
)

Sets a text color for a message

Parameters
textColorFont color
textBGColorBackground color
void setTextSize ( short  size)

Sets the size of the font

Parameters
sizeFont size
void setTextWrap ( short  wrap)

Wraps a printed message

Parameters
wrapTrue (0x1) or false (0x0)
Inheritance diagram for GFX:
Inheritance graph
[legend]

The documentation for this class was generated from the following file: