21 #include "../parallelism.h"
22 #include "../geometry.h"
26 class X2UpsamplingNetwork;
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.
Resamples an image to a given resolution.
void setOutput(AbstractBitmap *output)
Sets the output image.
virtual void beforeProcessing(ThreadIndex, ProcessingTarget target, GraphicPipeline *)
Instruction called before the task is executed.
void setInput(AbstractBitmap *input)
Sets the image to process.
AbstractBitmap * output
input and output bitmaps
virtual ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
virtual TaskDeviceRequirement getUsedDevices() const
Communicates devices (CPU and/or GPU) the task is run on.
float getCubicParameter() const
Returns cubic interpolation parameter ("alpha").
BitmapResampler(Context &context)
Creates a resampler.
void setUsingEs31IfAvailable(bool useEs31)
Defines OpenGL ES backend selection policy (2.0 vs 3.1) when applicable.
void setCubicParameter(float alpha)
Sets cubic interpolation parameter ("alpha").
Mode
Resampling mode (algorithm) specification.
@ CONVNET
upsampling x2 using a convolutional neural network
@ NEAREST_NEIGHBOR
zero-order: usual nearest neighbor
@ LINEAR
first order: bilinear interpolation
@ CUBIC
third order: bicubic interpolation
@ BOX
"0.5-order": anti-aliasing box filter; identical to nearest neighbor when upsampling
bool isUsingEs31IfAvailable
if true, uses OpenGL ES 3.1 backend when available instead ES 2.0
IntRectangle getInputRect() const
virtual void afterProcessing(ThreadIndex, GraphicPipeline *, bool)
Instruction called after the task is executed.
virtual bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
void setInputRect(const IntRectangle &rect)
Specifies a rectangular working area in the input bitmap.
Mode getMode() const
Returns currently selected resampling algorithm.
virtual bool processOnGPU(GraphicPipeline &gpu, TaskThread &thread)
Executes the task on GPU.
void setOutputRect(const IntRectangle &rect)
Specifies a rectangular working area in the output bitmap.
IntRectangle getOutputRect() const
AbstractBitmap * getInput()
X2UpsamplingNetwork * convnet
convnet instance
void setMode(Mode mode)
Sets the resampling algorithm to use.
AbstractBitmap * getOutput()
static const float DEFAULT_CUBIC_PARAMETER
Context & context
a context managing intermediate bitmaps
Basic class: task and memory management, any kind of static data.
Internal low-level GPU control API.
Interface of x2 image upsampling using a convolutional neural network on GPU.
unsigned char ThreadIndex
number of threads / thread index
Beatmup::IntRectangle rect(x1, y1, x2, y2)