Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions
pcl::LineIterator Class Reference

Organized Index Iterator for iterating over the "pixels" for a given line using the Bresenham algorithm. More...

#include <pcl/geometry/line_iterator.h>

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

List of all members.

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.
virtual ~LineIterator ()
 Destructor.
virtual void operator++ ()
 go to next pixel/point in image/cloud
virtual unsigned getRowIndex () const
 returns the row index (y-coordinate) of the current pixel/point
virtual unsigned getColumnIndex () const
 returns the col index (x-coordinate) of the current pixel/point
virtual bool isValid () const
 return whether the current visited pixel/point is valid or not.
virtual void reset ()
 resets the iterator to the beginning of the line
virtual void operator++ (int)
 go to next pixel/point in image/cloud
unsigned operator* () const
 returns the pixel/point index in the linearized memory of the image/cloud
virtual unsigned getIndex () const
 returns the pixel/point index in the linearized memory of the image/cloud

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::OrganizedIndexIterator::getIndex ( ) const [inline, virtual, inherited]

returns the pixel/point index in the linearized memory of the image/cloud

Returns:
the pixel/point index in the linearized memory of the image/cloud

Definition at line 131 of file organized_index_iterator.h.

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

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

default implementation.

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

Should be overloaded

Reimplemented from pcl::OrganizedIndexIterator.

Definition at line 244 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.

unsigned pcl::OrganizedIndexIterator::operator* ( ) const [inline, inherited]

returns the pixel/point index in the linearized memory of the image/cloud

Returns:
the pixel/point index in the linearized memory of the image/cloud

Definition at line 124 of file organized_index_iterator.h.

void pcl::OrganizedIndexIterator::operator++ ( int  ) [inline, virtual, inherited]

go to next pixel/point in image/cloud

Definition at line 117 of file organized_index_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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines