It implements and iterator to "navigate" over a single band, optimized by a window structure (e.g. 3x3, 5x5, etc). Examples include filters, moving windows, morphology, etc. More...
#include <BandIteratorWindow.h>
Public Member Functions | |
BandIteratorWindow () | |
Constructor. | |
BandIteratorWindow (Band const *const b, std::size_t w, const std::size_t h) | |
Constructor. | |
BandIteratorWindow (const BandIteratorWindow &rhs) | |
Copy constructor. | |
unsigned int | getColumn () const |
Returns the current column in iterator. | |
unsigned int | getRow () const |
Returns the current row in iterator. | |
T | getValue () const |
Returns the value in current position (column, row) from iterator. | |
T | getValue (int c, int r) const |
Returns the value in a relative position to the center pixel currently pointed by iterator. | |
bool | operator!= (const BandIteratorWindow &rhs) const |
Differece operator. | |
BandIteratorWindow | operator* () |
void | operator++ () |
Advances to the next position. | |
void | operator-- () |
Returns to the previous position. | |
BandIteratorWindow & | operator= (const BandIteratorWindow &rhs) |
Assignment operator. | |
void | replaceBlocks () |
Replaces the current bufferized blocks. | |
~BandIteratorWindow () | |
Destructor. | |
Static Public Member Functions | |
static BandIteratorWindow | begin (Band const *const b, std::size_t w, const std::size_t h) |
Returns an iterator referring to the first value of the band. | |
static BandIteratorWindow | end (Band const *const b, std::size_t w, const std::size_t h) |
Returns an iterator referring to after the end of the iterator. | |
Private Member Functions | |
T * | getBlock (int c, int r) const |
Returns the correct block where relative value is used. | |
int | getRelativeIndex (int c, int r) const |
Returns the correct index where the relative value is in the relative block. | |
Private Attributes | |
Band const * | m_band |
The band from where to get the values. | |
int | m_blkh |
The internal block height. | |
int | m_blkw |
The internal block width. | |
int | m_blkx |
The position in X of the current block. | |
int | m_blky |
The position in Y of the current block. | |
std::vector< T * > | m_blocks |
A vector of internal blocks, to provide fast access to window elements. | |
int | m_cblock |
The index of the central block;. | |
te::rst::GetBufferValueFPtr | m_getBuff |
A pointer to a function that helps to extract a double or complex value from a specific buffer data type (char, int16, int32, float, ...). | |
te::rst::GetBufferValueFPtr | m_getBuffI |
A pointer to a function that helps to extract the imaginary part value from a specific buffer data type (cint16, cint32, cfloat, cdouble). | |
int | m_h |
The height of the window to iterate. | |
int | m_i |
The actual position inside the block. | |
int | m_lastblksize |
The number of pixels inside the last block. | |
int | m_nblocksx |
The number of blocks in X direction. | |
int | m_nblocksy |
The number of blocks in Y direction. | |
int | m_npxlsblk |
The maximum number of pixels inside the block. | |
int | m_nvblocksx |
The amount of blocks in direction X in vector of internal blocks. | |
int | m_nvblocksy |
The amount of blocks in direction Y in vector of internal blocks. | |
te::rst::SetBufferValueFPtr | m_setBuff |
A pointer to a function that helps to insert a double or complex value into a specific buffer data type (char, int16, int32, float, ...). | |
te::rst::SetBufferValueFPtr | m_setBuffI |
A pointer to a function that helps to insert the imaginary part value into a specific buffer data type (cint16, cint32, cfloat, cdouble). | |
int | m_w |
The width of the window to iterate. | |
It implements and iterator to "navigate" over a single band, optimized by a window structure (e.g. 3x3, 5x5, etc). Examples include filters, moving windows, morphology, etc.
Definition at line 54 of file BandIteratorWindow.h.
te::rst::BandIteratorWindow< T >::BandIteratorWindow | ( | Band const *const | b, |
std::size_t | w, | ||
const std::size_t | h | ||
) |
Constructor.
b | The band to iterate. |
w | The width of the window to iterate. |
h | The height of the window to iterate. |
Definition at line 192 of file BandIteratorWindow.h.
References te::rst::Band::getBlockSize(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::Band::getRaster(), te::rst::BandProperty::getType(), te::rst::BandIteratorWindow< T >::m_band, te::rst::BandIteratorWindow< T >::m_blkh, te::rst::BandIteratorWindow< T >::m_blkw, te::rst::BandIteratorWindow< T >::m_blocks, te::rst::BandIteratorWindow< T >::m_cblock, te::rst::BandIteratorWindow< T >::m_getBuff, te::rst::BandIteratorWindow< T >::m_getBuffI, te::rst::BandIteratorWindow< T >::m_h, te::rst::BandIteratorWindow< T >::m_lastblksize, te::rst::BandIteratorWindow< T >::m_nblocksx, te::rst::BandIteratorWindow< T >::m_nblocksy, te::rst::BandIteratorWindow< T >::m_npxlsblk, te::rst::BandIteratorWindow< T >::m_nvblocksx, te::rst::BandIteratorWindow< T >::m_nvblocksy, te::rst::BandIteratorWindow< T >::m_setBuff, te::rst::BandIteratorWindow< T >::m_setBuffI, te::rst::BandIteratorWindow< T >::m_w, te::rst::BandIteratorWindow< T >::replaceBlocks(), and te::rst::SetBlockFunctions().
te::rst::BandIteratorWindow< T >::BandIteratorWindow | ( | const BandIteratorWindow< T > & | rhs | ) |
Copy constructor.
rhs | The right-hand-side copy used to copy from. |
Definition at line 252 of file BandIteratorWindow.h.
References te::common::FreeContents(), te::rst::Band::getBlockSize(), te::rst::BandIteratorWindow< T >::m_band, te::rst::BandIteratorWindow< T >::m_blocks, te::rst::BandIteratorWindow< T >::m_nvblocksx, te::rst::BandIteratorWindow< T >::m_nvblocksy, and te::rst::BandIteratorWindow< T >::replaceBlocks().
te::rst::BandIteratorWindow< T >::BandIteratorWindow |
Constructor.
Definition at line 284 of file BandIteratorWindow.h.
te::rst::BandIteratorWindow< T >::~BandIteratorWindow |
Destructor.
Definition at line 304 of file BandIteratorWindow.h.
References te::common::FreeContents().
|
static |
Returns an iterator referring to the first value of the band.
b | The band to iterate. |
w | The width of the window to iterate. |
h | The height of the window to iterate. |
Definition at line 433 of file BandIteratorWindow.h.
|
static |
Returns an iterator referring to after the end of the iterator.
b | The band to iterate. |
w | The width of the window to iterate. |
h | The height of the window to iterate. |
Definition at line 438 of file BandIteratorWindow.h.
References te::rst::Band::getProperty(), te::rst::BandIteratorWindow< T >::m_blky, and te::rst::BandProperty::m_nblocksy.
|
private |
Returns the correct block where relative value is used.
r | The row relative to the center pixel. |
c | The column relative to the center pixel. |
Definition at line 465 of file BandIteratorWindow.h.
unsigned int te::rst::BandIteratorWindow< T >::getColumn |
Returns the current column in iterator.
Definition at line 314 of file BandIteratorWindow.h.
|
private |
Returns the correct index where the relative value is in the relative block.
r | The row relative to the center pixel. |
c | The column relative to the center pixel. |
Definition at line 476 of file BandIteratorWindow.h.
unsigned int te::rst::BandIteratorWindow< T >::getRow |
Returns the current row in iterator.
Definition at line 309 of file BandIteratorWindow.h.
T te::rst::BandIteratorWindow< T >::getValue |
Returns the value in current position (column, row) from iterator.
Definition at line 319 of file BandIteratorWindow.h.
T te::rst::BandIteratorWindow< T >::getValue | ( | int | c, |
int | r | ||
) | const |
Returns the value in a relative position to the center pixel currently pointed by iterator.
r | The row relative to the center pixel. |
c | The column relative to the center pixel. |
Definition at line 329 of file BandIteratorWindow.h.
bool te::rst::BandIteratorWindow< T >::operator!= | ( | const BandIteratorWindow< T > & | rhs | ) | const |
Differece operator.
rhs | The right-hand side to compare. |
Definition at line 428 of file BandIteratorWindow.h.
References te::rst::BandIteratorWindow< T >::m_blky.
te::rst::BandIteratorWindow< T > te::rst::BandIteratorWindow< T >::operator* |
Definition at line 396 of file BandIteratorWindow.h.
void te::rst::BandIteratorWindow< T >::operator++ |
Advances to the next position.
Definition at line 339 of file BandIteratorWindow.h.
void te::rst::BandIteratorWindow< T >::operator-- |
Returns to the previous position.
Definition at line 368 of file BandIteratorWindow.h.
te::rst::BandIteratorWindow< T > & te::rst::BandIteratorWindow< T >::operator= | ( | const BandIteratorWindow< T > & | rhs | ) |
Assignment operator.
rhs | The right-hand-side copy used to copy from. |
Definition at line 401 of file BandIteratorWindow.h.
References te::common::FreeContents(), te::rst::BandIteratorWindow< T >::m_band, te::rst::BandIteratorWindow< T >::m_blkh, te::rst::BandIteratorWindow< T >::m_blkw, te::rst::BandIteratorWindow< T >::m_blkx, te::rst::BandIteratorWindow< T >::m_blky, te::rst::BandIteratorWindow< T >::m_i, te::rst::BandIteratorWindow< T >::m_lastblksize, te::rst::BandIteratorWindow< T >::m_nblocksx, te::rst::BandIteratorWindow< T >::m_nblocksy, te::rst::BandIteratorWindow< T >::m_npxlsblk, te::rst::BandIteratorWindow< T >::m_nvblocksx, and te::rst::BandIteratorWindow< T >::m_nvblocksy.
void te::rst::BandIteratorWindow< T >::replaceBlocks |
Replaces the current bufferized blocks.
Definition at line 447 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
The band from where to get the values.
Definition at line 185 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The internal block height.
Definition at line 173 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The internal block width.
Definition at line 172 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The position in X of the current block.
Definition at line 181 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::operator=().
|
private |
The position in Y of the current block.
Definition at line 182 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::end(), te::rst::BandIteratorWindow< T >::operator!=(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
A vector of internal blocks, to provide fast access to window elements.
Definition at line 184 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
The index of the central block;.
Definition at line 179 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
A pointer to a function that helps to extract a double or complex value from a specific buffer data type (char, int16, int32, float, ...).
Definition at line 186 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
A pointer to a function that helps to extract the imaginary part value from a specific buffer data type (cint16, cint32, cfloat, cdouble).
Definition at line 187 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
The height of the window to iterate.
Definition at line 171 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
The actual position inside the block.
Definition at line 180 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::operator=().
|
private |
The number of pixels inside the last block.
Definition at line 183 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The number of blocks in X direction.
Definition at line 175 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The number of blocks in Y direction.
Definition at line 176 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The maximum number of pixels inside the block.
Definition at line 174 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The amount of blocks in direction X in vector of internal blocks.
Definition at line 177 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
The amount of blocks in direction Y in vector of internal blocks.
Definition at line 178 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWindow< T >::operator=().
|
private |
A pointer to a function that helps to insert a double or complex value into a specific buffer data type (char, int16, int32, float, ...).
Definition at line 188 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
A pointer to a function that helps to insert the imaginary part value into a specific buffer data type (cint16, cint32, cfloat, cdouble).
Definition at line 189 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().
|
private |
The width of the window to iterate.
Definition at line 170 of file BandIteratorWindow.h.
Referenced by te::rst::BandIteratorWindow< T >::BandIteratorWindow().