BeRTOS
|
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. |
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.
Draw a line from the current pen position to the new coordinates.
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.
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.