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. | |
unsigned int | getRow () const |
Returns the current row in iterator. | |
void | getValues (std::vector< T > &v) const |
Gets the values from all bands in current position (column, row) from iterator. | |
bool | operator!= (const RasterIterator &rhs) const |
Difference operator. | |
std::vector< T > | operator* () const |
Returns a vector with pixel values from all bands in current position (column, row) from iterator. | |
void | operator++ () |
Advances to the next position. | |
void | operator-- () |
Returns to the previous position. | |
RasterIterator & | operator= (const RasterIterator &rhs) |
Assignment operator. | |
T | operator[] (const unsigned int i) const |
Returns the value in current position (column, row, band) from iterator. | |
RasterIterator () | |
Empty constructor. | |
RasterIterator (const RasterIterator &rhs) | |
Copy constructor. | |
RasterIterator (Raster *r, const std::vector< unsigned int > &bands, bool ignoreNoDataValue=false) | |
Constructor. | |
~RasterIterator () | |
Destructor. | |
Static Public Member Functions | |
static RasterIterator | begin (Raster *r, const std::vector< unsigned int > &bands, bool ignoreNoDataValue=false) |
Returns an iterator referring to the first value. | |
static RasterIterator | end (Raster *r, const std::vector< unsigned int > &bands) |
Returns an iterator referring to after the end of the iterator. | |
Protected Member Functions | |
bool | isNoDataValue () |
Check if current position from iterartor represents a pixel with no data value. | |
Private Attributes | |
std::vector< unsigned int > | m_b |
The vector of bands to iterate. | |
bool | m_ignoreNoDataValue |
Flag used to not iterate over pixels with no data value. | |
std::vector< BandIterator< T > > | m_it |
The vector of band iterators. | |
Raster * | m_raster |
The raster from where to get the values. | |
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 161 of file RasterIterator.h.
te::rst::RasterIterator< T >::RasterIterator | ( | Raster * | r, |
const std::vector< unsigned int > & | bands, | ||
bool | ignoreNoDataValue = false |
||
) |
Constructor.
r | The raster to iterate. |
bands | The vector of band indices that the iterator will use. |
Definition at line 168 of file RasterIterator.h.
References te::rst::Raster::getBand(), te::rst::RasterIterator< T >::isNoDataValue(), te::rst::RasterIterator< T >::m_b, te::rst::RasterIterator< T >::m_ignoreNoDataValue, te::rst::RasterIterator< T >::m_it, and te::rst::RasterIterator< T >::operator++().
te::rst::RasterIterator< T >::RasterIterator | ( | const RasterIterator< T > & | rhs | ) |
Copy constructor.
rhs | The right-hand-side copy used to copy from. |
Definition at line 185 of file RasterIterator.h.
te::rst::RasterIterator< T >::~RasterIterator |
Destructor.
Definition at line 190 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 297 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 302 of file RasterIterator.h.
References te::rst::Raster::getBand(), and te::rst::RasterIterator< T >::m_it.
unsigned int te::rst::RasterIterator< T >::getColumn |
Returns the current column in iterator.
Definition at line 199 of file RasterIterator.h.
unsigned int te::rst::RasterIterator< T >::getRow |
Returns the current row in iterator.
Definition at line 194 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 218 of file RasterIterator.h.
|
protected |
Check if current position from iterartor represents a pixel with no data value.
Definition at line 312 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::RasterIterator().
bool te::rst::RasterIterator< T >::operator!= | ( | const RasterIterator< T > & | rhs | ) | const |
Difference operator.
rhs | The right-hand side to compare. |
Definition at line 292 of file RasterIterator.h.
References te::rst::RasterIterator< T >::m_it.
std::vector< T > te::rst::RasterIterator< T >::operator* |
Returns a vector with pixel values from all bands in current position (column, row) from iterator.
Definition at line 209 of file RasterIterator.h.
void te::rst::RasterIterator< T >::operator++ |
Advances to the next position.
Definition at line 224 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::RasterIterator().
void te::rst::RasterIterator< T >::operator-- |
Returns to the previous position.
Definition at line 250 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 276 of file RasterIterator.h.
References te::rst::RasterIterator< T >::m_b, te::rst::RasterIterator< T >::m_ignoreNoDataValue, 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 204 of file RasterIterator.h.
|
private |
The vector of bands to iterate.
Definition at line 155 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::operator=(), and te::rst::RasterIterator< T >::RasterIterator().
|
private |
Flag used to not iterate over pixels with no data value.
Definition at line 158 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 157 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 156 of file RasterIterator.h.
Referenced by te::rst::RasterIterator< T >::operator=().