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