Commit graph

13 commits

Author SHA1 Message Date
Hermet Park
1ae92daa9d api: enhance Shape::fill() method usage.
Designate a default value for alpha which is mostly optional.
2023-06-07 12:10:31 +09:00
Hermet Park
f2fdc380b4 fix compiler warnings on MacOS
warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
2023-05-19 10:56:59 +09:00
Hermet Park
9b3c34c3b1 updated copyright. 2023-01-14 13:48:11 +09:00
Hermet Park
f0141e63de updated copyright date. 2022-01-12 14:08:48 +09:00
Hermet Park
19fc4f4b37 examples: allow a desianted main thread capacity.
Maximum threads is not always peak the highest performance,
tvg examples guide user the proper threads count.
2021-03-24 14:19:01 +09:00
Hermet Park
1a7d41ce71 updated copyright 2021-03-23 14:31:58 +09:00
JunsuChoi
55978d1bf4 examples Opacity: Add close method 2020-12-14 17:22:41 +09:00
Hermet Park
924490a7a5 sw_engine renderer: code refactoring.
Unify Shape+Stroke composition with CompositeCtx which is added for Scene Composition

This fixes clipping issue as well.

@Issues: 164
2020-12-09 12:54:13 +09:00
Hermet Park
77e8a195b4
sw_engine renderer: support scene opacity composition
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.
2020-12-07 15:45:44 +09:00
Hermet Park
af8c278c5e sw_engine raster: support opacity composition.
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
2020-12-03 13:07:17 +09:00
Hermet Park
e445b7f579 Revert "examples: revise example code."
This broke gl_engine rendering, revert it.

This reverts commit 9bb1972ef9.
2020-11-06 15:37:17 +09:00
Hermet Park
9bb1972ef9 examples: revise example code.
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
2020-11-04 19:05:11 +09:00
Hermet Park
0399d84478 common paint: introduce opacity() method.
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
2020-10-26 19:23:54 +09:00