Fawkes API  Fawkes Development Version
firevision::ScanlineGrid Class Reference

Scanline Grid. More...

#include <>>

Inheritance diagram for firevision::ScanlineGrid:

Public Member Functions

 ScanlineGrid (unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
 Constructor. More...
 
virtual ~ScanlineGrid ()
 Destructor. More...
 
fawkes::upoint_t operator* ()
 Get the current coordinate. More...
 
fawkes::upoint_toperator-> ()
 Get pointer to current point. More...
 
fawkes::upoint_toperator++ ()
 Postfix ++ operator. More...
 
fawkes::upoint_toperator++ (int)
 Prefix ++ operator. More...
 
bool finished ()
 Check if all desired points have been processed. More...
 
void reset ()
 Reset model. More...
 
const char * get_name ()
 Get name of scanline model. More...
 
unsigned int get_margin ()
 Get margin around points. More...
 
virtual void set_robot_pose (float x, float y, float ori)
 Set the robot's pose. More...
 
virtual void set_pan_tilt (float pan, float tilt)
 Set camera's pan/tilt values. More...
 
virtual void set_roi (ROI *roi=NULL)
 Set the region-of-interest. More...
 
void setDimensions (unsigned int width, unsigned int height, ROI *roi=NULL)
 Set dimensions. More...
 
void setOffset (unsigned int offset_x, unsigned int offset_y)
 Set offset. More...
 
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. More...
 
- Public Member Functions inherited from firevision::ScanlineModel
virtual ~ScanlineModel ()
 Virtual empty destructor. More...
 

Detailed Description

Scanline Grid.

A grid as scanline points. The crossings of the lines are the scanline points.

Definition at line 36 of file grid.h.

Constructor & Destructor Documentation

◆ ScanlineGrid()

firevision::ScanlineGrid::ScanlineGrid ( unsigned int  width,
unsigned int  height,
unsigned int  offset_x,
unsigned int  offset_y,
ROI roi = NULL,
bool  horizontal_grid = true 
)

Constructor.

Parameters
widthwidth of grid
heightheight of grid
offset_xx offset between lines
offset_yy offset between lines
roithe grid will only be calculated within the roi (if NULL the roi will be from 0,0 to width,height).
horizontal_gridif true x will be increased before y

Definition at line 51 of file grid.cpp.

References setGridParams().

◆ ~ScanlineGrid()

firevision::ScanlineGrid::~ScanlineGrid ( )
virtual

Destructor.

Definition at line 64 of file grid.cpp.

Member Function Documentation

◆ finished()

bool firevision::ScanlineGrid::finished ( )
virtual

Check if all desired points have been processed.

Returns
true if all pixels that the model defines have been iterated.

Implements firevision::ScanlineModel.

Definition at line 143 of file grid.cpp.

Referenced by operator->().

◆ get_margin()

unsigned int firevision::ScanlineGrid::get_margin ( )
virtual

Get margin around points.

Models that do not use margins shall return zero. It shall be guaranteed that in this margin region around a point there is no other point that has been or will be returned in a full iteration.

Returns
margin around a point.

Implements firevision::ScanlineModel.

Definition at line 165 of file grid.cpp.

◆ get_name()

const char * firevision::ScanlineGrid::get_name ( )
virtual

Get name of scanline model.

Returns
name of scanline model.

Implements firevision::ScanlineModel.

Definition at line 158 of file grid.cpp.

◆ operator*()

upoint_t firevision::ScanlineGrid::operator* ( )
virtual

Get the current coordinate.

Returns
current point in image that is shall be processed.

Implements firevision::ScanlineModel.

Definition at line 70 of file grid.cpp.

◆ operator++() [1/2]

upoint_t * firevision::ScanlineGrid::operator++ ( )
virtual

Postfix ++ operator.

Advances to the next point and returns the new point.

Returns
pointer to new point

Implements firevision::ScanlineModel.

Definition at line 128 of file grid.cpp.

◆ operator++() [2/2]

upoint_t * firevision::ScanlineGrid::operator++ ( int  )
virtual

Prefix ++ operator.

Advances to the next point but returns the old point.

Returns
pointer to next point

Implements firevision::ScanlineModel.

Definition at line 135 of file grid.cpp.

◆ operator->()

upoint_t * firevision::ScanlineGrid::operator-> ( )
virtual

Get pointer to current point.

Returns
pointer to current point
See also
operator*()

Implements firevision::ScanlineModel.

Definition at line 76 of file grid.cpp.

References finished(), firevision::ROI::image_height, firevision::ROI::image_width, firevision::ROI::start, fawkes::upoint_t::x, and fawkes::upoint_t::y.

◆ reset()

void firevision::ScanlineGrid::reset ( )
virtual

Reset model.

Resets the set of processed points.

Implements firevision::ScanlineModel.

Definition at line 149 of file grid.cpp.

References firevision::ROI::start, fawkes::upoint_t::x, and fawkes::upoint_t::y.

Referenced by set_roi(), and setOffset().

◆ set_pan_tilt()

void firevision::ScanlineGrid::set_pan_tilt ( float  pan,
float  tilt 
)
virtual

Set camera's pan/tilt values.

Parameters
pancamera's current pan
tiltcamera's current tilt

Implements firevision::ScanlineModel.

Definition at line 179 of file grid.cpp.

◆ set_robot_pose()

void firevision::ScanlineGrid::set_robot_pose ( float  x,
float  y,
float  ori 
)
virtual

Set the robot's pose.

Parameters
xrobot's x coordinate on field in meters
yrobot's y coordinate on field in meters
orirobot's orientation. Looking towards the opponent goal is zero rad, with positive values pointing to the right, negative to the left.

Implements firevision::ScanlineModel.

Definition at line 172 of file grid.cpp.

◆ set_roi()

void firevision::ScanlineGrid::set_roi ( ROI roi = NULL)
virtual

Set the region-of-interest.

If not NULL the scanlines gets only calculated within the ROI

Parameters
roithe region where scanlines should be calculated

Reimplemented from firevision::ScanlineModel.

Definition at line 185 of file grid.cpp.

References firevision::ROI::height, firevision::ROI::image_height, firevision::ROI::image_width, reset(), firevision::ROI::start, firevision::ROI::width, fawkes::upoint_t::x, and fawkes::upoint_t::y.

Referenced by setDimensions().

◆ setDimensions()

void firevision::ScanlineGrid::setDimensions ( unsigned int  width,
unsigned int  height,
ROI roi = NULL 
)

Set dimensions.

Set width and height of scanline grid. Implicitly resets the grid.

Parameters
widthwidth
heightheight
roithe grid will only be calculated within the roi (if NULL the roi will be from 0,0 to width,height). The object will be deleted by ScanlineGrid!

Definition at line 217 of file grid.cpp.

References set_roi().

Referenced by setGridParams().

◆ setGridParams()

void firevision::ScanlineGrid::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.

Set width, height, X and Y offset by which the pointer in the grid is advanced. Implicitly resets the grid.

Parameters
widthwidth
heightheight
offset_xoffset_x
offset_yoffset_y
roithe grid will only be calculated within the roi (if NULL the roi will be from 0,0 to width,height). The object will be deleted by ScanlineGrid!
horizontal_gridif true x will be increased before y

Definition at line 254 of file grid.cpp.

References setDimensions(), and setOffset().

Referenced by ScanlineGrid().

◆ setOffset()

void firevision::ScanlineGrid::setOffset ( unsigned int  offset_x,
unsigned int  offset_y 
)

Set offset.

Set X and Y offset by which the pointer in the grid is advanced. Implicitly resets the grid.

Parameters
offset_xoffset_x
offset_yoffset_y

Definition at line 232 of file grid.cpp.

References reset().

Referenced by setGridParams().


The documentation for this class was generated from the following files: