| TerraLib 4.1

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

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

Classes | Public Member Functions | Protected Member Functions
TeDecoderVirtualMemory Class Reference

Implements a virtual memory strategy to decode raster in blocks. More...

`#include <TeDecoderVirtualMemory.h>`

Inheritance diagram for TeDecoderVirtualMemory:

List of all members.

## Classes

struct | TeBlockIndexMapFunc

## Public Member Functions

| TeDecoderVirtualMemory ()
| Empty constructor.
| TeDecoderVirtualMemory (const TeRasterParams par)
| Constructor from parameters.
virtual | ~TeDecoderVirtualMemory ()
| Destructor.
bool | getElement (int col, int lin, double &val, int band)
| Sets the value of a specific raster pixel.
bool | setElement (int col, int lin, double val, int band)
| Gets an specific element (col, lin, band) of a raster data.
void | init ()
| Initializes the internal structures of the decoder, from its raster parameters structure.
bool | clear ()
| Clears the decoder internal structures.
void | setCacheSize (int size)
| Defines the physical size of the cache.
int | getCacheSize ()
| Returns the physical size of the cache.
void | setCacheNTiles (int n)
| Defines the number of tiles in the cache.
int | getCacheNTiles ()
| Returns the number of tiles in the cache.

## Protected Member Functions

virtual bool | putRasterBlock (const TeBlockIndex &index, void *buf, long bsize)=0
| Saves a raster tile from a virtual memory to permanent storage.
virtual bool | getRasterBlock (const TeBlockIndex &index, void *buf)=0
| Gets the raster block with index identifier.
virtual TeBlockIndex | blockIndex (int col, int lin, int band)
| Codifies the unique identifier of the raster block that contains a certain pixel.
virtual void | blockIndexPos (const TeBlockIndex &index, int &ulCol, int &ulLin, int &band)
| Returns the parameters of a tile from its indexs.
TeMemoryPage * | loadBlock (int col, int lin, int band)
| Retrieve a block of the cache that contains an element.

## Detailed Description

Implements a virtual memory strategy to decode raster in blocks.

## Constructor & Destructor Documentation

TeDecoderVirtualMemory::TeDecoderVirtualMemory | ( |  | ) | `[inline]`

Empty constructor.

TeDecoderVirtualMemory::TeDecoderVirtualMemory | ( | const TeRasterParams | par | ) |

Constructor from parameters.

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

Destructor.

## Member Function Documentation

TeBlockIndex TeDecoderVirtualMemory::blockIndex | ( | int | col,
|  | int | lin,
|  | int | band
| ) |  | `[protected, virtual]`

Codifies the unique identifier of the raster block that contains a certain pixel.

Parameters:

  col | column number
  lin | pixel line number
  band | pixel band

Returns:
  block index

Reimplemented in TeDecoderDatabase.

void TeDecoderVirtualMemory::blockIndexPos | ( | const TeBlockIndex & | index,
|  | int & | ulCol,
|  | int & | ulLin,
|  | int & | band
| ) |  | `[protected, virtual]`

Returns the parameters of a tile from its indexs.

Reimplemented in TeDecoderDatabase.

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

Clears the decoder internal structures.

Implements TeDecoder.

Reimplemented in TeGDALDecoder, and TeDecoderDatabase.

int TeDecoderVirtualMemory::getCacheNTiles | ( |  | ) |

Returns the number of tiles in the cache.

int TeDecoderVirtualMemory::getCacheSize | ( |  | ) |

Returns the physical size of the cache.

bool TeDecoderVirtualMemory::getElement | ( | int | col,
|  | int | lin,
|  | double & | val,
|  | int | band
| ) |  | `[virtual]`

Sets the value of a specific raster pixel.

Parameters:

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

Implements TeDecoder.

virtual bool TeDecoderVirtualMemory::getRasterBlock | ( | const TeBlockIndex & | index,
|  | void * | buf
| ) |  | `[protected, pure virtual]`

Gets the raster block with index identifier.

Parameters:

  index | block index
  buf | pointer to a raster tile in memory

Implemented in TeGDALDecoder, and TeDecoderDatabase.

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

Initializes the internal structures of the decoder, from its raster parameters structure.

Implements TeDecoder.

Reimplemented in TeGDALDecoder, and TeDecoderDatabase.

TeMemoryPage * TeDecoderVirtualMemory::loadBlock | ( | int | col,
|  | int | lin,
|  | int | band
| ) |  | `[protected]`

Retrieve a block of the cache that contains an element.

virtual bool TeDecoderVirtualMemory::putRasterBlock | ( | const TeBlockIndex & | index,
|  | void * | buf,
|  | long | bsize
| ) |  | `[protected, pure virtual]`

Saves a raster tile from a virtual memory to permanent storage.

Parameters:

  index | block index
  buf | pointer to a raster tile in memory
  bsize | block size

Implemented in TeGDALDecoder, and TeDecoderDatabase.

void TeDecoderVirtualMemory::setCacheNTiles | ( | int | n | ) |

Defines the number of tiles in the cache.

void TeDecoderVirtualMemory::setCacheSize | ( | int | size | ) |

Defines the physical size of the cache.

bool TeDecoderVirtualMemory::setElement | ( | int | col,
|  | int | lin,
|  | double | val,
|  | int | band
| ) |  | `[virtual]`

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

Parameters:

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

Implements TeDecoder.

Reimplemented in TeGDALDecoder.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines