36 in_t op1, in_t op2, out_t
out,
54 for (
int x = 0;
x <
width; ++
x, op1++, op2++,
out++) {
60 for (
int x = 0;
x <
width; ++
x, op1++, op2++,
out++) {
78 in_t op1, in_t op2, out_t
out,
157 op1(nullptr), op2(nullptr), output(nullptr),
231 lock<ProcessingTarget::CPU>(gpu, {
op1,
op2 }, {
output });
241 #define PROCESS(IN_T, OUT_T) \
242 Kernels::BinaryOpBody<IN_T, OUT_T>::process( \
243 IN_T(*op1), IN_T(*op2), OUT_T(*output), \
244 operation, cropWidth, cropHeight, op1Origin, op2Origin, outputOrigin, thread);
A very basic class for any image.
virtual const PixelFormat getPixelFormat() const =0
Pixel format of the bitmap.
static ThreadIndex validThreadCount(int number)
Valid thread count from a given integer value.
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)
virtual ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
const int MIN_PIXEL_COUNT_PER_THREAD
minimum number of pixels per worker
void setOutput(AbstractBitmap *output)
void setOp2Origin(const IntPoint origin)
void setOperand2(AbstractBitmap *op2)
virtual bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
void unlock(AbstractBitmap *bitmap)
Drops a lock to the bitmap.
static const CustomPoint ZERO
virtual const int getHeight() const =0
Height of the texture in pixels.
virtual const int getWidth() const =0
Width of the texture in pixels.
Internal low-level GPU control API.
A generic to access sub-byte mask bitmap data.
A generic to write mask bitmap data lookup tables for masks values.
Quad float bitmap reader.
Quad float bitmap writer.
static void check(const bool condition, const std::string &message)
Single byte bitmap reader.
Single byte bitmap writer.
Single float bitmap reader.
Single float bitmap writer.
virtual ThreadIndex numThreads() const =0
ThreadIndex currentThread() const
virtual bool isTaskAborted() const =0
Returns true if the task is asked to stop from outside.
Triple byte bitmap reader.
Triple byte bitmap writer.
Triple float bitmap reader.
Triple float bitmap writer.
static void process(in_t op1, in_t op2, out_t out, BitmapBinaryOperation::Operation operation, int width, int height, const IntPoint &op1Origin, const IntPoint &op2Origin, const IntPoint &outOrigin, const TaskThread &tt)
Performs a binary operation on two bitmaps.
static void processAlignedBinaryMask(in_t op1, in_t op2, out_t out, BitmapBinaryOperation::Operation operation, int width, int height, const IntPoint &op1Origin, const IntPoint &op2Origin, const IntPoint &outOrigin, const TaskThread &tt)
Performs a binary operation on two binary masks.
#define BEATMUP_ASSERT_DEBUG(C)
unsigned char ThreadIndex
number of threads / thread index
LookupMaskWriter< 1, MASK_LUT_1_BIT > BinaryMaskWriter
LookupMaskScanner< 1, MASK_LUT_1_BIT > BinaryMaskReader
@ SingleByte
single channel of 8 bits per pixel (like grayscale), unsigned integer values
@ SingleFloat
single channel of 32 bits per pixel (like grayscale), single precision floating point values
@ QuaternaryMask
2 bits per pixel
@ QuadFloat
4 channels of 32 bits per pixel, single precision floating point values,
@ TripleFloat
3 channels of 32 bits per pixel, single precision floating point values
@ QuadByte
4 channels of 8 bits per pixel (like RGBA), unsigned integer values
@ TripleByte
3 channels of 8 bits per pixel (like RGB), unsigned integer values
@ BinaryMask
1 bit per pixel
@ HexMask
4 bits per pixel
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
#define PROCESS(IN_T, OUT_T)
jobject jlong jint jint y
Beatmup::InternalBitmap * bitmap
Beatmup::IntPoint outOrigin(left, top)
jlong jobject jobject jobject op2Origin
return bitmap getHeight()
jlong jobject jobject op1Origin