drawer.h

00001
00002 /***************************************************************************
00003  *  drawer.h - Drawer allows to draw arbitrarily in a buffer
00004  *
00005  *  Generated: Wed Feb 08 20:30:00 2006
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #ifndef __FIREVISION_FVUTILS_DRAWER_H_
00025 #define __FIREVISION_FVUTILS_DRAWER_H_
00026 
00027 #include <fvutils/color/yuv.h>
00028
00029 class Drawer {
00030
00031  public:
00032   Drawer();
00033   ~Drawer();
00034
00035   void draw_circle(int center_x, int center_y, unsigned int radius);
00036
00037   void draw_rectangle(unsigned int x, unsigned int y,
00038                      unsigned int w, unsigned int h);
00039
00040   void draw_rectangle_inverted(unsigned int x, unsigned int y,
00041                              unsigned int w, unsigned int h);
00042
00043   void draw_point(unsigned int x, unsigned int y);
00044   void color_point(unsigned int x, unsigned int y);
00045   void color_point(unsigned int x, unsigned int y, YUV_t color);
00046   void draw_line(unsigned int x_start, unsigned int y_start,
00047                 unsigned int x_end, unsigned int y_end);
00048   void draw_cross(unsigned int x_center, unsigned int y_center, unsigned int width);
00049
00050   void set_buffer(unsigned char *buffer,
00051                  unsigned int width, unsigned int height);
00052
00053   void set_color(unsigned char y, unsigned char u, unsigned char v);
00054   void set_color(YUV_t color);
00055
00056  private:
00057   unsigned char  *__buffer;
00058   unsigned int    __width;
00059   unsigned int    __height;
00060   YUV_t           __color;
00061
00062 };
00063
00064
00065 #endif