te::rst::BandIteratorWithMask< T > Class Template Reference

This class implements an iterator to "navigate" over a single band, with a spatial restriction given by a mask. More...

#include <BandIterator.h>

Inheritance diagram for te::rst::BandIteratorWithMask< T >:
te::rst::BandIterator< T > te::rst::AbstractBandIterator< T >

Public Member Functions

 BandIteratorWithMask ()
 Constructor. More...
 
 BandIteratorWithMask (Band *b, Raster *m)
 Constructor. More...
 
 BandIteratorWithMask (const BandIteratorWithMask &rhs)
 Copy constructor. More...
 
unsigned int getColumn () const
 Returns the current column in iterator. More...
 
unsigned int getRow () const
 Returns the current row in iterator. More...
 
bool operator!= (const AbstractBandIterator &rhs) const
 Difference operator. More...
 
operator* ()
 Returns the value in current position (column, row) from iterator. More...
 
const T operator* () const
 Returns the value in current position (column, row) from iterator. More...
 
void operator++ ()
 Advances to the next position. More...
 
void operator-- ()
 
BandIteratorWithMaskoperator= (const BandIteratorWithMask &rhs)
 Assignment operator. More...
 
void replaceBlock ()
 Replaces the current bufferized block values. More...
 

Static Public Member Functions

static BandIterator begin (Band *b)
 Returns an iterator referring to the first value of the band. More...
 
static BandIteratorWithMask begin (Band *b, Raster *m)
 Returns an iterator with the mask referring to the first value of the band. More...
 
static BandIterator end (Band *b)
 Returns an iterator referring to after the end of the iterator. More...
 
static BandIteratorWithMask end (Band *b, Raster *m)
 Returns an iterator with the mask referring to after the end of the iterator. More...
 

Protected Member Functions

void reset ()
 Reset this instance to a initial state. More...
 

Protected Attributes

Bandm_band
 The band from where to get the values. More...
 
T * m_blk
 Internal block. More...
 
int m_blkh
 The internal block height. More...
 
int m_blksize
 The block size of the band. More...
 
int m_blkw
 The internal block width. More...
 
int m_blkx
 The position in X of the current block. More...
 
int m_blky
 The position in Y of the current block. More...
 
unsigned int m_currentpixelindex
 The index of the current pixel location. More...
 
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, ...). More...
 
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). More...
 
int m_i
 The actual position inside the block. More...
 
int m_lastblksize
 The number of pixels inside the last block. More...
 
boost::dynamic_bitset m_mask
 The internal mask of bits, one bit per pixel. More...
 
unsigned int m_masksize
 The size of the mask (rows * columns of the mask raster). More...
 
int m_nblocksx
 The number of blocks in X direction. More...
 
int m_nblocksy
 The number of blocks in Y direction. More...
 
int m_npxlsblk
 The maximum number of pixels inside the block. More...
 
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, ...). More...
 
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). More...
 

Detailed Description

template<class T>
class te::rst::BandIteratorWithMask< T >

This class implements an iterator to "navigate" over a single band, with a spatial restriction given by a mask.

We provide an efficient method to obtain all values in a raster, without regard to their locations. The implementation navigates through the blocks of the image. The mask is a 1bit raster where the pixels with value 0 are not returned by the iterator, and pixels with value 1 are returned.

See also
te::rst::Band

Definition at line 280 of file BandIterator.h.

Constructor & Destructor Documentation

◆ BandIteratorWithMask() [1/3]

Constructor.

Definition at line 649 of file BandIterator.h.

◆ BandIteratorWithMask() [2/3]

◆ BandIteratorWithMask() [3/3]

template<class T >
te::rst::BandIteratorWithMask< T >::BandIteratorWithMask ( const BandIteratorWithMask< T > &  rhs)

Copy constructor.

Parameters
rhsThe right-hand-side copy used to copy from.

Definition at line 682 of file BandIterator.h.

Member Function Documentation

◆ begin() [1/2]

template<class T >
te::rst::BandIterator< T > te::rst::BandIterator< T >::begin ( Band b)
staticinherited

Returns an iterator referring to the first value of the band.

Definition at line 563 of file BandIterator.h.

