mikroSDK Reference Manual
|
Basic Library Configuration API Reference. More...
Functions list | |
void | gl_set_driver (gl_driver_t *driver) |
Sets the driver to the active state and enables drawing on whole display. More... | |
void | gl_clear (gl_color_t color) |
Paint whole display. More... | |
void | gl_clear_inside_borders (gl_color_t color) |
Paint display within crop borders. More... | |
bool | gl_set_crop_borders (gl_coord_t left, gl_coord_t right, gl_coord_t top, gl_coord_t bottom) |
Initialize borders for drawing on display. More... | |
void | gl_set_font (const uint8_t *font) |
Initialize the active font. More... | |
void | gl_set_font_orientation (gl_font_orientation_t orientation) |
Sets the active font orientation. More... | |
void | gl_set_pen (gl_color_t color, uint16_t width) |
Sets the active pen width and color. More... | |
void | gl_set_pen_color (gl_color_t color) |
Sets the active pen's color. More... | |
void | gl_set_pen_width (uint16_t width) |
Sets the active pen width. More... | |
void | gl_set_inner_pen (uint16_t width_inside_object) |
Sets width of inner part of active pen. More... | |
uint16_t | gl_get_inner_pen () |
Returns the inner width of active pen. More... | |
void | gl_set_outer_pen (uint16_t width_outside_object) |
Sets width of outer part of active pen. More... | |
uint16_t | gl_get_outer_pen () |
Returns the outer width of active pen. More... | |
void | gl_set_brush_style (gl_brush_style_t style) |
Sets active brush style. More... | |
void | gl_set_brush_color (gl_color_t color) |
Sets active brush color. More... | |
void | gl_set_brush_color_from (gl_color_t color) |
Sets the active start color. More... | |
void | gl_set_brush_color_to (gl_color_t color) |
Sets the active end color. More... | |
void | gl_set_font_background_color (gl_color_t background) |
Sets the active background color for texts. More... | |
void | gl_set_font_background (bool enable) |
Sets active indicator for text background. More... | |
uint16_t | gl_get_screen_width () |
Returns the width of the display. More... | |
uint16_t | gl_get_screen_height () |
Returns the height of the display. More... | |
It has the active state that can be changed by using this header's function. Active state stores all information needed in drawing time for concluding on wich of various ways the drawing should be performed. The order of setting active state in most case is not important, but there are some exceptions. For example it is the best to first set driver. Also there are default values for the most of variables. But driver must be set by user.
The list of variables in active state :
uint16_t
inner_width - width of the pen that overlaps shape used for every shape, can be set by gl_set_pen_width, gl_set_pen, gl_set_inner_penuint16_t
outer_width - width of the pen that does not overlap the shape used for every shape, can be set by gl_set_pen_width, gl_set_pen, gl_set_outer_penbool
background_on - indicates if background is enabled required for every text drawing, can be set by gl_set_font_backgroundvoid gl_set_driver | ( | gl_driver_t * | driver | ) |
Sets the driver to the active state and enables drawing on whole display. The given driver should contain information about display's width and height and, the most important, pointer to funciton for drawing one rectangle into the display. If driver is NULL any future drawing will not be executed and the old one will be forgotten (but not deleted).
[in] | driver | the driver that will be set as active. See gl_driver_t definition for detailed explanation. |
Example
void gl_clear | ( | gl_color_t | color | ) |
Paint whole display with color
. Borders set by user using gl_set_crop_borders will be ignored.
[in] | color | The color that is used for painting. See gl_color_t definition for detailed explanation. |
Example
void gl_clear_inside_borders | ( | gl_color_t | color | ) |
Paint display with color
within crop borders. Only portion of the screen covered by crop borders will cleared with color
. See gl_set_crop_borders for details on setting crop borders.
[in] | color | The color that is used for painting. See gl_color_t definition for detailed explanation. |
Example
bool gl_set_crop_borders | ( | gl_coord_t | left, |
gl_coord_t | right, | ||
gl_coord_t | top, | ||
gl_coord_t | bottom | ||
) |
Initialize borders for drawing on display by calculating the intersection of display's borders and rectangle determined by left
, top
, bottom
and right
and change borders of active state to calculated ones. It affects every future drawing by cropping every part of the text or object which cross the set borders. If rectangle between left
, top
, bottom
and right
coordinates is completely out of display or left
is greater then right
or top
is greater then bottom
, then state will be same as if function was called with 0, 0, display_height, display_width, and whole display is available for future drawing. Every border is given by its coordinate. Left and right is given by x-axis and top and bottom by y-axis. Function accepts values for a rectangle that has no area, in that case no future drawings will be visible. By default, crop borders are set to make entire screen visible. See gl_coord_t definition for detailed explanation.
[in] | left | Left border. |
[in] | top | Top border. |
[in] | bottom | Bottom border. |
[in] | right | Right border. |
Example
void gl_set_font | ( | const uint8_t * | font | ) |
Initialize the active font to font
. Active font is used for every text drawing.
[in] | font | The font generated by NECTO Studio. |
Example
void gl_set_font_orientation | ( | gl_font_orientation_t | orientation | ) |
Sets the active font orientation to orientation
. Active font orientation determines direction of string and characters inside string whenever text is drawn. Default font orientation is horizontal.
[in] | orientation | the font orientation. See gl_set_font_orientation definition for detailed explanation. |
Example
void gl_set_pen | ( | gl_color_t | color, |
uint16_t | width | ||
) |
Sets the active pen width to width
and its color to color
. This affects every future drawing of shape by displaying pen so that one half of pen's width cover shape, and the rest of width
is drew on the outside of shape.If the shape is less then inner part of pen, the rest of inner pen will just be ignored, it wont afect outer pen to change. Default pen color is red and pen width is 1 pixel.
[in] | color | the color of the pen. See gl_color_t definition for detailed explanation. |
[in] | width | the width of the pen. |
Example
void gl_set_pen_color | ( | gl_color_t | color | ) |
Sets the active pen's color to color
. This affects every future drawing of shape by painting pen in given color
if pen width is not zero.
[in] | color | The color of the pen. See gl_color_t definition for detailed explanation. |
Example
void gl_set_pen_width | ( | uint16_t | width | ) |
Sets the active pen width to width
. This affects every future drawing of shape by displaying pen so that one half of pen's width cover shape, and the rest of pen is drew on the outside of shape.
[in] | width | the width of the pen. |
Example
void gl_set_inner_pen | ( | uint16_t | width_inside_object | ) |
Sets width of inner part of active pen to width_inside_object
. The old width of the pen drew on the outside of shape stays the same, ie. only width of inner part of shape is changed to given value. This affects every drawing of shape in the future. If the shape is less then inner part of pen, the rest of inner pen will just be ignored, it wont afect outer pen to change.
[in] | width_inside_object | the width of inner pen, ie. part of pen that overlaps shape. |
Example
uint16_t gl_get_inner_pen | ( | ) |
Returns the inner width of active pen.
Example
void gl_set_outer_pen | ( | uint16_t | width_outside_object | ) |
Sets width of outer part of active pen to width_outside_object
. The old width of the pen drew on the inside of shape stays the same, ie. only width of outer part of shape is changed to given value. This affects every drawing of shape in the future.If the shape is less then inner part of pen, the rest of inner pen will just be ignored, it won't affect outer pen to change.
[in] | width_outside_object | the width of outer pen, ie. part of pen that doesn't overlap shape. |
Example
uint16_t gl_get_outer_pen | ( | ) |
Returns the outer width of active pen.
Example
void gl_set_brush_style | ( | gl_brush_style_t | style | ) |
Sets active brush style to style
. This affects every drawing in the future. By setting brush style its determined how shapes will be collored. Default style is GL_BRUSH_STYLE_FILL
[in] | style | a style for painting shapes. See gl_brush_style_t definition for detailed explanation. |
Example
void gl_set_brush_color | ( | gl_color_t | color | ) |
Sets active brush color to color
. This affects every drawing in the future when brush style if GL_BRUSH_STYLE_FILL. Default brush color is yellow.
[in] | color | the color for painting non gradient style. See gl_color_t definition for detailed explanation. |
Example
void gl_set_brush_color_from | ( | gl_color_t | color | ) |
Sets the active start color to color
. The active start color is used whenever a drawing of shape with some of gradient style is performed. Default color is white.
[in] | color | determines the color from which the gradient starts. See gl_color_t definition for detailed explanation. |
Example
void gl_set_brush_color_to | ( | gl_color_t | color | ) |
Sets the active end color to color
. The active end color is used whenever drawing of shape with some of gradient style is performed. Default color is black.
[in] | color | determines the color with which the gradient ends. See gl_color_t definition for detailed explanation. |
Example
void gl_set_font_background_color | ( | gl_color_t | background | ) |
Sets the active background color for texts to background
. This will affect drawing text only if background is enabled. To enable drawing use gl_set_font_background. Default background color is white.
[in] | background | the color of the background of character. See gl_color_t definition for detailed explanation. |
Example
void gl_set_font_background | ( | bool | enable | ) |
Sets active indicator for text background to enable
. Font background is disabled by default.
[in] | enable | the indicator for determining if background behind character should be painted. |
Example
uint16_t gl_get_screen_width | ( | ) |
Returns the width of the display.
Example
uint16_t gl_get_screen_height | ( | ) |
Returns the height of the display.
Example