line_grid.h

00001 
00002 /***************************************************************************
00003  *  line_grid.h - Scanline model implementation: line grid
00004  *
00005  *  Created: 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 namespace firevision {
00034 #if 0 /* just to make Emacs auto-indent happy */
00035 }
00036 #endif
00037 
00038 class ROI;
00039 
00040 class ScanlineLineGrid : public ScanlineModel
00041 {
00042  private:
00043   typedef std::list<fawkes::point_t> point_list_t;
00044 
00045  public:
00046   ScanlineLineGrid(unsigned int width, unsigned int height,
00047                    unsigned int offset_hor, unsigned int offset_ver,
00048                    ROI* roi = NULL, unsigned int gap = 0);
00049   virtual ~ScanlineLineGrid();
00050 
00051   fawkes::point_t operator*();
00052   fawkes::point_t * operator->();
00053   fawkes::point_t * operator++();
00054   fawkes::point_t * operator++(int);
00055 
00056   bool finished();
00057   void reset();
00058   const char * get_name();
00059   unsigned int get_margin();
00060 
00061   virtual void set_robot_pose(float x, float y, float ori);
00062   virtual void set_pan_tilt(float pan, float tilt);
00063 
00064   virtual void set_dimensions(unsigned int width, unsigned int height, ROI* roi = NULL);
00065   virtual void set_offset(unsigned int offset_x, unsigned int offset_y);
00066   virtual void set_grid_params(unsigned int width, unsigned int height,
00067                              unsigned int offset_hor, unsigned int offset_ver, ROI* roi = NULL);
00068   virtual void set_roi(ROI* roi = NULL);
00069 
00070  private:
00071   unsigned int __width;
00072   unsigned int __height;
00073   unsigned int __offset_ver;
00074   unsigned int __offset_hor;
00075   unsigned int __next_pixel;
00076 
00077   ROI*         __roi;
00078 
00079   point_list_t           __point_list;
00080   point_list_t::iterator __cur;
00081 
00082   void calc_coords();
00083 };
00084 
00085 } // end namespace firevision
00086 
00087 #endif //__FIREVISION_SCANLINE_LINE_GRID_H_

Generated on Tue Feb 22 13:31:17 2011 for Fawkes API by  doxygen 1.4.7