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)
This reverts commit 6cbc1de570.
Setting def value for 'a' makes it impossible to overload
the 'stroke' api with 3 values (needed for introducing dash offset).
These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.
@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;
@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;
@Issue: https://github.com/thorvg/thorvg/issues/1203
this is an additional enhancement of af8c278c5e
Now scene opacity composition is supported.
Also, this implementaion fixes an incorrect scene bounding box computation.
Plus, adding stroking feathering to shape bounding box size.
This implementation supports shape + stroke opacity composition.
Currently, tvg shape provides individual alpha values for filling & stroking
These alpha values are working individually, meaning that if stroking is half translucent,
user can see that translucent stroking is crossed the shape outlines.
Sometimes this result can be expected but user also expects the shape filling is invisible
behind of translucent stroking.
For this reason, Paint provides an additional api opacity()
that applies opacity value to whole paint attributes.
This is a little expensive job, please consider if you can possibly avoid that usage.
See Opacity example.
@Issues: 94
Move the Clear call to the end of drawing those scenarios doesn't need to retain paints resources.
We should show the examples as the best usage.
@Issues: 75
We introduced separate opacity interface to adjust alpha value by paint.
This opacity will affect to whole paint image if paint is a group of paints.
Also, this opacity is to multipy with fill/stroke alpha values.
This means if the opacity is valid, the paint might deal with a composition step,
which is very expensive due to additional rendering step.
One tip is, if you want to toggle on/off for a certian paint,
you can set opacity to 255 or 0.
@API Additions:
Result Paint::opacity(uint8_t o) noexcept;
uint8_t Paint::opacity() const noexcept;
@Examples: examples/Opacity
@Issues: 94