20 #include "../parallelism.h"
21 #include "../geometry.h"
A very basic class for any image.
Task: an operation that can be executed by multiple threads in parallel.
A binary pixelwise operation on images.
virtual void beforeProcessing(ThreadIndex, ProcessingTarget target, GraphicPipeline *)
Instruction called before the task is executed.
void setOp1Origin(const IntPoint origin)
AbstractBitmap * output
input and output bitmaps
void setCropSize(int width, int height)
void setOperand1(AbstractBitmap *op1)
Operation
Binary operation specification.
@ MULTIPLY
the input images are multiplied
@ ADD
the input images are added
@ NONE
bypass; the output bitmap remains unchanged
virtual void afterProcessing(ThreadIndex, GraphicPipeline *, bool)
Instruction called after the task is executed.
void setOperation(const Operation operation)
void setOutputOrigin(const IntPoint origin)
const IntPoint getOp1Origin() const
int getCropHeight() const
virtual ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
const IntPoint getOp2Origin() const
const int MIN_PIXEL_COUNT_PER_THREAD
minimum number of pixels per worker
void setOutput(AbstractBitmap *output)
void setOp2Origin(const IntPoint origin)
const IntPoint getOutputOrigin() const
void setOperand2(AbstractBitmap *op2)
virtual bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
Makes sure the bitmap content is accessible within an image processing task.
Internal low-level GPU control API.
unsigned char ThreadIndex
number of threads / thread index