Go to the documentation of this file.
26 #ifndef __TERRALIB_RASTER_INTERNAL_BANDITERATOR_H
27 #define __TERRALIB_RASTER_INTERNAL_BANDITERATOR_H
35 #include <boost/dynamic_bitset.hpp>
86 unsigned int getRow()
const;
340 m_npxlsblk = (m_blkw * m_blkh);
352 m_lastblksize = m_npxlsblk - ((m_npxlsblk * m_nblocksx * m_nblocksy) -
357 m_blk =
new T[m_blksize];
380 return m_blky * m_blkh + (m_i - (m_i % m_blkw)) / m_blkw;
385 return m_blkx * m_blkw + m_i % m_blkw;
399 if(m_blkx < m_nblocksx)
410 if(m_blky < m_nblocksy)
413 if((m_blkx == m_nblocksx - 1) && (m_blky == m_nblocksy - 1))
414 m_npxlsblk = m_lastblksize;
424 m_i = m_npxlsblk - 1;
435 m_blkx = m_nblocksx - 1;
485 return (m_blky != rhs.
m_blky);
538 this->m_getBuff(this->m_i, this->m_blk, &value);
540 return static_cast<T
>(value);
547 this->m_getBuff(this->m_i, this->m_blk, &value);
549 return static_cast<T
>(value);
579 m_band->read(this->m_blkx, this->m_blky, this->m_blk);
615 this->m_getBuff(this->m_i, this->m_blk, &value);
617 return static_cast<T
>(value);
645 m_band->read(this->m_blkx, this->m_blky, this->m_blk);
653 m_currentpixelindex(0)
660 m_currentpixelindex(0)
694 m_currentpixelindex++;
696 if (m_currentpixelindex >= m_masksize)
699 while (m_mask[m_currentpixelindex] == 0);
708 m_currentpixelindex--;
710 if (m_currentpixelindex < 0)
713 while (m_mask[m_currentpixelindex] == 0);
744 #endif // __TERRALIB_RASTER_INTERNAL_BANDITERATOR_H
const Band * m_band
The band from where to get the values.
const T operator*() const
Returns the value in current position (column, row) from iterator.
int m_nblocksy
The number of blocks in y.
A raster band description.
bool operator!=(const AbstractBandIterator &rhs) const
Difference operator.
ConstBandIterator & operator=(const ConstBandIterator &rhs)
Assignment operator.
void(* SetBufferValueFPtr)(int index, void *buffer, const double *value)
The type of function used to extract data from a buffer.
Band * m_band
The band from where to get the values.
static BandIteratorWithMask end(Band *b, Raster *m)
Returns an iterator with the mask referring to after the end of the iterator.
An abstract class for raster data strucutures.
te::rst::GetBufferValueFPtr m_getBuffI
A pointer to a function that helps to extract the imaginary part value from a specific buffer data ty...
int m_blkw
The internal block width.
int m_nblocksx
The number of blocks in X direction.
virtual int getBlockSize() const
It returns the number of bytes ocuppied by a data block.
This class implements an iterator to "navigate" over a single band (const).
This class implements an abstract iterator to "navigate" over a single band.
Band implementation for TerraLib 4.x.
int m_nblocksx
The number of blocks in x.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
virtual void replaceBlock()=0
Replaces the current bufferized block values.
unsigned int m_masksize
The size of the mask (rows * columns of the mask raster).
void reset()
Reset this instance to a initial state.
int m_blkx
The position in X of the current block.
void operator--()
Returns to the previous position.
boost::dynamic_bitset m_mask
The internal mask of bits, one bit per pixel.
int getType() const
It returns the data type of the elements in the band.
te::rst::SetBufferValueFPtr m_setBuffI
A pointer to a function that helps to insert the imaginary part value into a specific buffer data typ...
void replaceBlock()
Replaces the current bufferized block values.
int m_blksize
The block size of the band.
static BandIteratorWithMask begin(Band *b, Raster *m)
Returns an iterator with the mask referring to the first value of the band.
static BandIterator begin(Band *b)
Returns an iterator referring to the first value of the band.
ConstBandIterator()
Constructor.
TERASTEREXPORT void SetBlockFunctions(GetBufferValueFPtr *gb, GetBufferValueFPtr *gbi, SetBufferValueFPtr *sb, SetBufferValueFPtr *sbi, int type)
Sets the pointers to functions that helps to extract a double or complex value from a specific buffer...
BandIteratorWithMask()
Constructor.
BandProperty * getProperty()
Returns the band property.
static ConstBandIterator begin(const Band *b)
Returns an iterator referring to the first value of the band.
T operator*()
Returns the value in current position (column, row) from iterator.
BandIterator()
Constructor.
void replaceBlock()
Replaces the current bufferized block values.
te::rst::GetBufferValueFPtr m_getBuff
A pointer to a function that helps to extract a double or complex value from a specific buffer data t...
virtual Raster * getRaster() const =0
Returns the associated raster.
static BandIterator end(Band *b)
Returns an iterator referring to after the end of the iterator.
AbstractBandIterator & operator=(const AbstractBandIterator &rhs)
Assignment operator.
int m_blky
The position in Y of the current block.
virtual ~AbstractBandIterator()
Destructor.
int m_blkh
The internal block height.
unsigned int getRow() const
Returns the current row in iterator.
This class implements an iterator to "navigate" over a single band.
BandIteratorWithMask & operator=(const BandIteratorWithMask &rhs)
Assignment operator.
virtual const T operator*() const =0
Returns the value in current position (column, row) from iterator.
unsigned int m_currentpixelindex
The index of the current pixel location.
int m_blkh
Block height (pixels).
virtual void operator++()
Advances to the next position.
int m_npxlsblk
The maximum number of pixels inside the block.
It describes one band (or dimension) of a raster.
void reset()
Reset this instance to a initial state.
void(* GetBufferValueFPtr)(int index, void *buffer, double *value)
The type of function used to extract data from a buffer.
static ConstBandIterator end(const Band *b)
Returns an iterator referring to after the end of the iterator.
void operator++()
Advances to the next position.
int m_nblocksy
The number of blocks in Y direction.
This class implements an iterator to "navigate" over a single band, with a spatial restriction given ...
BandIterator & operator=(const BandIterator &rhs)
Assignment operator.
int m_i
The actual position inside the block.
int m_blkw
Block width (pixels).
unsigned int getColumn() const
Returns the current column in iterator.
te::rst::SetBufferValueFPtr m_setBuff
A pointer to a function that helps to insert a double or complex value into a specific buffer data ty...
int m_lastblksize
The number of pixels inside the last block.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
Utility functions for dealing with raster data blocks.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
AbstractBandIterator()
Constructor.