Referenced by te::rst::BandIteratorWithMask< T >::BandIteratorWithMask().

◆ begin() [2/2]

template<class T >
te::rst::BandIteratorWithMask< T > te::rst::BandIteratorWithMask< T >::begin ( Band b,
Raster m 
)
static

Returns an iterator with the mask referring to the first value of the band.

Definition at line 727 of file BandIterator.h.

◆ end() [1/2]

template<class T >
te::rst::BandIterator< T > te::rst::BandIterator< T >::end ( Band b)
staticinherited

Returns an iterator referring to after the end of the iterator.

Definition at line 568 of file BandIterator.h.

References te::rst::Band::getProperty(), te::rst::AbstractBandIterator< T >::m_blky, and te::rst::BandProperty::m_nblocksy.

Referenced by te::rst::BandIteratorWithMask< T >::BandIteratorWithMask().

◆ end() [2/2]

template<class T >
te::rst::BandIteratorWithMask< T > te::rst::BandIteratorWithMask< T >::end ( Band b,
Raster m 
)
static

Returns an iterator with the mask referring to after the end of the iterator.

Definition at line 732 of file BandIterator.h.

References te::rst::Band::getProperty(), te::rst::AbstractBandIterator< T >::m_blky, and te::rst::BandProperty::m_nblocksy.

◆ getColumn()

template<class T >
unsigned int te::rst::AbstractBandIterator< T >::getColumn ( ) const
inherited

Returns the current column in iterator.

Definition at line 383 of file BandIterator.h.

◆ getRow()

template<class T >
unsigned int te::rst::AbstractBandIterator< T >::getRow ( ) const
inherited

Returns the current row in iterator.

Definition at line 378 of file BandIterator.h.

◆ operator!=()

template<class T >
bool te::rst::AbstractBandIterator< T >::operator!= ( const AbstractBandIterator< T > &  rhs) const
inherited

Difference operator.

Parameters
rhsThe right-hand side to compare.
Returns
Returns true if the iterators are at different positions, or false otherwise.

Definition at line 483 of file BandIterator.h.

References te::rst::AbstractBandIterator< T >::m_blky.

◆ operator*() [1/2]

template<class T >
T te::rst::BandIterator< T >::operator* ( )
inherited

Returns the value in current position (column, row) from iterator.

Definition at line 534 of file BandIterator.h.

◆ operator*() [2/2]

template<class T >
const T te::rst::BandIterator< T >::operator* ( ) const
virtualinherited

Returns the value in current position (column, row) from iterator.

Implements te::rst::AbstractBandIterator< T >.

Definition at line 543 of file BandIterator.h.

◆ operator++()

template<class T >
void te::rst::BandIteratorWithMask< T >::operator++ ( )
virtual

Advances to the next position.

Reimplemented from te::rst::AbstractBandIterator< T >.

Definition at line 688 of file BandIterator.h.

References te::rst::AbstractBandIterator< T >::operator++().

Referenced by te::rst::BandIteratorWithMask< T >::BandIteratorWithMask().

◆ operator--()

template<class T >
void te::rst::BandIteratorWithMask< T >::operator-- ( )

Definition at line 702 of file BandIterator.h.

References te::rst::AbstractBandIterator< T >::operator--().

◆ operator=()

template<class T >
te::rst::BandIteratorWithMask< T > & te::rst::BandIteratorWithMask< T >::operator= ( const BandIteratorWithMask< T > &  rhs)

Assignment operator.

Parameters
rhsThe right-hand-side copy used to copy from.
Returns
A reference to this object.

Definition at line 716 of file BandIterator.h.

References te::rst::BandIteratorWithMask< T >::m_currentpixelindex, te::rst::BandIteratorWithMask< T >::m_mask, te::rst::BandIteratorWithMask< T >::m_masksize, and te::rst::BandIterator< T >::operator=().

◆ replaceBlock()

template<class T >
void te::rst::BandIterator< T >::replaceBlock ( )
virtualinherited

Replaces the current bufferized block values.

Implements te::rst::AbstractBandIterator< T >.

Definition at line 577 of file BandIterator.h.

Referenced by te::rst::BandIterator< T >::BandIterator().

◆ reset()

