Introduced the reference counting for the backend engines so that
tvg prevents unpaired engine initialization/termination calls by user mistake.
@Issues: 296
A duplicated picture needs to access internal picture loader data
to get its properties while rasterizing.
But it missed the loader since it's not copied from origin.
Thus, we fix this by sharing the internal loader among the duplications and origin.
@Examples: Duplicate
Description:
Fixed appendArc API for -90 angles. In that case it was drawn in wrong
direction.
@Examples
```cpp
float x = 40.0, y = 40.0;
auto shape1 = tvg::Shape::gen();
//OK
shape1->appendArc(x + 50, y, 25, 0, -91, false);
//NOK
shape1->appendArc(x + 100, y, 25, 0, -90, false);
//OK
shape1->appendArc(x + 150, y, 25, 0, -89, false);
```
If the boundary of scene created through the scenebuilder is larger than the viewbox,
scene(SVG's root) should be clipped to the size of the viewbox.
So, if scene need a clip, add a parent root and add clippath composition to that root.
This reverts commit 74b27c74af.
This patch breaks Stroke example. 1 line drawings...
There is a possibility that less 1 (i.e: 0.5) width axis-aligned line drawings...
So logically "&&" is correct.
The alpha value calculation pulled out outside the inner loop
to reduce the number of unnecessary operations.
Added local variables to reduce the number of costly
multiplications performed in a loop.
This condition(optimization) is not a step suggested by arc implementation.
https://www.w3.org/TR/SVG11/implnote.html#ArcCorrectionOutOfRangeRadii (Step2)
This code is useful if the arc is too small to represent.
However, scaling often occurs in vectors, which can create unnecessary problems.
example path
<path d="M32.41,20.49a.41.41,0,1,1-.41-.42A.41.41,0,0,1,32.41,20.49Z" transform="translate(0)" fill="#020202"/>
There transformation logic was not identical between shape & gradient
gradient transform was applied into center of gradient world,
while shape wasn't. So... we correct gradient transform metric to shape like.
@Issues: 255
Scene could avoid composition if its children is only child (non scene)
This patch bring it conditionally check so as to avoid unnecesary expensive job.
@Issues: 254
* examples: Added resize_cb to Capi example.
resize_cb in capi example is used to verify crash on reize described
in @180 issue.
* examples capi: Fixed file type from dos to unix.
Use the same code style as it is used in other examples.
Description:
Crash was observed in examples when composite object was used.
It was caused because __m256i object was used on non aligned
memory to 32bit. Algorithm in this function was changed to use
unaligned __m256i_u object. Code was also simplified.
If a scene has another scene as a child and
the number of children is 1, the composition of the child does not work.
Therefore, fix that composition works as long as the number of children is not 0.
* sw_engine: adding a gradient as a stroke feature
Similarly as a shape may have a gradient fill so can the stroke.
* Capi: adding APIs for a gradient stroke
Co-authored-by: Hermet Park <hermetpark@gmail.com>