|
px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
|
A basic monochrome (1 bit per pixel) graphics library.
File(s):
Tool to convert images and fonts: Ruison.com LCD Image Converter
Tool template files:
Tool preset file:
Data Structures | |
| struct | px_gfx_img_t |
| Image definition. More... | |
| struct | px_gfx_font_t |
| Font definition. More... | |
| struct | px_gfx_area_t |
| Area definition. More... | |
| struct | px_gfx_view_port_t |
| View port definition. More... | |
Typedefs | |
| typedef int16_t | px_gfx_xy_t |
| Size definition of an X or Y coordinate. More... | |
Enumerations | |
| enum | px_gfx_color_t |
| Foreground and background color definitions. More... | |
| enum | px_gfx_align_t { PX_GFX_ALIGN_V_TOP = 0x00 , PX_GFX_ALIGN_V_MID = 0x01 , PX_GFX_ALIGN_V_BOT = 0x02 , PX_GFX_ALIGN_H_LEFT = 0x00 , PX_GFX_ALIGN_H_MID = 0x10 , PX_GFX_ALIGN_H_RIGHT = 0x20 } |
| Alignment definition. More... | |
| enum | px_gfx_xy_ref_t { PX_GFX_XY_REF_REL = 0 , PX_GFX_XY_REF_ABS } |
| X Y coordinate reference. More... | |
Functions | |
| void | px_gfx_init (void) |
| Initialise graphics library. More... | |
| void | px_gfx_buf_clear (void) |
| Clear display buffer. More... | |
| void | px_gfx_draw (void) |
| Redraw whole display using display buffer. More... | |
| void | px_gfx_draw_update (void) |
| Update display with total area that has changed in display buffer. More... | |
| bool | px_gfx_update_area_get (px_gfx_area_t *area) |
| Get total area of frame that has changed. More... | |
| void | px_gfx_draw_prop_reset (void) |
| Reset drawing properties to default. More... | |
| px_gfx_color_t | px_gfx_color_fg_set (px_gfx_color_t color) |
| Set the new foreground drawing color. More... | |
| px_gfx_color_t | px_gfx_color_bg_set (px_gfx_color_t color) |
| Set the new background drawing color. More... | |
| px_gfx_align_t | px_gfx_align_set (px_gfx_align_t align) |
| Set the new alignment. More... | |
| void | px_gfx_view_port_set (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t width, px_gfx_xy_t height, px_gfx_xy_ref_t xy_ref) |
| Set a drawing view port. More... | |
| void | px_gfx_view_port_reset (void) |
| Reset view port. More... | |
| const px_gfx_font_t * | px_gfx_font_set (const px_gfx_font_t *font) |
| Set the new font. More... | |
| void | px_gfx_draw_pixel (px_gfx_xy_t x, px_gfx_xy_t y) |
| Draw a pixel using the current foreground color. More... | |
| void | px_gfx_draw_line (px_gfx_xy_t x1, px_gfx_xy_t y1, px_gfx_xy_t x2, px_gfx_xy_t y2) |
| Draw a line using the current foreground color. More... | |
| void | px_gfx_draw_line_hor (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t width) |
| Draw a horizontal line using the current foreground color. More... | |
| void | px_gfx_draw_line_ver (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t height) |
| Draw a vertical line using the current foreground color. More... | |
| void | px_gfx_draw_rect (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t width, px_gfx_xy_t height) |
| Draw a rectangle using the current foreground color. More... | |
| void | px_gfx_draw_fill_fg (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t width, px_gfx_xy_t height) |
| Draw a solid rectangular fill in the current foreground color. More... | |
| void | px_gfx_draw_fill_bg (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t width, px_gfx_xy_t height) |
| Draw a solid rectangular fill in the current background color. More... | |
| void | px_gfx_draw_circ (px_gfx_xy_t x, px_gfx_xy_t y, px_gfx_xy_t radius) |
| Draw a circle using the current foreground color. More... | |
| void | px_gfx_draw_img (px_gfx_xy_t x, px_gfx_xy_t y, const px_gfx_img_t *img) |
| Draw a graphic image using the current foreground and background color. More... | |
| void | px_gfx_draw_char (px_gfx_xy_t x, px_gfx_xy_t y, char glyph) |
| Draw a font character using the current foreground color. More... | |
| void | px_gfx_draw_str (px_gfx_xy_t x, px_gfx_xy_t y, const char *str) |
| Draw a font string using the current foreground color. More... | |
| void | px_gfx_printf (px_gfx_xy_t x, px_gfx_xy_t y, const char *format,...) |
| Draw a formatted font string using the current foreground color. More... | |
Convenience alignment combination definitions | |
| #define | PX_GFX_ALIGN_TOP_LEFT (px_gfx_align_t)(PX_GFX_ALIGN_V_TOP | PX_GFX_ALIGN_H_LEFT ) |
| #define | PX_GFX_ALIGN_TOP_MID (px_gfx_align_t)(PX_GFX_ALIGN_V_TOP | PX_GFX_ALIGN_H_MID ) |
| #define | PX_GFX_ALIGN_TOP_RIGHT (px_gfx_align_t)(PX_GFX_ALIGN_V_TOP | PX_GFX_ALIGN_H_RIGHT) |
| #define | PX_GFX_ALIGN_MID (px_gfx_align_t)(PX_GFX_ALIGN_V_MID | PX_GFX_ALIGN_H_MID ) |
| #define | PX_GFX_ALIGN_BOT_LEFT (px_gfx_align_t)(PX_GFX_ALIGN_V_BOT | PX_GFX_ALIGN_H_LEFT ) |
| #define | PX_GFX_ALIGN_BOT_MID (px_gfx_align_t)(PX_GFX_ALIGN_V_BOT | PX_GFX_ALIGN_H_MID ) |
| #define | PX_GFX_ALIGN_BOT_RIGHT (px_gfx_align_t)(PX_GFX_ALIGN_V_BOT | PX_GFX_ALIGN_H_RIGHT) |
| struct px_gfx_area_t |
| Data Fields | ||
|---|---|---|
| px_gfx_xy_t | x1 | Left. |
| px_gfx_xy_t | y1 | Top. |
| px_gfx_xy_t | x2 | Right. |
| px_gfx_xy_t | y2 | Bottom. |
| struct px_gfx_view_port_t |
| Data Fields | ||
|---|---|---|
| px_gfx_xy_t | x | Left. |
| px_gfx_xy_t | y | Top. |
| px_gfx_xy_t | width | Width. |
| px_gfx_xy_t | height | Height. |
| px_gfx_xy_ref_t | xy_ref | Coordinate reference. |
| typedef int16_t px_gfx_xy_t |
| enum px_gfx_color_t |
| enum px_gfx_align_t |
| enum px_gfx_xy_ref_t |
| void px_gfx_draw | ( | void | ) |
| void px_gfx_draw_update | ( | void | ) |
| bool px_gfx_update_area_get | ( | px_gfx_area_t * | area | ) |
| void px_gfx_draw_prop_reset | ( | void | ) |
| px_gfx_color_t px_gfx_color_fg_set | ( | px_gfx_color_t | color | ) |
| px_gfx_color_t px_gfx_color_bg_set | ( | px_gfx_color_t | color | ) |
| px_gfx_align_t px_gfx_align_set | ( | px_gfx_align_t | align | ) |
| void px_gfx_view_port_set | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | width, | ||
| px_gfx_xy_t | height, | ||
| px_gfx_xy_ref_t | xy_ref | ||
| ) |
Set a drawing view port.
Pixels outside the view port is clipped. Drawing coordinates can relative to the top left corner of the view port with the PX_GFX_XY_REF_REL option or absolute (relative to the top left corner of the display) using the PX_GFX_XY_REF_ABS option.
| x | Top left X coordinate of view port |
| y | Top left Y coordinate of view port |
| width | Width of view port |
| height | Height of view port |
| xy_ref | Coordinate are absolute (to display) or relative to view port |
| void px_gfx_view_port_reset | ( | void | ) |
| const px_gfx_font_t * px_gfx_font_set | ( | const px_gfx_font_t * | font | ) |
| void px_gfx_draw_pixel | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y | ||
| ) |
| void px_gfx_draw_line | ( | px_gfx_xy_t | x1, |
| px_gfx_xy_t | y1, | ||
| px_gfx_xy_t | x2, | ||
| px_gfx_xy_t | y2 | ||
| ) |
| void px_gfx_draw_line_hor | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | width | ||
| ) |
| void px_gfx_draw_line_ver | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | height | ||
| ) |
| void px_gfx_draw_rect | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | width, | ||
| px_gfx_xy_t | height | ||
| ) |
| void px_gfx_draw_fill_fg | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | width, | ||
| px_gfx_xy_t | height | ||
| ) |
| void px_gfx_draw_fill_bg | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | width, | ||
| px_gfx_xy_t | height | ||
| ) |
| void px_gfx_draw_circ | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| px_gfx_xy_t | radius | ||
| ) |
| void px_gfx_draw_img | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| const px_gfx_img_t * | img | ||
| ) |
| void px_gfx_draw_char | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| char | glyph | ||
| ) |
| void px_gfx_draw_str | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| const char * | str | ||
| ) |
| void px_gfx_printf | ( | px_gfx_xy_t | x, |
| px_gfx_xy_t | y, | ||
| const char * | format, | ||
| ... | |||
| ) |