Organized Index Iterator for iterating over the "pixels" for a given line using the Bresenham algorithm. Supports 4 and 8 neighborhood connectivity. More...
#include <line_iterator.h>
Public Types | |
enum | Neighborhood { Neighbor4 = 4, Neighbor8 = 8 } |
Neighborhood connectivity. More... | |
Public Member Functions | |
virtual unsigned | getColumnIndex () const |
returns the col index (x-coordinate) of the current pixel/point | |
virtual unsigned | getRowIndex () const |
returns the row index (y-coordinate) of the current pixel/point | |
virtual bool | isValid () const |
return whether the current visited pixel/point is valid or not. | |
LineIterator (unsigned x_start, unsigned y_start, unsigned x_end, unsigned y_end, unsigned width, const Neighborhood &neighborhood=Neighbor8) | |
Constructor. | |
virtual void | operator++ () |
go to next pixel/point in image/cloud | |
virtual void | reset () |
resets the iterator to the beginning of the line | |
virtual | ~LineIterator () |
Destructor. | |
Protected Member Functions | |
void | init (const Neighborhood &neighborhood) |
initializes the variables for the Bresenham algorithm | |
Protected Attributes | |
int | error_ |
current distance to the line | |
int | error_max_ |
error threshold | |
int | error_minus_ |
increment of error (distance) value in case of an y-step (if dx > dy) | |
int | error_plus_ |
increment of error (distance) value in case of just an x-step (if dx > dy) | |
int | index_minus_ |
increment pixel/point index in case of just an y-step (if dx > dy) | |
int | index_plus_ |
increment pixel/point index in case of just an x-step (if dx > dy) | |
unsigned | x_ |
current column index | |
unsigned | x_end_ |
column index of end pixel/point | |
int | x_minus_ |
increment of column index in case of just an y-step (if dx > dy) | |
int | x_plus_ |
increment of column index in case of just an x-step (if dx > dy) | |
unsigned | x_start_ |
column index of first pixel/point | |
unsigned | y_ |
current row index | |
unsigned | y_end_ |
row index of end pixel/point | |
int | y_minus_ |
increment of row index in case of just an y-step (if dx > dy) | |
int | y_plus_ |
increment of row index in case of just an x-step (if dx > dy) | |
unsigned | y_start_ |
row index of first pixel/point |
Organized Index Iterator for iterating over the "pixels" for a given line using the Bresenham algorithm. Supports 4 and 8 neighborhood connectivity.
Definition at line 48 of file line_iterator.h.
Neighborhood connectivity.
Definition at line 52 of file line_iterator.h.
pcl::LineIterator::LineIterator | ( | unsigned | x_start, |
unsigned | y_start, | ||
unsigned | x_end, | ||
unsigned | y_end, | ||
unsigned | width, | ||
const Neighborhood & | neighborhood = Neighbor8 |
||
) | [inline] |
Constructor.
x_start | column of the start pixel of the line |
y_start | row of the start pixel of the line |
x_end | column of the end pixel of the line |
y_end | row of the end pixel of the line |
width | width of the organized structure e.g. image/cloud/map etc.. |
neighborhood | connectivity of the neighborhood |
Definition at line 134 of file line_iterator.h.
pcl::LineIterator::~LineIterator | ( | ) | [inline, virtual] |
Destructor.
Definition at line 145 of file line_iterator.h.
unsigned pcl::LineIterator::getColumnIndex | ( | ) | const [inline, virtual] |
returns the col index (x-coordinate) of the current pixel/point
Reimplemented from pcl::OrganizedIndexIterator.
Definition at line 251 of file line_iterator.h.
unsigned pcl::LineIterator::getRowIndex | ( | ) | const [inline, virtual] |
returns the row index (y-coordinate) of the current pixel/point
default implementation. Should be overloaded
Reimplemented from pcl::OrganizedIndexIterator.
Definition at line 244 of file line_iterator.h.
void pcl::LineIterator::init | ( | const Neighborhood & | neighborhood | ) | [inline, protected] |
initializes the variables for the Bresenham algorithm
[in] | neighborhood | connectivity to the neighborhood. Either 4 or 8 |
Definition at line 151 of file line_iterator.h.
bool pcl::LineIterator::isValid | ( | ) | const [inline, virtual] |
return whether the current visited pixel/point is valid or not.
Implements pcl::OrganizedIndexIterator.
Definition at line 258 of file line_iterator.h.
void pcl::LineIterator::operator++ | ( | ) | [inline, virtual] |
go to next pixel/point in image/cloud
Implements pcl::OrganizedIndexIterator.
Definition at line 224 of file line_iterator.h.
void pcl::LineIterator::reset | ( | ) | [inline, virtual] |
resets the iterator to the beginning of the line
Implements pcl::OrganizedIndexIterator.
Definition at line 265 of file line_iterator.h.
int pcl::LineIterator::error_ [protected] |
current distance to the line
Definition at line 98 of file line_iterator.h.
int pcl::LineIterator::error_max_ [protected] |
error threshold
Definition at line 101 of file line_iterator.h.
int pcl::LineIterator::error_minus_ [protected] |
increment of error (distance) value in case of an y-step (if dx > dy)
Definition at line 104 of file line_iterator.h.
int pcl::LineIterator::error_plus_ [protected] |
increment of error (distance) value in case of just an x-step (if dx > dy)
Definition at line 107 of file line_iterator.h.
int pcl::LineIterator::index_minus_ [protected] |
increment pixel/point index in case of just an y-step (if dx > dy)
Definition at line 125 of file line_iterator.h.
int pcl::LineIterator::index_plus_ [protected] |
increment pixel/point index in case of just an x-step (if dx > dy)
Definition at line 122 of file line_iterator.h.
unsigned pcl::LineIterator::x_ [protected] |
current column index
Definition at line 79 of file line_iterator.h.
unsigned pcl::LineIterator::x_end_ [protected] |
column index of end pixel/point
Definition at line 91 of file line_iterator.h.
int pcl::LineIterator::x_minus_ [protected] |
increment of column index in case of just an y-step (if dx > dy)
Definition at line 116 of file line_iterator.h.
int pcl::LineIterator::x_plus_ [protected] |
increment of column index in case of just an x-step (if dx > dy)
Definition at line 110 of file line_iterator.h.
unsigned pcl::LineIterator::x_start_ [protected] |
column index of first pixel/point
Definition at line 85 of file line_iterator.h.
unsigned pcl::LineIterator::y_ [protected] |
current row index
Definition at line 82 of file line_iterator.h.
unsigned pcl::LineIterator::y_end_ [protected] |
row index of end pixel/point
Definition at line 94 of file line_iterator.h.
int pcl::LineIterator::y_minus_ [protected] |
increment of row index in case of just an y-step (if dx > dy)
Definition at line 119 of file line_iterator.h.
int pcl::LineIterator::y_plus_ [protected] |
increment of row index in case of just an x-step (if dx > dy)
Definition at line 113 of file line_iterator.h.
unsigned pcl::LineIterator::y_start_ [protected] |
row index of first pixel/point
Definition at line 88 of file line_iterator.h.