36 #ifndef __PCL_LINE_ITERATOR__ 37 #define __PCL_LINE_ITERATOR__ 38 #include "organized_index_iterator.h" 71 virtual void reset ();
161 int x_dir = ( (delta_x > 0) ? 1 : -1 ) ;
162 int y_dir = ( (delta_y > 0) ? 1 : -1 ) ;
167 if(delta_x >= delta_y)
275 #endif // __PCL_LINE_ITERATOR__
unsigned index_
the index of the current pixel/point
virtual bool isValid() const
return whether the current visited pixel/point is valid or not.
virtual unsigned getColumnIndex() const
returns the col index (x-coordinate) of the current pixel/point
virtual void operator++()
go to next pixel/point in image/cloud
int index_plus_
increment pixel/point index in case of just an x-step (if dx > dy)
virtual ~LineIterator()
Destructor.
Neighborhood
Neighborhood connectivity.
int index_minus_
increment pixel/point 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
virtual unsigned getRowIndex() const
returns the row index (y-coordinate) of the current pixel/point
virtual void reset()
resets the iterator to the beginning of the line
void init(const Neighborhood &neighborhood)
initializes the variables for the Bresenham algorithm
int y_minus_
increment of row index in case of just an y-step (if dx > dy)
unsigned x_end_
column index of end pixel/point
unsigned x_start_
column index of first pixel/point
Organized Index Iterator for iterating over the "pixels" for a given line using the Bresenham algorit...
LineIterator(unsigned x_start, unsigned y_start, unsigned x_end, unsigned y_end, unsigned width, const Neighborhood &neighborhood=Neighbor8)
Constructor.
base class for iterators on 2-dimensional maps like images/organized clouds etc.
unsigned x_
current column index
int x_minus_
increment of column index in case of just an y-step (if dx > dy)
unsigned y_end_
row index of end pixel/point
int error_minus_
increment of error (distance) value in case of an y-step (if dx > dy)
int x_plus_
increment of column index in case of just an x-step (if dx > dy)
unsigned width_
the width of the image/cloud
int error_max_
error threshold
int error_plus_
increment of error (distance) value in case of just an x-step (if dx > dy)
unsigned y_
current row index
int error_
current distance to the line