Draw to a monochrome image. More...
#include <>>
Public Member Functions | |
MonoDrawer () | |
Constructor. | |
~MonoDrawer () | |
Destructor. | |
void | draw_circle (int center_x, int center_y, unsigned int radius) |
Draw circle. | |
void | draw_rectangle (unsigned int x, unsigned int y, unsigned int w, unsigned int h) |
Draw rectangle. | |
void | draw_rectangle_inverted (unsigned int x, unsigned int y, unsigned int w, unsigned int h) |
Draw inverted rectangle. | |
void | draw_point (unsigned int x, unsigned int y) |
Draw point. | |
void | draw_line (unsigned int x_start, unsigned int y_start, unsigned int x_end, unsigned int y_end) |
Draw line. | |
void | draw_cross (unsigned int x_center, unsigned int y_center, unsigned int width) |
Draws a cross. | |
void | set_buffer (unsigned char *buffer, unsigned int width, unsigned int height) |
Set the buffer to draw to. | |
void | set_brightness (unsigned char b) |
Set drawing brightness. | |
void | set_overlap (bool o) |
Enable/Disable transparency (overlapping pixels increase brightness). |
Draw to a monochrome image.
Definition at line 35 of file mono_drawer.h.
firevision::MonoDrawer::MonoDrawer | ( | ) |
Constructor.
Definition at line 52 of file mono_drawer.cpp.
firevision::MonoDrawer::~MonoDrawer | ( | ) |
Destructor.
Definition at line 60 of file mono_drawer.cpp.
void firevision::MonoDrawer::draw_circle | ( | int | center_x, | |
int | center_y, | |||
unsigned int | radius | |||
) |
Draw circle.
Draws a circle at the given center point and with the given radius.
center_x | x coordinate of circle center | |
center_y | y coordinate of circle center | |
radius | radius of circle |
Definition at line 107 of file mono_drawer.cpp.
void firevision::MonoDrawer::draw_cross | ( | unsigned int | x_center, | |
unsigned int | y_center, | |||
unsigned int | width | |||
) |
Draws a cross.
x_center | Center of the cross | |
y_center | Center of the cross | |
width | of the bars |
Definition at line 361 of file mono_drawer.cpp.
References draw_line().
void firevision::MonoDrawer::draw_line | ( | unsigned int | x_start, | |
unsigned int | y_start, | |||
unsigned int | x_end, | |||
unsigned int | y_end | |||
) |
Draw line.
Standard Bresenham in all directions. For in-depth information have a look at http://de.wikipedia.org/wiki/Bresenham-Algorithmus
x_start | x coordinate of start point | |
y_start | y coordinate of start point | |
x_end | x coordinate of end point | |
y_end | y coordinate of end point |
Definition at line 282 of file mono_drawer.cpp.
Referenced by draw_cross().
void firevision::MonoDrawer::draw_point | ( | unsigned int | x, | |
unsigned int | y | |||
) |
Draw point.
x | x coordinate of point | |
y | y coordinate of point |
Definition at line 264 of file mono_drawer.cpp.
void firevision::MonoDrawer::draw_rectangle | ( | unsigned int | x, | |
unsigned int | y, | |||
unsigned int | w, | |||
unsigned int | h | |||
) |
Draw rectangle.
x | x coordinate of rectangle's upper left corner | |
y | y coordinate of rectangle's upper left corner | |
w | width of rectangle from x to the right | |
h | height of rectangle from y to the bottom |
Definition at line 173 of file mono_drawer.cpp.
void firevision::MonoDrawer::draw_rectangle_inverted | ( | unsigned int | x, | |
unsigned int | y, | |||
unsigned int | w, | |||
unsigned int | h | |||
) |
Draw inverted rectangle.
This draws a rectangle but instead of using the draw color it is drawn in the inverted color of the pixel where it is drawn.
x | x coordinate of rectangle's upper left corner | |
y | y coordinate of rectangle's upper left corner | |
w | width of rectangle from x to the right | |
h | height of rectangle from y to the bottom |
Definition at line 218 of file mono_drawer.cpp.
void firevision::MonoDrawer::set_brightness | ( | unsigned char | b | ) |
Set drawing brightness.
b | brightness; 0-255 |
Definition at line 84 of file mono_drawer.cpp.
void firevision::MonoDrawer::set_buffer | ( | unsigned char * | buffer, | |
unsigned int | width, | |||
unsigned int | height | |||
) |
Set the buffer to draw to.
buffer | buffer to draw to, must be MONO8 formatted. E.g. Y-plane of YUV | |
width | width of the buffer | |
height | height of the buffer |
Definition at line 71 of file mono_drawer.cpp.
void firevision::MonoDrawer::set_overlap | ( | bool | o | ) |
Enable/Disable transparency (overlapping pixels increase brightness).
o | overlapping true/false |
Definition at line 94 of file mono_drawer.cpp.