Fawkes API  Fawkes Development Version
drawer.h
1 
2 /***************************************************************************
3  * drawer.h - Drawer allows to draw arbitrarily in a buffer
4  *
5  * Generated: Wed Feb 08 20:30:00 2006
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _FIREVISION_FVUTILS_DRAWER_H_
25 #define _FIREVISION_FVUTILS_DRAWER_H_
26 
27 #include <fvutils/color/yuv.h>
28 
29 namespace firevision {
30 
31 class Drawer
32 {
33 public:
34  Drawer();
36 
37  void draw_circle(int center_x, int center_y, unsigned int radius);
38 
39  void draw_rectangle(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
40 
41  void draw_rectangle_inverted(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
42 
43  void draw_point(unsigned int x, unsigned int y);
44  void color_point(unsigned int x, unsigned int y);
45  void color_point(unsigned int x, unsigned int y, YUV_t color);
46  void
47  draw_line(unsigned int x_start, unsigned int y_start, unsigned int x_end, unsigned int y_end);
48  void draw_cross(unsigned int x_center, unsigned int y_center, unsigned int width);
49 
50  void set_buffer(unsigned char *buffer, unsigned int width, unsigned int height);
51 
52  void set_color(unsigned char y, unsigned char u, unsigned char v);
53  void set_color(YUV_t color);
54 
55 private:
56  unsigned char *buffer_;
57  unsigned int width_;
58  unsigned int height_;
59  YUV_t color_;
60 };
61 
62 } // end namespace firevision
63 
64 #endif
firevision::Drawer::~Drawer
~Drawer()
Destructor.
Definition: drawer.cpp:52
firevision::Drawer::set_color
void set_color(unsigned char y, unsigned char u, unsigned char v)
Set drawing color.
Definition: drawer.cpp:75
firevision::YUV_t_struct
YUV pixel.
Definition: yuv.h:62
firevision::Drawer::color_point
void color_point(unsigned int x, unsigned int y)
Color the given point.
Definition: drawer.cpp:320
firevision::Drawer::draw_line
void draw_line(unsigned int x_start, unsigned int y_start, unsigned int x_end, unsigned int y_end)
Draw line.
Definition: drawer.cpp:367
firevision::Drawer::draw_circle
void draw_circle(int center_x, int center_y, unsigned int radius)
Draw circle.
Definition: drawer.cpp:98
firevision::Drawer::draw_rectangle
void draw_rectangle(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Draw rectangle.
Definition: drawer.cpp:203
firevision::Drawer::Drawer
Drawer()
Constructor.
Definition: drawer.cpp:45
firevision::Drawer::draw_rectangle_inverted
void draw_rectangle_inverted(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Draw inverted rectangle.
Definition: drawer.cpp:255
firevision::Drawer::set_buffer
void set_buffer(unsigned char *buffer, unsigned int width, unsigned int height)
Set the buffer to draw to.
Definition: drawer.cpp:62
firevision::Drawer::draw_cross
void draw_cross(unsigned int x_center, unsigned int y_center, unsigned int width)
Draws a cross.
Definition: drawer.cpp:453
firevision::Drawer::draw_point
void draw_point(unsigned int x, unsigned int y)
Draw point.
Definition: drawer.cpp:297