TerraLib 4.1
TeDecoderVirtualMemory Class Reference

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

#include <TeDecoderVirtualMemory.h>

Inheritance diagram for TeDecoderVirtualMemory:
TeDecoder TeDecoderDatabase TeGDALDecoder

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.
TeMemoryPageloadBlock (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:
colcolumn number
linpixel line number
bandpixel 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:
colpixel column identifier
linpixel line identifier
valpixel value being inserted
bandpixel band identifier

Implements TeDecoder.

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

Gets the raster block with index identifier.

Parameters:
indexblock index
bufpointer 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:
indexblock index
bufpointer to a raster tile in memory
bsizeblock 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:
colpixel column identifier
linpixel line identifier
valpixel value being retrieved
bandpixel band identifier

Implements TeDecoder.

Reimplemented in TeGDALDecoder.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines