An OrthoCPUProducer whose tiles can be edited at runtime. More...
#include <EditOrthoCPUProducer.h>
Public Member Functions | |
EditOrthoCPUProducer (ptr< TileCache > cache, const char *name) | |
Creates a new EditOrthoCPUProducer. | |
virtual | ~EditOrthoCPUProducer () |
Deletes this EditOrthoCPUProducer. | |
void | editedTile (int level, int tx, int ty, int *deltaColor) |
Notifies this producer that a tile has been edited. | |
void | updateTiles () |
Updates the residual tiles produced by this producer to take into account all the edited tiles since the last call to this method. | |
void | reset () |
Cancels all editing operations performed on this producer. | |
Protected Member Functions | |
EditOrthoCPUProducer () | |
Creates an uninitialized EditOrthoCPUProducer. | |
virtual void | init (ptr< TileCache > cache, const char *name) |
Initializes this EditOrthoCPUProducer. | |
Private Member Functions | |
int * | getDeltaColor (int level, int n, int tx, int ty, int x, int y) |
Returns the color delta at the given location. | |
Private Attributes | |
bool | empty |
True if there is no file associated with this producer. | |
int | tWidth |
The size of the color residual tiles, including borders. | |
int | tSize |
The size of the color residual tiles, without borders. | |
int | tChannels |
The number of channels of the color residual tiles. | |
TileCache::Tile::Id | curId |
The id of the last color delta tile that was used in getDeltaColor. | |
int * | curDeltaColor |
The last color delta tile that was used in getDeltaColor. | |
map< TileCache::Tile::Id, unsigned char * > | modifiedTiles |
The color residual tiles that have been modified. | |
map< TileCache::Tile::Id, int * > | deltaColors |
The color deltas from which to recompute the color residual tiles. |
An OrthoCPUProducer whose tiles can be edited at runtime.
Intended to be used with an EditOrthoProducer.
proland::EditOrthoCPUProducer::EditOrthoCPUProducer | ( | ptr< TileCache > | cache, | |
const char * | name | |||
) |
Creates a new EditOrthoCPUProducer.
See OrthoCPUProducer.
virtual proland::EditOrthoCPUProducer::~EditOrthoCPUProducer | ( | ) | [virtual] |
Deletes this EditOrthoCPUProducer.
proland::EditOrthoCPUProducer::EditOrthoCPUProducer | ( | ) | [protected] |
Creates an uninitialized EditOrthoCPUProducer.
void proland::EditOrthoCPUProducer::editedTile | ( | int | level, | |
int | tx, | |||
int | ty, | |||
int * | deltaColor | |||
) |
Notifies this producer that a tile has been edited.
level | the level of the edited tile. | |
tx | the logical x coordinate of the edited tile. | |
ty | the logical y coordinate of the edited tile. | |
deltaColor | the difference between the new and the previous color values of the edited tile. Does not include borders. |
int* proland::EditOrthoCPUProducer::getDeltaColor | ( | int | level, | |
int | n, | |||
int | tx, | |||
int | ty, | |||
int | x, | |||
int | y | |||
) | [private] |
Returns the color delta at the given location.
level | a quadtree level. | |
n | the numbers of tiles per row or column in the quadtree at this level (1 << level). | |
tx | a logical tile x coordinate. | |
ty | a logical tile y coordinate. | |
x | a pixel coordinate relatively to the lower left corner of the (level,tx,ty) tile (without borders). Can be outside the tile itself (then the value will be looked up in an adjacent tile). | |
y | a pixel coordinate relatively to the lower left corner of the (level,tx,ty) tile (without borders). Can be outside the tile itself (then the value will be looked up in an adjacent tile). |
virtual void proland::EditOrthoCPUProducer::init | ( | ptr< TileCache > | cache, | |
const char * | name | |||
) | [protected, virtual] |
Initializes this EditOrthoCPUProducer.
See EditOrthoCPUProducer.
void proland::EditOrthoCPUProducer::reset | ( | ) |
Cancels all editing operations performed on this producer.
void proland::EditOrthoCPUProducer::updateTiles | ( | ) |
Updates the residual tiles produced by this producer to take into account all the edited tiles since the last call to this method.
int* proland::EditOrthoCPUProducer::curDeltaColor [private] |
The last color delta tile that was used in getDeltaColor.
Optimization to avoid too many lookups in the deltaColors map.
TileCache::Tile::Id proland::EditOrthoCPUProducer::curId [private] |
The id of the last color delta tile that was used in getDeltaColor.
Optimization to avoid too many lookups in the deltaColors map.
map<TileCache::Tile::Id, int*> proland::EditOrthoCPUProducer::deltaColors [private] |
The color deltas from which to recompute the color residual tiles.
bool proland::EditOrthoCPUProducer::empty [private] |
True if there is no file associated with this producer.
map<TileCache::Tile::Id, unsigned char*> proland::EditOrthoCPUProducer::modifiedTiles [private] |
The color residual tiles that have been modified.
int proland::EditOrthoCPUProducer::tChannels [private] |
The number of channels of the color residual tiles.
int proland::EditOrthoCPUProducer::tSize [private] |
The size of the color residual tiles, without borders.
int proland::EditOrthoCPUProducer::tWidth [private] |
The size of the color residual tiles, including borders.