proland::EditOrthoCPUProducer Class Reference
[edit]

An OrthoCPUProducer whose tiles can be edited at runtime. More...

#include <EditOrthoCPUProducer.h>

List of all members.

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.

Detailed Description

An OrthoCPUProducer whose tiles can be edited at runtime.

Intended to be used with an EditOrthoProducer.

Authors:
Eric Bruneton, Antoine Begault

Constructor & Destructor Documentation

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.


Member Function Documentation

void proland::EditOrthoCPUProducer::editedTile ( int  level,
int  tx,
int  ty,
int *  deltaColor 
)

Notifies this producer that a tile has been edited.

Parameters:
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.

Parameters:
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]
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.


Member Data Documentation

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.

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.

The number of channels of the color residual tiles.

The size of the color residual tiles, without borders.

The size of the color residual tiles, including borders.


Generated on Sat May 12 09:43:15 2012 for proland by  doxygen 1.6.1