Commit graph

1178 commits

Author SHA1 Message Date
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
Mira Grudzinska
c5430684d1 infra: excluding pthread lib dependency on windows os 2021-09-22 12:38:17 +09:00
Mira Grudzinska
cfacdd705f example: refactoring 2021-09-22 01:13:52 +02:00
Michal Maciola
702f452c6c svg: fix url property
If 'fill="url(#image)"' and defs with id 'image' was not found, the paint was
improperly filled with color.
2021-09-21 20:20:59 +02:00
Mira Grudzinska
4589196689
common: preventing msvc compiler warnings (#817) 2021-09-20 13:54:06 +02:00
Mira Grudzinska
9d63e2894d common: preventing possible compiler warnings 2021-09-19 19:53:40 +02:00
Hermet Park
75e1310c7a prepare to release tvg format feature. 2021-09-16 17:46:10 +09:00
Hermet Park
3d93867e8e tvg_saver: code refactoring
removed the duplicated given child transform code,

no logical changes actually.
2021-09-16 15:01:42 +09:00
Hermet Park
80a940c70a examples: updated tvg resources. 2021-09-16 12:47:05 +09:00
Mira Grudzinska
6b216e362d tvg_saver: proper serialization of a grad fill
In the case when a gradinet fill is present, the transformation matrix
can't be preapplied.
2021-09-16 12:40:37 +09:00
Michal Szczecinski
09301dfde1 sw_engine: Fixed build errors. 2021-09-16 12:27:04 +09:00
Hermet Park
ee7dc1352e tvg_saver: do not merge if the shapes have outlines.
Merged shapes with outlines expects the layered,
unfortunately tvg can't cover the situation.

@Issues: https://github.com/Samsung/thorvg/issues/783
2021-09-16 00:06:01 +09:00
Hermet Park
e5f8bc99b7 examples: updated favorite tvg to fix position issue. 2021-09-15 20:06:20 +09:00
Hermet Park
c4e1a1f752 examples: updated tvg resources
these two resources were fixed by the positioning.
2021-09-15 19:41:11 +09:00
Hermet Park
4142237cac examples: updated tvg resources 2021-09-15 19:16:44 +09:00
Mira Grudzinska
c9c3776207 svg_loader: proper svg resizing
Solves the problem of 'vx' and 'vy' < 0 and cases with 'width'
and 'height' values different than widht and height from the 'viewBox'
attribute.
2021-09-15 19:12:43 +09:00
Michal Maciola
1d8625d40d
wasm: paint opacity in the layers list (#804) 2021-09-14 14:27:39 +02:00
Hermet Park
47c1aac562 examples: updated tvg sample 2021-09-14 19:53:12 +09:00
Hermet Park
e3266ac19c examples: extends svg samples 2021-09-13 20:49:46 +09:00
Mira Grudzinska
d3368c9727 svg_saver: shifting 'preTransform' value changing
'preTransform = false' makes sense in case a stroke exist,
so not only when the stroke-width > 0 but when it's color
is valid as well.
2021-09-11 10:49:09 +09:00
Michal Maciola
150cff0fd5
example images: added rotlines.svg (#796) 2021-09-10 13:31:20 +02:00
Michal Maciola
e62f8a0db4
wasm: improved bounds calculation (#795)
Improved bounds calculation in case a rotation is applied
2021-09-10 13:26:58 +02:00
Hermet Park
8c2e762e98
Update README.md 2021-09-09 22:30:03 +09:00
Michal Maciola
e91dcdb0de
wasm: validate empty data (#790) 2021-09-09 10:45:58 +02:00
Michal Maciola
b294a71613
wasm: remove default data (#789) 2021-09-09 10:40:19 +02:00
Hermet Park
4e9452c4b8 api: removed unused 2021-09-09 14:18:46 +09:00
Michal Maciola
2a2ccb30bd
Wasm: allow iterator and add functions for layers revising (#730)
* common: move iterator functionality into separate IteratorModule
* wasm: allow internal lib dependencies and iterator
* wasm: added functions for layers revising

This patch adds functions to thorvgwasm.cpp:
 layers() - that return a list of paints in a picture
 bounds() - that returns a bounds of a given paint
 setOpacity() - that sets the opacity of a given paint
2021-09-09 13:06:13 +09:00
Michal Maciola
f732479acc wasm: pass mimetype on loading and store original size
This patch adds the mimetype parameter for load() function and adds storing of
an original size after successful loading. Added function originalSize().
2021-09-09 12:55:56 +09:00
Hermet Park
79933d9efa api: set default value nullptr for user convenience. 2021-09-09 12:40:43 +09:00
Michal Maciola
8c4197a8a5 wasm: add force parameter for update() function 2021-09-09 11:48:53 +09:00
Hermet Park
1ea9692841 sw_engine image: fix the clipped image issue.
there was a wrong condition introduced the bug that image was not updated,
because transformation is not re-applied after the first created the internal image data.

@Issues: https://github.com/Samsung/thorvg/issues/751
2021-09-09 11:31:05 +09:00
Hermet Park
789083527e examples: updated a tvg resource. 2021-09-09 11:05:54 +09:00
Mira Grudzinska
288c9f5c1d tvg_saver: fix the stroke width scaling factor
To get the scaling factor from the transformation matrix we have
to use two of its elements.
2021-09-08 10:36:59 +02:00
Hermet Park
b495f04ef4 examples tvg: added a new example to verify tvg resources.
These tvg resources might be updated before official release.
2021-09-08 13:29:04 +09:00