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 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 class Drawer {
35 
36  public:
37  Drawer();
38  ~Drawer();
39 
40  void draw_circle(int center_x, int center_y, unsigned int radius);
41 
42  void draw_rectangle(unsigned int x, unsigned int y,
43  unsigned int w, unsigned int h);
44 
45  void draw_rectangle_inverted(unsigned int x, unsigned int y,
46  unsigned int w, unsigned int h);
47 
48  void draw_point(unsigned int x, unsigned int y);
49  void color_point(unsigned int x, unsigned int y);
50  void color_point(unsigned int x, unsigned int y, YUV_t color);
51  void draw_line(unsigned int x_start, unsigned int y_start,
52  unsigned int x_end, unsigned int y_end);
53  void draw_cross(unsigned int x_center, unsigned int y_center, unsigned int width);
54 
55  void set_buffer(unsigned char *buffer,
56  unsigned int width, unsigned int height);
57 
58  void set_color(unsigned char y, unsigned char u, unsigned char v);
59  void set_color(YUV_t color);
60 
61  private:
62  unsigned char *__buffer;
63  unsigned int __width;
64  unsigned int __height;
65  YUV_t __color;
66 
67 };
68 
69 } // end namespace firevision
70 
71 #endif
void draw_point(unsigned int x, unsigned int y)
Draw point.
Definition: drawer.cpp:314
void draw_cross(unsigned int x_center, unsigned int y_center, unsigned int width)
Draws a cross.
Definition: drawer.cpp:467
~Drawer()
Destructor.
Definition: drawer.cpp:51
Draw to an image.
Definition: drawer.h:34
void draw_rectangle_inverted(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Draw inverted rectangle.
Definition: drawer.cpp:268
void draw_line(unsigned int x_start, unsigned int y_start, unsigned int x_end, unsigned int y_end)
Draw line.
Definition: drawer.cpp:381
void set_buffer(unsigned char *buffer, unsigned int width, unsigned int height)
Set the buffer to draw to.
Definition: drawer.cpp:62
void draw_rectangle(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Draw rectangle.
Definition: drawer.cpp:212
void draw_circle(int center_x, int center_y, unsigned int radius)
Draw circle.
Definition: drawer.cpp:102
YUV pixel.
Definition: yuv.h:59
void color_point(unsigned int x, unsigned int y)
Color the given point.
Definition: drawer.cpp:336
void set_color(unsigned char y, unsigned char u, unsigned char v)
Set drawing color.
Definition: drawer.cpp:77
Drawer()
Constructor.
Definition: drawer.cpp:44