Commit graph

3044 commits

Author SHA1 Message Date
Mira Grudzinska
e01cc2723f common: precision increase while matrix inversion
A numerically motivated limit on the matrix determinant
set at 1e-6 was not sufficient. The limit has been increased
by checkoing whether 1/det is still a number.
2024-09-06 00:01:06 +09:00
Hermet Park
9dbe141058 lottie/parser: ++ null value handling
Note that, only dealt with a obivous case in practice.

issue: https://github.com/thorvg/thorvg/issues/2703
2024-09-06 00:00:31 +09:00
Łukasz Pomietło
251ec5586b loader/ttf: Spaces and invalid glyphs rendering fix
If for any reason an invalid glyph is found in text, 
it will now be skipped when rendering 
(instead of increasing offset by last valid glyph advance).

Issue: #2687
2024-09-06 00:00:24 +09:00
Mira Grudzinska
bd87d136a5 lottie: handle trim path edge cases
According to the definition of trim path elements,
the begin and end values are specified as percentages
in the range of 0-100% (this is also confirmed by AE,
where it's not possible to exceed this range).
Added clamping to align with spec.
2024-09-05 23:59:52 +09:00
Mira Grudzinska
dc386ba280 common: introduce tvg::clamp 2024-09-05 23:59:29 +09:00
Mira Grudzinska
216167ccde sw_engine: increased accuracy in dashing
The limit on leftovers was too small, which became
noticeable for animations with trimming - currently
implemented with the dashing alg.
The limit has been increased.
2024-09-05 23:57:22 +09:00
Hermet Park
e253f0f716 bump up version v0.14.8 2024-08-30 01:08:37 +09:00
Hermet Park
759354f7cd sw_engine: fixed incorrect image blending operations
The anti-aliased outline color was incorrectly blended
at the multiply option.

The fix can be observed in the example:
'examples/lottie/resourcesguitar.json'

in order to do this, RenderMehthod::blend() method introduced
`bool direct` for figuring out the intermediate composition.
2024-08-30 01:08:37 +09:00
Mira Grudzinska
94047ffd36 common: uint8_t version of the lerp
An uint8_t version of the lerp function
is introduced to handle cases where
the interpolation factor t exceeds 1, which
previously caused overflow issues due to casting.
2024-08-30 01:08:34 +09:00
Hermet Park
c30447be98 lottie/expressions: rectified $bm_sum()
Added only a single element to x.
2024-08-30 01:01:47 +09:00
Hermet Park
354533c922 lottie/expressions: hotfix a crash
Stabilized $bm_sum(), by allowing the different dimensional
arguments.

issue: https://github.com/thorvg/thorvg/issues/2664
2024-08-30 01:01:40 +09:00
JunsuChoi
244e61205c svg_loader: Adjust hsl values out of range
The range of saturation and brightness values is 0 ~ 100% and range of hue is 0 ~ 360.
If a value greater than 100% is loaded, it will be modified to be 100%.

issue: https://github.com/thorvg/thorvg/issues/2678
2024-08-30 01:01:32 +09:00
Mira Grudzinska
0751b14186 lottie: fix trim
The bug caused the trim path to not be applied
when it appeared in a group between different
shapes.
2024-08-30 01:00:59 +09:00
Mira Grudzinska
bd5728a140 lottie: fix trim path regression
To avoid editing the trim path values provided
by the user, the logic for their interpretation
was moved from the API to the renderer (7c87d8e).
This caused an issue in the lottie animations when
the trim path is applied more than once. Now fixed.

@issue: https://github.com/thorvg/thorvg/issues/2670
2024-08-30 01:00:52 +09:00
Łukasz Pomietło
f324cc993d renderer/text: fix a missing text update
previously font size & italic style had been ignored
even if its attributes are changed.

Co-Authored-By: Hermet Park <hermet@lottiefiles.com>

issue: https://github.com/thorvg/thorvg/issues/2676
2024-08-30 01:00:42 +09:00
lpogic
35ffa9edf8 text: fixed a corrupted italic style application
issue: https://github.com/thorvg/thorvg/issues/2669
2024-08-30 00:57:57 +09:00
tangruiwen.mmh1103
fbae8ad095 gl_engine: fix mistake in the calculation of stroke miter limit
* correct the stroke width and color calculation with scaling
* fix the miter limit calculation to make bevel join fallback correct
2024-08-30 00:56:57 +09:00
Hermet Park
223a07d0d2 lottie/jerryscript: ++build reliance 2024-08-30 00:56:48 +09:00
Hermet Park
e3a6bf5229 bump up version v0.14.7 2024-08-23 10:56:46 +09:00
Mira Grudzinska
660484b12b lottie: add offsetPath support
Due to the lack of an analytical solution for Bezier
curves offsetting, a simple and computationally cheap
approximation has been implemented. The algorithm shifts
the segments connecting control points and determines
new points based on their intersections.

@issue: https://github.com/thorvg/thorvg/issues/2230
2024-08-23 10:56:23 +09:00
Mira Grudzinska
b521eee2be lottie: roundness refactored based on #2295 2024-08-23 10:50:43 +09:00
Mira Grudzinska
1540ecb4c0 common: prevent warning - expression result unused 2024-08-23 10:46:38 +09:00
Hermet Park
222eb2720a renderer/text: --memory leak
regression by 71d3fce1dd
2024-08-23 10:46:29 +09:00
Hermet Park
9a1d169558 sw_engine/texmap: ++fixed memory access violation
Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>
2024-08-23 10:46:22 +09:00
Mira Grudzinska
73fd8015f7 lottie: fix text update
The occurrence of a 'carriage return' (13) or 'end of text' (3)
caused the skipping of the next character check, immediately
searching for it in the list of available characters.
If the next character was also 13 or 3, it led to incorrect
interpretation; however, if it was the last character in the
sequence, a crash occurred.
2024-08-23 10:46:15 +09:00
Mira Grudzinska
a08c73b08b sw_engine: fix TexmapPolygon rastering
The y range initialization was missing a check to ensure
that the height is a positive value. This could lead to
an attempt to call malloc with a negative argument, which
cast to an unsigned value, caused a crash.
2024-08-23 10:46:07 +09:00
Hermet Park
f5337015e9 renderer: text refactoring
- assign the shape instance as mandatory.
- assign the text instance internally.
2024-08-23 10:45:55 +09:00
Hermet Park
8ca5e74902 api: corrected wrong const specifier
Setter obvisouly modifies the instance.
2024-08-23 10:45:49 +09:00
Mira Grudzinska
2447e02932 docs: description++ 2024-08-23 10:45:39 +09:00
Hermet Park
7a37735110 doc: ++enhancement in Picture::load()
addressed supported raw data format.

issue: https://github.com/thorvg/thorvg/issues/2648
2024-08-23 10:45:29 +09:00
Hermet Park
65c808fc02 common: spec out TexMap
Spec out this incomplete experimental feature,
this is a still promising one, we will reintroduce
this officially after 1.0 release

size: -2kb

issue: https://github.com/thorvg/thorvg/issues/1372
2024-08-23 10:45:14 +09:00
Elliott Sales de Andrade
eb462c6e32 build: Override dependency for use as subproject
A pkgconfig file is already provided, which enables using `thorvg` once
it is installed. However, this file is not, and cannot be, available at
setup time if using `thorvg` as a subproject.

In such cases, Meson provides the `override_dependency` mechanism for a
subproject to tell its parent how to use it.
2024-08-23 10:35:35 +09:00
Hermet Park
ac729068f5 lottie: ensure a null terminator at the end of the copied data
In certain cases, the user might want to set mapped memory directly.
This update ensures that a null terminator is appended to the string data.

Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>

Issue: https://github.com/thorvg/thorvg/issues/2642
2024-08-23 10:35:23 +09:00
Hermet Park
82563bf29a doc: hotfix 2024-08-20 11:50:29 +09:00
Hermet Park
03d4b754df bump up version 0.14.6 2024-08-15 23:19:13 +09:00
Mira Grudzinska
183b67b967 lottie: prioritization of roundness in rectangles
Added prioritization of rectangle roundness over
rounded corners, in line with AE results.
2024-08-15 23:18:51 +09:00
Hermet Park
8927294374 common: spec out Scene Clipper
Scene Clipper is an unusual feature
that is too unstable and ambiguous in ThorVG.

Users can achieve the same functionality
with multiple composed shapes instead of scene clipping.

size: -2.5kb

issues:
- https://github.com/thorvg/thorvg/issues/1548
- https://github.com/thorvg/thorvg/issues/1549
- https://github.com/thorvg/thorvg/issues/1573
2024-08-15 23:18:39 +09:00
Mira Grudzinska
4af3825bc3 lottie: handle edge case for rounded rect
For rounded rectangles the roundness value should
be determined using to the formula:
r = min(r, max(size.x, size.y)/2)
rather than the previous method:
r = min(size.x/2, size.y/2, r)
2024-08-15 23:14:19 +09:00
Hermet Park
e0a8a9b25f wasm: thorvg canvas resize problem.
The canvas syncs before changing a target buffer.

issue: https://github.com/thorvg/thorvg/issues/2580
2024-08-15 23:14:12 +09:00
Hermet Park
9fe0b001d6 lottie: code refactoring
getting too many parameters,
migrated static functions to class member functions,
reducing the binary size by 2KB

no logical changes
2024-08-15 23:14:04 +09:00
Hermet Park
331ea0cae3 lottie: ++scene rendering optimization
Apply LottieRenderPooler to RenderContext propagators.
2024-08-15 23:13:52 +09:00
Hermet Park
142cb05e63 lottie: ++scene rendering optimization
Apply LottieRenderPooler to maskings.
2024-08-15 23:10:27 +09:00
Mira Grudzinska
7e19a960d8 lottie: handle rounded polygons
The implementation of rounded polygons was
mistakenly omitted, now has been added.

@Issue: https://github.com/thorvg/thorvg/issues/2624
2024-08-15 23:10:15 +09:00
Hermet Park
a04ebe18f3 bump up version v0.14.5 2024-08-09 11:33:38 +09:00
Mira Grudzinska
6902c790d2 common: add missing consts
Adding const was necessary to allow calling
the functions on constant objects.
2024-08-09 11:33:38 +09:00
Mira Grudzinska
fdc45edf32 common: increase precision for bezier calculations
The epsilon value currently used for the precision
of Beziers calculations is sufficient for comparing
curve lengths. However, for the parameter t, which
ranges from 0 to 1, an accuracy of 1% can introduce
errors.
The solution is to increase the precision for the t
parameter while keeping the rest of the calculations
at the previously used epsilon value.

@Issue: https://github.com/thorvg/thorvg/issues/2619
2024-08-09 11:33:38 +09:00
Hermet Park
0776216ed0 infra: switch the optimization option to level 3
In case of modern systems, size is not a big problem,
so we turn the optimization option to default
for better performance.

FPS: ~20% enhanced
Size: ~25% increased

Note that this doesn't affect to the web player.
2024-08-09 11:33:38 +09:00
Hermet Park
b88ccd2cfc renderer: rectified the bounds() behavior
Text fill is broken by 43c87b4eb5
2024-08-09 11:33:38 +09:00
Hermet Park
96c8c17d33 lottie: support matte+masking combination
introduced an intermediate scene for embracing
the matte and maskings
2024-08-09 11:33:38 +09:00
Hermet Park
e0e00fe6fe lottie/expressions: rectified fill color support
Assign the fill color value properly.
2024-08-09 11:33:38 +09:00