| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
TeDecoderSmartMem Class Reference

Implements a decoder to a raster stored as a as a mulitdimensional matrix in memory (and disk when necessary). More...

`#include <TeDecoderSmartMem.h>`

Inheritance diagram for TeDecoderSmartMem:

List of all members.

## Public Member Functions

| TeDecoderSmartMem ()
| Empty constructor.
| TeDecoderSmartMem (const TeRasterParams &par)
| Constructor from parameters.
virtual | ~TeDecoderSmartMem ()
| Destructor.
bool | setElement (int col, int lin, double val, int band=0)
| Sets the value of a specific raster element.
bool | getElement (int col, int lin, double &val, int band=0)
| Gets an specific element (col, lin, band) of a raster data.
template<typename ValueType >
void | setValue (const int &col, const int &lin, const ValueType &val, const int &band)
| Optmized method to set an element value.
template<typename ValueType >
void | getValue (const int &col, const int &lin, ValueType &val, const int &band) const
| Optmized method to get an element value.
void * | getScanLine (const int &lin, const int &band)
| Provides direct access to each line.
virtual void | init ()
| Initializes the internal structures of the decoder.
virtual bool | clear ()
| Clears its internal structures.

## Protected Types

typedef void(TeDecoderSmartMem::* | GetEleFunctPtrT )(const int &col, const int &lin, double &val, const int &band)
| Type definition for the getElement function pointer.
typedef void(TeDecoderSmartMem::* | SetEleFunctPtrT )(const int &col, const int &lin, const double &val, const int &band)
| Type definition for the setElement function pointer.

## Protected Member Functions

