20 #include "../parallelism.h"
21 #include "../bitmap/abstract_bitmap.h"
22 #include "../shading/image_shader.h"
63 virtual void setup(
bool useGpu);
A very basic class for any image.
Task: an operation that can be executed by multiple threads in parallel.
TaskDeviceRequirement
Specifies which device (CPU and/or GPU) is used to run the task.
Makes sure the bitmap content is accessible within an image processing task.
Base class for image filters processing a given bitmap in a pixelwise fashion.
virtual std::string getGlslDeclarations() const
Provides GLSL declarations used in the GLSL code.
virtual void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu)
Instruction called before the task is executed.
virtual void setInput(AbstractBitmap *input)
virtual TaskDeviceRequirement getUsedDevices() const final
Communicates devices (CPU and/or GPU) the task is run on.
virtual void afterProcessing(ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted)
Instruction called after the task is executed.
virtual void apply(int x, int y, msize nPix, TaskThread &thread)=0
Applies filtering to given pixel data.
AbstractBitmap * getOutput()
AbstractBitmap * inputBitmap
virtual std::string getGlslSourceCode() const =0
Provides GLSL source code of the filter.
virtual bool processOnGPU(GraphicPipeline &gpu, TaskThread &thread) final
Executes the task on GPU.
virtual void setup(bool useGpu)
A callback run every time before the filter is applied to the image.
virtual void setOutput(AbstractBitmap *output)
virtual bool process(TaskThread &thread) final
Executes the task on CPU within a given thread.
ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
AbstractBitmap * outputBitmap
static const std::string GLSL_RGBA_INPUT
AbstractBitmap * getInput()
Internal low-level GPU control API.
A GLSL program to process images.
uint32_t msize
memory size
unsigned char ThreadIndex
number of threads / thread index
jobject jlong jint jint y