Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::LineIterator Class Reference

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>

Inheritance diagram for pcl::LineIterator:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Organized Index Iterator for iterating over the "pixels" for a given line using the Bresenham algorithm. Supports 4 and 8 neighborhood connectivity.

Note:
iterator does not visit the given end-point (by purpose).
Author:
Suat Gedikli <gedikli@willowgarage.com>

Definition at line 48 of file line_iterator.h.


Member Enumeration Documentation

Neighborhood connectivity.

Enumerator:
Neighbor4 
Neighbor8 

Definition at line 52 of file line_iterator.h.


Constructor & Destructor Documentation

pcl::LineIterator::LineIterator ( unsigned  x_start,
unsigned  y_start,
unsigned  x_end,
unsigned  y_end,
unsigned  width,
const Neighborhood neighborhood = Neighbor8 
) [inline]

Constructor.

Parameters:
x_startcolumn of the start pixel of the line
y_startrow of the start pixel of the line
x_endcolumn of the end pixel of the line
y_endrow of the end pixel of the line
widthwidth of the organized structure e.g. image/cloud/map etc..
neighborhoodconnectivity 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.


Member Function Documentation

unsigned pcl::LineIterator::getColumnIndex ( ) const [inline, virtual]

returns the col index (x-coordinate) of the current pixel/point

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

Returns:
the row index (y-coordinate) of the current pixel/point

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

Parameters:
[in]neighborhoodconnectivity 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.

Returns:
true if the current pixel/point is within the points to be iterated over, false otherwise

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.


Member Data Documentation

int pcl::LineIterator::error_ [protected]

current distance to the line

Definition at line 98 of file line_iterator.h.

error threshold

Definition at line 101 of file line_iterator.h.

increment of error (distance) value in case of an y-step (if dx > dy)

Definition at line 104 of file line_iterator.h.

increment of error (distance) value in case of just an x-step (if dx > dy)

Definition at line 107 of file line_iterator.h.

increment pixel/point index in case of just an y-step (if dx > dy)

Definition at line 125 of file line_iterator.h.

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.


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


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:19:33