line_grid.h

00001
00002 /***************************************************************************
00003  *  line_grid.h - Scanline model implementation: line grid
00004  *
00005  *  Generated: Wen Mar 25 17:31:00 2009
00006  *  Copyright  2009 Christof Rath <c.rath@student.tugraz.at>
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_SCANLINE_LINE_GRID_H_
00025 #define __FIREVISION_SCANLINE_LINE_GRID_H_
00026 
00027 #include "scanlinemodel.h"
00028 #include <fvutils/base/types.h>
00029 #include <fvutils/color/yuv.h>
00030
00031 #include <list>
00032
00033 class ROI;
00034
00035
00036 class ScanlineLineGrid :
00037   public ScanlineModel
00038 {
00039 private:
00040   typedef std::list<fawkes::point_t> point_list_t;
00041
00042 public:
00043   ScanlineLineGrid(unsigned int width, unsigned int height,
00044                    unsigned int offset_hor, unsigned int offset_ver,
00045                    ROI* roi = NULL, unsigned int gap = 0);
00046   virtual ~ScanlineLineGrid();
00047
00048   fawkes::point_t operator*();
00049   fawkes::point_t * operator->();
00050   fawkes::point_t * operator++();
00051   fawkes::point_t * operator++(int);
00052
00053   bool finished();
00054   void reset();
00055   const char * get_name();
00056   unsigned int get_margin();
00057
00058   virtual void set_robot_pose(float x, float y, float ori);
00059   virtual void set_pan_tilt(float pan, float tilt);
00060
00061   virtual void set_dimensions(unsigned int width, unsigned int height, ROI* roi = NULL);
00062   virtual void set_offset(unsigned int offset_x, unsigned int offset_y);
00063   virtual void set_grid_params(unsigned int width, unsigned int height,
00064                              unsigned int offset_hor, unsigned int offset_ver, ROI* roi = NULL);
00065   virtual void set_roi(ROI* roi = NULL);
00066
00067 private:
00068   unsigned int __width;
00069   unsigned int __height;
00070   unsigned int __offset_ver;
00071   unsigned int __offset_hor;
00072   unsigned int __next_pixel;
00073
00074   ROI*         __roi;
00075
00076   point_list_t           __point_list;
00077   point_list_t::iterator __cur;
00078
00079   void calc_coords();
00080 };
00081
00082 #endif //__FIREVISION_SCANLINE_LINE_GRID_H_