Hermet Park
6456252b43
API: introduce a Paint ID member as a reserved field
...
The "id" is a reserved field to specify a paint instance in a scene.
in this change, it assigns the layer id to the lottie scene as well.
2024-09-30 15:48:18 +09:00
Hermet Park
abf3e2d6ae
renderer: newly support the Lighten/Darken Masking options
...
Lighten is applied, where multiple masks intersect,
the highest transparency value is used.
Darken is applied, where multiple masks intersect,
the lowest transparency value is used.
Experimental API:
- CompositeMethod::LightenMask
- CompositeMethod::DarkenMask
issue: https://github.com/thorvg/thorvg/issues/2608
2024-09-30 15:48:18 +09:00
Hermet Park
439124d670
lottie/expressions: add missing expressions property updates
...
apply expressions to separate x/y transform coordinates.
2024-09-30 15:48:18 +09:00
Hermet Park
17e628d8f7
lottie: remove useless condition check.
...
lottie is always animatable.
2024-09-30 15:48:18 +09:00
Hermet Park
c9ad7289a6
lottie/expressions: feature enhancement
...
added groupIndex() support
added property (ix) value support
2024-09-30 15:48:18 +09:00
Hermet Park
fc61fc42c2
lottie: code refactoring
...
Access its type from a property instance,
through coherent data structure.
2024-09-30 15:48:18 +09:00
Hermet Park
ecabdc5ebc
renderer: code refactoring
...
Replaced the transformation with
a strong associated data field.
This helps to reduce the binary size (-1k).
2024-09-30 15:39:52 +09:00
Hermet Park
4ed9ada00e
lottie/expressions: hotfix
...
- fixed a memory leak.
- corrected loopIn key value.
2024-09-30 15:38:32 +09:00
Hermet Park
2478a5f65a
lottie/expressions: feature support enhancement
...
- revised the transformation building logic.
- rectified to properly search "this" composition layers.
- rectified the linear interpolation implementation.
- added "pingpong" looping attributes.
2024-09-30 15:38:05 +09:00
Hermet Park
4e3d027fa7
lottie: code refactoring
...
- removed unnecessary variables.
- migrated the composition methods to the precomp layer.
2024-09-30 15:38:00 +09:00
Hermet Park
d7e4fc7d6a
lottie: ++optimization with object culling
...
More precisely, culling the render objects by
determining if the group has no renderable objects.
Additionally, check opacity to quickly return
in the rendering process.
2024-09-30 15:37:40 +09:00
Hermet Park
935d3d83ae
lottie: hotfix with an intermediate patch merge.
2024-09-30 15:37:32 +09:00
Hermet Park
7a6d2e0c5a
lottie: ++scene rendering optimization
...
Apply LottieRenderPooler to texts.
2024-09-30 15:37:26 +09:00
Hermet Park
d671f8637b
lottie/expressions: ++coverage enhancement
...
Allow to access layer index globally.
2024-09-30 15:36:24 +09:00
Hermet Park
0b66cd422e
lottie/expressions: added a missing polystar property build.
2024-09-30 15:35:59 +09:00
Hermet Park
699063625b
lottie: ++scene rendering optimization
...
Apply LottieRenderPooler to path/rect/ellipse/polystar.
This enhances the animation performance: ~10%
2024-09-30 15:34:57 +09:00
Hermet Park
ba3d2b77a1
lottie: introduced LottieRenderPooler
...
LottieRenderPooler is designed to manages rendering
instances(paints) efficiently through a simple pooling
mechanism to resuse among the animations
This replaces the previous individusal paints implemenations
among solidfill, precomp vierport and pictures,
also fix a potential paints corruption problems.
2024-09-30 15:33:49 +09:00
Hermet Park
e27b8ddf25
lottie/parser: tiny binary size reduction
2024-09-30 15:30:47 +09:00
Mira Grudzinska
774e4f5156
lottie: support 'direction' in ellipses
2024-09-30 15:30:29 +09:00
Mira Grudzinska
177bae539c
lottie: remove unnecessary cast
2024-09-30 15:30:18 +09:00
Hermet Park
12b7c634f7
lottie: clarify shape direction.
...
There are only two options clockwise or counter-clockwise.
2024-09-30 15:29:22 +09:00
Mira Grudzinska
bba48a8084
lottie: apply direction to rect
2024-09-30 15:29:22 +09:00
Hermet Park
43a5bf2fce
lottie: ++ scene composing optimization
...
retain resuable layer solid paint during animation.
2024-09-30 15:29:22 +09:00
Hermet Park
3adee7238c
lottie: ++ scene composing optimization
...
retain reusable precomp clipper shapes during animation.
2024-09-30 15:29:22 +09:00
Hermet Park
192135835f
lottie: ++memory access stability
...
Internal matrix can be null.
This update prevents such cases by using a safer API.
2024-09-30 15:29:07 +09:00
Jinny You
0953d000c1
lottie/text: Support text range selector (Phase 1)
...
This patch provides initial support for the text range selector. Full support will be added gradually in subsequent steps. This is the first step.
Text range selector with following properties:
1. Text Range Selector (Units)
2. Text Style
- Fill Color
- Fill Opacity
- Stroke Color
- Stroke Width
- Stroke Opacity
- Opacity
- Rotation
- Position
- Scale
2024-09-30 15:28:24 +09:00
Hermet Park
12d0504a23
common: replace the round() with nearbyint()
...
nearbyint() is 2x faster than round() in our local test.
2024-09-30 15:24:39 +09:00
Mira Grudzinska
8e78745e2e
lottie: improvement 3d rotation
...
For rotation around the X and Y axes, the transformation
matrix was incorrectly created - elements e12 and e21
were omitted. Now fixed.
2024-09-30 15:23:08 +09:00
Hermet Park
4f58124754
common/math: code refactoring
...
- migrate tvgLine to tvgMath
- associate line functions with classes.
2024-09-30 15:22:46 +09:00
Hermet Park
c9d1df3957
common/math: code refactoring
...
Replaced the prefix "math" with "tvg" namespace.
2024-09-30 15:22:38 +09:00
Hermet Park
d3a900701f
common/math: introduced custom atan2()
...
the custom atan2 algorithm by Remez.
see: https://en.wikipedia.org/wiki/Remez_algorithm
This improved the Lottie example by ~2ms.
Total atan2 performance time was reduced by 43%
2024-09-30 15:21:27 +09:00
Hermet Park
aff7f61819
lottie: code refactoring
...
- _draw() returns boolean whether merging shape is allowed or not.
- renamed some internal variables.
2024-09-30 15:20:54 +09:00
Mira Grudzinska
c64923336d
lottie: enhance support for ao: 1
...
Adding support for auto-orient=true for frames <= first
and >= last, as well as for positions specified without
outer and inner tangent.
2024-09-30 15:20:46 +09:00
Mira Grudzinska
5276663c45
lottie: add support for image size
...
The width and height of the image must
be specified in the Lottie file and must
be taken into account during rendering.
2024-09-30 15:11:34 +09:00
Hermet Park
69d1d8dcd5
lottie: ++thread safety.
...
comp pointer is used for checking if the header is ready.
It can be written in a worker thread and needs a critical
section on the reader side.
This also potentally improve the thread efficiency
from the segment() / marker() function calls.
2024-09-30 12:57:08 +09:00
Hermet Park
ce50165103
common: Fix a compilation failure on VS 2017
...
issue: https://github.com/thorvg/thorvg/issues/2512
2024-09-30 12:49:06 +09:00
Hermet Park
359ad22b3a
lottie: fix a regression bug of masking
...
InverseAlphaMasking should be applied as intended,
but it was mistakenly reverted to alpha.
regression in v0.14.0 by: 2c7a83406e
2024-09-30 12:48:50 +09:00
Hermet Park
dd0705eef9
lottie: allow image asset sharing among LottiePicture instances
...
Previously, the Lottie builder didn't account for image asset sharing
among multiple layers. This update rectifies the situation.
issue: https://github.com/thorvg/thorvg/issues/2428
2024-09-30 12:48:08 +09:00
Hermet Park
98e613e3f0
lottie/parser: optimization++
...
Skip the data constructuion if the mask mode
is none. it's not used at all.
2024-09-30 12:46:49 +09:00
Hermet Park
b94c30675c
lottie/builder: revise the masking update.
...
Append the mask shape to the previous one, instead of composition,
when it's able by the condition.
issue: https://github.com/thorvg/thorvg/issues/2426
2024-09-30 12:46:40 +09:00
Hermet Park
74cd0ba0e7
common: code refactoring
...
replaced min/max with the standard library
2024-09-30 12:45:14 +09:00
Hermet Park
fad80deceb
lottie: remove exception handling
...
don't stop the parsing when the data type is incorrect.
just let it slide.
issue: https://github.com/thorvg/thorvg/issues/2389
2024-09-30 12:42:17 +09:00
Hermet Park
dfa2b78ad8
lottie/rapidjson: --assert
...
Save binary size about 0.8kb
2024-09-30 12:42:10 +09:00
Josh Soref
e3c66db301
common: fix 178+ spelling errors
2024-09-30 12:41:38 +09:00
Vincent Torri
ab7ff34674
json loader: fix warnings in jerryscript on Windows
2024-09-30 12:37:03 +09:00
Hermet Park
f3469350b9
lottie: fix a data-race problem
...
make it sync call before accessing the composition data
from marker and segments.
issue: https://github.com/thorvg/thorvg/issues/2462
2024-06-27 14:42:27 +09:00
Hermet Park
933176e309
lottie: hotfix for preventing a crash.
...
MaskMode=None is not properly addressed,
Prevent the crash from the use-case.
issue: https://github.com/thorvg/thorvg/issues/2426
2024-06-27 14:42:27 +09:00
Hermet Park
a0c6025132
lottie: fix a compile error on MSC with clang.
...
issue: https://github.com/thorvg/thorvg/issues/2347
2024-06-27 14:42:27 +09:00
Mira Grudzinska
d9326921fa
lottie: fix repeater order
...
Assigning numbers 1 or 2 to a bool always
resulted in true. Now fixed and repeated
shapes are drawn in the proper order.
If the repeater had no elements, iterating
shapes from the end would result in a segf.
This issue is now fixed.
2024-06-24 14:56:31 +09:00
Jinny You
8a1a3e54ee
lottie: Add exception for lottie doesn't have exported glyph
...
Added handling logic for missing characters to prevent program hang.
2024-06-24 14:42:33 +09:00