|
Scroom 0.14-48-ga0fee447
|
#include <layeroperations.hh>


Public Member Functions | |
| Operations (ColormapProvider::Ptr colormapProvider, int bpp) | |
| int | getBpp () override |
| Scroom::Utils::Stuff | cache (const ConstTile::Ptr &tile) override |
| void | reduce (Tile::Ptr target, ConstTile::Ptr source, int x, int y) 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 CommonOperations | |
| 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 |
Static Public Member Functions | |
| static Ptr | create (ColormapProvider::Ptr colormapProvider, int bpp) |
Static Public Member Functions inherited from CommonOperations | |
| 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) |
Protected Attributes | |
| ColormapProvider::Ptr | colormapProvider |
| const unsigned | bpp |
| const unsigned | pixelsPerByte |
| const unsigned | pixelOffset |
| const unsigned | pixelMask |
Additional Inherited Members | |
Public Types inherited from LayerOperations | |
| using | Ptr = std::shared_ptr< LayerOperations > |
| Operations::Operations | ( | ColormapProvider::Ptr | colormapProvider, |
| int | bpp | ||
| ) |
|
overridevirtual |
Cache data for use during later cacheZoom() calls.
This function is called for a given tile, and then the results are passed to the cacheZoom() 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 |
Reimplemented from LayerOperations.
Reimplemented in OperationsColormapped.
Referenced by draw().


|
static |
Referenced by Scroom::TiledBitmap::ColormappedBitmap(), Scroom::TiledBitmap::GreyscaleBitmap(), setupTest2bpp(), setupTest4bpp(), and setupTest8bppColormapped().

|
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() |
Reimplemented from CommonOperations.

|
overridevirtual |
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.
Reimplemented in OperationsColormapped.
|
overridevirtual |
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
| target | Tile that will contain the reduced bitmap |
| source | Tile that is to be reduced |
| x | x-offset (0..7) of the source tile in the target tile |
| y | y-offset (0..7) of the source tile in the target tile |
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.
Reimplemented in OperationsColormapped.

|
protected |
|
protected |
Referenced by cache(), OperationsColormapped::cache(), create(), OperationsColormapped::create(), and draw().
|
protected |
Referenced by OperationsColormapped::cache(), reduce(), and OperationsColormapped::reduce().
|
protected |
Referenced by OperationsColormapped::cache(), reduce(), and OperationsColormapped::reduce().
|
protected |
Referenced by cache(), OperationsColormapped::cache(), draw(), reduce(), and OperationsColormapped::reduce().