#include <tiledbitmaplayer.hh>
|
| const int | depth |
| |
| const int | x |
| |
| const int | y |
| |
| const int | bpp |
| |
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.
◆ Ptr
◆ CompressedTile()
◆ cleanupState()
| void CompressedTile::cleanupState |
( |
| ) |
|
|
private |
Does some internal state maintenance.
Call only while stateData is locked.
Referenced by do_load(), and observerAdded().
◆ close()
Gets called just before the View is destroyed
- Precondition
- Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)
Implements Viewable.
◆ create()
◆ do_load()
◆ 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.
◆ 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().
◆ getState()
◆ 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.
59 boost::mutex::scoped_lock
const lock(
tileData);
70 boost::mutex::scoped_lock
const lock(
tileData);
75 boost::mutex::scoped_lock
const lock(
tileData);
Referenced by initialize().
◆ getViewState()
◆ initialize()
Initializes the tile data
Allocates memory, initializes it to 0, and changes state to TSI_LOADED
95 bool didInitialize =
false;
97 boost::mutex::scoped_lock
const stateLock(
stateData);
98 boost::mutex::scoped_lock
const dataLock(
tileData);
102 s =
data->initialize(0);
104 didInitialize =
true;
◆ notifyObservers()
275 observer->tileLoaded(tile_);
Referenced by do_load().
◆ observerAdded() [1/2]
◆ observerAdded() [2/2]
◆ open()
Gets called just after the View is created
- Precondition
- Should be called from within a Gdk critical section (i.e. between gdk_threads_enter() and gdk_threads_leave() calls)
Implements Viewable.
◆ registerObserver() [1/2]
◆ registerObserver() [2/2]
◆ registerStrongObserver() [1/2]
◆ registerStrongObserver() [2/2]
◆ reportFinished()
| void CompressedTile::reportFinished |
( |
| ) |
|
Report that the tile is completely filled with data
This will be used to notify our observers.
122 observer->tileFinished(me);
126 observer->tileLoaded(t);
◆ bpp
| const int CompressedTile::bpp |
◆ constTile
◆ data
◆ depth
| const int CompressedTile::depth |
◆ provider
Provider of blocks of memory
Referenced by create().
◆ queue
◆ state
◆ stateData
| boost::mutex CompressedTile::stateData |
|
private |
◆ tile
◆ tileData
| boost::mutex CompressedTile::tileData |
|
private |
◆ viewStates
| 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().
The documentation for this class was generated from the following files:
std::map< ViewInterface::WeakPtr, boost::weak_ptr< TileViewState > > viewStates
Definition: tiledbitmaplayer.hh:127
boost::shared_ptr< TileLoadingObserver > Ptr
Definition: tiledbitmaplayer.hh:83
boost::shared_ptr< TileInitialisationObserver > Ptr
Definition: tiledbitmaplayer.hh:52
const int x
Definition: tiledbitmaplayer.hh:112
@ TILE_UNLOADED
Definition: tiledbitmapinterface.hh:35
boost::shared_ptr< Queue > Ptr
Definition: threadpool.hh:82
Tile::WeakPtr tile
Definition: tiledbitmaplayer.hh:118
Scroom::Bookkeeping::Token registerStrongObserver(Observer const &observer)
Definition: observable.hh:213
ConstTile::WeakPtr constTile
Definition: tiledbitmaplayer.hh:119
void cleanupState()
Definition: compressedtile.cc:261
Tile::Ptr getTileSync()
Definition: compressedtile.cc:55
boost::shared_ptr< ConstTile > Ptr
Definition: tile.hh:47
ConstTile::Ptr getConstTileSync()
Definition: compressedtile.cc:44
@ TSI_LOADING_SYNCHRONOUSLY
Definition: tiledbitmaplayer.hh:39
ConstTile::Ptr do_load()
Definition: compressedtile.cc:130
#define require(expr)
Definition: assertions.hh:28
boost::shared_ptr< TileViewState > Ptr
Definition: tileviewstate.hh:27
@ TILE_LOADED
Definition: tiledbitmapinterface.hh:36
static Ptr create()
ThreadPool::Queue.
Definition: threadpoolimpl.cc:377
boost::mutex stateData
Definition: tiledbitmaplayer.hh:122
Scroom::Bookkeeping::Token registerObserver(ObserverWeak const &observer)
Definition: observable.hh:233
const int depth
Definition: tiledbitmaplayer.hh:111
TileState
Definition: tiledbitmapinterface.hh:32
Scroom::MemoryBlobs::PageProvider::Ptr provider
Definition: tiledbitmaplayer.hh:120
@ TILE_OUT_OF_BOUNDS
Definition: tiledbitmapinterface.hh:37
ThreadPool::Ptr CpuBound()
Definition: threadpoolimpl.cc:452
CompressedTile(int depth, int x, int y, int bpp, const Scroom::MemoryBlobs::PageProvider::Ptr &provider, TileStateInternal state)
CompressedTile.
Definition: compressedtile.cc:21
void notifyObservers(const ConstTile::Ptr &tile)
Definition: compressedtile.cc:271
@ TSI_UNINITIALIZED
Definition: tiledbitmaplayer.hh:36
TileStateInternal state
Definition: tiledbitmaplayer.hh:117
boost::shared_ptr< Tile > Ptr
Definition: tile.hh:21
const int bpp
Definition: tiledbitmaplayer.hh:114
boost::shared_ptr< void > Stuff
Definition: stuff.hh:18
Definition: observable.hh:24
@ TSI_OUT_OF_BOUNDS
Definition: tiledbitmaplayer.hh:38
@ TILE_UNINITIALIZED
Definition: tiledbitmapinterface.hh:34
Scroom::MemoryBlobs::Blob::Ptr data
Definition: tiledbitmaplayer.hh:121
boost::shared_ptr< CompressedTile > Ptr
Definition: tiledbitmaplayer.hh:108
#define TILESIZE
Definition: tiledbitmaplayer.hh:28
static Ptr create(const boost::shared_ptr< CompressedTile > &parent)
Definition: tileviewstate.cc:27
boost::mutex tileData
Definition: tiledbitmaplayer.hh:123
@ TSI_LOADING_ASYNCHRONOUSLY
Definition: tiledbitmaplayer.hh:40
const int y
Definition: tiledbitmaplayer.hh:113
@ TSI_NORMAL
Definition: tiledbitmaplayer.hh:37
#define LOAD_PRIO
Definition: local.hh:10
ThreadPool::Queue::WeakPtr queue
Definition: tiledbitmaplayer.hh:125
void create(NewPresentationInterface *interface)
Definition: loader.cc:175