![]() |
Display Simple Graphics library
v0.5
Library containing shape, text, and bitmap drawing functions called by various display drivers
|
#include "simplegfx.h"
Functions | |
void | clearDisplay (screen_t *dev) |
Clears (sets to the native background color of the screen, usually black) the entire screen. More... | |
void | updateDisplay (screen_t *dev) |
Updates the display by writing the image buffer to it. Not necessary for screens that have their own image buffers. More... | |
void | resetDisplay (screen_t *dev) |
Resets the display. More... | |
void | setDisplayRotation (screen_t *dev, char r) |
Sets the screen's orientation. More... | |
char | getDisplayRotation (screen_t *dev) |
Returns the screen's orientation. More... | |
int | getDisplayWidth (screen_t *dev) |
Returns the width of the display in pixels with screen rotation taken into account. More... | |
int | getDisplayHeight (screen_t *dev) |
Returns the height of the display in pixels with screen rotation taken into account. More... | |
void | invertDisplay (screen_t *dev, char i) |
Toggles the invert/normal display modes for the display. Depending on the display type it may only invert existing drawings, or it may invert both existing and colors drawn when inversion is set. More... | |
void | sleepWakeDisplay (screen_t *dev, char i) |
Toggle the display's sleep/wake mode. Not supported by all displays. More... | |
void | scrollDisplay (screen_t *dev, int h, int v) |
Set the display's vertical or hrizontal scrolling functions. Not supported by all displays, and different display types behave differently. More... | |
char | isInverted (screen_t *dev) |
Returns the status of the screen's colors - normal or inverted. More... | |
char | isAsleep (screen_t *dev) |
Returns whether the screen is currently in a sleep mode or awake. More... | |
unsigned char | getScrollHorizontal (screen_t *dev) |
Returns a value representing the status or speed of the display's horizontal scroll. More... | |
unsigned char | getScrollVertical (screen_t *dev) |
Returns a value representing the status or speed of the display's vertical scroll. More... | |
void clearDisplay | ( | screen_t * | dev | ) |
Clears (sets to the native background color of the screen, usually black) the entire screen.
dev | Pointer to the display's device structure returned by the initialization function. |
int getDisplayHeight | ( | screen_t * | dev | ) |
Returns the height of the display in pixels with screen rotation taken into account.
dev | Pointer to the display's device structure returned by the initialization function. |
char getDisplayRotation | ( | screen_t * | dev | ) |
Returns the screen's orientation.
dev | Pointer to the display's device structure returned by the initialization function. |
int getDisplayWidth | ( | screen_t * | dev | ) |
Returns the width of the display in pixels with screen rotation taken into account.
dev | Pointer to the display's device structure returned by the initialization function. |
unsigned char getScrollHorizontal | ( | screen_t * | dev | ) |
Returns a value representing the status or speed of the display's horizontal scroll.
dev | Pointer to the display's device structure returned by the initialization function. |
unsigned char getScrollVertical | ( | screen_t * | dev | ) |
Returns a value representing the status or speed of the display's vertical scroll.
dev | Pointer to the display's device structure returned by the initialization function. |
void invertDisplay | ( | screen_t * | dev, |
char | i | ||
) |
Toggles the invert/normal display modes for the display. Depending on the display type it may only invert existing drawings, or it may invert both existing and colors drawn when inversion is set.
dev | Pointer to the display's device structure returned by the initialization function. |
i | Set to 0 for normal and 1 for inverted. |
char isAsleep | ( | screen_t * | dev | ) |
Returns whether the screen is currently in a sleep mode or awake.
dev | Pointer to the display's device structure returned by the initialization function. |
char isInverted | ( | screen_t * | dev | ) |
Returns the status of the screen's colors - normal or inverted.
dev | Pointer to the display's device structure returned by the initialization function. |
void resetDisplay | ( | screen_t * | dev | ) |
Resets the display.
dev | Pointer to the display's device structure returned by the initialization function. |
void scrollDisplay | ( | screen_t * | dev, |
int | h, | ||
int | v | ||
) |
Set the display's vertical or hrizontal scrolling functions.
Not supported by all displays, and different display types behave differently.
dev | Pointer to the display's device structure returned by the initialization function. |
h | Sets the horizontal display velocity, or for displays with only on/off modes, any non-zero value will trigger a horizontal scroll. Enter zero to stop horizontal scrolling. |
v | Sets the vertical display velocity, or for displays with only on/off modes, any non-zero value will trigger a vertical scroll. Enter zero to stop vertical scrolling. |
void setDisplayRotation | ( | screen_t * | dev, |
char | r | ||
) |
Sets the screen's orientation.
dev | Pointer to the display's device structure returned by the initialization function. |
r | Number representing the orientation to set the display to. (0) means pixels are drawn to the screen is at it's native orientation, (1) means pixels are drawn rotated 90 degrees clockwise, (2) means pixels are drawn upside-down - 180 degrees rotated, and (3) means pixels are drawn rotated 270 degrees clockwise. |
void sleepWakeDisplay | ( | screen_t * | dev, |
char | i | ||
) |
Toggle the display's sleep/wake mode. Not supported by all displays.
dev | Pointer to the display's device structure returned by the initialization function. |
i | Set to 0 for awake and 1 for asleep. |
void updateDisplay | ( | screen_t * | dev | ) |
Updates the display by writing the image buffer to it. Not necessary for screens that have their own image buffers.
dev | Pointer to the display's device structure returned by the initialization function. |