Drawer Class Reference
Draw to an image. More...
#include <fvutils/draw/drawer.h>
Public Member Functions | |
| Drawer () | |
| Constructor. | |
| ~Drawer () | |
| 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 | color_point (unsigned int x, unsigned int y) |
| Color the given point. | |
| void | color_point (unsigned int x, unsigned int y, YUV_t color) |
| Color the given 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_color (unsigned char y, unsigned char u, unsigned char v) |
| Set drawing color. | |
| void | set_color (YUV_t color) |
| Set drawing color. | |
Detailed Description
Draw to an image.Definition at line 29 of file drawer.h.
Constructor & Destructor Documentation
| Drawer::Drawer | ( | ) |
Constructor.
Default paint color is white.
Definition at line 38 of file drawer.cpp.
References YUV_t_struct::white().
| Drawer::~Drawer | ( | ) |
Member Function Documentation
| void Drawer::color_point | ( | unsigned int | x, | |
| unsigned int | y, | |||
| YUV_t | color | |||
| ) |
Color the given point.
This will color a single point (to save excessive function calls the color is also a parameter)
- Parameters:
-
x x coordinate of point y y coordinate of point color Color to set
Definition at line 352 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
| void Drawer::color_point | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) |
Color the given point.
This will leave the Y-component of the given pixel unchanged and will just set the U and V components. This can be used to keep a little bit of original image information but marking special regions.
- Parameters:
-
x x coordinate of point y y coordinate of point
Definition at line 330 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
Referenced by ColorTrainWidget::draw_segmentation_result().
| void Drawer::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.
- Parameters:
-
center_x x coordinate of circle center center_y y coordinate of circle center radius radius of circle
Definition at line 96 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
Referenced by FieldDrawer::draw_field(), and FieldDrawer::draw_lines().
| void Drawer::draw_cross | ( | unsigned int | x_center, | |
| unsigned int | y_center, | |||
| unsigned int | width | |||
| ) |
Draws a cross.
- Parameters:
-
x_center Center of the cross y_center Center of the cross width of the bars
Definition at line 461 of file drawer.cpp.
References draw_line().
Referenced by FieldDrawer::draw_line_points().
| void Drawer::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
- Parameters:
-
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 375 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
Referenced by draw_cross(), FieldDrawer::draw_field(), FieldDrawer::draw_lines(), and SEGenerator::linear().
| void Drawer::draw_point | ( | unsigned int | x, | |
| unsigned int | y | |||
| ) |
Draw point.
- Parameters:
-
x x coordinate of point y y coordinate of point
Definition at line 308 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
| void Drawer::draw_rectangle | ( | unsigned int | x, | |
| unsigned int | y, | |||
| unsigned int | w, | |||
| unsigned int | h | |||
| ) |
Draw rectangle.
- Parameters:
-
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 206 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
| void Drawer::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.
- Parameters:
-
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 262 of file drawer.cpp.
Referenced by ColorTrainWidget::click().
| void Drawer::set_buffer | ( | unsigned char * | buffer, | |
| unsigned int | width, | |||
| unsigned int | height | |||
| ) |
Set the buffer to draw to.
- Parameters:
-
buffer buffer to draw to, must be YUV422 planar formatted width width of the buffer height height of the buffer
Definition at line 56 of file drawer.cpp.
Referenced by ColorTrainWidget::click(), FieldDrawer::draw_field(), FieldDrawer::draw_line_points(), FieldDrawer::draw_lines(), ColorTrainWidget::draw_segmentation_result(), and SEGenerator::linear().
| void Drawer::set_color | ( | YUV_t | color | ) |
Set drawing color.
- Parameters:
-
color the YUV drawing color
Definition at line 83 of file drawer.cpp.
| void Drawer::set_color | ( | unsigned char | y, | |
| unsigned char | u, | |||
| unsigned char | v | |||
| ) |
Set drawing color.
- Parameters:
-
y Y component of YUV drawing color u U component of YUV drawing color v V component of YUV drawing color
Definition at line 71 of file drawer.cpp.
References YUV_t_struct::U, YUV_t_struct::V, and YUV_t_struct::Y.
Referenced by FieldDrawer::draw_field(), FieldDrawer::draw_line_points(), FieldDrawer::draw_lines(), ColorTrainWidget::draw_segmentation_result(), and SEGenerator::linear().
The documentation for this class was generated from the following files:
- src/firevision/fvutils/draw/drawer.h
- src/firevision/fvutils/draw/drawer.cpp

