| TerraLib 4.1

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

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

Public Member Functions | Protected Member Functions
TeDecoderDatabase Class Reference

A concrete class to manipulate raster data stored in a TerraLib database. More...

`#include <TeDecoderDatabase.h>`

Inheritance diagram for TeDecoderDatabase:

List of all members.

## Public Member Functions

| TeDecoderDatabase ()
| Empty constructor.
| TeDecoderDatabase (const TeRasterParams &par)
| Constructor from parameters.
| ~TeDecoderDatabase ()
| Destructor.
void | setDB (TeDatabase *db)
| Sets the database pointer associated to this decoder.
virtual void | init ()
| Initializes the decoder.
virtual bool | create ()
| Creates the decoder.
virtual bool | clear ()
| Clears the decoder.
bool | getRasterBlock (const string &index, void *buf)
| Gets the raster block with index identifier.
bool | putRasterBlock (const string &index, void *buf, long bsize)
| Saves a raster tile from a virtual memory to permanent storage.
string | codifyId (int col, int lin, int band, int res, int subb)
| Codifiy the index for the block that contains an element.
void | decodifyId (const string &id, int &col, int &lin, int &band, int &res, int &subb)
| Decodify the parameters of the block that has an index.
bool | saveLUTTable ()
| Saves the lut table of the raster associated to this decoder.
int | bestResolution (TeBox &bb, int ncols, int nlines, TeProjection *proj)
| Search for tiles of image that intersects a certain bounding box in a given resolution.
bool | selectBlocks (TeBox &bb, int resFac, TeRasterParams &parBlock)
| Select the stored raster blocks with a certain resolution to fill a given bounding box.
bool | selectBlocks (TeBox &bb, int resFac, TeRasterParams &parBlock, const std::string &blockId)
| Select the stored raster blocks with a certain resolution to fill a given bounding box.
bool | getSelectedRasterBlock (TeDecoderMemory *memDec)
| Gets current raster block an outputs it in a memory decoder.
void | clearBlockSelection ()
| Clears selected blocks portal.
int | numberOfSelectedBlocks ()
| Returns the number of selectd raster blocks.
virtual void | blockIndexPos (const TeBlockIndex &index, int &ulCol, int &ulLin, int &band)
| Decodifies the position of a block within the raster from its index.

## Protected Member Functions

virtual TeBlockIndex | blockIndex (int col, int lin, int band)
| Codifies the unique identifier of the raster block that contains a certain pixel.
virtual string | codifyId (const TeBlockIndex &idx, int res=1, int subb=0)
bool | getRasterBlock (const TeBlockIndex &index, void *buf)
| Gets the raster block with index identifier.
bool | putRasterBlock (const TeBlockIndex &index, void *buf, long bsize)
| Saves a raster tile from a virtual memory to permanent storage.

## Detailed Description

A concrete class to manipulate raster data stored in a TerraLib database.

## Constructor & Destructor Documentation

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

Empty constructor.

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

Constructor from parameters.

TeDecoderDatabase::~TeDecoderDatabase | ( |  | ) |

Destructor.

## Member Function Documentation

int TeDecoderDatabase::bestResolution | ( | TeBox & | bb,
|  | int | ncols,
|  | int | nlines,
|  | TeProjection * | proj
| ) |  | `[virtual]`

Search for tiles of image that intersects a certain bounding box in a given resolution.

Reimplemented from TeDecoder.

TeBlockIndex TeDecoderDatabase::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 from TeDecoderVirtualMemory.

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

Decodifies the position of a block within the raster from its index.

Reimplemented from TeDecoderVirtualMemory.

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

Clears the decoder.

Reimplemented from TeDecoderVirtualMemory.

void TeDecoderDatabase::clearBlockSelection | ( |  | ) | `[virtual]`

Clears selected blocks portal.

Reimplemented from TeDecoder.

string TeDecoderDatabase::codifyId | ( | const TeBlockIndex & | idx,
|  | int | res = `1`,
|  | int | subb = `0`
| ) |  | `[protected, virtual]`

string TeDecoderDatabase::codifyId | ( | int | col,
|  | int | lin,
|  | int | band,
|  | int | res,
|  | int | subb
| ) |  |

Codifiy the index for the block that contains an element.

bool TeDecoderDatabase::create | ( |  | ) | `[virtual]`

Creates the decoder.

void TeDecoderDatabase::decodifyId | ( | const string & | id,
|  | int & | col,
|  | int & | lin,
|  | int & | band,
|  | int & | res,
|  | int & | subb
| ) |  |

Decodify the parameters of the block that has an index.

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

Gets the raster block with index identifier.

Parameters:

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

Implements TeDecoderVirtualMemory.

bool TeDecoderDatabase::getRasterBlock | ( | const string & | index,
|  | void * | buf
| ) |  |

Gets the raster block with index identifier.

Parameters:

  index | tile unique identifier
  buf | pointer to a raster tile in memory

bool TeDecoderDatabase::getSelectedRasterBlock | ( | TeDecoderMemory * | memDec | ) | `[virtual]`

Gets current raster block an outputs it in a memory decoder.

Reimplemented from TeDecoder.

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

Initializes the decoder.

Reimplemented from TeDecoderVirtualMemory.

int TeDecoderDatabase::numberOfSelectedBlocks | ( |  | ) | `[inline, virtual]`

Returns the number of selectd raster blocks.

Reimplemented from TeDecoder.

bool TeDecoderDatabase::putRasterBlock | ( | const string & | index,
|  | void * | buf,
|  | long | bsize
| ) |  |

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

Parameters:

  index | tile unique identifier
  buf | pointer to a raster tile in memory
  bsize | size of the block in bytes

bool TeDecoderDatabase::putRasterBlock | ( | const TeBlockIndex & | index,
|  | void * | buf,
|  | long | bsize
| ) |  | `[protected, 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

Implements TeDecoderVirtualMemory.

bool TeDecoderDatabase::saveLUTTable | ( |  | ) |

Saves the lut table of the raster associated to this decoder.

bool TeDecoderDatabase::selectBlocks | ( | TeBox & | bb,
|  | int | resFac,
|  | TeRasterParams & | parBlock
| ) |  | `[virtual]`

Select the stored raster blocks with a certain resolution to fill a given bounding box.

Reimplemented from TeDecoder.

bool TeDecoderDatabase::selectBlocks | ( | TeBox & | bb,
|  | int | resFac,
|  | TeRasterParams & | parBlock,
|  | const std::string & | blockId
| ) |  |

Select the stored raster blocks with a certain resolution to fill a given bounding box.

void TeDecoderDatabase::setDB | ( | TeDatabase * | db | ) | `[inline]`

Sets the database pointer associated to this decoder.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines