This class implements and iterator to "navigate" over a raster, with a predefined number of bands. More...
#include <RasterIterator.h>
Public Member Functions | |
unsigned int | getColumn () const |
Returns the current column in iterator. More... | |
unsigned int | getRow () const |
Returns the current row in iterator. More... | |
void | getValues (std::vector< T > &v) const |
Gets the values from all bands in current position (column, row) from iterator. More... | |
bool | operator!= (const RasterIterator &rhs) const |
Difference operator. More... | |
std::vector< T > | operator* () const |
Returns a vector with pixel values from all bands in current position (column, row) from iterator. More... | |
void | operator++ () |
Advances to the next position. More... | |
void | operator-- () |
Returns to the previous position. More... | |
RasterIterator & | operator= (const RasterIterator &rhs) |
Assignment operator. More... | |
T | operator[] (const unsigned int i) const |
Returns the value in current position (column, row, band) from iterator. More... | |
RasterIterator () | |
Empty constructor. More... | |
RasterIterator (Raster *r, const std::vector< unsigned int > &bands) | |
Constructor. More... | |
RasterIterator (const RasterIterator &rhs) | |
Copy constructor. More... | |
~RasterIterator () | |
Destructor. More... | |
Static Public Member Functions | |
static RasterIterator | begin (Raster *r, const std::vector< unsigned int > &bands) |
Returns an iterator referring to the first value. More... | |
static RasterIterator | end (Raster *r, const std::vector< unsigned int > &bands) |
Returns an iterator referring to after the end of the iterator. More... | |
Private Attributes | |
std::vector< unsigned int > | m_b |
The vector of bands to iterate. More... | |
std::vector< BandIterator< T > > | m_it |
The vector of band iterators. More... | |
Raster * | m_raster |
The raster from where to get the values. More... | |
This class implements and iterator to "navigate" over a raster, with a predefined number of bands.
Definition at line 52 of file RasterIterator.h.
te::rst::RasterIterator< T >::RasterIterator | ( | ) |
Empty constructor.
Definition at line 151 of file RasterIterator.h.
te::rst::RasterIterator< T >::RasterIterator | ( | Raster * | r, |
const std::vector< unsigned int > & | bands | ||
) |
Constructor.
r | The raster to iterate. |
bands | The vector of band indices that the iterator will use. |
Definition at line 158 of file RasterIterator.h.
References te::rst::Raster::getBand(), te::rst::RasterIterator< T >::m_b, and te::rst::RasterIterator< T >::m_it.
te::rst::RasterIterator< T >::RasterIterator | ( | const RasterIterator< T > & | rhs | ) |
Copy constructor.
rhs | The right-hand-side copy used to copy from. |
Definition at line 166 of file RasterIterator.h.
te::rst::RasterIterator< T >::~RasterIterator | ( | ) |
Destructor.
Definition at line 171 of file RasterIterator.h.
|
static |
Returns an iterator referring to the first value.
r | The raster to iterate. |
bands | The vector of band indices that the iterator will use. |
Definition at line 236 of file RasterIterator.h.
|
static |
Returns an iterator referring to after the end of the iterator.
r | The raster to iterate. |
bands | The vector of band indices that the iterator will use. |
Definition at line 241 of file RasterIterator.h.
References te::rst::Raster::getBand(), and te::rst::RasterIterator< T >::m_it.
unsigned int te::rst::RasterIterator< T >::getColumn | ( | ) | const |
Returns the current column in iterator.
Definition at line 180 of file RasterIterator.h.
unsigned int te::rst::RasterIterator< T >::getRow | ( | ) | const |
Returns the current row in iterator.
Definition at line 175 of file RasterIterator.h.
void te::rst::RasterIterator< T >::getValues | ( | std::vector< T > & | v | ) | const |
Gets the values from all bands in current position (column, row) from iterator.
v | A vector previously created to be filled with values. |
Definition at line 199 of file RasterIterator.h.
bool te::rst::RasterIterator< T >::operator!= | ( | const RasterIterator< T > & | rhs | ) | const |
Difference operator.
rhs | The right-hand side to compare. |
Definition at line 231 of file RasterIterator.h.
References te::rst::RasterIterator< T >::m_it.
std::vector< T > te::rst::RasterIterator< T >::operator* | ( | ) | const |
Returns a vector with pixel values from all bands in current position (column, row) from iterator.
Definition at line 190 of file RasterIterator.h.
void te::rst::RasterIterator< T >::operator++ | ( | ) |
Advances to the next position.
Definition at line 205 of file RasterIterator.h.
void te::rst::RasterIterator< T >::operator-- | ( | ) |
Returns to the previous position.
Definition at line 211 of file RasterIterator.h.
te::rst::RasterIterator< T > & te::rst::RasterIterator< T >::operator= | ( | const RasterIterator< T > & | rhs | ) |
Assignment operator.
rhs | The right-hand-side copy used to copy from. |
Definition at line 217 of file RasterIterator.h.
References te::rst::RasterIterator< T >::m_b, te::rst::RasterIterator< T >::m_it, and te::rst::RasterIterator< T >::m_raster.
T te::rst::RasterIterator< T >::operator[] | ( | const unsigned int | i | ) | const |
Returns the value in current position (column, row, band) from iterator.
i | The band index. |
Definition at line 185 of file RasterIterator.h.
|
private |
The vector of bands to iterate.
Definition at line 146 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::operator=(), and te::rst::RasterIterator< T >::RasterIterator().
|
private |
The vector of band iterators.
Definition at line 148 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::end(), te::rst::RasterIterator< T >::operator!=(), te::rst::RasterIterator< T >::operator=(), and te::rst::RasterIterator< T >::RasterIterator().
|
private |
The raster from where to get the values.
Definition at line 147 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::operator=().