Line drawing graphics routines. More...
#include "gfx.h"#include "gfx_p.h"#include "cfg/cfg_gfx.h"#include <cfg/debug.h>#include <cfg/macros.h>Go to the source code of this file.
Functions | |
| static void | gfx_lineUnclipped (Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2) |
| Draw a sloped line without performing clipping. | |
| void | gfx_line (Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2) |
| Draw a sloped line segment. | |
| void | gfx_moveTo (Bitmap *bm, coord_t x, coord_t y) |
| Move the current pen position to the specified coordinates. | |
| void | gfx_lineTo (Bitmap *bm, coord_t x, coord_t y) |
| Draw a line from the current pen position to the new coordinates. | |
| void | gfx_rectDraw (Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2) |
| Draw the perimeter of an hollow rectangle. | |
| void | gfx_rectFillC (Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t color) |
| Fill a rectangular area with color. | |
| void | gfx_rectFill (Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2) |
| Draw a filled rectangle. | |
| void | gfx_rectClear (Bitmap *bm, coord_t x1, coord_t y1, coord_t x2, coord_t y2) |
| Clear a rectangular area. | |
Detailed Description
Function Documentation
Draw a sloped line segment.
Draw a sloped line segment identified by the provided start and end coordinates on the bitmap bm.
The line endpoints are clipped inside the current bitmap clipping rectangle using the Cohen-Sutherland algorithm, which is very fast.
- Note:
- The point at coordinates x2 y2 is not drawn.
- This function does not update the current pen position.
Draw a line from the current pen position to the new coordinates.
- Note:
- This function moves the current pen position to the new coordinates.
- See also:
- gfx_line()
| static void gfx_lineUnclipped | ( | Bitmap * | bm, |
| coord_t | x1, | ||
| coord_t | y1, | ||
| coord_t | x2, | ||
| coord_t | y2 | ||
| ) | [static] |
Draw a sloped line without performing clipping.
Parameters are the same of gfx_line(). This routine is based on the Bresenham Line-Drawing Algorithm.
- Note:
- Passing coordinates outside the bitmap boundaries will result in memory trashing.
- See also:
- gfx_line()
Move the current pen position to the specified coordinates.
The pen position is used for drawing operations such as gfx_lineTo(), which can be used to draw polygons.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/bertos_logo.png)