20 #include "../gpu/pipeline.h"
31 RuntimeError::check(input.second->getTextureFormat() != GL::TextureHandler::TextureFormat::OES_Ext,
78 shader(nullptr), mainInput(nullptr), output(nullptr)
100 auto sampler =
samplers.find(uniformName);
A very basic class for any image.
void unlock(AbstractBitmap *bitmap)
Drops a lock to the bitmap.
void readLock(GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
Locks content of a bitmap for reading using a specific processing target device.
void writeLock(GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
Locks content of a bitmap for writing using a specific processing target device.
void setInteger(std::string name, int value)
Sets a scalar integer uniform value.
Internal low-level GPU control API.
void bind(GL::TextureHandler &texture, size_t texUnit, const TextureParam param)
A GLSL program to process images.
void process(GraphicPipeline &gpu)
Apply the shader to produce an image.
void prepare(GraphicPipeline &gpu, GL::TextureHandler *input, const TextureParam texParam, AbstractBitmap *output, const AffineMapping &mapping)
Conducts required preparations for blending.
static const std::string INPUT_IMAGE_DECL_TYPE
A virtual input image type defined at shader compile time by ordinary texture or OES texture sampler ...
static const std::string INPUT_IMAGE_ID
Shader variable name referring to the input image.
static void check(const bool condition, const std::string &message)
std::map< std::string, AbstractBitmap * > samplers
void clearSamplers()
Clears all connections of bitmaps to samplers.
void setShader(ImageShader *shader)
void addSampler(AbstractBitmap *bitmap, const std::string uniformName=ImageShader::INPUT_IMAGE_ID)
Connects a bitmap to a shader uniform variable.
void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu)
Instruction called before the task is executed.
bool processOnGPU(GraphicPipeline &gpu, TaskThread &thread)
Executes the task on GPU.
void setOutputBitmap(AbstractBitmap *bitmap)
AbstractBitmap * mainInput
void afterProcessing(ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted)
Instruction called after the task is executed.
bool removeSampler(const std::string uniformName)
Removes a sampler with a uniform variable name.
unsigned char ThreadIndex
number of threads / thread index
@ INTERP_LINEAR
bilinear pixel interpolation
Beatmup::InternalBitmap * bitmap