Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
DummyLayerOperations Class Reference
Inheritance diagram for DummyLayerOperations:
Inheritance graph
Collaboration diagram for DummyLayerOperations:
Collaboration graph

Public Member Functions

int getBpp () override
 
void initializeCairo (cairo_t *) override
 
void draw (cairo_t *, const ConstTile::Ptr &, Scroom::Utils::Rectangle< double >, Scroom::Utils::Rectangle< double >, int, Scroom::Utils::Stuff) override
 
void drawState (cairo_t *, TileState, Scroom::Utils::Rectangle< double >) override
 
void reduce (Tile::Ptr, const ConstTile::Ptr, int, int) override
 
- Public Member Functions inherited from LayerOperations
virtual Scroom::Utils::Stuff cache (const ConstTile::Ptr &)
 
virtual Scroom::Utils::Stuff cacheZoom (const ConstTile::Ptr &, int, Scroom::Utils::Stuff &)
 

Static Public Member Functions

static Ptr create ()
 

Additional Inherited Members

- Public Types inherited from LayerOperations
using Ptr = std::shared_ptr< LayerOperations >
 

Member Function Documentation

◆ create()

static Ptr DummyLayerOperations::create ( )
inlinestatic
18{ return Ptr(new DummyLayerOperations()); }
Definition tiledbitmap-tests.cc:16
std::shared_ptr< LayerOperations > Ptr
Definition tiledbitmapinterface.hh:52

◆ draw()

void DummyLayerOperations::draw ( cairo_t *  cr,
const ConstTile::Ptr tile,
Scroom::Utils::Rectangle< double >  tileArea,
Scroom::Utils::Rectangle< double >  viewArea,
int  zoom,
Scroom::Utils::Stuff  cache 
)
inlineoverridevirtual

Draw the given tileArea into the given viewArea at the requested zoom level

Parameters
crThe canvas on which to draw
tileThe tile to take data from
tileAreaArea of the tile that needs to be drawn
viewAreaArea of the canvas that the tile needs to be drawn in
zoomThe requested zoom level. One pixel of your presentation should have size 2**zoom when drawn. zoom will be negative for all but the first layer.
cacheDepending on whether the cacheZoom() function finished already, this may either be an empty reference, or a reference to the value returned by cacheZoom()

Implements LayerOperations.

30 {
31 }

◆ drawState()

void DummyLayerOperations::drawState ( cairo_t *  cr,
TileState  s,
Scroom::Utils::Rectangle< double >  viewArea 
)
inlineoverridevirtual

Draw the given state into the given viewArea

The associated tile is likely not loaded or not initialized or in whatever other TileState that doesn't allow its contents to be drawn.

Something needs to be drawn in the given viewArea anyway. Implementors might want to just draw an empty rectangle, maybe color-coded to reflect the state of the tile.

Implements LayerOperations.

32{}

◆ getBpp()

int DummyLayerOperations::getBpp ( )
inlineoverridevirtual

Return the number of bits per pixel that the layer will use.

This number will be used to compute the amount of memory required to store one tile

Implements LayerOperations.

20{ return 8; }

◆ initializeCairo()

void DummyLayerOperations::initializeCairo ( cairo_t *  cr)
inlineoverridevirtual

Initialize the canvas for drawing the bitmap

When TiledBitmapInterface::redraw() is called, (a portion of) the Layer needs to be redrawn. TiledBitmap will compute which tiles are involved in the redraw, and call draw() or drawState() for each of them, as appropriate. However, before doing so, it will first call initializeCairo(). You can take this opportunity to set various properties that are needed in all subsequent calls to draw() and drawState(), such as anti-aliasing and line caps.

Implements LayerOperations.

21{}

◆ reduce()

void DummyLayerOperations::reduce ( Tile::Ptr  target,
const ConstTile::Ptr  source,
int  x,
int  y 
)
inlineoverridevirtual

Reduce the source tile by a factor of 8

The target tile will contain data for 8*8 source tiles. Offsets x and y indicate which of those 64 source tiles is currently being processed

Parameters
targetTile that will contain the reduced bitmap
sourceTile that is to be reduced
xx-offset (0..7) of the source tile in the target tile
yy-offset (0..7) of the source tile in the target tile
Note
The target tile belongs to a different layer, and hence possibly has a different bpp than the current one, depending on the LayerSpec given to createTiledBitmap()

Implements LayerOperations.

33{}

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