27 #include "../common/Translator.h"  
   28 #include "../raster/BandProperty.h" 
   38   : te::rst::
Band(p, idx),
 
   83     m_getBuff(rhs.m_getBuff),
 
   84     m_getBuffI(rhs.m_getBuffI),
 
   85     m_setBuff(rhs.m_setBuff),
 
   86     m_setBuffI(rhs.m_setBuffI),
 
   89     m_blksize(rhs.m_blksize),
 
   90     m_nblksx(rhs.m_nblksx),
 
   91     m_nblksy(rhs.m_nblksy),
 
  112   for(
int i = 0; i < m_nblksy; ++i)
 
  114     for(
int j = 0; j < m_nblksx; ++j)
 
  117       delete [] m_buff[i][j];
 
  140       throw Exception(
TE_TR(
"You can not assign a band to another one with different block size or tile dimesinsions"));
 
  144     for(
int i = 0; i < m_nblksy; ++i)
 
  146       m_buff[i] = 
new unsigned char*[m_nblksx];
 
  148       for(
int j = 0; j < m_nblksx; ++j)
 
  150         m_buff[i][j] = 
new unsigned char[m_blksize];
 
  152         memcpy(m_buff[i][j], rhs.
m_buff[i][j], m_blksize);
 
  169   int blkx = c / m_blkw;
 
  171   int blky = r / m_blkh;
 
  173   int pos = c % m_blkw + ((r % m_blkh) * m_blkw);
 
  175   assert(pos < m_blksize);
 
  177   m_getBuff(pos, m_buff[blky][blkx], &value);
 
  182   int blkx = c / m_blkw;
 
  184   int blky = r / m_blkh;
 
  186   int pos = c % m_blkw + ((r % m_blkh) * m_blkw);
 
  188   assert(pos < m_blksize);
 
  190   m_setBuff(pos, m_buff[blky][blkx], &value);
 
  195   int blkx = c / m_blkw;
 
  197   int blky = r / m_blkh;
 
  199   int pos = c % m_blkw + ((r % m_blkh) * m_blkw);
 
  201   assert(pos < m_blksize);
 
  203   m_getBuffI(pos, m_buff[blky][blkx], &value);
 
  208   int blkx = c / m_blkw;
 
  210   int blky = r / m_blkh;
 
  212   int pos = c % m_blkw + ((r % m_blkh) * m_blkw);
 
  214   assert(pos < m_blksize);
 
  216   m_setBuffI(pos, m_buff[blky][blkx], &value);
 
  221   assert(x < m_nblksx && y < m_nblksy);
 
  223   memcpy(buffer, m_buff[y][x], m_blksize);
 
  228   assert(x < m_nblksx && y < m_nblksy);
 
  235   assert(x < m_nblksx && y < m_nblksy);
 
  237   memcpy(m_buff[y][x], buffer, m_blksize);
 
A raster class for memory. 
 
A raster band description. 
 
A tiled band implementation for the In-Memory Raster. 
 
unsigned int getNumberOfColumns() const 
Returns the raster number of columns. 
 
int m_nblocksx
The number of blocks in x. 
 
virtual Band & operator=(const Band &rhs)
Assignment operator. 
 
void setRaster(Raster *r)
 
int m_nblocksy
The number of blocks in y. 
 
te::rst::Raster * getRaster() const 
Returns the associated raster. 
 
TiledBand(Raster *r, te::rst::BandProperty *p, std::size_t idx)
 
te::rst::GetBufferValueFPtr m_getBuffI
A pointer to a function that helps to extract the imaginary part value from a specific buffer data ty...
 
void setIValue(unsigned int c, unsigned int r, const double value)
Sets the imaginary attribute value in a complex band of a cell. 
 
#define TE_TR(message)
It marks a string in order to get translated. 
 
An exception class for the TerraLib In-Memory Data Access driver. 
 
unsigned char *** m_buff
A internal block buffer. 
 
int m_ncols
Buffered number of cols. 
 
void write(int x, int y, void *buffer)
It writes a data block from the specified buffer. 
 
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...
 
An abstract class for raster data strucutures. 
 
unsigned int getNumberOfRows() const 
Returns the raster number of rows. 
 
int m_blkw
Block width (pixels). 
 
int m_nrows
Buffered number of rows. 
 
A raster class for memory. 
 
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 getValue(unsigned int c, unsigned int r, double &value) const 
Returns the cell attribute value. 
 
Band implementation for the In-Memory Raster. 
 
void setValue(unsigned int c, unsigned int r, const double value)
Sets the cell attribute value. 
 
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 getType() const 
It returns the data type of the elements in the band. 
 
void read(int x, int y, void *buffer) const 
It reads a data block to the specified buffer. 
 
int m_blkh
Block height (pixels). 
 
TiledBand & operator=(const TiledBand &rhs)
 
int m_blksize
The data block size. 
 
virtual int getBlockSize() const 
It returns the number of bytes ocuppied by a data block. 
 
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...
 
BandProperty * m_property
The band information. 
 
void getIValue(unsigned int c, unsigned int r, double &value) const 
Returns the imaginary attribute value in a complex band of a cell.