Fawkes API  Fawkes Development Version
line_grid.h
1 
2 /***************************************************************************
3  * line_grid.h - Scanline model implementation: line grid
4  *
5  * Created: Wen Mar 25 17:31:00 2009
6  * Copyright 2009 Christof Rath <c.rath@student.tugraz.at>
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_SCANLINE_LINE_GRID_H_
25 #define __FIREVISION_SCANLINE_LINE_GRID_H_
26 
27 #include "scanlinemodel.h"
28 #include <fvutils/base/types.h>
29 #include <fvutils/color/yuv.h>
30 
31 #include <list>
32 
33 namespace firevision {
34 #if 0 /* just to make Emacs auto-indent happy */
35 }
36 #endif
37 
38 class ROI;
39 
41 {
42  private:
43  typedef std::list<fawkes::upoint_t> point_list_t;
44 
45  public:
46  ScanlineLineGrid(unsigned int width, unsigned int height,
47  unsigned int offset_hor, unsigned int offset_ver,
48  ROI* roi = NULL, unsigned int gap = 0);
49  virtual ~ScanlineLineGrid();
50 
55 
56  bool finished();
57  void reset();
58  const char * get_name();
59  unsigned int get_margin();
60 
61  virtual void set_robot_pose(float x, float y, float ori);
62  virtual void set_pan_tilt(float pan, float tilt);
63 
64  virtual void set_dimensions(unsigned int width, unsigned int height, ROI* roi = NULL);
65  virtual void set_offset(unsigned int offset_x, unsigned int offset_y);
66  virtual void set_grid_params(unsigned int width, unsigned int height,
67  unsigned int offset_hor, unsigned int offset_ver, ROI* roi = NULL);
68  virtual void set_roi(ROI* roi = NULL);
69 
70  private:
71  unsigned int __width;
72  unsigned int __height;
73  unsigned int __offset_ver;
74  unsigned int __offset_hor;
75  unsigned int __next_pixel;
76 
77  ROI* __roi;
78 
79  point_list_t __point_list;
80  point_list_t::iterator __cur;
81 
82  void calc_coords();
83 };
84 
85 } // end namespace firevision
86 
87 #endif //__FIREVISION_SCANLINE_LINE_GRID_H_
virtual ~ScanlineLineGrid()
Destructor.
Definition: line_grid.cpp:73
void reset()
Reset model.
Definition: line_grid.cpp:185
Scanline model interface.
Definition: scanlinemodel.h:55
Grid of scan lines.
Definition: line_grid.h:40
virtual void set_offset(unsigned int offset_x, unsigned int offset_y)
Sets offset.
Definition: line_grid.cpp:271
Region of interest.
Definition: roi.h:58
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: line_grid.cpp:79
virtual void set_dimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Sets the dimensions of the grid.
Definition: line_grid.cpp:228
bool finished()
Check if all desired points have been processed.
Definition: line_grid.cpp:179
virtual void set_robot_pose(float x, float y, float ori)
Set the robot&#39;s pose.
Definition: line_grid.cpp:205
const char * get_name()
Get name of scanline model.
Definition: line_grid.cpp:191
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
unsigned int get_margin()
Get margin around points.
Definition: line_grid.cpp:198
virtual void set_roi(ROI *roi=NULL)
Sets the region-of-interest.
Definition: line_grid.cpp:242
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: line_grid.cpp:162
virtual void set_pan_tilt(float pan, float tilt)
Set camera&#39;s pan/tilt values.
Definition: line_grid.cpp:212
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: line_grid.cpp:85
ScanlineLineGrid(unsigned int width, unsigned int height, unsigned int offset_hor, unsigned int offset_ver, ROI *roi=NULL, unsigned int gap=0)
Constructor.
Definition: line_grid.cpp:60
virtual void set_grid_params(unsigned int width, unsigned int height, unsigned int offset_hor, unsigned int offset_ver, ROI *roi=NULL)
Set all grid parameters.
Definition: line_grid.cpp:294