A TileProducer to load any kind of texture tile from disk to CPU memory. More...
#include <OrthoCPUProducer.h>
Public Member Functions | |
OrthoCPUProducer (ptr< TileCache > cache, const char *name) | |
Creates a new OrthoCPUProducer. | |
virtual | ~OrthoCPUProducer () |
Deletes this OrthoCPUProducer. | |
bool | isCompressed () |
Returns true if the produced tiles are compressed in DXT format. | |
Protected Member Functions | |
OrthoCPUProducer () | |
Creates an uninitialized OrthoCPUProducer. | |
virtual void | init (ptr< TileCache > cache, const char *name) |
Initializes this OrthoCPUProducer. | |
Private Member Functions | |
int | getTileId (int level, int tx, int ty) |
Returns the id of the given tile. | |
Private Attributes | |
string | name |
The name of the file containing the residual tiles to load. | |
int | channels |
The number of components per pixel in the tiles to load. | |
int | tileSize |
The size of the tiles to load, without borders. | |
int | border |
The size in pixels of the border around each tile. | |
int | maxLevel |
The maximum level of the stored tiles on disk (inclusive). | |
bool | dxt |
true if the produced tiles are compressed in DXT format. | |
int | header |
Offset of the first stored tile on disk. | |
long long * | offsets |
The offsets of each tile on disk, relatively to offset, for each tile id (see getTileId). | |
void * | mutex |
A mutex used to serializes accesses to the file storing the tiles. | |
FILE * | tileFile |
The file storing the tiles on disk. | |
Static Private Attributes | |
static void * | key |
A key to store thread specific buffers used to produce the tiles. |
A TileProducer to load any kind of texture tile from disk to CPU memory.
See Ortho CPU producer.
proland::OrthoCPUProducer::OrthoCPUProducer | ( | ptr< TileCache > | cache, | |
const char * | name | |||
) |
Creates a new OrthoCPUProducer.
cache | the cache to store the produced tiles. The underlying storage must be a CPUTileStorage of unsigned char type. The size of tiles in this storage size must be equal to the size of the tiles stored on disk, borders included. | |
name | the name of the file containing the tiles to load. |
virtual proland::OrthoCPUProducer::~OrthoCPUProducer | ( | ) | [virtual] |
Deletes this OrthoCPUProducer.
proland::OrthoCPUProducer::OrthoCPUProducer | ( | ) | [protected] |
Creates an uninitialized OrthoCPUProducer.
int proland::OrthoCPUProducer::getTileId | ( | int | level, | |
int | tx, | |||
int | ty | |||
) | [private] |
Returns the id of the given tile.
This id is used to find the offset the tile data on disk, using offsets.
level | the level of the tile. | |
tx | the logical x coordinate of the tile. | |
ty | the logical y coordinate of the tile. |
virtual void proland::OrthoCPUProducer::init | ( | ptr< TileCache > | cache, | |
const char * | name | |||
) | [protected, virtual] |
Initializes this OrthoCPUProducer.
cache | the cache to store the produced tiles. The underlying storage must be a CPUTileStorage of unsigned char type. The size of tiles in this storage size must be equal to the size of the tiles stored on disk, borders included. | |
name | the name of the file containing the tiles to load. |
bool proland::OrthoCPUProducer::isCompressed | ( | ) |
Returns true if the produced tiles are compressed in DXT format.
int proland::OrthoCPUProducer::border [private] |
The size in pixels of the border around each tile.
A tile contains (tileSize+4)*(tileSize+4)*channels samples.
int proland::OrthoCPUProducer::channels [private] |
The number of components per pixel in the tiles to load.
bool proland::OrthoCPUProducer::dxt [private] |
true if the produced tiles are compressed in DXT format.
int proland::OrthoCPUProducer::header [private] |
Offset of the first stored tile on disk.
The offsets indicated in the tile offsets array offsets are relative to this offset.
void* proland::OrthoCPUProducer::key [static, private] |
A key to store thread specific buffers used to produce the tiles.
int proland::OrthoCPUProducer::maxLevel [private] |
The maximum level of the stored tiles on disk (inclusive).
void* proland::OrthoCPUProducer::mutex [private] |
A mutex used to serializes accesses to the file storing the tiles.
string proland::OrthoCPUProducer::name [private] |
The name of the file containing the residual tiles to load.
long long* proland::OrthoCPUProducer::offsets [private] |
The offsets of each tile on disk, relatively to offset, for each tile id (see getTileId).
FILE* proland::OrthoCPUProducer::tileFile [private] |
The file storing the tiles on disk.
int proland::OrthoCPUProducer::tileSize [private] |
The size of the tiles to load, without borders.
A tile contains (tileSize+4)*(tileSize+4)*channels samples.