Hanna
Sourcecode Batteriemanagementsystem |
Graphic library API header file. Mehr ...
gehe zum Quellcode dieser Datei
Datenstrukturen | |
struct | font |
Aufzählungen | |
enum | font_data_type { FONT_LOC_PROGMEM } |
Valid storage locations for font data. Mehr ... | |
enum | gfx_text_alignment { TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER } |
enum | gfx_text_position { TEXT_POS_TOP = (1 << 0), TEXT_POS_CENTER_Y = (1 << 1), TEXT_POS_BOTTOM = (1 << 2), TEXT_POS_LEFT = (1 << 3), TEXT_POS_CENTER_X = (1 << 4), TEXT_POS_RIGHT = (1 << 5), TEXT_POS_TOP_LEFT = TEXT_POS_TOP | TEXT_POS_LEFT, TEXT_POS_TOP_CENTER = TEXT_POS_TOP | TEXT_POS_CENTER_X, TEXT_POS_TOP_RIGHT = TEXT_POS_TOP | TEXT_POS_RIGHT, TEXT_POS_CENTER_LEFT = TEXT_POS_CENTER_Y | TEXT_POS_LEFT, TEXT_POS_CENTER = TEXT_POS_CENTER_Y | TEXT_POS_CENTER_X, TEXT_POS_CENTER_RIGHT = TEXT_POS_CENTER_Y | TEXT_POS_RIGHT, TEXT_POS_BOTTOM_LEFT = TEXT_POS_BOTTOM | TEXT_POS_LEFT, TEXT_POS_BOTTOM_CENTER = TEXT_POS_BOTTOM | TEXT_POS_CENTER_X, TEXT_POS_BOTTOM_RIGHT = TEXT_POS_BOTTOM | TEXT_POS_RIGHT } |
Funktionen | |
Strings and characters located in RAM | |
void | gfx_draw_char (const char c, const gfx_coord_t x, const gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color) |
Draws a character to the display. Mehr ... | |
void | gfx_draw_string (const char *str, const gfx_coord_t x, const gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color) |
Draws a string to the display. Mehr ... | |
void | gfx_draw_string_aligned (const char *str, gfx_coord_t x, gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color, enum gfx_text_position text_pos, enum gfx_text_alignment text_align) |
Draws an aligned string to the display. Mehr ... | |
void | gfx_get_string_bounding_box (char const *str, const struct font *font, gfx_coord_t *width, gfx_coord_t *height) |
Strings located in flash | |
void | gfx_draw_progmem_string (char PROGMEM_PTR_T str, gfx_coord_t x, gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color) |
Draws a string located in program memory to the display. Mehr ... | |
void | gfx_draw_progmem_string_aligned (char PROGMEM_PTR_T str, gfx_coord_t x, gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color, enum gfx_text_position text_pos, enum gfx_text_alignment text_align) |
Draws an aligned string located in program memory to the display. Mehr ... | |
void | gfx_get_progmem_string_bounding_box (char PROGMEM_PTR_T str, const struct font *font, gfx_coord_t *width, gfx_coord_t *height) |
Computes the bounding box of a string located in program memory. Mehr ... | |
Graphic library API header file.
Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
Definiert in Datei gfx_text.h.
enum font_data_type |
Valid storage locations for font data.
Aufzählungswerte | |
---|---|
FONT_LOC_PROGMEM |
Font data stored in program/flash memory. |
Definiert in Zeile 63 der Datei gfx_text.h.
enum gfx_text_alignment |
Text alignment options for text lines within a paragraph.
Definiert in Zeile 73 der Datei gfx_text.h.
enum gfx_text_position |
Text paraphraph positioning options.
Definiert in Zeile 83 der Datei gfx_text.h.
void gfx_draw_char | ( | const char | c, |
const gfx_coord_t | x, | ||
const gfx_coord_t | y, | ||
const struct font * | font, | ||
const gfx_color_t | bg_color, | ||
const gfx_color_t | text_color | ||
) |
Draws a character to the display.
c | Character to be drawn |
x | X coordinate on screen. |
y | Y coordinate on screen. |
font | Font to draw character in |
bg_color | Background color to draw behind the text string |
text_color | Foreground color to draw the text string in |
Definiert in Zeile 234 der Datei gfx_text.c.
void gfx_draw_progmem_string | ( | char PROGMEM_PTR_T | str, |
gfx_coord_t | x, | ||
gfx_coord_t | y, | ||
const struct font * | font, | ||
const gfx_color_t | bg_color, | ||
const gfx_color_t | text_color | ||
) |
Draws a string located in program memory to the display.
This function will draw a string located in program memory to the display, this differs from gfx_draw_string() by using constant string data from the program memory instead of string data in RAM.
Using program memory for constant strings will reduce the applications need for RAM, and thus lower the overall size footprint.
str | Pointer to string located in program memory |
x | X coordinate on screen. |
y | Y coordinate on screen. |
font | Font to draw string in |
bg_color | Background color to draw behind the text string |
text_color | Foreground color to draw the text string in |
Definiert in Zeile 389 der Datei gfx_text.c.
void gfx_draw_progmem_string_aligned | ( | char PROGMEM_PTR_T | str, |
gfx_coord_t | x, | ||
gfx_coord_t | y, | ||
const struct font * | font, | ||
const gfx_color_t | bg_color, | ||
const gfx_color_t | text_color, | ||
enum gfx_text_position | text_pos, | ||
enum gfx_text_alignment | text_align | ||
) |
Draws an aligned string located in program memory to the display.
This function will draw a string located in program memory to the display with the specified alignment. This differs from gfx_draw_aligned_string() by using constant string data from the program memory instead of string data in RAM.
str | Pointer to string located in program memory |
x | X coordinate on screen. |
y | Y coordinate on screen. |
font | Font to draw string in |
bg_color | Background color to draw behind the text string |
text_color | Foreground color to draw the text string in |
text_pos | Position of the coordinate relative to the text paragraph |
text_align | Alignment of text lines within the paragraph bounding box |
Definiert in Zeile 414 der Datei gfx_text.c.
void gfx_draw_string | ( | const char * | str, |
gfx_coord_t | x, | ||
gfx_coord_t | y, | ||
const struct font * | font, | ||
const gfx_color_t | bg_color, | ||
const gfx_color_t | text_color | ||
) |
Draws a string to the display.
This function will draw a string located in memory to the display.
str | Pointer to string |
x | X coordinate on screen. |
y | Y coordinate on screen. |
font | Font to draw string in |
bg_color | Background color to draw behind the text string |
text_color | Foreground color to draw the text string in |
Definiert in Zeile 272 der Datei gfx_text.c.
void gfx_draw_string_aligned | ( | const char * | str, |
gfx_coord_t | x, | ||
gfx_coord_t | y, | ||
const struct font * | font, | ||
const gfx_color_t | bg_color, | ||
const gfx_color_t | text_color, | ||
enum gfx_text_position | text_pos, | ||
enum gfx_text_alignment | text_align | ||
) |
Draws an aligned string to the display.
This function will draw a string located in memory to the display with the specified alignment.
str | Pointer to string |
x | X coordinate on screen. |
y | Y coordinate on screen. |
font | Font to draw string in |
bg_color | Background color to draw behind the text string |
text_color | Foreground color to draw the text string in |
text_pos | Position of the coordinate relative to the text paragraph |
text_align | Alignment of text lines within the paragraph bounding box |
Definiert in Zeile 295 der Datei gfx_text.c.
void gfx_get_progmem_string_bounding_box | ( | char PROGMEM_PTR_T | str, |
const struct font * | font, | ||
gfx_coord_t * | width, | ||
gfx_coord_t * | height | ||
) |
Computes the bounding box of a string located in program memory.
str | String in program memory to calculate bounding box for |
font | Font used |
width | Pointer to width result |
height | Pointer to height result |
Definiert in Zeile 565 der Datei gfx_text.c.