21 #include "../gpu/gpu_task.h"
53 static const unsigned int
A very basic class for any image.
2x3 affine mapping containing a 2x2 matrix and a 2D point
Template of a task using GPU.
Internal low-level GPU control API.
Represents image size in pixels.
Stores the rendering context: current program, current mapping in the scene space,...
AbstractTask rendering a Scene.
AbstractBitmap * getBackgroundImage() const
bool getOutputPixelsFetching() const
Reports whether the output bitmap pixels are automatically offloaded from GPU to CPU memory every tim...
bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
RenderingContext::EventListener * eventListener
void setScene(Scene *scene)
AffineMapping outputCoords
the actual output mapping used during the last rendering
OutputMapping
Scene coordinates to output (screen or bitmap) pixel coordinates mapping.
@ STRETCH
output viewport covers entirely the scene axis span, aspect ratio is not preserved in general
@ FIT_HEIGHT
height is covered entirely, width is resized to keep aspect ratio, point (0.5, 0.5) is mapped to the ...
@ FIT_WIDTH
width is covered entirely, height is resized to keep aspect ratio, point (0.5, 0.5) is mapped to the ...
@ FIT_WIDTH_TO_TOP
width is covered entirely, height is resized to keep aspect ratio, the top borders are aligned
int referenceWidth
value overriding output width for elements that have their size in pixels, in order to render a resol...
void resetOutput()
Removes a bitmap from the renderer output, if any, and switches to on-screen rendering.
void setOutputPixelsFetching(bool fetch)
Specifies whether the output image data is pulled from GPU to CPU memory every time the rendering is ...
void setOutputMapping(const OutputMapping mapping)
Specifies the output mapping specifying how the scene coordinates [0,1]² are mapped to the output (sc...
ImageResolution resolution
last rendered resolution
AbstractBitmap * output
output bitmap
bool processOnGPU(GraphicPipeline &gpu, TaskThread &thread)
Executes the task on GPU.
Scene * scene
content to render
void setRenderingEventListener(RenderingContext::EventListener *eventListener)
bool outputPixelsFetching
if true, the output bitmap data is fetched from GPU to CPU RAM every time the rendering is done
static const unsigned int MAX_RECURSION_LEVEL
void setOutput(AbstractBitmap *bitmap)
Attaches a bitmap to the renderer output.
const Scene * getScene() const
void setBackgroundImage(AbstractBitmap *)
Sets an image to pave the background.
Scene::Layer * pickLayer(float x, float y, bool inPixels) const
Retrieves a scene layer visible at a given point, if any.
OutputMapping outputMapping
specifies how the scene coordinates [0,1] are mapped to the output (screen or bitmap)
void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu)
Instruction called before the task is executed.
void renderLayer(RenderingContext &context, TaskThread &thread, Scene::Layer &layer, const AffineMapping &base, unsigned int recursionLevel=0)
GL::TextureHandler * cameraFrame
last got camera frame; set to NULL before rendering, then asked from outside through eventListener
OutputMapping getOutputMapping() const
Retrieves the output mapping specifying how the scene coordinates [0,1]² are mapped to the output (sc...
int getOutputReferenceWidth() const
bool doRender(GraphicPipeline &gpu, TaskThread &thread)
AbstractBitmap * background
used to pave the screen before rendering
AbstractBitmap * getOutput() const
void setOutputReferenceWidth(int newWidth)
Sets a value overriding output width for elements that have their size in pixels, in order to render ...
Abstract scene layer having name, type, geometry and some content to display.
An ordered set of layers representing a renderable content.
unsigned char ThreadIndex
number of threads / thread index
jobject jlong jint jint y
Beatmup::InternalBitmap * bitmap
Beatmup::Scene::Layer * layer
Beatmup::AffineMapping & mapping