examples are not considered a feature of ThorVG;
hence, they are excluded from the src directory.
This change allows developers to concentrate more effectively
on the core ThorVG sources for practical usages.
Refactor the GlCanvas::target() interface to allow
passing the drawing target ID from the user side.
Previously, it performed the drawing on the currently set FBO target.
Beta API change:
Result GlCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
-> Result GlCanvas::target(int32_t id, uint32_t w, uint32_t h)
This change introduces the CanvasEngine::All type to automatically
initialize the engines available on the current system.
These revisions improve the usability of these APIs.
Addtions:
- enum class CanvasEngine::All
Modifications:
- Result Initializer::init(CanvasEngine engine, uint32_t threads) ->
Result Initializer::init(uint32_t threads, CanvasEngine engine = tvg::CanvasEngine::All)
Basically, this Accessor is a utility to debug the Scene structure,
by traversing the scene-tree by users.
You can search specific nodes to read the property information,
figure out the structure of the scene tree and its size.
We actually don't recommend you to touch the property unless you really
know the each paint's position and role because it's not visible, difficult to
understand its anatomy.
Also, You must underatnd that modifying the nodes of the scene will be going
well with both the art-design structure and the prorgram logic.
In this first version, Accessor only supports for the Picture class.
@example:
auto picture = tvg::Picture::gen();
picture->load("test.svg");
//The callback function from lambda expression.
//This function will be called for every paint nodes of the tree.
auto f = [](const tvg::Paint* paint) -> bool
{
if (paint->identifier() == Shape::identifier()) {
//override properties?
uint8_t r, g, b, a;
paint->fillColor(&r, &g, &b, &a);
paint->fill(r / 2, g / 2, b / 2, a);
}
//You can return false, to stop traversing immediately.
return true;
};
auto accessor = tvg::Accessor::gen();
picture = accessor->access(move(picture), f);
...
@Issue: https://github.com/Samsung/thorvg/issues/693