CircleOS
1
|
Various utilities for drawings (characters, ..) More...
Go to the source code of this file.
Functions | |
void | DRAW_SetCharMagniCoeff (mag_t Coeff) |
mag_t | DRAW_GetCharMagniCoeff (void) |
color_t | DRAW_GetTextColor (void) |
void | DRAW_SetTextColor (color_t Color) |
color_t | DRAW_GetBGndColor (void) |
void | DRAW_SetBGndColor (color_t Color) |
void | DRAW_Clear (void) |
void | DRAW_SetLogoBW (void) |
void | DRAW_SetImage (const color_t *imageptr, coord_t x, coord_t y, coord_t width, coord_t height) |
Draw a color bitmap at the provided coordinates. More... | |
void | DRAW_SetImageSel (const color_t *imageptr, coord_t x, coord_t y, coord_t width, coord_t height, color_t oldBgndColor, color_t newBgndColor) |
Draw a color bitmap at the provided coordinates, with selected background color. More... | |
void | DRAW_SetImageBW (const u8 *imageptr, coord_t x, coord_t y, coord_t width, coord_t height) |
Draw a monochrome bitmap at the provided coordinates. More... | |
void | DRAW_DisplayVbat (coord_t x, coord_t y) |
void | DRAW_DisplayTime (coord_t x, coord_t y) |
void | DRAW_DisplayStringWithMode (coord_t x, coord_t y, char *ptr, len_t len, bool mode, enumset_t align) |
void | DRAW_DisplayString (coord_t x, coord_t y, char *ptr, len_t len) |
void | DRAW_DisplayStringInverted (coord_t x, coord_t y, char *ptr, len_t len) |
void | DRAW_SetDefaultColor (void) |
void | DRAW_Line (coord_t x1, coord_t y1, coord_t x2, coord_t y2, color_t color) |
void | DRAW_Putc (u8 Ascii) |
void | DRAW_Puts (const u8 *ptr) |
void | DRAW_SetCursorPos (coord_t x, coord_t y) |
ret_t | DRAW_GetCursorPos (void) |
void | DRAW_SetCursorMargin (coord_t lx, coord_t rx, coord_t hy, coord_t ly) |
void | DRAW_GetCursorMargin (coord_t *lx, coord_t *rx, coord_t *hy, coord_t *ly) |
void | DRAW_Circle (coord_t CENTER_x, coord_t CENTER_y, coord_t RADIUS_r, color_t Color, color_t Fill_Color, bool Fill, bool Circle) |
void | DRAW_Ellipse (coord_t CENTER_x, coord_t CENTER_y, coord_t RADIUS_a, coord_t RADIUS_b, color_t Color, color_t Fill_Color, bool Fill, bool Ellipse) |
void | DRAW_Polygon (coord_t *points, u16 NUM_Points, color_t Line_Color) |
void DRAW_Circle | ( | coord_t | CENTER_x, |
coord_t | CENTER_y, | ||
coord_t | RADIUS_r, | ||
color_t | Color, | ||
color_t | Fill_Color, | ||
bool | Fill, | ||
bool | Circle | ||
) |
Function Name : DRAW_Circle() Description : Implementation of Bresenham's Circle variant algorithm
[in] | CENTER_x | Circle Center x position |
[in] | CENTER_y | Circle Center y position |
[in] | RADIUS_r | Circle Radius |
[in] | Color | Line color of the Circle |
[in] | Fill_Color | Background of the Circle |
[in] | Fill | Defines if the circle is filled |
[in] | Circle | Defines if the circle is drawn |
void DRAW_Clear | ( | void | ) |
void DRAW_DisplayString | ( | coord_t | x, |
coord_t | y, | ||
char * | ptr, | ||
len_t | len | ||
) |
This function is used to display a character string (ALL_SCREEN u8 max) at given X, Y coordinates on the LCD display.
[in] | x | The horizontal coordinate of the string. |
[in] | y | The vertical coordinate of the string. |
[in] | *ptr | Pointer to the string. |
[in] | len | String length i.e., number of characters to display. |
void DRAW_DisplayStringInverted | ( | coord_t | x, |
coord_t | y, | ||
char * | ptr, | ||
len_t | len | ||
) |
This function is used to display a character string (ALL_SCREEN char max) at given X, Y coordinates on the LCD display, with inverted colors.
[in] | x | The horizontal coordinate of the string. |
[in] | y | The vertical coordinate of the string. |
[in] | *ptr | Pointer to the string. |
[in] | len | String length i.e., number of characters to display. |
void DRAW_DisplayStringWithMode | ( | coord_t | x, |
coord_t | y, | ||
char * | ptr, | ||
len_t | len, | ||
bool | mode, | ||
enumset_t | align | ||
) |
This function is used to display a character string at given X, Y coordinates on the LCD display. Note: This function is the user interface to use the LCD driver.
[in] | x | The horizontal coordinate of the string. |
[in] | y | The vertical coordinate of the string. |
[in] | *ptr | Pointer to the string. |
[in] | len | String length i.e., number of characters to display: if 0 = len(string), if ALL_SCREEN = width screen. |
[in] | mode | Display mode: 0 normal, 1 inverted colors. |
[in] | align | Alignment mode: 0 normal, 1 centered. |
void DRAW_DisplayTime | ( | coord_t | x, |
coord_t | y | ||
) |
void DRAW_DisplayVbat | ( | coord_t | x, |
coord_t | y | ||
) |
void DRAW_Ellipse | ( | coord_t | CENTER_x, |
coord_t | CENTER_y, | ||
coord_t | RADIUS_a, | ||
coord_t | RADIUS_b, | ||
color_t | Color, | ||
color_t | Fill_Color, | ||
bool | Fill, | ||
bool | Ellipse | ||
) |
Function Name : DRAW_Ellipse() Description : This function draw an Ellipse
[in] | CENTER_x | Ellipse Center x position |
[in] | CENTER_y | Ellipse Center y position |
[in] | RADIUS_a | Ellipse Radius a |
[in] | RADIUS_b | Ellipse Radius b |
[in] | Color | Line color of the Circle |
[in] | Fill_Color | Background of the Circle |
[in] | Fill | Defines if the Ellipse is filled |
[in] | Ellipse | Defines if the Ellipse is drawn |
color_t DRAW_GetBGndColor | ( | void | ) |
mag_t DRAW_GetCharMagniCoeff | ( | void | ) |
void DRAW_GetCursorMargin | ( | coord_t * | lx, |
coord_t * | rx, | ||
coord_t * | hy, | ||
coord_t * | ly | ||
) |
This function is used to get the current margins for the cursor. This position is used by the DRAW_putc and DRAW_Puts functions.
[out] | *lx | X current left margin in pixels. |
[out] | *rx | X current right margin in pixels. |
[out] | *hy | Y current high margin in pixels. |
[out] | *ly | Y current low margin in pixels. |
ret_t DRAW_GetCursorPos | ( | void | ) |
color_t DRAW_GetTextColor | ( | void | ) |
void DRAW_Line | ( | coord_t | x1, |
coord_t | y1, | ||
coord_t | x2, | ||
coord_t | y2, | ||
color_t | color | ||
) |
Draw a line on the LCD screen. Optimized for horizontal/vertical lines, and use the Bresenham algorithm for other cases.
[in] | x1 | The x-coordinate of the first line endpoint. |
[in] | x2 | The x-coordinate of the second line endpoint. |
[in] | y1 | The y-coordinate of the first line endpoint. |
[in] | y2 | The y-coordinate of the second line endpoint. |
[in] | color | The line color. |
void DRAW_Polygon | ( | coord_t * | points, |
u16 | NUM_Points, | ||
color_t | Line_Color | ||
) |
Function Name : DRAW_Polygon() Description : Function to draw a polygon with the given points
[in] | *points | Pointer to the points of the polygon |
[in] | NUM_Points | Number of pointscolor of the line |
[in] | Line_Color | Color of the line. |
void DRAW_Putc | ( | u8 | Ascii) |
Display at current coordinates the provided ASCII character with the current text and background colors and with the current magnify coefficient.
[in] | Ascii | The ASCII code of the character to display. Ascii must be higher than 31 and lower than 255. ' ' managed as CRLF. |
void DRAW_Puts | ( | const u8 * | ptr) |
This function is used to display a character string at current coordinates on the LCD display. Note: This function is the user interface to use the LCD driver.
[in] | *ptr | Pointer to the string. |
void DRAW_SetBGndColor | ( | color_t | Color) |
void DRAW_SetCharMagniCoeff | ( | mag_t | Coeff) |
void DRAW_SetCursorMargin | ( | coord_t | lx, |
coord_t | rx, | ||
coord_t | hy, | ||
coord_t | ly | ||
) |
This function is used to set the current margins for the cursor. This position is used by the DRAW_putc and DRAW_Puts functions.
[in] | lx | X new left margin in pixels. |
[in] | rx | X new right margin in pixels. |
[in] | hy | Y new high margin in pixels. |
[in] | ly | Y new low margin in pixels. |
void DRAW_SetCursorPos | ( | coord_t | x, |
coord_t | y | ||
) |
void DRAW_SetDefaultColor | ( | void | ) |
void DRAW_SetImage | ( | const color_t * | imageptr, |
coord_t | x, | ||
coord_t | y, | ||
coord_t | width, | ||
coord_t | height | ||
) |
The provided bitmap is made width * height 2 byte words. Each 2 byte word contains the RGB color of a pixel.
[in] | imageptr | A pointer to an array of width * height 2 byte words. |
[in] | x | The horizontal coordinate of the low left corner of the bitmap. |
[in] | y | The vertical coordinate of the low left corner of the bitmap. |
[in] | width | The bitmap width. |
[in] | height | The bitmap height. |
void DRAW_SetImageBW | ( | const u8 * | imageptr, |
coord_t | x, | ||
coord_t | y, | ||
coord_t | width, | ||
coord_t | height | ||
) |
The provided bitmap is made of width * height bits where a set bit means a pixel drawn in the current text color, whereas an unset bit means a pixel drawn in the current background color.
[in] | imageptr | A pointer to an array of width * height bits. |
[in] | x | The horizontal coordinate of the low left corner of the bitmap. |
[in] | y | The vertical coordinate of the low left corner of the bitmap. |
[in] | width | The bitmap width. |
[in] | height | The bitmap height. |
void DRAW_SetImageSel | ( | const color_t * | imageptr, |
coord_t | x, | ||
coord_t | y, | ||
coord_t | width, | ||
coord_t | height, | ||
color_t | oldBgndColor, | ||
color_t | newBgndColor | ||
) |
The provided bitmap is made width * height 2 byte words. Each 2 byte word contains the RGB color of a pixel. All pixels with the oldBgndColor are replaced with the newBgndColor
[in] | imageptr | A pointer to an array of width * height 2 byte words. |
[in] | x | The horizontal coordinate of the low left corner of the bitmap. |
[in] | y | The vertical coordinate of the low left corner of the bitmap. |
[in] | width | The bitmap width. |
[in] | height | The bitmap height. |
[in] | oldBgndColor | The color of the background to replace. |
[in] | newBgndColor | The new color. |