te::mem::Band Class Reference

Band implementation for the In-Memory Raster. More...

#include <Band.h>

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

Public Member Functions

 Band (Raster *r, te::rst::BandProperty *p, std::size_t idx, void *externalBuffer=0)
 
 Band (const Band &rhs)
 
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...
 
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 getHistogramR (const unsigned int rowStart, const unsigned int colStart, const unsigned int finalRow, const unsigned int finalCol, const unsigned int histoBins, const unsigned int sampleStep, std::map< double, unsigned > &histogram) 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...
 
Bandoperator= (const Band &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...
 
void write (int x, int y, void *buffer)
 It writes a data block from the specified buffer. More...
 
 ~Band ()
 Virtual destructor. More...
 

Protected Attributes

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

Private Attributes

int m_blksize
 The data block size. More...
 
unsigned char * m_buff
 A pointer to a 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_ncols
 Buffered number of cols. More...
 
int m_nrows
 Buffered number of rows. More...
 
Rasterm_raster
 
bool m_releaseBuffer
 A flag that indicates if the buffer must be released when the band goes out of scope. 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

Band implementation for the In-Memory Raster.

A tiled band implementation for the In-Memory Raster.

Definition at line 46 of file src/terralib/memory/Band.h.

Constructor & Destructor Documentation

te::mem::Band::Band ( const Band rhs)

Definition at line 77 of file src/terralib/memory/Band.cpp.

References m_blksize, and m_buff.

te::mem::Band::~Band ( )
virtual

Virtual destructor.

Reimplemented from te::rst::Band.

Definition at line 95 of file src/terralib/memory/Band.cpp.

References m_buff, and m_releaseBuffer.

Member Function Documentation

te::rst::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.

Definition at line 585 of file src/terralib/raster/Band.cpp.

References te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::Band::getRaster(), te::rst::Band::getValue(), te::rst::BandProperty::m_blkh, te::rst::BandProperty::m_blkw, te::rst::BandProperty::m_nblocksx, te::rst::BandProperty::m_nblocksy, te::rst::BandProperty::m_noDataValue, te::common::RWAccess, te::rst::Band::setValue(), and te::common::WAccess.

Referenced by te::rst::Band::operator*=(), te::rst::Band::operator+=(), te::rst::Band::operator-=(), and te::rst::Band::operator/=().

te::rst::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.

Definition at line 655 of file src/terralib/raster/Band.cpp.

References te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::Band::getRaster(), te::rst::Band::getValue(), te::rst::BandProperty::m_blkh, te::rst::BandProperty::m_blkw, te::rst::BandProperty::m_nblocksx, te::rst::BandProperty::m_nblocksy, te::rst::BandProperty::m_noDataValue, te::common::RWAccess, te::rst::Band::setValue(), and te::common::WAccess.

int te::mem::Band::getBlockSize ( ) const
virtual

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

Reimplemented from te::rst::Band.

Definition at line 182 of file src/terralib/memory/Band.cpp.

References m_blksize.

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.

Definition at line 481 of file src/terralib/raster/Band.cpp.

References te::rst::Band::getIValue(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), and te::rst::Band::getRaster().

Referenced by te::rst::RasterSummaryManager::get().

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.

Definition at line 270 of file src/terralib/raster/Band.cpp.

Referenced by te::rst::RasterSummaryManager::get().

void te::rst::Band::getHistogramR ( const unsigned int  rowStart,
const unsigned int  colStart,
const unsigned int  finalRow,
const unsigned int  finalCol,
const unsigned int  histoBins,
const unsigned int  sampleStep,
std::map< double, unsigned > &  histogram 
) const
virtualinherited

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

Parameters
rowStartThe starting row.
colStartThe starting column.
finalRowThe final row.
finalColThe final column.
histoBinsThe number of bins (intervals from minimum pixel to maximum). When b = 0, the histogram will be divided according to all pixel values.
sampleStepThe row/column step used when reading pixels (to read all pixels sampleStep=1, to read half of pixels use sampleStep=2 );
histogramThe generated histogram.
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.

Definition at line 277 of file src/terralib/raster/Band.cpp.

References te::dt::DOUBLE_TYPE, te::dt::FLOAT_TYPE, te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getRaster(), te::rst::Band::getValue(), te::rst::BandProperty::m_blkh, te::rst::BandProperty::m_blkw, te::rst::BandProperty::m_nblocksx, te::rst::BandProperty::m_nblocksy, te::rst::BandProperty::m_noDataValue, te::rst::Band::m_property, te::rst::BandProperty::m_type, and pixelValue.

void te::mem::Band::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.

Definition at line 142 of file src/terralib/memory/Band.cpp.

References m_buff, m_getBuffI, and m_ncols.

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

Reimplemented in te::gdal::Band.

Definition at line 144 of file src/terralib/raster/Band.cpp.

References te::rst::PointSetIterator< T >::begin(), te::rst::PointSetIterator< T >::end(), te::rst::PointSetIterator< T >::getColumn(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::GetRandomPointsInRaster(), te::rst::Band::getRaster(), te::rst::PointSetIterator< T >::getRow(), te::rst::Band::getValue(), and te::rst::BandProperty::m_noDataValue.

Referenced by ArithmeticWithRaster(), BOOST_AUTO_TEST_SUITE(), te::rst::RasterSummaryManager::get(), te::gdal::Band::getMaxValue(), Texture(), and te::rst::Raster::toString().

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

Reimplemented in te::gdal::Band.

Definition at line 241 of file src/terralib/raster/Band.cpp.

References te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getRaster(), and te::rst::Band::getValue().

Referenced by te::rst::RasterSummaryManager::get(), te::gdal::Band::getMeanValue(), te::rst::Band::getStdValue(), and te::rst::Raster::toString().

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

Reimplemented in te::gdal::Band.

Definition at line 82 of file src/terralib/raster/Band.cpp.

References te::rst::PointSetIterator< T >::begin(), te::rst::PointSetIterator< T >::end(), te::rst::PointSetIterator< T >::getColumn(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getProperty(), te::rst::GetRandomPointsInRaster(), te::rst::Band::getRaster(), te::rst::PointSetIterator< T >::getRow(), te::rst::Band::getValue(), and te::rst::BandProperty::m_noDataValue.

Referenced by ArithmeticWithRaster(), BOOST_AUTO_TEST_SUITE(), te::rst::RasterSummaryManager::get(), te::gdal::Band::getMinValue(), Texture(), and te::rst::Raster::toString().

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

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

Definition at line 565 of file src/terralib/raster/Band.cpp.

References te::rst::Band::m_property, and te::rst::BandProperty::m_valuesOffset.

Referenced by te::rst::Raster::toString().

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

Returns the band property.

Definition at line 575 of file src/terralib/raster/Band.cpp.

References te::rst::Band::m_property.

Referenced by te::rst::AbstractBandIterator< T >::AbstractBandIterator(), te::mem::ExpansibleRaster::addTopBands(), te::qt::widgets::ColorTransformDialog::applyPreviewHLS2RGB(), te::qt::widgets::ColorTransformDialog::applyPreviewIHS2RGB(), te::qt::widgets::ColorTransformDialog::applyPreviewRGB2HLS(), te::qt::widgets::ColorTransformDialog::applyPreviewRGB2IHS(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), te::rp::Blender::blendIntoRaster1(), te::qt::widgets::ColorTransformDialog::buildMemRaster(), te::qt::widgets::ColorTransformDialog::buildOutputRaster(), te::mem::CachedBand::CachedBand(), te::rp::GeoMosaic::calcBandStatistics(), te::rp::TiePointsMosaic::calcBandStatistics(), te::rp::SequenceMosaic::calcBandStatistics(), te::rst::Band::callOperator(), te::mem::ExpansibleRaster::clone(), te::rp::ConvertHLS2RGB(), te::rp::ConvertIHS2RGB(), te::rp::ConvertRGB2IHS(), te::rst::Copy(), Copy2DiskRaster(), te::rp::Copy2DiskRaster(), te::tools::rastermanager::RasterManager::copyRaster(), te::mem::Raster::create(), te::rst::CreateCopy(), te::rp::Segmenter::createCutOffLinesTiff(), te::rp::SequenceMosaic::createDiskRasterCopy(), te::rp::ClassifierStrategy::createOutputRaster(), te::rp::SequenceMosaic::createRasterDataSet(), te::rst::CropRaster(), te::rp::DecomposeBands(), te::rp::Filter::DilationFilter(), te::qt::widgets::ColorTransformDialog::drawPreview(), te::qt::widgets::RasterNavigatorWidget::drawRaster(), te::map::DrawRaster(), te::mem::ExpansibleRaster::dummyFillAllBlocks(), te::rst::BandIteratorWindow< T >::end(), te::rst::BandIterator< T >::end(), te::rst::ConstBandIterator< T >::end(), te::rst::BandIteratorWithMask< T >::end(), te::rp::Filter::ErosionFilter(), te::rp::ArithmeticOperations::execBinaryOperatorRasterXRaster(), te::rp::ArithmeticOperations::execBinaryOperatorRasterXReal(), te::rp::Contrast::execDecorrelationEnhancement(), te::rp::Contrast::execHistogramEqualizationContrast(), te::rp::Contrast::execLinearContrast(), te::rp::Contrast::execLogContrast(), te::rp::Contrast::execSetMeanAndStdContrast(), te::rp::Contrast::execSquareContrast(), te::rp::Contrast::execSquareRootContrast(), te::rp::ArithmeticOperations::execUnaryOperatorRaster(), te::rp::ArithmeticOperations::execUnaryOperatorReal(), te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEDStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), te::rp::ClassifierMAPStrategy::execute(), te::rp::ClassifierSAMStrategy::execute(), te::rp::PostClassification::execute(), te::rp::GeoMosaic::execute(), te::rp::Register::execute(), te::rp::Filter::execute(), te::rp::TiePointsMosaic::execute(), te::rp::WisperFusion::execute(), te::rp::Skeleton::execute(), te::rp::ArithmeticOperations::execute(), te::rp::SequenceMosaic::execute(), te::rp::MixtureModel::execute(), te::rp::Segmenter::execute(), te::rp::Contrast::execute(), te::rp::CloudDetection::executeCloudDetection(), te::mem::ExpansibleRaster::ExpansibleRaster(), exportRastertoGPKG(), te::rp::ClassifierISOSegStrategy::fillRegionsThreadEntry(), TsExpansibleRaster::fillWithNoDataValues(), te::rst::RasterSummaryManager::get(), te::rst::SynchronizedBandBlocksManager::getBlockPointer(), te::mem::CachedBandBlocksManager::getBlockPointer(), te::map::RasterTransformConfigurer::getChannelSelection(), te::rp::GetCovarianceValue(), te::rp::GetCovarianceValueThread(), te::ws::ogc::wms::WMSLayer::getData(), te::map::GetExtentRaster(), te::rp::RasterAttributes::getGLCM(), te::rst::Band::getMaxValue(), te::rp::GetMeanValue(), te::rp::GetMeanValueThread(), te::mnt::getMinMax(), te::rst::Band::getMinValue(), te::attributefill::RasterToVector::getPixelDistinct(), te::tools::rastermanager::RasterManager::getRasterInfo(), te::rp::IHSFusion::getRGBRange(), te::map::RasterLayer::getSchema(), te::rp::RasterAttributes::getStatisticsFromPolygon(), te::rp::GetStdDevValue(), te::rp::GetStdDevValueThread(), te::attributefill::GetValuesFromBand(), te::rp::RasterAttributes::getValuesFromBand(), te::rp::RasterAttributes::getValuesFromRaster(), te::rst::SynchronizedBandBlocksManager::initialize(), te::mem::CachedBandBlocksManager::initialize(), te::rp::Blender::initialize(), te::rst::Interpolator::initialize(), te::rp::InverseWaveletAtrous(), te::rp::IHSFusion::loadIHSData(), te::rp::PCAFusion::loadRessampledRaster(), te::rp::Filter::MeanFilter(), te::rp::Filter::MedianFilter(), te::rp::Filter::ModeFilter(), te::qt::plugins::terramobile::NormalizeRaster(), te::rp::NormalizeRaster(), te::qt::widgets::ColorMapWidget::onBandSelected(), te::qt::widgets::RasterSymbolizerWidget::onHistogramToolButtonClicked(), te::mem::Raster::open(), te::qt::plugins::pgisRaster::RasterPropertiesInfo::RasterPropertiesInfo(), te::rp::RasterResample(), te::rp::RasterSlicing(), te::rst::RasterSynchronizer::RasterSynchronizer(), te::rp::Contrast::remapBandLevels(), te::rp::RemapValues(), te::rp::RemapValuesThread(), te::rst::Reproject(), te::rp::Filter::RobertsFilter(), te::mnt::TINCalculateGrid::run(), te::attributefill::RasterToVector::run(), te::serialize::xml::Save(), te::rp::IHSFusion::saveIHSData(), te::qt::widgets::LayerPropertiesInfo::setLayerRasterProperties(), te::rp::Filter::SobelFilter(), te::rp::PCAFusion::swapBandByHighResRaster(), te::rst::SynchronizedBand::SynchronizedBand(), te::mem::CachedBandBlocksManager::threadEntry(), te::rst::Raster::toString(), te::rp::Filter::UserDefinedFilter(), and te::rst::Vectorizer::Vectorizer().

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

Returns the band property.

Definition at line 580 of file src/terralib/raster/Band.cpp.

References te::rst::Band::m_property.

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

Returns the associated raster.

Implements te::rst::Band.

Definition at line 101 of file src/terralib/memory/Band.cpp.

References m_raster.

Referenced by Band().

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

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

Definition at line 555 of file src/terralib/raster/Band.cpp.

References te::rst::Band::m_property, and te::rst::BandProperty::m_valuesScale.

Referenced by te::rst::Raster::toString().

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

Reimplemented in te::gdal::Band.

Definition at line 206 of file src/terralib/raster/Band.cpp.

References te::rst::Band::getMeanValue(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Band::getRaster(), and te::rst::Band::getValue().

Referenced by te::rst::RasterSummaryManager::get(), te::gdal::Band::getStdValue(), and te::rst::Raster::toString().

void te::mem::Band::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.

Definition at line 128 of file src/terralib/memory/Band.cpp.

References m_buff, m_getBuff, and m_ncols.

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.

Definition at line 62 of file src/terralib/raster/Band.cpp.

References te::rst::Band::getIValue(), and te::rst::Band::getValue().

te::rst::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.

Definition at line 762 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and times().

te::rst::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.

Definition at line 757 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and times().

te::rst::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.

Definition at line 737 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and plus().

te::rst::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.

Definition at line 742 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and plus().

te::rst::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.

Definition at line 747 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and minus().

te::rst::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.

Definition at line 752 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and minus().

te::rst::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.

Definition at line 767 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and divide().

te::rst::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.

Definition at line 772 of file src/terralib/raster/Band.cpp.

References te::rst::Band::callOperator(), and divide().

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

Definition at line 156 of file src/terralib/memory/Band.cpp.

References m_blksize, and m_buff.

void * te::mem::Band::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.

Definition at line 163 of file src/terralib/memory/Band.cpp.

References m_buff.

void te::mem::Band::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.

Definition at line 149 of file src/terralib/memory/Band.cpp.

References m_buff, m_ncols, and m_setBuffI.

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.

Definition at line 570 of file src/terralib/raster/Band.cpp.

References te::rst::Band::m_property, and te::rst::BandProperty::m_valuesOffset.

void te::mem::Band::setRaster ( Raster r)
Note
In-Memory driver extended method.

Definition at line 177 of file src/terralib/memory/Band.cpp.

References m_raster.

Referenced by te::mem::Raster::Raster().

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.

Definition at line 560 of file src/terralib/raster/Band.cpp.

References te::rst::Band::m_property, and te::rst::BandProperty::m_valuesScale.

void te::mem::Band::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.

Definition at line 135 of file src/terralib/memory/Band.cpp.

References m_buff, m_ncols, and m_setBuff.

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.

Definition at line 75 of file src/terralib/raster/Band.cpp.

References te::rst::Band::setIValue(), and te::rst::Band::setValue().

void te::mem::Band::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.

Definition at line 170 of file src/terralib/memory/Band.cpp.

References m_blksize, and m_buff.

Member Data Documentation

int te::mem::Band::m_blksize
private

The data block size.

Definition at line 94 of file src/terralib/memory/Band.h.

Referenced by Band(), getBlockSize(), operator=(), read(), and write().

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

A pointer to a block buffer.

Definition at line 87 of file src/terralib/memory/Band.h.

Referenced by Band(), getIValue(), getValue(), operator=(), read(), setIValue(), setValue(), write(), and ~Band().

te::rst::GetBufferValueFPtr te::mem::Band::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 88 of file src/terralib/memory/Band.h.

Referenced by Band(), getValue(), and operator=().

te::rst::GetBufferValueFPtr te::mem::Band::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 89 of file src/terralib/memory/Band.h.

Referenced by Band(), getIValue(), and operator=().

int te::mem::Band::m_ncols
private

Buffered number of cols.

Definition at line 92 of file src/terralib/memory/Band.h.

Referenced by Band(), getIValue(), getValue(), operator=(), setIValue(), and setValue().

int te::mem::Band::m_nrows
private

Buffered number of rows.

Definition at line 93 of file src/terralib/memory/Band.h.

Referenced by Band(), and operator=().

Raster* te::mem::Band::m_raster
private

Definition at line 86 of file src/terralib/memory/Band.h.

Referenced by getRaster(), and setRaster().

bool te::mem::Band::m_releaseBuffer
private

A flag that indicates if the buffer must be released when the band goes out of scope.

Definition at line 95 of file src/terralib/memory/Band.h.

Referenced by Band(), and ~Band().

te::rst::SetBufferValueFPtr te::mem::Band::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 90 of file src/terralib/memory/Band.h.

Referenced by Band(), operator=(), and setValue().

te::rst::SetBufferValueFPtr te::mem::Band::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 91 of file src/terralib/memory/Band.h.

Referenced by Band(), operator=(), and setIValue().


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