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
29namespace firevision {
30
31class Drawer
32{
33public:
34 Drawer();
35 ~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
55private:
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
Draw to an image.
Definition: drawer.h:32
void color_point(unsigned int x, unsigned int y)
Color the given point.
Definition: drawer.cpp:316
void draw_rectangle_inverted(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Draw inverted rectangle.
Definition: drawer.cpp:251
void set_color(unsigned char y, unsigned char u, unsigned char v)
Set drawing color.
Definition: drawer.cpp:71
~Drawer()
Destructor.
Definition: drawer.cpp:48
void draw_rectangle(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Draw rectangle.
Definition: drawer.cpp:199
void draw_cross(unsigned int x_center, unsigned int y_center, unsigned int width)
Draws a cross.
Definition: drawer.cpp:449
void draw_line(unsigned int x_start, unsigned int y_start, unsigned int x_end, unsigned int y_end)
Draw line.
Definition: drawer.cpp:363
Drawer()
Constructor.
Definition: drawer.cpp:41
void set_buffer(unsigned char *buffer, unsigned int width, unsigned int height)
Set the buffer to draw to.
Definition: drawer.cpp:58
void draw_point(unsigned int x, unsigned int y)
Draw point.
Definition: drawer.cpp:293
void draw_circle(int center_x, int center_y, unsigned int radius)
Draw circle.
Definition: drawer.cpp:94
YUV pixel.
Definition: yuv.h:58