|
Scroom
0.14
|
#include <layeroperations.hh>


Public Member Functions | |
| void | initializeCairo (cairo_t *cr) override |
| void | drawState (cairo_t *cr, TileState s, Scroom::Utils::Rectangle< double > viewArea) override |
| Scroom::Utils::Stuff | cacheZoom (const ConstTile::Ptr &tile, int zoom, Scroom::Utils::Stuff &cache) override |
| void | draw (cairo_t *cr, const ConstTile::Ptr &tile, Scroom::Utils::Rectangle< double > tileArea, Scroom::Utils::Rectangle< double > viewArea, int zoom, Scroom::Utils::Stuff cache) override |
Public Member Functions inherited from LayerOperations | |
| virtual int | getBpp ()=0 |
| virtual Scroom::Utils::Stuff | cache (const ConstTile::Ptr &tile) |
| virtual void | reduce (Tile::Ptr target, ConstTile::Ptr source, int x, int y)=0 |
Static Public Member Functions | |
| static void | drawPixelValue (cairo_t *cr, int x, int y, int size, int value) |
| static void | drawPixelValue (cairo_t *cr, int x, int y, int size, int value, Color const &bgColor) |
Additional Inherited Members | |
Public Types inherited from LayerOperations | |
| using | Ptr = boost::shared_ptr< LayerOperations > |
|
overridevirtual |
Cache data for use during later draw() calls.
This function is called for a given tile and zoom level, and then the results are passed to the draw() function. Because draw() is called relatively frequently (i.e. when scrolling), it is recommended to do cpu-intensive work in the cache() and cacheZoom() functions, and then re-use the data to make the draw() faster.
The default implementation returns an empty reference, meaning nothing is cached. As a result, the draw() function will receive an empty reference.
| tile | the Tile for which caching is requested |
| zoom | the requested zoom level |
| cache | the output of cache(const ConstTile::Ptr) |
Reimplemented from LayerOperations.
Reimplemented in Operations1bppClipped.

|
overridevirtual |
Draw the given tileArea into the given viewArea at the requested zoom level
| cr | The canvas on which to draw |
| tile | The tile to take data from |
| tileArea | Area of the tile that needs to be drawn |
| viewArea | Area of the canvas that the tile needs to be drawn in |
| zoom | The 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. |
| cache | Depending 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.
Reimplemented in Operations, Operations8bpp, and Operations1bpp.
Referenced by Operations1bpp::draw(), Operations8bpp::draw(), and Operations::draw().


|
static |
Referenced by Operations1bpp::draw(), Operations8bpp::draw(), and Operations::draw().

|
static |

|
overridevirtual |
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.

|
overridevirtual |
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.