template<class T >
void te::rst::BandIterator< T >::reset ( )
protectedinherited

Reset this instance to a initial state.

Definition at line 583 of file BandIterator.h.

Referenced by te::rst::BandIterator< T >::BandIterator().

Member Data Documentation

◆ m_band

template<class T>
Band* te::rst::BandIterator< T >::m_band
protectedinherited

The band from where to get the values.

Definition at line 200 of file BandIterator.h.

Referenced by te::rst::BandIterator< T >::BandIterator(), and te::rst::BandIterator< T >::operator=().

◆ m_blk

template<class T>
T* te::rst::AbstractBandIterator< T >::m_blk
protectedinherited

Internal block.

Definition at line 130 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_blkh

template<class T>
int te::rst::AbstractBandIterator< T >::m_blkh
protectedinherited

The internal block height.

Definition at line 121 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_blksize

template<class T>
int te::rst::AbstractBandIterator< T >::m_blksize
protectedinherited

The block size of the band.

Definition at line 129 of file BandIterator.h.

Referenced by te::rst::ConstBandIterator< T >::ConstBandIterator(), and te::rst::AbstractBandIterator< T >::operator=().

◆ m_blkw

template<class T>
int te::rst::AbstractBandIterator< T >::m_blkw
protectedinherited

The internal block width.

Definition at line 120 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_blkx

template<class T>
int te::rst::AbstractBandIterator< T >::m_blkx
protectedinherited

The position in X of the current block.

Definition at line 126 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_blky

◆ m_currentpixelindex

template<class T>
unsigned int te::rst::BandIteratorWithMask< T >::m_currentpixelindex
protected

The index of the current pixel location.

Definition at line 324 of file BandIterator.h.

Referenced by te::rst::BandIteratorWithMask< T >::operator=().

◆ m_getBuff

template<class T>
te::rst::GetBufferValueFPtr te::rst::AbstractBandIterator< T >::m_getBuff
protectedinherited

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 131 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_getBuffI

template<class T>
te::rst::GetBufferValueFPtr te::rst::AbstractBandIterator< T >::m_getBuffI
protectedinherited

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 132 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_i

template<class T>
int te::rst::AbstractBandIterator< T >::m_i
protectedinherited

The actual position inside the block.

Definition at line 125 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_lastblksize

template<class T>
int te::rst::AbstractBandIterator< T >::m_lastblksize
protectedinherited

The number of pixels inside the last block.

Definition at line 128 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_mask

template<class T>
boost::dynamic_bitset te::rst::BandIteratorWithMask< T >::m_mask
protected

The internal mask of bits, one bit per pixel.

Definition at line 322 of file BandIterator.h.

Referenced by te::rst::BandIteratorWithMask< T >::BandIteratorWithMask(), and te::rst::BandIteratorWithMask< T >::operator=().

◆ m_masksize

template<class T>
unsigned int te::rst::BandIteratorWithMask< T >::m_masksize
protected

The size of the mask (rows * columns of the mask raster).

Definition at line 323 of file BandIterator.h.

Referenced by te::rst::BandIteratorWithMask< T >::BandIteratorWithMask(), and te::rst::BandIteratorWithMask< T >::operator=().

◆ m_nblocksx

template<class T>
int te::rst::AbstractBandIterator< T >::m_nblocksx
protectedinherited

The number of blocks in X direction.

Definition at line 123 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_nblocksy

template<class T>
int te::rst::AbstractBandIterator< T >::m_nblocksy
protectedinherited

The number of blocks in Y direction.

Definition at line 124 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_npxlsblk

template<class T>
int te::rst::AbstractBandIterator< T >::m_npxlsblk
protectedinherited

The maximum number of pixels inside the block.

Definition at line 122 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_setBuff

template<class T>
te::rst::SetBufferValueFPtr te::rst::AbstractBandIterator< T >::m_setBuff
protectedinherited

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 133 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().

◆ m_setBuffI

template<class T>
te::rst::SetBufferValueFPtr te::rst::AbstractBandIterator< T >::m_setBuffI
protectedinherited

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 134 of file BandIterator.h.

Referenced by te::rst::AbstractBandIterator< T >::operator=().


The documentation for this class was generated from the following file: