Organized Index Iterator for iterating over the "pixels" for a given line using the Bresenham algorithm. More...
#include <pcl/geometry/line_iterator.h>
Public Types | |
enum | Neighborhood { Neighbor4 = 4, Neighbor8 = 8 } |
Neighborhood connectivity More... |
|
Public Member Functions | |
LineIterator (unsigned x_start, unsigned y_start, unsigned x_end, unsigned y_end, unsigned width, const Neighborhood &neighborhood=Neighbor8) | |
Constructor. More... |
|
~LineIterator () | |
Destructor. More... |
|
void | operator++ () override |
go to next pixel/point in image/cloud More... |
|
unsigned | getRowIndex () const override |
returns the row index (y-coordinate) of the current pixel/point More... |
|
unsigned | getColumnIndex () const override |
returns the col index (x-coordinate) of the current pixel/point More... |
|
bool | isValid () const override |
return whether the current visited pixel/point is valid or not. More... |
|
void | reset () override |
resets the iterator to the beginning of the line More... |
|
Public Member Functions inherited from pcl::OrganizedIndexIterator | |
OrganizedIndexIterator (unsigned width) | |
constructor More... |
|
virtual | ~OrganizedIndexIterator () |
virtual destructor More... |
|
virtual void | operator++ (int) |
go to next pixel/point in image/cloud More... |
|
unsigned | operator* () const |
returns the pixel/point index in the linearized memory of the image/cloud More... |
|
virtual unsigned | getIndex () const |
returns the pixel/point index in the linearized memory of the image/cloud More... |
|
Protected Member Functions | |
void | init (const Neighborhood &neighborhood) |
initializes the variables for the Bresenham algorithm More... |
|
Protected Attributes | |
unsigned | x_ |
current column index More... |
|
unsigned | y_ |
current row index More... |
|
unsigned | x_start_ |
column index of first pixel/point More... |
|
unsigned | y_start_ |
row index of first pixel/point More... |
|
unsigned | x_end_ |
column index of end pixel/point More... |
|
unsigned | y_end_ |
row index of end pixel/point More... |
|
int | error_ |
current distance to the line More... |
|
int | error_max_ |
error threshold More... |
|
int | error_minus_ |
increment of error (distance) value in case of an y-step (if dx > dy) More... |
|
int | error_plus_ |
increment of error (distance) value in case of just an x-step (if dx > dy) More... |
|
int | x_plus_ |
increment of column index in case of just an x-step (if dx > dy) More... |
|
int | y_plus_ |
increment of row index in case of just an x-step (if dx > dy) More... |
|
int | x_minus_ |
increment of column index in case of just an y-step (if dx > dy) More... |
|
int | y_minus_ |
increment of row index in case of just an y-step (if dx > dy) More... |
|
int | index_plus_ |
increment pixel/point index in case of just an x-step (if dx > dy) More... |
|
int | index_minus_ |
increment pixel/point index in case of just an y-step (if dx > dy) More... |
|
Protected Attributes inherited from pcl::OrganizedIndexIterator | |
unsigned | width_ |
the width of the image/cloud More... |
|
unsigned | index_ |
the index of the current pixel/point More... |
|
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
Enumerator | |
---|---|
Neighbor4 | |
Neighbor8 |
Definition at line 51 of file line_iterator.h.
| 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 148 of file line_iterator.h.
References init().
| inline |
Destructor.
Definition at line 164 of file line_iterator.h.
| inlineoverridevirtual |
returns the col index (x-coordinate) of the current pixel/point
Reimplemented from pcl::OrganizedIndexIterator.
Definition at line 260 of file line_iterator.h.
References x_.
| inlineoverridevirtual |
returns the row index (y-coordinate) of the current pixel/point
default implementation.
Should be overloaded
Reimplemented from pcl::OrganizedIndexIterator.
Definition at line 253 of file line_iterator.h.
References y_.
| inlineprotected |
initializes the variables for the Bresenham algorithm
[in] | neighborhood | connectivity to the neighborhood. Either 4 or 8 |
Definition at line 168 of file line_iterator.h.
References error_, error_max_, error_minus_, error_plus_, pcl::OrganizedIndexIterator::index_, index_minus_, index_plus_, Neighbor4, pcl::OrganizedIndexIterator::width_, x_, x_end_, x_minus_, x_plus_, x_start_, y_, y_end_, y_minus_, y_plus_, and y_start_.
Referenced by LineIterator().
| inlineoverridevirtual |
return whether the current visited pixel/point is valid or not.
Implements pcl::OrganizedIndexIterator.
Definition at line 267 of file line_iterator.h.
| inlineoverridevirtual |
go to next pixel/point in image/cloud
Implements pcl::OrganizedIndexIterator.
Definition at line 235 of file line_iterator.h.
References error_, error_max_, error_minus_, error_plus_, pcl::OrganizedIndexIterator::index_, index_minus_, index_plus_, x_, x_minus_, x_plus_, y_, y_minus_, and y_plus_.
| inlineoverridevirtual |
resets the iterator to the beginning of the line
Implements pcl::OrganizedIndexIterator.
Definition at line 274 of file line_iterator.h.
References error_, pcl::OrganizedIndexIterator::index_, pcl::OrganizedIndexIterator::width_, x_, x_start_, y_, and y_start_.
| protected |
current distance to the line
Definition at line 112 of file line_iterator.h.
Referenced by init(), operator++(), and reset().
| protected |
error threshold
Definition at line 115 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
increment of error (distance) value in case of an y-step (if dx > dy)
Definition at line 118 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
increment of error (distance) value in case of just an x-step (if dx > dy)
Definition at line 122 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
increment pixel/point index in case of just an y-step (if dx > dy)
Definition at line 140 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
increment pixel/point index in case of just an x-step (if dx > dy)
Definition at line 137 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
current column index
Definition at line 93 of file line_iterator.h.
Referenced by getColumnIndex(), init(), isValid(), operator++(), and reset().
| protected |
column index of end pixel/point
Definition at line 105 of file line_iterator.h.
| protected |
increment of column index in case of just an y-step (if dx > dy)
Definition at line 131 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
increment of column index in case of just an x-step (if dx > dy)
Definition at line 125 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
column index of first pixel/point
Definition at line 99 of file line_iterator.h.
| protected |
current row index
Definition at line 96 of file line_iterator.h.
Referenced by getRowIndex(), init(), isValid(), operator++(), and reset().
| protected |
row index of end pixel/point
Definition at line 108 of file line_iterator.h.
| protected |
increment of row index in case of just an y-step (if dx > dy)
Definition at line 134 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
increment of row index in case of just an x-step (if dx > dy)
Definition at line 128 of file line_iterator.h.
Referenced by init(), and operator++().
| protected |
row index of first pixel/point
Definition at line 102 of file line_iterator.h.
© 2009–2012, Willow Garage, Inc.
© 2012–, Open Perception, Inc.
Licensed under the BSD License.
https://pointclouds.org/documentation/classpcl_1_1_line_iterator.html