![]() |
TerraLib 4.1
|
Implements a virtual memory strategy to decode raster in blocks. More...
#include <TeDecoderVirtualMemory.h>
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. | |
Implements a virtual memory strategy to decode raster in blocks.
| TeDecoderVirtualMemory::TeDecoderVirtualMemory | ( | ) | [inline] |
Empty constructor.
| TeDecoderVirtualMemory::TeDecoderVirtualMemory | ( | const TeRasterParams | par | ) |
Constructor from parameters.
| TeDecoderVirtualMemory::~TeDecoderVirtualMemory | ( | ) | [virtual] |
Destructor.
| TeBlockIndex TeDecoderVirtualMemory::blockIndex | ( | int | col, |
| int | lin, | ||
| int | band | ||
| ) | [protected, virtual] |
Codifies the unique identifier of the raster block that contains a certain pixel.
| col | column number |
| lin | pixel line number |
| band | pixel band |
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.
| 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.
| 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.
| 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.
| col | pixel column identifier |
| lin | pixel line identifier |
| val | pixel value being retrieved |
| band | pixel band identifier |
Implements TeDecoder.
Reimplemented in TeGDALDecoder.