|
Beatmup
|
A task applying an image shader to a bitmap. More...
#include <shader_applicator.h>
Public Member Functions | |
| ShaderApplicator () | |
| void | addSampler (AbstractBitmap *bitmap, const std::string uniformName=ImageShader::INPUT_IMAGE_ID) |
| Connects a bitmap to a shader uniform variable. More... | |
| bool | removeSampler (const std::string uniformName) |
| Removes a sampler with a uniform variable name. More... | |
| void | clearSamplers () |
| Clears all connections of bitmaps to samplers. More... | |
| void | setOutputBitmap (AbstractBitmap *bitmap) |
| void | setShader (ImageShader *shader) |
| AbstractBitmap * | getOutputBitmap () const |
| ImageShader * | getShader () const |
| const size_t | getSamplersCount () const |
Public Member Functions inherited from Beatmup::Object | |
| virtual | ~Object () |
Private Member Functions | |
| bool | processOnGPU (GraphicPipeline &gpu, TaskThread &thread) |
| Executes the task on GPU. More... | |
| void | beforeProcessing (ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu) |
| Instruction called before the task is executed. More... | |
| void | afterProcessing (ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted) |
| Instruction called after the task is executed. More... | |
Private 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) |
Private Attributes | |
| std::map< std::string, AbstractBitmap * > | samplers |
| ImageShader * | shader |
| AbstractBitmap * | mainInput |
| AbstractBitmap * | output |
| AffineMapping | mapping |
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... | |
Static Public Member Functions inherited from Beatmup::AbstractTask | |
| static ThreadIndex | validThreadCount (int number) |
| Valid thread count from a given integer value. More... | |
A task applying an image shader to a bitmap.
Definition at line 31 of file shader_applicator.h.
| ShaderApplicator::ShaderApplicator | ( | ) |
Definition at line 77 of file shader_applicator.cpp.
|
privatevirtual |
Executes the task on GPU.
| gpu | graphic pipeline instance |
| thread | associated task execution context |
true if the execution is finished correctly, false otherwise Reimplemented from Beatmup::AbstractTask.
Definition at line 25 of file shader_applicator.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 57 of file shader_applicator.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 68 of file shader_applicator.cpp.
| void ShaderApplicator::addSampler | ( | AbstractBitmap * | bitmap, |
| const std::string | uniformName = ImageShader::INPUT_IMAGE_ID |
||
| ) |
Connects a bitmap to a shader uniform variable.
The bitmap connected to ImageShader::INPUT_IMAGE_ID is used to resolve the sampler type (ImageShader::INPUT_IMAGE_DECL_TYPE).
Definition at line 82 of file shader_applicator.cpp.
| bool ShaderApplicator::removeSampler | ( | const std::string | uniformName | ) |
Removes a sampler with a uniform variable name.
| [in] | uniformName | The uniform variable |
Definition at line 90 of file shader_applicator.cpp.
| void ShaderApplicator::clearSamplers | ( | ) |
Clears all connections of bitmaps to samplers.
Definition at line 111 of file shader_applicator.cpp.
| void ShaderApplicator::setOutputBitmap | ( | AbstractBitmap * | bitmap | ) |
Definition at line 117 of file shader_applicator.cpp.
| void ShaderApplicator::setShader | ( | ImageShader * | shader | ) |
Definition at line 122 of file shader_applicator.cpp.
|
inline |
Definition at line 66 of file shader_applicator.h.
|
inline |
Definition at line 67 of file shader_applicator.h.
|
inline |
Definition at line 68 of file shader_applicator.h.
|
private |
Definition at line 33 of file shader_applicator.h.
|
private |
Definition at line 34 of file shader_applicator.h.
|
private |
Definition at line 35 of file shader_applicator.h.
|
private |
Definition at line 35 of file shader_applicator.h.
|
private |
Definition at line 36 of file shader_applicator.h.