void | initVars ()
| Set all internal variables to their initial values.
void | updateFuncPtrVectors ()
| Update the function pointers vectors using the current raster parameters.
void | dummyFill ()
| Fill data with dummy values.
void | setElement_TeBIT (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeUNSIGNEDCHAR (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeCHAR (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeUNSIGNEDSHORT (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeSHORT (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeINTEGER (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeUNSIGNEDLONG (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeLONG (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeFLOAT (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | setElement_TeDOUBLE (const int &col, const int &lin, const double &val, const int &band)
| Method overload.
void | getElement_TeBIT (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeUNSIGNEDCHAR (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeCHAR (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeUNSIGNEDSHORT (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeSHORT (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeINTEGER (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeUNSIGNEDLONG (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeLONG (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeFLOAT (const int &col, const int &lin, double &val, const int &band)
| Method overload.
void | getElement_TeDOUBLE (const int &col, const int &lin, double &val, const int &band)
| Method overload.

## Protected Attributes

TeRasterMemManager | man_manager_
| Internal memory manager instance.
GetEleFunctPtrT * | getelement_ptrs_vec_
| A vector of pointers to the current getElement method following the current data bype of each band (indexed by the band index).
SetEleFunctPtrT * | setelement_ptrs_vec_
| A vector of pointers to the current setElement method following the current data bype of each band (indexed by the band index).

## Detailed Description

Implements a decoder to a raster stored as a as a mulitdimensional matrix in memory (and disk when necessary).

Note:
  This decoder accepts the following optional parameters from TeRasterParams::decoderParams_
  - Name:"TeDecoderSmartMem_MaxMemPercentUsage" Type:unsigned char Description: The maximum amount of RAM memory to use when necessary - valid range: [0,100] - Suggested default:40 See TeRasterMemManager for reference.
  No interleaving support.

## Member Typedef Documentation

typedef void(TeDecoderSmartMem::* TeDecoderSmartMem::GetEleFunctPtrT)(const int &col, const int &lin, double &val, const int &band)`[protected]`

Type definition for the getElement function pointer.

Parameters:

  line | Line.
  col | Column.
  band | Band.
  val | Pixel value.

typedef void(TeDecoderSmartMem::* TeDecoderSmartMem::SetEleFunctPtrT)(const int &col, const int &lin, const double &val, const int &band)`[protected]`

Type definition for the setElement function pointer.

Parameters:

  line | Line.
  col | Column.
  band | Band.
  val | Pixel value.

## Constructor & Destructor Documentation

TeDecoderSmartMem::TeDecoderSmartMem | ( |  | ) |

Empty constructor.

TeDecoderSmartMem::TeDecoderSmartMem | ( | const TeRasterParams & | par | ) |

Constructor from parameters.

TeDecoderSmartMem::~TeDecoderSmartMem | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

bool TeDecoderSmartMem::clear | ( |  | ) | `[virtual]`

Clears its internal structures.

Implements TeDecoder.

Reimplemented in TeDecoderSPR.

void TeDecoderSmartMem::dummyFill | ( |  | ) | `[protected]`

Fill data with dummy values.

bool TeDecoderSmartMem::getElement | ( | int | col,
|  | int | lin,
|  | double & | val,
|  | int | band = `0`
| ) |  | `[inline, virtual]`

Gets an specific element (col, lin, band) of a raster data.

Parameters:

  col | element column identifier
  lin | element line identifier
  val | element value being retrieved
  band | element band identifier

Implements TeDecoder.

void TeDecoderSmartMem::getElement_TeBIT | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeCHAR | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeDOUBLE | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeFLOAT | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  line | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeINTEGER | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeLONG | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeSHORT | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeUNSIGNEDCHAR | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeUNSIGNEDLONG | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::getElement_TeUNSIGNEDSHORT | ( | const int & | col,
|  | const int & | lin,
|  | double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void* TeDecoderSmartMem::getScanLine | ( | const int & | lin,
|  | const int & | band
| ) |  | `[inline]`

Provides direct access to each line.

Parameters:

  lin | Line.
  band | Band.

Returns:
  A pointer the the required line.

Note:
  Use this method only if the target band data type is known otherwise memory corruption may occur.
  Further accesses to this class instance invalidates the pointer.

template<typename ValueType >

void TeDecoderSmartMem::getValue | ( | const int & | col,
|  | const int & | lin,
|  | ValueType & | val,
|  | const int & | band
| ) |  | const`[inline]`

Optmized method to get an element value.

Note:
  Use this method only if the used ValueType matches the target band data type otherwise memory corruption may occur.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::init | ( |  | ) | `[virtual]`

Initializes the internal structures of the decoder.

Implements TeDecoder.

Reimplemented in TeDecoderPAM, and TeDecoderSPR.

void TeDecoderSmartMem::initVars | ( |  | ) | `[protected]`

Set all internal variables to their initial values.

bool TeDecoderSmartMem::setElement | ( | int | col,
|  | int | lin,
|  | double | val,
|  | int | band = `0`
| ) |  | `[inline, virtual]`

Sets the value of a specific raster element.

Parameters:

  col | element column identifier
  lin | element line identifier
  val | element value being inserted
  band | element band identifier

Implements TeDecoder.

Reimplemented in TeDecoderSPR.

void TeDecoderSmartMem::setElement_TeBIT | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeCHAR | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeDOUBLE | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeFLOAT | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeINTEGER | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeLONG | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeSHORT | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeUNSIGNEDCHAR | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeUNSIGNEDLONG | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::setElement_TeUNSIGNEDSHORT | ( | const int & | col,
|  | const int & | lin,
|  | const double & | val,
|  | const int & | band
| ) |  | `[inline, protected]`

Method overload.

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

template<typename ValueType >

void TeDecoderSmartMem::setValue | ( | const int & | col,
|  | const int & | lin,
|  | const ValueType & | val,
|  | const int & | band
| ) |  | `[inline]`

Optmized method to set an element value.

Note:
  Use this method only if the used ValueType matches the target band data type otherwise memory corruption may occur..

Parameters:

  lin | Line.
  col | Column.
  band | Band.
  val | Pixel value.

void TeDecoderSmartMem::updateFuncPtrVectors | ( |  | ) | `[protected]`

Update the function pointers vectors using the current raster parameters.

## Member Data Documentation

GetEleFunctPtrT* TeDecoderSmartMem::getelement_ptrs_vec_`[protected]`

A vector of pointers to the current getElement method following the current data bype of each band (indexed by the band index).

TeRasterMemManager TeDecoderSmartMem::man_manager_`[mutable, protected]`

Internal memory manager instance.

SetEleFunctPtrT* TeDecoderSmartMem::setelement_ptrs_vec_`[protected]`

A vector of pointers to the current setElement method following the current data bype of each band (indexed by the band index).

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeDecoderSmartMem.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeDecoderSmartMem.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines