ThorVG
v0.1
|
A module managing the multiple paints as one group paint. More...
![]() |
Functions | |
TVG_EXPORT Tvg_Paint * | tvg_scene_new () |
Creates a new scene object. More... | |
TVG_EXPORT Tvg_Result | tvg_scene_reserve (Tvg_Paint *scene, uint32_t size) |
Sets the size of the container, where all the paints pushed into the scene are stored. More... | |
TVG_EXPORT Tvg_Result | tvg_scene_push (Tvg_Paint *scene, Tvg_Paint *paint) |
Passes drawing elements to the scene using Tvg_Paint objects. More... | |
TVG_EXPORT Tvg_Result | tvg_scene_clear (Tvg_Paint *scene) |
Sets the total number of the paints pushed into the scene to be zero. (BETA version) More... | |
A module managing the multiple paints as one group paint.
As a group, scene can be transformed, translucent, composited with other target paints, its children will be affected by the scene world.
TVG_EXPORT Tvg_Result tvg_scene_clear | ( | Tvg_Paint * | scene | ) |
Sets the total number of the paints pushed into the scene to be zero. (BETA version)
TVG_EXPORT Tvg_Paint* tvg_scene_new | ( | ) |
Creates a new scene object.
A scene object is used to group many paints into one object, which can be manipulated using TVG APIs.
TVG_EXPORT Tvg_Result tvg_scene_push | ( | Tvg_Paint * | scene, |
Tvg_Paint * | paint | ||
) |
Passes drawing elements to the scene using Tvg_Paint objects.
Only the paints pushed into the scene will be drawing targets. If you know the number of pushed objects in the advance, please call tvg_scene_reserve().
[in] | scene | A Tvg_Paint pointer to the scene object. |
[in] | paint | A graphical object to be drawn. |
TVG_RESULT_SUCCESS | Succeed. |
TVG_RESULT_INVALID_ARGUMENT | An invalid pointer to the scene . |
TVG_RESULT_MEMORY_CORRUPTION | An invalid pointer to the paint . |
TVG_RESULT_INSUFFICIENT_CONDITION | An internal error. |
TVG_EXPORT Tvg_Result tvg_scene_reserve | ( | Tvg_Paint * | scene, |
uint32_t | size | ||
) |
Sets the size of the container, where all the paints pushed into the scene are stored.
If the number of objects pushed into the scene is known in advance, calling the function prevents multiple memory reallocation, thus improving the performance.
[in] | scene | A Tvg_Paint pointer to the scene object. |
[in] | size | The number of objects for which the memory is to be reserved. |
TVG_RESULT_SUCCESS | Succeed. |
TVG_RESULT_INVALID_ARGUMENT | An invalid Tvg_Paint pointer. |