24 #include <core/exceptions/software.h>
25 #include <fvmodels/scanlines/grid.h>
31 namespace firevision {
50 unsigned int offset_x,
51 unsigned int offset_y,
56 setGridParams(width, height, offset_x, offset_y, roi, horizontal_grid);
80 ScanlineGrid::calc_next_coord()
85 if (horizontal_grid) {
86 if (
static_cast<int>(coord.
x) <
static_cast<int>(roi->
image_width - offset_x)) {
89 if (
static_cast<int>(coord.
y) <
static_cast<int>(roi->
image_height - offset_y)) {
98 if (
static_cast<int>(coord.
y) <
static_cast<int>(roi->
image_height - offset_y)) {
101 if (
static_cast<int>(coord.
x) <
static_cast<int>(roi->
image_width - offset_x)) {
105 more_to_come =
false;
121 memcpy(&tmp_coord, &coord,
sizeof(
upoint_t));
129 return !more_to_come;
144 return "ScanlineModel::Grid";
150 return (offset_x > offset_y) ? offset_x : offset_y;
169 this->roi =
new ROI(0, 0, this->width, this->height, this->width, this->height);
172 this->roi =
new ROI(roi);
207 this->height = height;
220 this->offset_x = offset_x;
221 this->offset_y = offset_y;
241 unsigned int offset_x,
242 unsigned int offset_y,
244 bool horizontal_grid)
246 this->horizontal_grid = horizontal_grid;
unsigned int height
ROI height.
fawkes::upoint_t start
ROI start.
unsigned int width
ROI width.
unsigned int image_width
width of image that contains this ROI
unsigned int image_height
height of image that contains this ROI
virtual ~ScanlineGrid()
Destructor.
virtual void set_roi(ROI *roi=NULL)
Set the region-of-interest.
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
ScanlineGrid(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Constructor.
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
unsigned int get_margin()
Get margin around points.
void setDimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Set dimensions.
const char * get_name()
Get name of scanline model.
fawkes::upoint_t * operator->()
Get pointer to current point.
bool finished()
Check if all desired points have been processed.
fawkes::upoint_t operator*()
Get the current coordinate.
void setOffset(unsigned int offset_x, unsigned int offset_y)
Set offset.
void setGridParams(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Set all grid parameters.
fawkes::upoint_t * operator++()
Postfix ++ operator.
Point with cartesian coordinates as unsigned integers.
unsigned int x
x coordinate
unsigned int y
y coordinate