Commit graph

1891 commits

Author SHA1 Message Date
Hermet Park
467feabf65
Update README.md 2023-06-13 20:13:41 +09:00
Hermet Park
218a452cf1
Update README.md 2023-06-13 20:08:34 +09:00
Hermet Park
767c50d9d8
Update README.md 2023-06-13 12:27:19 +09:00
Hermet Park
8398fdbca7 tvg: recover the broken compatibility.
The issue was introduced by b214fd23bc
2023-06-13 12:23:17 +09:00
Hermet Park
4627daf6f7 api: enhance API usability
Set the default values of rx = 0 and ry = 0 for the shape.
Only the round rectangle shape requires the usage of these values.
2023-06-13 10:42:57 +09:00
Hermet Park
8305383989 sw_engine: optimize 64-bit rasterization.
Write the pixels per 64-bit data.
This optimization can potentially double the performance in the best case scenario.
It's visually noticeable, especially when the resolution is sufficiently large.

@Issue: https://github.com/thorvg/thorvg/issues/1471
2023-06-13 10:42:40 +09:00
Martin Capitanio
a597d3bb49 API, sw_engine: add stroke-miterlimit example. 2023-06-13 10:42:20 +09:00
Martin Capitanio
44a750ee5d API, CAPI, sw_engine: add suport for stroke-miterlimit. 2023-06-13 10:42:20 +09:00
Hermet Park
07dc68f655 capi: --redundant tag 2023-06-12 11:29:29 +09:00
Hermet Park
84b36e92df api: -- a redundant util func. 2023-06-09 18:50:37 +09:00
Hermet Park
a0e6aead95 infra github: keep the loader tries load all. 2023-06-09 11:13:28 +09:00
JunsuChoi
595cc56e86 webp_loader: Introduce Webp image loader
Add external_webp loader which uses libwebp library.
2023-06-09 10:58:01 +09:00
Hermet Park
b214fd23bc common canvas/scene: introduce paints() api that returns the list of the paints.
These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.

@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;

@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;

@Issue: https://github.com/thorvg/thorvg/issues/1203
2023-06-09 10:54:03 +09:00
Martin Capitanio
4def2a679c Fix clang compiler warnings in unit tests.
[clang] Warn on unqualified calls to std::move and std::forward
See: https://reviews.llvm.org/D119670

[141/166] Compiling C++ object test/tvgUnitTests.p/testAccessor.cpp.o
../thorvg-git/test/testAccessor.cpp:58:29: warning: unqualified call to
'std::move' [-Wunqualified-std-cast-call]
    picture = accessor->set(move(picture), nullptr);
                            ^
                            std::
...
2023-06-07 16:56:30 +09:00
Hermet Park
6cbc1de570 api: enhance Shape::stroke() method usage.
Designate a default value for alpha which is mostly optional.
2023-06-07 12:10:31 +09:00
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
fbf8e8dfce Revert "api: remove deprecated apis"
This reverts commit aa000f7c56.

TVG will move forward to v0.10, so we still need to keep the deprecated APIs.
2023-06-07 10:49:20 +09:00
Hermet Park
dbdf103e82 sw_engine texmap: code clean up.
eliminate logic duplication by introducing a c++ template mechanism.

This will retain the opacity condition branches to minimize binary size.
2023-06-05 16:52:57 +09:00
Hermet Park
3399da198f sw_engine fill: code clean up.
eliminate logic duplication by introducing direct blend operation.
2023-06-05 16:52:57 +09:00
Hermet Park
fbe1b1fb5f sw_engine raster: code clean up.
eliminate logic duplication by introducing functions.
2023-06-05 16:52:57 +09:00
Hermet Park
92265ef0f1 sw_engine: Keep compact masking raster code.
Reduce duplicated masking raster code by replacing with c++ templates
this change does not noticeably impact performance (< error bound).

Binary Size diff: 218379 -> 217851 (-0.5kb)
2023-06-03 15:50:48 +09:00
Hermet Park
0294782c77 sw_engine: keep code clean. 2023-06-03 15:50:48 +09:00
Hermet Park
c3a002a474 sw_engine: Keep compact image raster code.
Reduce duplicated image raster code between scaler approaches.

Although this allows for a function call per pixel,
this change does not noticeably impact performance (< error bound).

Binary Size diff: 222541 -> 218379 (-4kb)
2023-06-03 15:50:48 +09:00
Hermet Park
a3691ff249 sw_engine: gradient filling code refactoring.
Reduce excessive gradient filling code duplication by employing C++ template method.

This change does not affect performance or binary size adversely.

Binary Size Diff: 223399 -> 222693 (-706)
2023-06-03 15:50:48 +09:00
Hermet Park
d4dc625481 examples MaskMethods: add a new example
This is introduced for Masking Methods.
2023-06-03 15:50:48 +09:00
Hermet Park
fddc409728 common sw_engine: adds missing composite methods.
Now tvg user could combine Mask Alpha & Mask Method like this:

paint->composite(target, tvg::CompositeMethod::AddMask);

binary size diff: 201307 -> 223399 (+22kb)

@APIs:
- CompositeMethod::AddMask
- CompositeMethod::SubtractMask
- CompositeMethod::IntersectMask
- CompositeMethod::DifferenceMask

@Issue: https://github.com/thorvg/thorvg/issues/404
2023-06-03 15:50:48 +09:00
Hermet Park
b45c8efd75 doc: ++Colorspace description
@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-06-01 10:59:06 +09:00
Hermet Park
9032c00347 sw_engine texmap: code optimization.
Unify textmap methods that are overly duplicated with each other.

Still trying to simplifying raster code so that thorvg could introduce
the a bunch of masking method code nicely.

This reduces the size like: 214773 -> 212843 (-2kb)
2023-05-31 18:07:57 +09:00
Hermet Park
01974f652c sw_engine: code refactoring.
Unify raster methods that are overly duplicated with each others.
2023-05-30 20:07:34 +09:00
Hermet Park
86d287038b sw_engine: minor code clean up
keep code consistency, no logical changes.
2023-05-30 20:07:34 +09:00
Hermet Park
eb8539e0b4 sw_engine fill: optimize linear/radial fill fetching.
Save the separated for-loop by
unifying the blending/composition in one fetching stage.
2023-05-29 09:45:21 +09:00
Hermet Park
4d842d03f6 sw_engine: code refactoring.
unify raster methods that are overly duplicated with each other.
2023-05-29 09:45:21 +09:00
Hermet Park
28257ec807 common masking: optimize InvAlphaMask
try fast track if InvAlphaMask has 0 opacity + rectangle shape.
2023-05-29 09:45:21 +09:00
Hermet Park
62963268cb sw_engine: code cleanup
Remove unused template multiply.
Currently, 8-bit multiplication is the only valid operation.
2023-05-29 09:45:21 +09:00
Hermet Park
ee9b947c0c sw_engine: optimize alpha blending operation.
Compact blending instructions by distinquish the
shape & images. since we gurantee the shape color is
premultiplied alpha.

As a result, this enhanced performance by 0.002s in examples/Performance
on my local machine.

This also contains code cleanup chores.
2023-05-29 09:45:21 +09:00
Hermet Park
36919dc70f examples Texmap: extending the feature scenario. 2023-05-29 09:45:21 +09:00
Hermet Park
f4c9c4189e examples: changed the screen size. 2023-05-29 09:45:21 +09:00
Martin Capitanio
8b810bed87 tvgJpgd.cpp: Warnings - set but unused variables.
[41/145] Compiling C++ object src/libthorvg.a.p/loaders_jpg_tvgJpgd.cpp.o
../src/loaders/jpg/tvgJpgd.cpp:1339:17: warning: variable 'bytes' set but not used [-Wunused-but-set-variable]
    uint32_t c, bytes = 0;
                ^
../src/loaders/jpg/tvgJpgd.cpp:1773:29: warning: variable 'row_block' set but not used [-Wunused-but-set-variable]
    int mcu_row, mcu_block, row_block = 0;
                            ^
../src/loaders/jpg/tvgJpgd.cpp:1876:9: warning: variable 'row_block' set but not used [-Wunused-but-set-variable]
    int row_block = 0;
        ^
3 warnings generated.
2023-05-24 10:12:57 +09:00
Martin Capitanio
42a04bbc77 CI: Fix ubuntu-latest apt-get install ... 404 Not Found. 2023-05-23 14:49:58 +09:00
Vincenzo Pupillo
368ff01618 Fix invalid conversion error in Avx raster. 2023-05-22 10:34:25 +09:00
Martin Capitanio
2a56c43c84 infra: Avoid meson warning.
WARNING:: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300
2023-05-22 00:06:08 +09:00
Hermet Park
4838c25fa4 sw_engine raster: compact blender alpha table size. 2023-05-20 20:11:58 +09:00
Hermet Park
5643ecabd8 sw_engine: code refactoring
Introduced a blender alpha() to maintain clean and organized code.
2023-05-20 20:11:58 +09:00
Hermet Park
72f89fcf53 test: add Inverse Luma Mask test cases 2023-05-20 20:11:58 +09:00
Hermet Park
0aae65a171 sw_engine code refactoring.
Introduced a compositor table to maintain clean and organized code.
2023-05-20 20:11:58 +09:00
Hermet Park
7e1a647a36 examples: added InvLumaMasking sample. 2023-05-20 20:11:58 +09:00
Hermet Park
21c7debf14 composite: Support Inverse Luma Masking
The CompositeMethod now includes the newly supported InvLumaMask option:

The source pixels are converted to grayscale (luma values),
and the complement of the target's pixels is alpha blended.
As a result, only the part of the source where the grayscale
is not covered by the target is visible.

@APIs: CompositeMethod::InvLumaMask

@Example: examples/InvLumaMasking.cpp

@Issue: https://github.com/thorvg/thorvg/issues/404
2023-05-20 20:11:58 +09:00
Martin Capitanio
6f715b46a7 Fix clang compiler warnings.
[clang] Warn on unqualified calls to std::move and std::forward
See: https://reviews.llvm.org/D119670
2023-05-20 20:10:56 +09:00
Mira Grudzinska
ca0f30c4c0 tests: capi test for tvg_shape_set_paint_order 2023-05-20 13:23:47 +09:00
Mira Grudzinska
2309a48369 capi: tvg_shape_set_paint_order introduced
Capi sets the rendering order of the stroke and the fill.
2023-05-20 13:23:47 +09:00