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
29#include <fvutils/base/types.h>
30#include <fvutils/color/yuv.h>
31
32#include <list>
33
34namespace firevision {
35
36class ROI;
37
39{
40private:
41 typedef std::list<fawkes::upoint_t> point_list_t;
42
43public:
44 ScanlineLineGrid(unsigned int width,
45 unsigned int height,
46 unsigned int offset_hor,
47 unsigned int offset_ver,
48 ROI * roi = NULL,
49 unsigned int gap = 0);
50 virtual ~ScanlineLineGrid();
51
56
57 bool finished();
58 void reset();
59 const char * get_name();
60 unsigned int get_margin();
61
62 virtual void set_robot_pose(float x, float y, float ori);
63 virtual void set_pan_tilt(float pan, float tilt);
64
65 virtual void set_dimensions(unsigned int width, unsigned int height, ROI *roi = NULL);
66 virtual void set_offset(unsigned int offset_x, unsigned int offset_y);
67 virtual void set_grid_params(unsigned int width,
68 unsigned int height,
69 unsigned int offset_hor,
70 unsigned int offset_ver,
71 ROI * roi = NULL);
72 virtual void set_roi(ROI *roi = NULL);
73
74private:
75 unsigned int width_;
76 unsigned int height_;
77 unsigned int offset_ver_;
78 unsigned int offset_hor_;
79 unsigned int next_pixel_;
80
81 ROI *roi_;
82
83 point_list_t point_list_;
84 point_list_t::iterator cur_;
85
86 void calc_coords();
87};
88
89} // end namespace firevision
90
91#endif //FIREVISION_SCANLINE_LINE_GRID_H__
Region of interest.
Definition: roi.h:55
Grid of scan lines.
Definition: line_grid.h:39
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
Definition: line_grid.cpp:200
void reset()
Reset model.
Definition: line_grid.cpp:176
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
Definition: line_grid.cpp:194
virtual void set_dimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Sets the dimensions of the grid.
Definition: line_grid.cpp:215
virtual void set_offset(unsigned int offset_x, unsigned int offset_y)
Sets offset.
Definition: line_grid.cpp:264
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:56
const char * get_name()
Get name of scanline model.
Definition: line_grid.cpp:182
virtual void set_roi(ROI *roi=NULL)
Sets the region-of-interest.
Definition: line_grid.cpp:229
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:286
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: line_grid.cpp:83
unsigned int get_margin()
Get margin around points.
Definition: line_grid.cpp:188
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: line_grid.cpp:77
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: line_grid.cpp:152
virtual ~ScanlineLineGrid()
Destructor.
Definition: line_grid.cpp:71
bool finished()
Check if all desired points have been processed.
Definition: line_grid.cpp:170
Scanline model interface.
Definition: scanlinemodel.h:53
Point with cartesian coordinates as unsigned integers.
Definition: types.h:35