![]() |
ThorVG v1.0
|
A class to composite children paints. More...
#include <thorvg.h>


Public Member Functions | |
| Result | push (Paint *target, Paint *at=nullptr) noexcept |
| Inserts a paint object to the scene. | |
| const std::list< Paint * > & | paints () const noexcept |
| Returns the list of paints currently held by the Scene. | |
| Result | remove (Paint *paint=nullptr) noexcept |
| Removes a paint object or all paint objects from the scene. | |
| Result | push (SceneEffect effect,...) noexcept |
| Apply a post-processing effect to the scene. | |
| Type | type () const noexcept override |
| Returns the ID value of this class. | |
Public Member Functions inherited from Paint | |
| const Paint * | parent () const noexcept |
| Retrieves the parent paint object. | |
| Result | visible (bool on) noexcept |
| Sets the visibility of the Paint object. | |
| Result | rotate (float degree) noexcept |
| Sets the angle by which the object is rotated. | |
| Result | scale (float factor) noexcept |
| Sets the scale value of the object. | |
| Result | translate (float x, float y) noexcept |
| Sets the values by which the object is moved in a two-dimensional space. | |
| Result | transform (const Matrix &m) noexcept |
| Sets the matrix of the affine transformation for the object. | |
| Matrix & | transform () noexcept |
| Gets the matrix of the affine transformation of the object. | |
| Result | opacity (uint8_t o) noexcept |
| Sets the opacity of the object. | |
| Result | mask (Paint *target, MaskMethod method) noexcept |
| Sets the masking target object and the masking method. | |
| Result | clip (Shape *clipper) noexcept |
| Clip the drawing region of the paint object. | |
| Result | blend (BlendMethod method) noexcept |
| Sets the blending method for the paint object. | |
| Result | bounds (Point *pt4) noexcept |
| Retrieves the object-oriented bounding box (OBB) of the paint object in canvas space. | |
| Result | bounds (float *x, float *y, float *w, float *h) noexcept |
| Retrieves the axis-aligned bounding box (AABB) of the paint object in canvas space. | |
| bool | intersects (int32_t x, int32_t y, int32_t w=1, int32_t h=1) noexcept |
| Checks whether a given region intersects the filled area of the paint. | |
| Paint * | duplicate () const noexcept |
| Duplicates the object. | |
| uint8_t | opacity () const noexcept |
| Gets the opacity value of the object. | |
| MaskMethod | mask (const Paint **target) const noexcept |
| Gets the masking target object and the masking method. | |
| Shape * | clip () const noexcept |
| Get the clipper shape of the paint object. | |
| bool | visible () const noexcept |
| Gets the current visibility status of the Paint object. | |
| uint16_t | ref () noexcept |
| Increment the reference count for the Paint instance. | |
| uint16_t | unref (bool free=true) noexcept |
| Decrement the reference count for the Paint instance. | |
| uint16_t | refCnt () const noexcept |
| Retrieve the current reference count of the Paint instance. | |
Static Public Member Functions | |
| static Scene * | gen () noexcept |
| Creates a new Scene object. | |
Static Public Member Functions inherited from Paint | |
| static void | rel (Paint *paint) noexcept |
| Safely releases a Paint object. | |
Additional Inherited Members | |
Public Attributes inherited from Paint | |
| uint32_t | id = 0 |
| Unique ID of this instance. | |
A class to composite children paints.
As the traditional graphics rendering method, TVG also enables scene-graph mechanism. This feature supports an array function for managing the multiple paints as one group paint.
As a group, the scene can be transformed, made translucent and composited with other target paints, its children will be affected by the scene world.
|
staticnoexcept |
Creates a new Scene object.
This function allocates and returns a new Scene instance. To properly destroy the Scene object, use Paint::rel().
|
noexcept |
Returns the list of paints currently held by the Scene.
This function provides a list of paint nodes, allowing users to access scene-graph information.
Inserts a paint object to the scene.
This function appends a paint object to the scene. If the optional at is provided, the new paint object will be inserted immediately before the specified paint object in the scene. If at is nullptr, the paint object will be added to the end of the scene.
| [in] | target | A pointer to the Paint object to be added into the scene. This parameter must not be nullptr. |
| [in] | at | A pointer to an existing Paint object in the scene before which the new paint object will be added. If nullptr, the new paint object is added to the end of the scene. The default is nullptr. |
paint object is transferred to the scene upon addition.
|
noexcept |
Apply a post-processing effect to the scene.
This function adds a specified effect—such as clearing all effects, applying a Gaussian blur, or adding a drop shadow—to the scene after rendering. Multiple effects can be applied in sequence by calling this function multiple times.
| [in] | effect | The scene effect to apply. Options are defined in the SceneEffect enum. For example, use SceneEffect::GaussianBlur to apply a blur with specific parameters. |
| [in] | ... | Additional variadic parameters required for certain effects (e.g., sigma and direction for GaussianBlur). |
Removes a paint object or all paint objects from the scene.
This function removes a specified paint object from the scene. If no paint object is specified (i.e., the default nullptr is used), the function performs to clear all paints from the scene.
| [in] | paint | A pointer to the Paint object to be removed from the scene. If nullptr, remove all the paints from the scene. |