Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | 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]

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

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 gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m

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 ( )
inlinevirtual

Destructor.

Definition at line 145 of file line_iterator.h.

Member Function Documentation

unsigned pcl::LineIterator::getColumnIndex ( ) const
inlinevirtual

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
inlinevirtualinherited

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
inlinevirtual

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
inlinevirtual

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
inlineinherited

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  )
inlinevirtualinherited

go to next pixel/point in image/cloud

Definition at line 117 of file organized_index_iterator.h.

void pcl::LineIterator::operator++ ( )
inlinevirtual

go to next pixel/point in image/cloud

Implements pcl::OrganizedIndexIterator.

Definition at line 224 of file line_iterator.h.

void pcl::LineIterator::reset ( )
inlinevirtual

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: