Commit graph

1211 commits

Author SHA1 Message Date
projectitis
a04349ac71
examples, tests: replace backslashes with forward slashes for portability (#880)
* Replace backslashes with forward slashes

* Downgrade to older meson syntax
2021-10-06 22:18:56 +09:00
Hermet Park
9737dd4a89 test capi: update tvg_paint_get_bounds() utc.
The api has been changed by 060564cc93
update it according its change.
2021-10-06 22:17:18 +09:00
Hermet Park
ca9a9c3a42 capi: replaced bounds() api with the latest.
The next api of c++ version has been deprecated

Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);

instead, we introduce the next one under the beta.

Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed);
2021-10-06 22:17:18 +09:00
Mira Grudzinska
dc55070ba7 docs: c and c++ apis docs improved 2021-10-06 22:11:17 +09:00
JunsuChoi
78b5ee4234 infra: Change test name
Build Test -> Build(Linux)
2021-10-06 22:07:26 +09:00
Hermet Park
a2ac28d0c5
infra: add all option to enable all loader formats.
just for developer convenience (including me)

ex) $meson . build -Dloaders="all" ...
2021-10-06 11:13:49 +09:00
Mira Grudzinska
e7c3a91aa1 all: fixing clang warnings
fopen->fopen_s, strdup -> _strdup, strncpy -> strncpy_s
__declspec(dllexport) -> __attribute__ ((visibility ("default")))
2021-10-06 11:13:12 +09:00
Mira Grudzinska
d67517337c tests: ++LOC svg loader, tvg saver 2021-10-06 11:11:21 +09:00
Projectitis
9ac024cff5 Update authors 2021-10-06 11:10:53 +09:00
JunsuChoi
ebc80987f3 Readme: Add window build test badge 2021-10-06 11:10:13 +09:00
JunsuChoi
5124a9ad6b infra: Add window build test in CI
Add build test for normal build
2021-10-06 10:44:51 +09:00
Mira Grudzinska
78363c3aad Revert "sw_engine: border cases for gradients"
This reverts commit 284298445b.
2021-10-06 01:13:02 +02:00
Mira Grudzinska
284298445b sw_engine: border cases for gradients
According to the svg standard, in a case when 'x1==x2 and y1==y2'
for a linear gradient or when 'r==0' for a radial gradient, the area
should be painted as a single color - the last gradient stop color.
2021-10-05 15:24:07 +02:00
Mira Grudzinska
fc29d888f1 docs: ++ docs of the load apis 2021-10-05 14:16:41 +02:00
Hermet Park
ff20974632 loaders: prepare for static jpg/png loaders.
This patch has 2 purposes,

1. revise the loaders infrastructure to support both static/external linking loaders.
2. add a template for static jpg/png loaders after external jpg/png.

Our default loaders prefer static linking, external loaders are only available
when dependent libraries on the build system are found.

You might wonder why we have the external loaders together,
they might be faster than static loaders since the popular libraries are likely to be well maintained,
fine-grained optimized.

Thus in this patch, meson tries to apply the external loaders first
then see if the dependencies were found or not,
if it's failed, it turns to the default static loaders.

Next this patch, we need the contribution for actual static jpg/png loaders implementation.

@Issue: https://github.com/Samsung/thorvg/issues/594
2021-10-05 19:22:51 +09:00
Mira Grudzinska
875e5bd058
svg_loader: proper handling width/height units (#851)
Units of the svg width and height tags were incorrectly assigned.
Percentage values will be handled separately.
2021-10-05 12:04:40 +02:00
Mira Grudzinska
5b7f94a527 capi: picture size apis added 2021-10-05 16:03:10 +09:00
Mira Grudzinska
aeda0e0ad3
docs: minor changes (#868) 2021-10-04 10:03:48 +02:00
Mira Grudzinska
72727ea322 capi: removed repeated comments 2021-10-03 15:12:46 +02:00
projectitis
de7b5e3b75
Readme: Add links to documentation 2021-10-02 12:40:31 +09:00
Projectitis
00fe44fc71 Portable fallthrough attribute 2021-10-02 12:34:11 +09:00
Mira Grudzinska
919b002068 capi: tvg_canvas_destroy should be able to destroy SwCanvas and GlCanvasa as well 2021-10-01 15:16:52 +09:00
Mira Grudzinska
9ad9c3e3f4
docs: improving c++ and c apis docs 2021-10-01 15:10:40 +09:00
Michal Szczecinski
91c1b99e2f capi: Release official CAPI's.
Changes:
- Removed beta api tag from CAPI module
- For some APIs, the tag has not been changed due to main API status
- Moved some documentation changes to have similar descriptions in main
API and CAPI
- Removed deprecation warnings.
2021-10-01 14:59:12 +09:00
Mira Grudzinska
b31961e517 capi: added the composite getter 2021-10-01 14:57:49 +09:00
Hermet Park
733f0b7f9a common: code refactoring.
--loc, no logical changes.
2021-10-01 14:53:56 +09:00
Michal Maciola
81e6471071 common: allow composition on empty scene without insufficient condition error
If there was an empty scene (empty scene, so bounds equal zero) with a mask composition applied,
Paint::Impl::render failed on checking size and Canvas::draw() returned InsufficientCondition.
As a result no other paints was rendered.

@issue: fixes #842
2021-10-01 14:50:29 +09:00
Projectitis
591ea1d61c Changes to support MSVC 2021-09-29 22:56:52 +09:00
Projectitis
e9be7ebf43 Update readme with optional dependencies 2021-09-29 22:54:19 +09:00
JunsuChoi
a31a04ee2b
README: Add license badge 2021-09-29 22:53:09 +09:00
Mira Grudzinska
79f7c744c5 svg_loader: fixing minor warnings 2021-09-28 12:07:52 +02:00
bchrescionko
f41cef44c1
test: creating test for downscaling picture (#837)
Added tests for the functions rastering scaled down images
2021-09-24 15:19:02 +02:00
bchrescionko
a50ccbb0c6
test: added test for tvg_picture_get_viewbox function 2021-09-24 21:08:59 +09:00
Hermet Park
49458aed7d
Update CONTRIBUTING.md 2021-09-24 21:07:34 +09:00
Hermet Park
6db62a54ad
Update README.md 2021-09-24 15:25:18 +09:00
Hermet Park
e4ae146716 updated doc 2021-09-24 12:50:07 +09:00
Hermet Park
5ad17c6ccf infra: just released v0.5.0 2021-09-24 12:19:02 +09:00
Hermet Park
44768e7125 sw_engine: fix compiler a warning
handle them double type values.
2021-09-24 12:13:11 +09:00
Hermet Park
daa114aafa tvg_saver: resolve sanitizer report.
"runtime error: load of misaligned address 0x7fb67895c815 for type 'unsigned int', which requires 4 byte alignment"

same to c8cc973888
2021-09-24 12:05:03 +09:00
Hermet Park
3ee6883f16 tvg_saver: fix the memory leak. 2021-09-24 11:58:48 +09:00
Hermet Park
c8cc973888 tvg_loader: resolve sanitizer report.
"runtime error: load of misaligned address 0x7fb67895c815 for type 'unsigned int', which requires 4 byte alignment"

This is actually not an issue but we can resolve it with an easy workaround,
since we don't need to see this report repeatedly.
2021-09-24 11:53:46 +09:00
Hermet Park
9128272ee3 infra: turn off the simd option in default.
avx is unstable, we can't recommend to use it.
2021-09-24 11:34:42 +09:00
Hermet Park
74954db56d common paint: refine the bounds() api to return the values after applying transformation.
Current paint::bounds() returns the coordinates under the raw status,
the values are not quite useful if the paint object has the transformed children.

Thus, we extends the feature and give an additional parameter "transformed"
to return the coordinates values after transformation by user demands.

This is also necessary for tvg format, since we need the exact view size of the scene information.

The previous api is deprecated and we introduce a new api to replace it.

@APIs:
+ Result Paint::bounds(float* x, float* y, float* w, float* h, bool transformed) const noexcept;
- Result Paint::bounds(float* x, float* y, float* w, float* h) const noexcept;

@Issues: https://github.com/Samsung/thorvg/issues/746
2021-09-24 11:25:49 +09:00
Hermet Park
000d3ec2f0 apis: release official apis.
tvg picture is going to be released, we need the Saver as well.
Also, two stable periperal apis are released in v0.5

@APIs:
Result Picture::load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false) noexcept;
CompositeMethod Paint::composite(const Paint** target) const noexcept;
Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path, bool compress = true) noexcept;
Result Saver::sync() noexcept;
static std::unique_ptr<Saver> Saver::gen() noexcept;
2021-09-24 11:25:27 +09:00
Hermet Park
e784143ff8 api: remove the redundant api, Picture::paint().
tvg::Picture is replaced to tvg::Scene if the picture has the vector tree,
Thus it's useless since it won't be reached logically.
2021-09-23 20:15:23 +09:00
JunsuChoi
56d31775ff
sw_engine Raster: Improving image quality in image scale down
An average value sampled based on adjacent pixels of the target pixel is used.
2021-09-23 14:39:58 +09:00
Michal Maciola
dcbcc409df
wasm: enable png loader (#828) 2021-09-22 15:11:23 +02:00
Michal Maciola
4c13246f9c
example image: added image image-embeded-png.svg (#827) 2021-09-22 15:08:14 +02:00
Mira Grudzinska
8ef928fcfc sw_engine avx: removing not portable variable type
__m256i_u is an internal gcc/clang type, which can not be used by msvc.
To ensure the portability of the lib a proper intrinsic is used.
2021-09-22 12:41:57 +09:00
Mira Grudzinska
90fa4fbe6d common: change args type in the internal size() implementation
The API expected floats, whereas the called impl function expected
ints. The values were saved as floats, so the float->int->float conversion
is not needed.
2021-09-22 12:40:13 +09:00