|
Scroom 0.14-49-gb7ae7a6d
|
#include <tiledbitmaplayer.hh>


Public Types | |
| using | Ptr = std::shared_ptr< CompressedTile > |
Public Types inherited from Scroom::Utils::Observable< TileInitialisationObserver > | |
| using | Observer = std::shared_ptr< TileInitialisationObserver > |
| using | Ptr = std::shared_ptr< Observable< TileInitialisationObserver > > |
Public Types inherited from Scroom::Utils::Observable< TileLoadingObserver > | |
| using | Observer = std::shared_ptr< TileLoadingObserver > |
| using | Ptr = std::shared_ptr< Observable< TileLoadingObserver > > |
Public Types inherited from Viewable | |
| using | Ptr = std::shared_ptr< Viewable > |
| using | WeakPtr = std::weak_ptr< Viewable > |
Static Public Member Functions | |
| static Ptr | create (int depth, int x, int y, int bpp, const Scroom::MemoryBlobs::PageProvider::Ptr &provider, TileStateInternal state=TSI_UNINITIALIZED) |
Public Attributes | |
| const int | depth |
| const int | x |
| const int | y |
| const int | bpp |
Protected Member Functions | |
| void | observerAdded (TileInitialisationObserver::Ptr const &observer, Scroom::Bookkeeping::Token const &token) override |
| void | observerAdded (TileLoadingObserver::Ptr const &observer, Scroom::Bookkeeping::Token const &token) override |
Protected Member Functions inherited from Scroom::Utils::Observable< TileInitialisationObserver > | |
| std::list< Observer > | getObservers () |
| virtual void | observerAdded (Observer const &observer, Scroom::Bookkeeping::Token const &token) |
Protected Member Functions inherited from Scroom::Utils::Observable< TileLoadingObserver > | |
| std::list< Observer > | getObservers () |
| virtual void | observerAdded (Observer const &observer, Scroom::Bookkeeping::Token const &token) |
Private Member Functions | |
| CompressedTile (int depth, int x, int y, int bpp, const Scroom::MemoryBlobs::PageProvider::Ptr &provider, TileStateInternal state) | |
| CompressedTile. | |
| void | cleanupState () |
| ConstTile::Ptr | do_load () |
| void | notifyObservers (const ConstTile::Ptr &tile) |
Private Attributes | |
| TileStateInternal | state |
| Tile::WeakPtr | tile |
| ConstTile::WeakPtr | constTile |
| Scroom::MemoryBlobs::PageProvider::Ptr | provider |
| Scroom::MemoryBlobs::Blob::Ptr | data |
| boost::mutex | stateData |
| boost::mutex | tileData |
| ThreadPool::Queue::WeakPtr | queue |
| Scroom::Utils::WeakKeyMap< ViewInterface::WeakPtr, std::weak_ptr< TileViewState > > | viewStates |
Internal data structure representing a Tile.
The CompressedTile class contains administrative information about the Tile. The Tile itself (and associated bitmap data) will be loaded and unloaded as needed. This class will stay in memory always.
Observers can receive events related to this tile.
| using CompressedTile::Ptr = std::shared_ptr<CompressedTile> |
|
private |
|
private |
Does some internal state maintenance.
Call only while stateData is locked.
Referenced by do_load(), and observerAdded().

|
overridevirtual |
Gets called just before the View is destroyed
Implements Viewable.
|
static |
Referenced by Layer::Layer().

|
private |
Referenced by getConstTileSync(), observerAdded(), and reportFinished().


| ConstTile::Ptr CompressedTile::getConstTileAsync | ( | ) |
Get a reference to the ConstTile.
If the tile is currently TSI_LOADED, you'll get a reference, otherwise, you'll receive an empty reference.
| ConstTile::Ptr CompressedTile::getConstTileSync | ( | ) |
Get a reference to the Const Tile.
If the tile is currently TSI_NORMAL, it will be loaded, if necessary. If the tile is TSI_UNINITIALIZED, you'll receive an empty reference.
Referenced by getTileSync().


| TileState CompressedTile::getState | ( | ) |
| Tile::Ptr CompressedTile::getTileSync | ( | ) |
Get a reference to the Tile.
If the tile is currently TSI_NORMAL, it will be loaded, if necessary. If the tile is TSI_UNINITIALIZED, you'll receive an empty reference.
Referenced by initialize().


| TileViewState::Ptr CompressedTile::getViewState | ( | const ViewInterface::WeakPtr & | vi | ) |

| Tile::Ptr CompressedTile::initialize | ( | ) |
Initializes the tile data
Allocates memory, initializes it to 0, and changes state to TSI_LOADED

|
private |
|
overrideprotected |
Keep track of new TileInitialisationObserver registrations.
Upon registering an observer, you'll receive the TileInitialisationObserver::tileCreated() event immediately, on your thread. Be careful with your mutexes :-)
|
overrideprotected |
Keep track of new TileLoadingObserver registrations.

|
overridevirtual |
|
inline |

|
inline |

|
inline |

|
inline |

| void CompressedTile::reportFinished | ( | ) |
Report that the tile is completely filled with data
This will be used to notify our observers.

| const int CompressedTile::bpp |
Bits per pixel of this tile. Must be a divisor of 8.
Referenced by create(), do_load(), and getTileSync().
|
private |
Reference to the actual Tile
Referenced by do_load(), getConstTileAsync(), getConstTileSync(), and observerAdded().
|
private |
Data associated with the Tile
Referenced by do_load(), getTileSync(), and initialize().
|
private |
Provider of blocks of memory
Referenced by create().
|
private |
Queue on which the load operation is executed
Referenced by cleanupState(), and observerAdded().
|
private |
State of this tile
Referenced by cleanupState(), create(), do_load(), getState(), initialize(), and observerAdded().
|
private |
Mutex protecting the state field
Referenced by do_load(), initialize(), and observerAdded().
|
private |
Reference to the actual Tile
Referenced by create(), getState(), and getTileSync().
|
private |
Mutex protecting the data-related fields
Referenced by do_load(), getTileSync(), and initialize().
|
private |
Referenced by close(), and getViewState().
| const int CompressedTile::x |
x-coordinate of this tile (i.e. number of tiles to the left of this tile)
Referenced by create().
| const int CompressedTile::y |
y-coordinate of this tile (i.e. number of tiles above this tile)
Referenced by create().