Beatmup
|
Loads a bitmap content from chunk. More...
#include <bitmap_from_chunk.h>
Public Member Functions | |
BitmapFromChunk () | |
BitmapFromChunk (AbstractBitmap &bitmap, ChunkCollection &collection, const std::string &chunkId) | |
void | setBitmap (AbstractBitmap *bitmap) |
void | setCollection (ChunkCollection *collection) |
void | setChunkId (const std::string &chunkId) |
Public Member Functions inherited from Beatmup::AbstractTask | |
virtual bool | processOnGPU (GraphicPipeline &gpu, TaskThread &thread) |
Executes the task on GPU. More... | |
virtual TaskDeviceRequirement | getUsedDevices () const |
Communicates devices (CPU and/or GPU) the task is run on. More... | |
virtual ThreadIndex | getMaxThreads () const |
Gives the upper limint on the number of threads the task may be performed by. More... | |
Public Member Functions inherited from Beatmup::Object | |
virtual | ~Object () |
Public Member Functions inherited from Beatmup::BitmapContentLock | |
BitmapContentLock () | |
~BitmapContentLock () | |
void | readLock (GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target) |
Locks content of a bitmap for reading using a specific processing target device. More... | |
void | writeLock (GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target) |
Locks content of a bitmap for writing using a specific processing target device. More... | |
void | unlock (AbstractBitmap *bitmap) |
Drops a lock to the bitmap. More... | |
void | unlockAll () |
Unlocks all the locked bitmaps unconditionally. More... | |
template<const ProcessingTarget target> | |
void | lock (GraphicPipeline *gpu, AbstractBitmap *input, AbstractBitmap *output) |
void | lock (GraphicPipeline *gpu, ProcessingTarget target, AbstractBitmap *input, AbstractBitmap *output) |
template<const ProcessingTarget target> | |
void | lock (GraphicPipeline *gpu, std::initializer_list< AbstractBitmap * > read, std::initializer_list< AbstractBitmap * > write) |
template<typename ... Args> | |
void | unlock (AbstractBitmap *first, Args ... others) |
Static Public Member Functions | |
static void | load (AbstractBitmap &bitmap, ChunkCollection &collection, const std::string &chunkId) |
Loads a bitmap content from a given collection and chunk. More... | |
Static Public Member Functions inherited from Beatmup::AbstractTask | |
static ThreadIndex | validThreadCount (int number) |
Valid thread count from a given integer value. More... | |
Private Member Functions | |
virtual bool | process (TaskThread &thread) |
Executes the task on CPU within a given thread. More... | |
virtual void | beforeProcessing (ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu) |
Instruction called before the task is executed. More... | |
virtual void | afterProcessing (ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted) |
Instruction called after the task is executed. More... | |
Private Attributes | |
AbstractBitmap * | bitmap |
ChunkCollection * | collection |
std::string | chunkId |
Additional Inherited Members | |
Public Types inherited from Beatmup::AbstractTask | |
enum class | TaskDeviceRequirement { CPU_ONLY , GPU_OR_CPU , GPU_ONLY } |
Specifies which device (CPU and/or GPU) is used to run the task. More... | |
Loads a bitmap content from chunk.
The bitmap needs to be created in advance. The loaded chunk contains pixel data in binary form.
Definition at line 31 of file bitmap_from_chunk.h.
|
inline |
Definition at line 40 of file bitmap_from_chunk.h.
|
inline |
Definition at line 41 of file bitmap_from_chunk.h.
|
privatevirtual |
Executes the task on CPU within a given thread.
Generally called by multiple threads.
thread | associated task execution context |
true
if the execution is finished correctly, false
otherwise Implements Beatmup::AbstractTask.
Definition at line 23 of file bitmap_from_chunk.cpp.
|
privatevirtual |
Instruction called before the task is executed.
threadCount | Number of threads used to perform the task |
target | Device used to perform the task |
gpu | A graphic pipeline instance; may be null. |
Reimplemented from Beatmup::AbstractTask.
Definition at line 29 of file bitmap_from_chunk.cpp.
|
privatevirtual |
Instruction called after the task is executed.
threadCount | Number of threads used to perform the task |
gpu | GPU to be used to execute the task; may be null. |
aborted | true if the task was aborted |
Reimplemented from Beatmup::AbstractTask.
Definition at line 41 of file bitmap_from_chunk.cpp.
|
inline |
Definition at line 44 of file bitmap_from_chunk.h.
|
inline |
Definition at line 46 of file bitmap_from_chunk.h.
|
inline |
Definition at line 48 of file bitmap_from_chunk.h.
|
static |
Loads a bitmap content from a given collection and chunk.
Launches a task in the main thread pool of the bitmap context.
[in,out] | bitmap | The bitmap to load |
[in,out] | collection | The collection to load from |
[in,out] | chunkId | Chunk ID containing the content to load |
Definition at line 46 of file bitmap_from_chunk.cpp.
|
private |
Definition at line 36 of file bitmap_from_chunk.h.
|
private |
Definition at line 37 of file bitmap_from_chunk.h.
|
private |
Definition at line 38 of file bitmap_from_chunk.h.