te::mem::TiledBand Class Reference

#include <TiledBand.h>

Inheritance diagram for te::mem::TiledBand:
te::rst::Band

Public Member Functions

BandcallOperator (std::complex< double >(*f)(std::complex< double >, std::complex< double >), Band &rhs)
 It calls a parameter function f to apply in all pixels from two bands, e.g. pixel = f(lhs, rhs);. More...
 
BandcallOperator (std::complex< double >(*f)(std::complex< double >, std::complex< double >), std::complex< double > &cvalue)
 It calls a parameter function f to apply in all pixels from the band, e.g. pixel = f(lhs, rhs);. More...
 
virtual int getBlockSize () const
 It returns the number of bytes ocuppied by a data block. More...
 
virtual std::map< double, unsigned > getHistogramI (unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0, unsigned int b=0) const
 It computes and returns the histogram occurring values (imaginary part) in a window of the band. More...
 
virtual std::map< double, unsigned > getHistogramR (unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0, unsigned int b=0) const
 It computes and returns the histogram occurring values (real part) in a window of the band. More...
 
void getIValue (unsigned int c, unsigned int r, double &value) const
 Returns the imaginary attribute value in a complex band of a cell. More...
 
virtual std::complex< double > getMaxValue (bool readall=false, unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
 It computes and returns the maximum occurring value in a window of the band. More...
 
virtual std::complex< double > getMeanValue (unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
 It computes and returns the mean of the occurring values in a window of the band. More...
 
virtual std::complex< double > getMinValue (bool readall=false, unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
 It computes and returns the minimum occurring value in a window of the band. More...
 
std::complex< double > getOffsetValue () const
 It returns the offset values (real and imaginary) to be applied to the band. More...
 
BandProperty * getProperty ()
 Returns the band property. More...
 
const BandProperty * getProperty () const
 Returns the band property. More...
 
te::rst::RastergetRaster () const
 Returns the associated raster. More...
 
std::complex< double > getScaleValue () const
 It returns the scale values (real and imaginary) to be applied to the band. More...
 
virtual std::complex< double > getStdValue (unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
 It computes and returns the standard deviation of the occurring values in a window of the band. More...
 
void getValue (unsigned int c, unsigned int r, double &value) const
 Returns the cell attribute value. More...
 
virtual void getValue (unsigned int c, unsigned int r, std::complex< double > &value) const
 Returns the imaginary attribute value in a complex band of a cell. More...
 
virtual Bandoperator*= (Band &rhs)
 It returns the band product (pixel by pixel). More...
 
virtual Bandoperator*= (std::complex< double > &cvalue)
 It returns the product of a constant value to all pixels in the band. More...
 
virtual Bandoperator+= (Band &rhs)
 It returns the band sum (pixel by pixel). More...
 
virtual Bandoperator+= (std::complex< double > &cvalue)
 It returns the sum of a constant value to all pixels in the band. More...
 
virtual Bandoperator-= (Band &rhs)
 It returns the band subtraction (pixel by pixel). More...
 
virtual Bandoperator-= (std::complex< double > &cvalue)
 It returns the difference from all pixels in the band to a constant value (pixel - constant). More...
 
virtual Bandoperator/= (Band &rhs)
 It returns the band division (pixel by pixel). More...
 
virtual Bandoperator/= (std::complex< double > &cvalue)
 It returns the division of all pixels in the band by a constant value (pixel / constant). More...
 
TiledBandoperator= (const TiledBand &rhs)
 
void read (int x, int y, void *buffer) const
 It reads a data block to the specified buffer. More...
 
void * read (int x, int y)
 It reads and returns a data block. More...
 
void setIValue (unsigned int c, unsigned int r, const double value)
 Sets the imaginary attribute value in a complex band of a cell. More...
 
void setOffsetValue (const std::complex< double > o)
 Sets the offset values (real and imaginary) to be applied to the band. More...
 
void setRaster (Raster *r)
 
void setScaleValue (const std::complex< double > s)
 Sets the scale values (real and imaginary) to be applied to the band. More...
 
void setValue (unsigned int c, unsigned int r, const double value)
 Sets the cell attribute value. More...
 
virtual void setValue (unsigned int c, unsigned int r, const std::complex< double > &value)
 Sets the imaginary attribute value in a complex band of a cell. More...
 
 TiledBand (Raster *r, te::rst::BandProperty *p, std::size_t idx)
 
 TiledBand (const TiledBand &rhs)
 
void write (int x, int y, void *buffer)
 It writes a data block from the specified buffer. More...
 
 ~TiledBand ()
 

Protected Attributes

std::size_t m_idx
 The band index. More...
 
BandProperty * m_property
 The band information. More...
 

Private Attributes

int m_blkh
 
int m_blksize
 The data block size. More...
 
int m_blkw
 
unsigned char *** m_buff
 A internal block buffer. 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_nblksx
 
int m_nblksy
 
int m_ncols
 Buffered number of cols. More...
 
int m_nrows
 Buffered number of rows. More...
 
Rasterm_raster
 
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

Definition at line 46 of file TiledBand.h.

Constructor & Destructor Documentation

te::mem::TiledBand::TiledBand ( Raster r,
te::rst::BandProperty p,
std::size_t  idx 
)
te::mem::TiledBand::TiledBand ( const TiledBand rhs)
te::mem::TiledBand::~TiledBand ( )

Member Function Documentation

Band& te::rst::Band::callOperator ( std::complex< double >(*)(std::complex< double >, std::complex< double >)  f,
Band rhs 
)
inherited

It calls a parameter function f to apply in all pixels from two bands, e.g. pixel = f(lhs, rhs);.

Parameters
(*f)a function with the signature complex<double>(*f)(complex<double>, complex<double>)
rhsThe rhs band to apply the function.
Returns
The resultant band.
Band& te::rst::Band::callOperator ( std::complex< double >(*)(std::complex< double >, std::complex< double >)  f,
std::complex< double > &  cvalue 
)
inherited

It calls a parameter function f to apply in all pixels from the band, e.g. pixel = f(lhs, rhs);.

Parameters
(*f)a function with the signature complex<double>(*f)(complex<double>, complex<double>)
cvalueThe constant value that will work with the generic function.
Returns
The resultant band.
virtual int te::rst::Band::getBlockSize ( ) const
virtualinherited

It returns the number of bytes ocuppied by a data block.

Reimplemented in te::mem::Band.

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

virtual std::map<double, unsigned> te::rst::Band::getHistogramI ( unsigned int  rs = 0,
unsigned int  cs = 0,
unsigned int  rf = 0,
unsigned int  cf = 0,
unsigned int  b = 0 
) const
virtualinherited

It computes and returns the histogram occurring values (imaginary part) in a window of the band.

Parameters
rsThe starting row.
csThe starting column.
rfThe final row.
cfThe final column.
bThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
Note
This method without parameters will compute for the entire raster band.
Warning
The caller is responsible for providing correct values for the range [rs, cs x rf, cf].
Returns
The histogram of the occurring values (imaginary part) in the window.
virtual std::map<double, unsigned> te::rst::Band::getHistogramR ( unsigned int  rs = 0,
unsigned int  cs = 0,
unsigned int  rf = 0,
unsigned int  cf = 0,
unsigned int  b = 0 
) const
virtualinherited

It computes and returns the histogram occurring values (real part) in a window of the band.

Parameters
rsThe starting row.
csThe starting column.
rfThe final row.
cfThe final column.
bThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
Note
This method without parameters will compute for the entire raster band.
Warning
The caller is responsible for providing correct values for the range [rs, cs x rf, cf].
Returns
The histogram of the occurring values (real part) in the window.
void te::mem::TiledBand::getIValue ( unsigned int  c,
unsigned int  r,
double &  value 
) const
virtual

Returns the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe attribute value to be assigned.
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Implements te::rst::Band.

virtual std::complex<double> te::rst::Band::getMaxValue ( bool  readall = false,
unsigned int  rs = 0,
unsigned int  cs = 0,
unsigned int  rf = 0,
unsigned int  cf = 0 
) const
virtualinherited

It computes and returns the maximum occurring value in a window of the band.

Parameters
readallForce the reading the entire image (can be slow). If false, will read up to 1000 pixels of the image, equally spaced.
rsThe starting row.
csThe starting column.
rfThe final row.
cfThe final column.
Note
This method without parameters will compute for the entire raster band.
Warning
The caller is responsible for providing correct values for the range [rs, cs x rf, cf].
Returns
The maximum occurring value in the window, real and imaginary (if present).
virtual std::complex<double> te::rst::Band::getMeanValue ( unsigned int  rs = 0,
unsigned int  cs = 0,
unsigned int  rf = 0,
unsigned int  cf = 0 
) const
virtualinherited

It computes and returns the mean of the occurring values in a window of the band.

Parameters
rsThe starting row.
csThe starting column.
rfThe final row.
cfThe final column.
Note
This method without parameters will compute for the entire raster band.
Warning
The caller is responsible for providing correct values for the range [rs, cs x rf, cf].
Returns
The mean of the occurring values in the window, real and imaginary (if present).
virtual std::complex<double> te::rst::Band::getMinValue ( bool  readall = false,
unsigned int  rs = 0,
unsigned int  cs = 0,
unsigned int  rf = 0,
unsigned int  cf = 0 
) const
virtualinherited

It computes and returns the minimum occurring value in a window of the band.

Parameters
readallForce the reading the entire image (can be slow). If false, will read up to 1000 pixels of the image, equally spaced.
rsThe starting row.
csThe starting column.
rfThe final row.
cfThe final column.
Note
This method without parameters will compute for the entire image.
Warning
The caller is responsible for providing correct values for the range [rs, cs x rf, cf x b].
Returns
The minimum occurring value in the window, real and imaginary (if present).
std::complex<double> te::rst::Band::getOffsetValue ( ) const
inherited

It returns the offset values (real and imaginary) to be applied to the band.

const BandProperty* te::rst::Band::getProperty ( ) const
inherited

Returns the band property.

te::rst::Raster* te::mem::TiledBand::getRaster ( ) const
virtual

Returns the associated raster.

Implements te::rst::Band.

std::complex<double> te::rst::Band::getScaleValue ( ) const
inherited

It returns the scale values (real and imaginary) to be applied to the band.

virtual std::complex<double> te::rst::Band::getStdValue ( unsigned int  rs = 0,
unsigned int  cs = 0,
unsigned int  rf = 0,
unsigned int  cf = 0 
) const
virtualinherited

It computes and returns the standard deviation of the occurring values in a window of the band.

Parameters
rsThe starting row.
csThe starting column.
rfThe final row.
cfThe final column.
Note
This method without parameters will compute for the entire raster band.
Warning
The caller is responsible for providing correct values for the range [rs, cs x rf, cf].
Returns
The standard deviation of the occurring values in the window, real and imaginary (if present).
void te::mem::TiledBand::getValue ( unsigned int  c,
unsigned int  r,
double &  value 
) const
virtual

Returns the cell attribute value.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueTo return the attribute value.
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Implements te::rst::Band.

virtual void te::rst::Band::getValue ( unsigned int  c,
unsigned int  r,
std::complex< double > &  value 
) const
virtualinherited

Returns the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe complex attribute value to be assigned (real, imaginary).
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Reimplemented in te::gdal::Band.

virtual Band& te::rst::Band::operator*= ( Band rhs)
virtualinherited

It returns the band product (pixel by pixel).

Parameters
rhsThe band to be multiplied, right-hand side.
Note
Both bands must have the same properties, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band product.
virtual Band& te::rst::Band::operator*= ( std::complex< double > &  cvalue)
virtualinherited

It returns the product of a constant value to all pixels in the band.

Parameters
cvalueThe constant value to be multiplied.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band product.
virtual Band& te::rst::Band::operator+= ( Band rhs)
virtualinherited

It returns the band sum (pixel by pixel).

Parameters
rhsThe band to be added, right-hand side.
Note
Both bands must have the same properties, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band sum.
virtual Band& te::rst::Band::operator+= ( std::complex< double > &  cvalue)
virtualinherited

It returns the sum of a constant value to all pixels in the band.

Parameters
cvalueThe constant value to be added.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band sum.
virtual Band& te::rst::Band::operator-= ( Band rhs)
virtualinherited

It returns the band subtraction (pixel by pixel).

Parameters
rhsThe band to be subtracted, right-hand side.
Note
Both bands must have the same properties, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band subtraction.
virtual Band& te::rst::Band::operator-= ( std::complex< double > &  cvalue)
virtualinherited

It returns the difference from all pixels in the band to a constant value (pixel - constant).

Parameters
cvalueThe constant value to be subtracted.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band difference.
virtual Band& te::rst::Band::operator/= ( Band rhs)
virtualinherited

It returns the band division (pixel by pixel).

Parameters
rhsThe band to be divided, right-hand side.
Note
Both bands must have the same properties, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band division.
virtual Band& te::rst::Band::operator/= ( std::complex< double > &  cvalue)
virtualinherited

It returns the division of all pixels in the band by a constant value (pixel / constant).

Parameters
cvalueThe constant value to be divided.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The band division.
TiledBand& te::mem::TiledBand::operator= ( const TiledBand rhs)
void te::mem::TiledBand::read ( int  x,
int  y,
void *  buffer 
) const
virtual

It reads a data block to the specified buffer.

Parameters
xThe block-id in x (or x-offset).
yThe block-id in y (or y-offset).
bufferThe buffer to be used to read from the band.
Note
The upper-left corner is (0, 0).
Warning
The buffer must have been previously allocated and must have enough capacity.

Implements te::rst::Band.

void* te::mem::TiledBand::read ( int  x,
int  y 
)
virtual

It reads and returns a data block.

Parameters
xThe block-id in x (or x-offset).
yThe block-id in y (or y-offset).
Note
The upper-left corner is (0, 0).
Returns
The specified data block.

Implements te::rst::Band.

void te::mem::TiledBand::setIValue ( unsigned int  c,
unsigned int  r,
const double  value 
)
virtual

Sets the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe attribute value to be assigned.
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Implements te::rst::Band.

void te::rst::Band::setOffsetValue ( const std::complex< double >  o)
inherited

Sets the offset values (real and imaginary) to be applied to the band.

Parameters
oThe new offset.
void te::mem::TiledBand::setRaster ( Raster r)
Note
In-Memory driver extended method.
void te::rst::Band::setScaleValue ( const std::complex< double >  s)
inherited

Sets the scale values (real and imaginary) to be applied to the band.

Parameters
sThe new scale.
void te::mem::TiledBand::setValue ( unsigned int  c,
unsigned int  r,
const double  value 
)
virtual

Sets the cell attribute value.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe attribute value to be assigned.
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Implements te::rst::Band.

virtual void te::rst::Band::setValue ( unsigned int  c,
unsigned int  r,
const std::complex< double > &  value 
)
virtualinherited

Sets the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe complex attribute value to be assigned (real, imaginary).
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Reimplemented in te::gdal::Band.

void te::mem::TiledBand::write ( int  x,
int  y,
void *  buffer 
)
virtual

It writes a data block from the specified buffer.

Parameters
xThe block-id in x (or x-offset).
yThe block-id in y (or y-offset).
bufferThe buffer to be used to write to the band.
Note
The upper-left corner is (0, 0).
Warning
The method will copy the same amount of bytes used by the internal band block representation.

Implements te::rst::Band.

Member Data Documentation

int te::mem::TiledBand::m_blkh
private

Definition at line 93 of file TiledBand.h.

int te::mem::TiledBand::m_blksize
private

The data block size.

Definition at line 89 of file TiledBand.h.

int te::mem::TiledBand::m_blkw
private

Definition at line 92 of file TiledBand.h.

unsigned char*** te::mem::TiledBand::m_buff
private

A internal block buffer.

Definition at line 82 of file TiledBand.h.

te::rst::GetBufferValueFPtr te::mem::TiledBand::m_getBuff
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 83 of file TiledBand.h.

te::rst::GetBufferValueFPtr te::mem::TiledBand::m_getBuffI
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 84 of file TiledBand.h.

std::size_t te::rst::Band::m_idx
protectedinherited

The band index.

Definition at line 475 of file Band.h.

int te::mem::TiledBand::m_nblksx
private

Definition at line 90 of file TiledBand.h.

int te::mem::TiledBand::m_nblksy
private

Definition at line 91 of file TiledBand.h.

int te::mem::TiledBand::m_ncols
private

Buffered number of cols.

Definition at line 87 of file TiledBand.h.

int te::mem::TiledBand::m_nrows
private

Buffered number of rows.

Definition at line 88 of file TiledBand.h.

BandProperty* te::rst::Band::m_property
protectedinherited

The band information.

Definition at line 474 of file Band.h.

Raster* te::mem::TiledBand::m_raster
private

Definition at line 81 of file TiledBand.h.

te::rst::SetBufferValueFPtr te::mem::TiledBand::m_setBuff
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 85 of file TiledBand.h.

te::rst::SetBufferValueFPtr te::mem::TiledBand::m_setBuffI
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 86 of file TiledBand.h.


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