te::rst::Band Class Referenceabstract

A raster band description. More...

#include <Band.h>

Inheritance diagram for te::rst::Band:
te::gdal::Band te::grib::Band te::idl::IdlBand te::mem::Band te::mem::CachedBand te::mem::ExpansibleBand te::mem::TiledBand te::rst::SynchronizedBand terralib4::Band

Public Member Functions

 Band (BandProperty *p, std::size_t idx)
 Constructor. More...
 
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...
 
virtual void getIValue (unsigned int c, unsigned int r, double &value) const =0
 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...
 
BandPropertygetProperty ()
 Returns the band property. More...
 
const BandPropertygetProperty () const
 Returns the band property. More...
 
virtual RastergetRaster () const =0
 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...
 
virtual void getValue (unsigned int c, unsigned int r, double &value) const =0
 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...
 
virtual Bandoperator= (const Band &rhs)
 Assignment operator. More...
 
virtual void read (int x, int y, void *buffer) const =0
 It reads a data block to the specified buffer. More...
 
virtual void * read (int x, int y)=0
 It reads and returns a data block. More...
 
virtual void setIValue (unsigned int c, unsigned int r, const double value)=0
 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 setScaleValue (const std::complex< double > s)
 Sets the scale values (real and imaginary) to be applied to the band. More...
 
virtual void setValue (unsigned int c, unsigned int r, const double value)=0
 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...
 
virtual void write (int x, int y, void *buffer)=0
 It writes a data block from the specified buffer. More...
 
virtual ~Band ()
 Virtual destructor. More...
 

Protected Member Functions

 Band (const Band &rhs)
 Copy constructor. More...
 

Protected Attributes

std::size_t m_idx
 The band index. More...
 
BandPropertym_property
 The band information. More...
 

Detailed Description

A raster band description.

The raster band describes how to interpret (and use) values that can be associated to each element of a raster, in one given dimension (e.g. a band of multi-hiperspectral remote sensing image). Each instance of this class refers to a particular dimension. This implementation defines a set of information commonly used to describe any raster.

See also
Raster, BandProperty

Definition at line 63 of file Band.h.

Constructor & Destructor Documentation

te::rst::Band::Band ( BandProperty p,
std::size_t  idx 
)

Constructor.

Parameters
pThe band property. The Band will take its ownership.
idxThe band index.
Warning
The class takes the ownership of the passed pointer. Do not pass a null pointer.
virtual te::rst::Band::~Band ( )
virtual

Virtual destructor.

Reimplemented in te::gdal::Band, te::mem::Band, te::grib::Band, and terralib4::Band.

te::rst::Band::Band ( const Band rhs)
protected

Copy constructor.

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

Member Function Documentation

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

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 
)

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
virtual

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
virtual

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
virtual

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.
virtual void te::rst::Band::getIValue ( unsigned int  c,
unsigned int  r,
double &  value 
) const
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::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
virtual

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
virtual

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
virtual

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

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

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

Returns the band property.

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

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
virtual

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).
virtual void te::rst::Band::getValue ( unsigned int  c,
unsigned int  r,
double &  value 
) const
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::Band.

Referenced by te::gdal::Band::getValue().

virtual void te::rst::Band::getValue ( unsigned int  c,
unsigned int  r,
std::complex< 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 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)
virtual

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)
virtual

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)
virtual

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)
virtual

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)
virtual

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)
virtual

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)
virtual

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)
virtual

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.
virtual Band& te::rst::Band::operator= ( const Band rhs)
virtual

Assignment operator.

Parameters
rhsThe right-hand-side copy used to copy from.
Returns
A reference to this object.
virtual void te::rst::Band::read ( int  x,
int  y,
void *  buffer 
) const
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::Band.

virtual void* te::rst::Band::read ( int  x,
int  y 
)
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::Band.

virtual void te::rst::Band::setIValue ( unsigned int  c,
unsigned int  r,
const double  value 
)
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::Band.

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

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

Parameters
oThe new offset.
void te::rst::Band::setScaleValue ( const std::complex< double >  s)

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

Parameters
sThe new scale.
virtual void te::rst::Band::setValue ( unsigned int  c,
unsigned int  r,
const double  value 
)
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::Band.

Referenced by te::gdal::Band::setValue().

virtual void te::rst::Band::setValue ( unsigned int  c,
unsigned int  r,
const std::complex< 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 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.

virtual void te::rst::Band::write ( int  x,
int  y,
void *  buffer 
)
pure 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.

Implemented in te::gdal::Band, te::idl::IdlBand, te::mem::ExpansibleBand, te::mem::CachedBand, te::rst::SynchronizedBand, te::mem::Band, te::grib::Band, te::mem::TiledBand, and terralib4::Band.

Member Data Documentation

std::size_t te::rst::Band::m_idx
protected

The band index.

Definition at line 475 of file Band.h.

BandProperty* te::rst::Band::m_property
protected

The band information.

Definition at line 474 of file Band.h.


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