Functions for GLCD object. More...
Public Member Functions | |
CONTROL FUNCTIONS | |
The following control functions are available | |
int | Init (glcd_device_mode invert=NON_INVERTED) |
Initilize library and device hardware. More... | |
void | SetDisplayMode (glcd_device_mode mode) |
Set LCD Display mode. More... | |
void | SetDot (uint8_t x, uint8_t y, uint8_t color) |
void | SetPixels (uint8_t x, uint8_t y, uint8_t x1, uint8_t y1, uint8_t color) |
uint8_t | ReadData (void) |
void | WriteData (uint8_t data) |
int | OnBacklight (void) |
int | OffBacklight (void) |
int | SetBacklight (int val) |
int | On (void) |
int | Off (void) |
int | OnDisplay (void) |
int | OffDisplay (void) |
void | GotoXY (uint8_t x, uint8_t y) |
Set x,y coordinates for both Graphics and Text. More... | |
DRAWING FUNCTIONS | |
The following graphic functions are available | |
void | ClearScreen (uint8_t color=PIXEL_OFF) |
Clear the lcd display. More... | |
void | DrawVLine (uint8_t x, uint8_t y, uint8_t height, uint8_t color=PIXEL_ON) |
Draw a Vertical Line. More... | |
void | DrawHLine (uint8_t x, uint8_t y, uint8_t width, uint8_t color=PIXEL_ON) |
Draw a Horizontal Line. More... | |
void | DrawLine (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t color=PIXEL_ON) |
Draw a line. More... | |
void | DrawRect (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color=PIXEL_ON) |
Draw a rectangle of given width and height. More... | |
void | FillRect (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color=PIXEL_ON) |
Fill a Rectangle. More... | |
void | DrawRoundRect (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t radius, uint8_t color=PIXEL_ON) |
Draw a rectangle with rounded corners. More... | |
void | FillRoundRect (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t radius, uint8_t color=PIXEL_ON) |
Fill a rectangle with rounded corners. More... | |
void | InvertRect (uint8_t x, uint8_t y, uint8_t width, uint8_t height) |
Invert a Rectangular area. More... | |
void | DrawTriangle (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t x3, uint8_t y3, uint8_t color=PIXEL_ON) |
Draw a triangle. More... | |
void | FillTriangle (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t x3, uint8_t y3, uint8_t color=PIXEL_ON) |
Fill a triangle. More... | |
void | DrawCircle (uint8_t xCenter, uint8_t yCenter, uint8_t radius, uint8_t color=PIXEL_ON) |
Draw a Circle. More... | |
void | FillCircle (uint8_t xCenter, uint8_t yCenter, uint8_t radius, uint8_t color=PIXEL_ON) |
Draw a Filled in a Circle. More... | |
void | DrawEllipse (uint8_t xCenter, uint8_t yCenter, uint8_t xRadius, uint8_t yRadius, uint8_t color=PIXEL_ON) |
Draw an ellipse. More... | |
void | FillEllipse (uint8_t xCenter, uint8_t yCenter, uint8_t xRadius, uint8_t yRadius, uint8_t color=PIXEL_ON) |
Draw a filled in ellipse. More... | |
void | DrawHBarGraph (uint8_t x, uint8_t y, int width, int height, uint8_t border, int minval, int maxval, int curval) |
Draw a Horizontal BarGraph. More... | |
void | DrawVBarGraph (uint8_t x, uint8_t y, int width, int height, uint8_t border, int minval, int maxval, int curval) |
Draw a Vertical BarGraph. More... | |
void | DrawBitmap (Image_t bitmap, uint8_t x, uint8_t y, uint8_t color=PIXEL_ON) |
Draw a glcd bitmap image. More... | |
void | DrawBitmapXBM (ImageXBM_t bitmapxbm, uint8_t x, uint8_t y, uint8_t color=PIXEL_ON) |
Draw a glcd bitmap image in x11 XBM bitmap data format. More... | |
void | DrawBitmapXBM_P (uint8_t width, uint8_t height, uint8_t *xbmbits, uint8_t x, uint8_t y, uint8_t fg_color, uint8_t bg_color) |
Draw a x11 XBM bitmap image. More... | |
TEXT FUNCTIONS | |
The following text functions are available | |
uint8_t | DefineArea (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, gTextMode mode=DEFAULT_gTEXTMODE) |
Define a text area by absolute coordinates. More... | |
uint8_t | DefineArea (uint8_t x, uint8_t y, uint8_t columns, uint8_t rows, Font_t font, gTextMode mode=DEFAULT_gTEXTMODE) |
Define a Text area by columns and rows. More... | |
uint8_t | DefineArea (predefinedArea selection, Font_t font, gTextMode mode=DEFAULT_gTEXTMODE) |
Define a predefined generic text area and font. More... | |
uint8_t | DefineArea (predefinedArea selection, gTextMode mode=DEFAULT_gTEXTMODE) |
Define a predefined generic text area. More... | |
void | ClearArea (void) |
Clear text area with the current font background color and home the cursor to upper left corner of the text area. More... | |
void | SetAreaMode (gTextMode mode) |
Set TextArea mode options. More... | |
void | ClearAreaMode (gTextMode mode) |
Clear TextArea mode options. More... | |
int | GetAreaProp (gTextProp_t) |
Get Text Area property. More... | |
void | SelectFont (Font_t font, uint8_t fgcolor=BLACK, FontCallback callback=ReadPgmData) |
Select a Font and font color. More... | |
void | SetFontColor (uint8_t fgcolor) |
Set a font foreground color. More... | |
int | PutChar (uint8_t c) |
output a character More... | |
void | Puts (const char *str) |
output a character string More... | |
void | Puts (const String &str) |
output a String class string More... | |
void | Puts_P (PGM_P str) |
output a program memory character string More... | |
void | DrawString (const char *str, int hpos, int vpos, eraseLine_t erase=eraseNONE) |
Output a NULL terminated character string with horizontal and vertical positioning. More... | |
void | DrawString (String &str, int hpos, int vpos, eraseLine_t erase=eraseNONE) |
Output a String class string with horizontal and vertical positioning. More... | |
void | DrawString (FLASHSTRING str, int hpos, int vpos, eraseLine_t erase=eraseNONE) |
Output an GLCD FLASH string with horizontal and vertical positioning. More... | |
void | DrawString_P (PGM_P str, int hpos, int vpos, eraseLine_t erase=eraseNONE) |
Output a program memory character string with horizontal and vertical positioning. More... | |
size_t | write (uint8_t c) |
output a character to the text area More... | |
size_t | writeUTF8 (wchar_t utfc) |
output a UTF8 encoded character to the text area More... | |
void | CursorTo (uint8_t column, uint8_t row) |
Positions cursor to a character based column and row. More... | |
void | CursorTo (int8_t column) |
Positions cursor to a character based column on the current row. More... | |
void | CursorToXY (uint8_t x, uint8_t y) |
Positions cursor to a X,Y position. More... | |
uint8_t | CharWidth (uint8_t c) |
Returns the pixel width of a character. More... | |
uint8_t | CharHeight (uint8_t c) |
Returns the pixel height of a character. More... | |
uint16_t | StringWidth (const char *str) |
Returns the pixel width of a string. More... | |
uint16_t | StringWidth (String &str) |
Returns the pixel width of a String class string. More... | |
uint16_t | StringWidth_P (PGM_P str) |
Returns the pixel width of a string. More... | |
void | EraseTextLine (eraseLine_t type=eraseTO_EOL) |
Erase in Line. More... | |
void | EraseTextLine (uint8_t row) |
Erase Text Line. More... | |
void | PrintNumber (long n) |
Legacy function to print a number. More... | |
void | printFlash (FLASHSTRING str) |
print a flash based string More... | |
void | printFlashln (FLASHSTRING str) |
print a flash based string More... | |
void | Printf (const char *format,...) |
print formatted data More... | |
void | Printf (const __FlashStringHelper *format,...) |
print formatted data More... | |
void | Printf_P (PGM_P format,...) |
print formatted data More... | |
Static Public Attributes | |
static const uint8_t | Bottom |
Bottom most pixel y coordinate on Display (equals Height -1) | |
static const uint8_t | CenterX |
Horizontal center pixel on Display (equals Width/2) | |
static const uint8_t | CenterY |
Vertical center pixel on Display (equals Height/2) | |
static const uint8_t | Height |
Display height in pixels. | |
static const uint8_t | Left |
Left most pixel x coordinate on Display (0 zero) | |
static const uint8_t | Right |
Right most pixel x coordinate on Display (equals Width -1) | |
static const uint8_t | Top |
Top most pixel y coordinate on Display (0 zero) | |
static const uint8_t | Width |
Display width in pixels. | |
Functions for GLCD object.
|
inherited |
Returns the pixel height of a character.
c | character to be sized. NULL can be used to size the first char in the font. |
If there is no font selected, 0 will be returned.
|
inherited |
Returns the pixel width of a character.
c | character to be sized |
|
inherited |
Clear text area with the current font background color and home the cursor to upper left corner of the text area.
|
inherited |
Clear TextArea mode options.
mode | a value from gTextMode |
Examples:
void ClearScreen | ( | uint8_t | color = PIXEL_OFF | ) |
Clear the lcd display.
color | Sets all the pixels on the display from GLCD.Left, GLCD.Top to GLCD.Right, GLCD.Bottom to the specified color. |
Color is optional and defaults to PIXEL_OFF
|
inherited |
Positions cursor to a character based column and row.
column | specifies the horizontal position |
row | specifies the vertical position |
Column and Row are zero based character positions and are relative the the upper left corner of the text area base on the size of the currently selected font.
This is intended for fixed width fonts
Examples:
|
inherited |
Positions cursor to a character based column on the current row.
column | specifies the horizontal position |
Column is a 0 based character position based on the size of the currently selected font.
If column is negative then the column position is relative to the current cursor position.
|
inherited |
Positions cursor to a X,Y position.
x | specifies the horizontal location |
y | specifies the vertical location |
X & Y are zero based pixel coordinates and are relative to the upper left corner of the text area.
Examples:
|
inherited |
Define a text area by absolute coordinates.
x1 | X coordinate of upper left corner |
y1 | Y coordinate of upper left corner |
x2 | X coordinate of lower right corner |
y2 | Y coordinate of lower right corner |
mode | a value from gTextMode |
Define a text area based on absolute coordinates. The pixel coordinates for the text area are inclusive so x2,y2 is the lower right pixel of the text area.
x1,y1 and x2,y2 are an absolute coordinates and are relateive to the 0,0 origin of the display.
The area within the newly defined text area is intentionally not cleared.
mode is an optional parameter and defaults to normal/up scrolling
Examples:
|
inherited |
Define a Text area by columns and rows.
x | X coordinate of upper left corner |
y | Y coordinate of upper left corner |
columns | number of text columns |
rows | number of text rows |
font | a font definition |
mode | a value from gTextMode |
Define a text area sized to hold columns characters across and rows characters tall. It is properly sized for the specified font.
The area within the newly defined text area is intentionally not cleared.
While intended for fixed width fonts, sizing will work for variable width fonts.
When variable width fonts are used, the column is based on assuming a width of the widest character.
x,y is an absolute coordinate and is relateive to the 0,0 origin of the display.
mode is an optional parameter and defaults to normal/up scrolling
Examples:
|
inherited |
Define a predefined generic text area and font.
selection | a value from predefinedArea |
font | a font definition |
mode | a value from gTextMode |
Define a text area using a selection from a set of predefined areas.
The area within the newly defined text area is intentionally not cleared.
mode is an optional parameter and defaults to normal/up scrolling
Examples:
|
inherited |
Define a predefined generic text area.
selection | a value from predefinedArea |
mode | a value from gTextMode |
Define a text area using a selection form a set of predefined areas without setting or altering the area's font.
The area within the newly defined text area is intentionally not cleared.
mode is an optional parameter and defaults to normal/up scrolling
Examples:
void DrawBitmap | ( | Image_t | bitmap, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a glcd bitmap image.
bitmap | a ponter to the bitmap data |
x | the x coordinate of the upper left corner of the bitmap |
y | the y coordinate of the upper left corner of the bitmap |
color | Draw a bitmap image with the upper left corner at location x,y The bitmap data is assumed to be in program memory. |
color is an optional parameter indicating pixel color, default is PIXEL_ON
void DrawBitmapXBM | ( | ImageXBM_t | bitmapxbm, |
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a glcd bitmap image in x11 XBM bitmap data format.
bitmapxbm | a ponter to the glcd XBM bitmap data |
x | the x coordinate of the upper left corner of the bitmap |
y | the y coordinate of the upper left corner of the bitmap |
color | Draw a x11 XBM bitmap image with the upper left corner at location x,y The glcd xbm bitmap data format consists of 1 byte of width followed by 1 byte of height followed by the x11 xbm pixel data bytes. The bitmap data is assumed to be in program memory. |
color is an optional parameter indicating pixel color, default is PIXEL_ON
void DrawBitmapXBM_P | ( | uint8_t | width, |
uint8_t | height, | ||
uint8_t * | xbmbits, | ||
uint8_t | x, | ||
uint8_t | y, | ||
uint8_t | fg_color, | ||
uint8_t | bg_color | ||
) |
Draw a x11 XBM bitmap image.
width | pixel width of the image |
height | pixel height of the image |
xbmbits | a ponter to the XBM bitmap pixel data |
x | the x coordinate of the upper left corner of the bitmap |
y | the y coordinate of the upper left corner of the bitmap |
fg_color | foreground color |
bg_color | background color |
Draw a x11 XBM bitmap image with the upper left corner at location x,y The xbm bitmap pixel data format is the same as the X11 bitmap pixel data. The bitmap data is assumed to be in program memory.
void DrawCircle | ( | uint8_t | xCenter, |
uint8_t | yCenter, | ||
uint8_t | radius, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a Circle.
xCenter | X coordinate of the center of the circle |
yCenter | Y coordinate of the center of the circle |
radius | radius of circle |
color | Draw a circle of the given radius extending out radius pixels from the center pixel. The circle will fit inside a rectanglular area bounded by x-radius,y-radius and x+radius,y+radius |
The diameter of the circle is radius*2 +1 pixels.
Color is optional and defaults to PIXEL_ON.
void DrawEllipse | ( | uint8_t | xCenter, |
uint8_t | yCenter, | ||
uint8_t | xRadius, | ||
uint8_t | yRadius, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw an ellipse.
xCenter | X coordinate of the center of the ellipse |
yCenter | Y coordinate of the center of the ellipse |
xRadius | horizontal radius of ellipse |
yRadius | vertical radius of ellipse |
color | Draw an ellipse of the 2 given radi extending out from the center pixel. The ellipse will fit inside a rectanglular area bounded by x-radius,y-radius and x+radius,y+radius Final ellipse dimensions will be xRadius*2 +1 by yRadius*2 +1 pixels |
color is an optional parameter indicating pixel color, default is PIXEL_ON
void DrawHBarGraph | ( | uint8_t | x, |
uint8_t | y, | ||
int | width, | ||
int | height, | ||
uint8_t | border, | ||
int | minval, | ||
int | maxval, | ||
int | curval | ||
) |
Draw a Horizontal BarGraph.
x | X coordinate of the corner of the bargraph |
y | Y coordinate of the corner of the bargraph |
width | Width in pixels of bargraph, including border pixels |
height | Height in pixels of bargraph, including border pixels |
border | Border pixels around bargraph (use zero for no border) |
minval | Minimum value of the bargraph |
maxval | Maximum value of the bargraph |
curval | Current value of the bargraph |
Draw a horizontal bargraph.
If width is positive, the graph will be drawn to the right of the x coordinate and the graph will advance from left to right as curval increases towards maxval.
If width is negative, the graph will be drawn to the left of the x coordinate and the graph will advance from right to left as curval increases towards maxval.
If height is positive, the graph will be drawn below the y coordinate.
If height is negative, the graph will be drawn above the y coordinate.
Examples:
void DrawHLine | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a Horizontal Line.
x | a value from 0 to GLCD.Width-1 |
y | a value from 0 to GLCD.Height-1 |
width | a value from 1 to GLCD.Width-x |
color | Draw a horizontal line of width pixels starting at x,y Resulting line is width pixels. |
color is an optional parameter indicating pixel color, default is PIXEL_ON
void DrawLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a line.
x1 | a value from 0 to GLCD.Width-1 indicating start x coordinate |
y1 | a value fron 0 to GLCD.Height-1 indicating start y coordinate |
x2 | a value from 0 to GLCD.Width-1 indicating end x coordinate |
y2 | a value fron 0 to GLCD.Height-1 indicating end y coordinate |
color | Draw a line starting at x1,y2 and ending at x2,y2. |
Color is optional and defaults to PIXEL_ON.
void DrawRect | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a rectangle of given width and height.
x | the x coordinate of the upper left corner of the rectangle |
y | the y coordinate of the upper left corner of the rectangle |
width | width of the rectangle |
height | height of the rectangle |
color | Draw a rectangle with the specified width and height. The upper left corner at x,y and the lower right corner at x+width-1, y+height-1. The left and right edges of the rectangle are at x and x+width-1. The top and bottom edges of the rectangle ar at y and y+height -1. The length of the horizontal sides will be width pixels The length of the vertical sides will be height pixels |
color is an optional parameter indicating pixel color, default is PIXEL_ON
void DrawRoundRect | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | radius, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a rectangle with rounded corners.
x | the x coordinate of the upper left corner of the rectangle |
y | the y coordinate of the upper left corner of the rectangle |
width | width of the rectangle |
height | height of the rectangle |
radius | radius of rounded corners |
color |
Draw a rectangle the same as DrawRect() but with rounded corners. Radius is a value from 1 to half the smaller of height or width of the rectangle. The upper left corner at x,y and the lower right corner at x+width-1, y+width-1.
The left and right edges of the rectangle are at x and x+width-1.
The top and bottom edges of the rectangle ar at y and y+height-1.
|
inherited |
Output a NULL terminated character string with horizontal and vertical positioning.
str | character string |
hpos | specifies the horizontal positioning. |
vpos | specifies the vertical positioning. |
erase | optional parameter that specifies which of the remaing pixels on the text line will be erased before the characters are rendered. It is one of the values from eraseLine_t and defaults to eraseNONE |
Outputs the characters in the string to the text area.
hpos/vpos can specify:
When hpos & vpos are not a formatting type, the value is a zero based pixel coordinate relative to the upper left corner of the text area.
Examples:
See PutChar() for a full description of how characters are written to the text area.
|
inherited |
Output a String class string with horizontal and vertical positioning.
str | character string |
hpos | specifies the horizontal positioning. |
vpos | specifies the vertical positioning. |
erase | optional parameter that specifies which of the remaing pixels on the text line will be erased before the characters are rendered. It is one of the values from eraseLine_t and defaults to eraseNONE |
Outputs the characters in the string to the text area.
hpos/vpos can specify:
When hpos & vpos are not a formatting type, the value is a zero based pixel coordinate relative to the upper left corner of the text area.
Examples:
See PutChar() for a full description of how characters are written to the text area.
|
inherited |
Output an GLCD FLASH string with horizontal and vertical positioning.
str | character string |
hpos | specifies the horizontal positioning. |
vpos | specifies the vertical positioning. |
erase | optional parameter that specifies which of the remaing pixels on the text line will be erased before the characters are rendered. It is one of the values from eraseLine_t and defaults to eraseNONE |
Outputs the characters in the string to the text area.
hpos/vpos can specify:
When hpos & vpos are not a formatting type, the value is a zero based pixel coordinate relative to the upper left corner of the text area.
Examples:
See PutChar() for a full description of how characters are written to the text area.
|
inherited |
Output a program memory character string with horizontal and vertical positioning.
str | character string |
hpos | specifies the horizontal positioning. |
vpos | specifies the vertical positioning. |
erase | optional parameter that specifies which of the remaing pixels on the text line will be erased before the characters are rendered. It is one of the values from eraseLine_t and defaults to eraseNONE |
Outputs the characters in the string to the text area.
hpos/vpos can specify:
When hpos & vpos are not a formatting type, the value is a zero based pixel coordinate relative to the upper left corner of the text area.
Examples:
See PutChar() for a full description of how characters are written to the text area.
void DrawTriangle | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2, | ||
uint8_t | x3, | ||
uint8_t | y3, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a triangle.
x1 | the x coordinate of point 1 |
y1 | the y coordinate of point 1 |
x2 | the x coordinate of point 2 |
y2 | the y coordinate of point 2 |
x3 | the x coordinate of point 3 |
y3 | the y coordinate of point 3 |
color | Draw a triangle defined by the 3 points |
color is an optional parameter indicating pixel color, default is ::PIXEL_ON
void DrawVBarGraph | ( | uint8_t | x, |
uint8_t | y, | ||
int | width, | ||
int | height, | ||
uint8_t | border, | ||
int | minval, | ||
int | maxval, | ||
int | curval | ||
) |
Draw a Vertical BarGraph.
x | X coordinate of the corner of the bargraph |
y | Y coordinate of the corner of the bargraph |
width | Width in pixels of bargraph, including border pixels |
height | Height in pixels of bargraph, including border pixels |
border | Border pixels around bargraph (use zero for no border) |
minval | Minimum value of the bargraph |
maxval | Maximum value of the bargraph |
curval | Current value of the bargraph |
Draw a vertical bargraph.
If width is positive, the graph will be drawn to the right of the x coordinate
If width is negative, the graph will be drawn to the left of the x coordinate
If height is positive, the graph will be drawn below the y coordinate and and the graph will advance down from the top as curval increases towards maxval.
If height is negative, the graph will be drawn above the y coordinate and and the graph will advance up from the bottom as curval increases towards maxval.
Examples:
void DrawVLine | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | height, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a Vertical Line.
x | a value from 0 to GLCD.Width-1 |
y | a value from 0 to GLCD.Height-1 |
height | a value from 1 to GLCD.Height-y |
color | color of line |
Draw a vertical line of width pixels starting at x,y Resulting line is height pixels.
color is an optional parameter indicating pixel color, default is PIXEL_ON
|
inherited |
Erase in Line.
type | type of line erase |
Erases all or part of a line of text depending on the type of erase specified.
If type is not specified it is assumed to be eraseTO_EOL
The cursor position does not change.
|
inherited |
Erase Text Line.
row | row # of text to earase |
Erases a line of text and moves the cursor to the begining of the line. Rows are zero based so the top line/row of a text area is 0.
void FillCircle | ( | uint8_t | xCenter, |
uint8_t | yCenter, | ||
uint8_t | radius, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a Filled in a Circle.
xCenter | X coordinate of the center of the circle |
yCenter | Y coordinate of the center of the circle |
radius | radius of circle |
color | Draw a filled in circle of the given radius extending out from the center pixel. |
See DrawCircle() for the full details on sizing.
color is an optional parameter indicating pixel color, default is PIXEL_ON
void FillEllipse | ( | uint8_t | xCenter, |
uint8_t | yCenter, | ||
uint8_t | xRadius, | ||
uint8_t | yRadius, | ||
uint8_t | color = PIXEL_ON |
||
) |
Draw a filled in ellipse.
xCenter | X coordinate of the center of the ellipse |
yCenter | Y coordinate of the center of the ellipse |
xRadius | horizontal radius of ellipse |
yRadius | vertical radius of ellipse |
color | Draw a filled in ellipse of the 2 given radi extending out from the center pixel. Final ellipse dimensions will be xRadius*2 +1 by yRadius*2 +1 pixels |
color is an optional parameter indicating pixel color, default is PIXEL_ON
void FillRect | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | color = PIXEL_ON |
||
) |
Fill a Rectangle.
x | the x coordinate of the upper left corner of the rectangle |
y | the y coordinate of the upper left corner of the rectangle |
width | width of the rectangle |
height | height of the rectangle |
color | Fill a rectanglular area of the specified width and height. |
The resulting rectangle covers an area width pixels wide by height pixels tall starting from the pixel at x,y.
The upper left corner at x,y and the lower right corner at x+width-1,y+width-1.
The length of the horizontal sides will be width pixels The length of the vertical sides will be height pixels
color is an optional parameter indicating pixel color, default is PIXEL_ON
void FillRoundRect | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height, | ||
uint8_t | radius, | ||
uint8_t | color = PIXEL_ON |
||
) |
Fill a rectangle with rounded corners.
x | the x coordinate of the upper left corner of the rectangle |
y | the y coordinate of the upper left corner of the rectangle |
width | width of the rectangle |
height | height of the rectangle |
radius | radius of rounded corners |
color |
Fill a rectanglular area with rounded corners with the same outline as DrawRoundRect()
Radius is a value from 1 to half the smaller of height or width of the rectangle.
void FillTriangle | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2, | ||
uint8_t | x3, | ||
uint8_t | y3, | ||
uint8_t | color = PIXEL_ON |
||
) |
Fill a triangle.
x1 | the x coordinate of point 1 |
y1 | the y coordinate of point 1 |
x2 | the x coordinate of point 2 |
y2 | the y coordinate of point 2 |
x3 | the x coordinate of point 3 |
y3 | the y coordinate of point 3 |
color | Fill a triangle formed by the 3 specified points. |
color is an optional parameter indicating pixel color, default is PIXEL_ON
|
inherited |
Get Text Area property.
property | a value from gTextProp_t Get Text Area property |
Examples:
gTextProp_FontWidth and gTextProp_FontHeight return rendered sizes in pixels which include any inter character padding pixels.
void GotoXY | ( | uint8_t | x, |
uint8_t | y | ||
) |
Set x,y coordinates for both Graphics and Text.
x | X coordinate |
y | Y coordinate |
Sets the current pixel location to x,y. x and y are relative to the 0,0 origin of the display which is the upper left most pixel on the display.
int Init | ( | glcd_device_mode | invert = NON_INVERTED | ) |
Initilize library and device hardware.
invert | specifices whether display is in normal mode or inverted mode. |
This should be called prior to any other graphic library function. It does all the needed initializations including taking care of the low level hardware initalization of the display device.
The optional invert parameter specifies if the display should be run in a normal mode, or inverted mode.
It does not refer to whether the display uses light or darg pixels.
In "normal" or NON_INVERTED mode, pixels are turned on for PIXEL_ON or BLACK and turned off for PIXEL_OFF or WHITE.
In "inverted" or INVERTED mode, pixels are turned off for PIXEL_ON or BLACK and turned on for PIXEL_OFF or WHITE.
NON_INVERTED mode clears the display with all pixels off and drawing with PIXEL_ON or BLACK will turn on pixels.
INVERTED mode clears the display with all pixels on and drawing with PIXEL_OFF or WHITE will turn on pixels.
The terminology of BLACK and WHITE is from the perspective of a display that uses black pixels on a light background. For example, if a pixel is set to BLACK and used on a black pixel on light background display, you get a black pixel.
However, if the display is a white pixel on dark background display, then setting a pixel to BLACK turns on a white pixel on the display.
Because of this, it can be less confusing to use PIXEL_ON and PIXEL_OFF vs BLACK and WHITE.
Upon successful completion of the initialization:
void InvertRect | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | width, | ||
uint8_t | height | ||
) |
Invert a Rectangular area.
x | the x coordinate of the upper left corner of the rectangle |
y | the y coordinate of the upper left corner of the rectangle |
width | width in pixels of the rectangular area |
height | height in pixels of the rectangular area |
Invert the pixels in the rectanglular area of the specified width and height. BLACK pixels become WHITE and WHITE pixels become BLACK.
The upper left corner at x,y and the lower right corner at x+width-1,y+width-1.
The length of the horizontal sides will be width pixels The length of the vertical sides will be height pixels
|
inherited |
print formatted data
format | string that contains text or optional embedded format tags |
... | Depending on the format string, the function may expect a sequence of additional arguments. |
Writes a sequence of data formatted as the format argument specifies. After the format parameter, the function expects at least as many additional arguments as specified in format. The format string supports all standard printf() formating % tags.
Examples:
|
inherited |
print formatted data
format | string that contains text or optional embedded format tags |
... | Depending on the format string, the function may expect a sequence of additional arguments. |
Writes a sequence of data formatted as the format argument specifies. After the format parameter, the function expects at least as many additional arguments as specified in format. The format string supports all standard printf() formating % tags.
Examples:
|
inherited |
print formatted data
format | string in AVR progmem that contains text or optional embedded format tags |
... | Depending on the format string, the function may expect a sequence of additional arguments. |
See gText::Printf() for full details.
|
inherited |
print a flash based string
str | pointer to a null terminated character string stored in program memory |
|
inherited |
print a flash based string
str | pointer to a null terminated character string stored in program memory |
The string is output followed by a newline.
|
inherited |
Legacy function to print a number.
n | is the number to print |
|
inherited |
output a character
c | the character to output |
If the character will not fit on the current text line inside the text area, the text position is wrapped to the next line. This might be the next lower or the next higher line depending on the scroll direction.
If there is not enough room to fit a full line of new text after wrapping, the entire text area will be scrolled to make room for a new line of text. The scroll direction will be up or down depending on the scroll direction for the text area.
If there is an attempt to output a character that has no definition i.e. its width is zero in the font data, then no character will be rendered. This occurs if the font is a "sparse" font, that does not define all the characters within the font range. To save room a "sparse" font will set the width of the undefined characters to zero.
|
inherited |
|
inherited |
output a String class string
str | String class string |
Outputs all the characters in the string to the text area. See PutChar() for a full description of how characters are written to the text area.
|
inherited |
output a program memory character string
str | pointer to a null terminated character string stored in program memory |
Outputs all the characters in the string to the text area.
Examples:
See PutChar() for a full description of how characters are written to the text area.
|
inherited |
Select a Font and font color.
font | a font definition |
fgcolor | foreground font color |
callback | optional font read routine |
Selects the font definition as the current font for the text area.
All subsequent printing functions will use this font.
Font definitions stored in program memory. You can have as many fonts defines as will fit in program memory can switch between them with this function.
fgcolor PIXEL_ON or BLACK renders "on" pixels on a "off" background, i.e. it turns on the pixels on the LCD for the pixels in the character glpyh and turns off all the background pixels.
fgcolor PIXEL_OFF or WHITE renders "off" pixels on a "on" background; i.e. it turns off the pixels on the LCD for the pixels in the character glpyh and turns on all the background pixels.
If the optional callback argument is ommitted, a default routine is selected that assumes that the font is in program memory (flash).
Examples:
|
inherited |
Set TextArea mode options.
mode | a value from gTextMode |
Examples:
void SetDisplayMode | ( | glcd_device_mode | invert | ) |
Set LCD Display mode.
invert | Inverted mode |
Sets the graphical state mode for the entire LCD display
In "normal" or NON_INVERTED mode, pixels are turned on for PIXEL_ON or BLACK and turned off for PIXEL_OFF or WHITE.
In "inverted" or INVERTED mode, pixels are turned off for PIXEL_ON or BLACK and turned on for PIXEL_OFF or WHITE.
|
inherited |
Set a font foreground color.
fgcolor | foreground font color |
Set the font foreground color for the text area.
fgcolor PIXEL_ON or BLACK renders "on" pixels on a "off" background, i.e. it turns on the pixels on the LCD for the pixels in the character glpyh and turns off all the background pixels.
fgcolor PIXEL_OFF or WHITE renders "off" pixels on a "on" background; i.e. it turns off the pixels on the LCD for the pixels in the character glpyh and turns on all the background pixels.
Examples:
|
inherited |
Returns the pixel width of a string.
str | pointer to string stored in RAM |
|
inherited |
Returns the pixel width of a String class string.
str | String class string |
|
inherited |
Returns the pixel width of a string.
str | pointer to string stored in program memory |
|
inherited |
output a character to the text area
c | the character to output |
This method is needed for the Print base class
|
inherited |
output a UTF8 encoded character to the text area
utfc | the UTF8 character to output |
used to output UTF8 encoded characters including multibyte wide UTF8 character codes.
The UTF character codes are limited to 0-255. To go beyond 255 is a BIG deal since the font header currently only supports up to 256 characters. (it is only an 8 bit field)
Also by only supporting 0-255 codes, when UTF8 processing is enabled, raw code processing can also be supported for characters above 0x7f with the exception that codes 0xc2 and 0xc3 will be lost.