21 #include "../exception.h"
22 #include "../bitmap/abstract_bitmap.h"
23 #include "../geometry.h"
24 #include "../utils/lockable_object.h"
25 #include "../shading/image_shader.h"
109 virtual Layer*
getChild(
float x,
float y,
unsigned int recursionDepth = 0)
const;
132 template<
class LayerType> LayerType&
castTo()
const {
133 return (LayerType&)(*this);
149 Layer*
getChild(
float x,
float y,
unsigned int recursionDepth = 0)
const;
314 Layer*
getLayer(
float x,
float y,
unsigned int recursionDepth = 0)
const;
A very basic class for any image.
2x3 affine mapping containing a 2x2 matrix and a 2D point
Base class for all exceptions.
A GLSL program to process images.
Beatmup object base class
Stores the rendering context: current program, current mapping in the scene space,...
AbstractTask rendering a Scene.
Layer having an image to render.
color4i getModulationColor() const
void setBitmapMapping(const AffineMapping &mapping)
void setBitmap(AbstractBitmap *bitmap)
void setModulationColor(color4i color)
GL::TextureHandler * resolveContent(RenderingContext &context)
const AbstractBitmap * getBitmap() const
void render(RenderingContext &context)
float invAr
inverse aspect ratio of what is rendered (set by SceneRenderer)
AffineMapping & getBitmapMapping()
void configure(RenderingContext &context, GL::TextureHandler *content)
Configures current rendering program to render this layer.
AffineMapping bitmapMapping
bitmap mapping w.r.t. the layer mapping
AbstractBitmap * bitmap
content to display, used if the image source is set to BITMAP
bool testPoint(float x, float y) const
Tests if a given point falls in the layer.
color4i modulation
modulation color
const AffineMapping & getBitmapMapping() const
Layer containing a bitmap and a mask applied to the bitmap when rendering.
void setBackgroundColor(color4i color)
AffineMapping & getMaskMapping()
void setMaskMapping(const AffineMapping &mapping)
color4i bgColor
color to fill mask areas where the bitmap is not present
void configure(RenderingContext &context, GL::TextureHandler *content)
CustomMaskedBitmapLayer(Type type)
color4i getBackgroundColor() const
AffineMapping maskMapping
mask mapping w.r.t. the layer mapping
const AffineMapping & getMaskMapping() const
Abstract scene layer having name, type, geometry and some content to display.
virtual bool testPoint(float x, float y) const
Tests if a given point falls in the layer.
@ MaskedBitmapLayer
layer displaying a bitmap with mask
@ BitmapLayer
layer displaying a bitmap
@ ShapedBitmapLayer
layer displaying a bitmap within a shape
void setVisible(bool visible)
Sets layer visibility.
void setName(const char *name)
void setMapping(const AffineMapping &mapping)
bool isVisible() const
Returns layer visibility flag.
virtual Layer * getChild(float x, float y, unsigned int recursionDepth=0) const
Picks a child layer at given point, if any.
virtual void render(RenderingContext &context)
bool visible
layer visibility
bool phantom
if true, layer is ignored by selection by point
const std::string & getName() const
const AffineMapping & getMapping() const
bool isPhantom() const
Returns true if the layer is ignored when searching a layer by point.
std::string name
layer name
AffineMapping mapping
layer mapping
AffineMapping & getMapping()
void setPhantom(bool phantom)
Makes/unmakes the layer "phantom".
LayerType & castTo() const
Layer(const Layer &)=delete
disabling copying constructor
Bitmap layer using another bitmap as a mask.
bool testPoint(float x, float y) const
Tests if a given point falls in the layer.
void setMask(AbstractBitmap *mask)
AbstractBitmap * mask
mask bitmap
void render(RenderingContext &context)
const AbstractBitmap * getMask() const
std::string getSceneLog(const Scene &scene, const std::string prefix, int recursionLeft=100) const
SceneIntegrityError(const std::string reason, const Scene &scene)
Layer containing an entire scene.
const Beatmup::Scene & scene
SceneLayer(const Beatmup::Scene &scene)
Layer * getChild(float x, float y, unsigned int recursionDepth=0) const
Picks a child layer at given point, if any.
bool testPoint(float x, float y) const
Tests if a given point falls in the layer.
const Beatmup::Scene & getScene() const
Bitmap layer using a custom shader.
ImageShader * getShader() const
void setShader(ImageShader *shader)
void render(RenderingContext &context)
Layer containing a bitmap and a parametric mask (shape)
float getSlopeWidth() const
void setInPixels(bool inPixels)
float getCornerRadius() const
float slopeWidth
thickness of the smoothed line between border and image
bool inPixels
if true, the widths and radius are set in pixels
void setBorderWidth(float borderWidth)
float getBorderWidth() const
void setCornerRadius(float cornerRadius)
void render(RenderingContext &context)
float cornerRadius
border corner radius
float borderWidth
constant border thickness
void setSlopeWidth(float slopeWidth)
bool testPoint(float x, float y) const
Tests if a given point falls in the layer.
An ordered set of layers representing a renderable content.
Type & newLayer(const char *name)
ShadedBitmapLayer & newShadedBitmapLayer()
bool resolveMapping(const Layer &layer, AffineMapping &mapping) const
Computes absolute mapping of a given layer with respect to the scene mapping.
void attachLayer(Layer &layer)
Attaches an existing layer to the scene.
MaskedBitmapLayer & newMaskedBitmapLayer()
Layer * getLayer(const char *name) const
Retrieves a layer by its name or null if not found.
BitmapLayer & newBitmapLayer()
Layer * detachLayer(int index)
Detaches a layer from the scene.
int getLayerCount() const
Returns total number of layers in the scene.
std::vector< Layer * > layers
scene layers
ShapedBitmapLayer & newShapedBitmapLayer()
int getLayerIndex(const Layer &layer) const
Returns layer index in the scene or -1 if not found.
SceneLayer & addScene(const Scene &scene)
Adds a subscene to the current scene.
return(jlong) new Beatmup jlong jstring name
jobject jlong jint jint y
Beatmup::Scene::Layer * layer
return $pool getJavaReference & scene(index)
Beatmup::AffineMapping & mapping