Commit graph

22 commits

Author SHA1 Message Date
Michal Maciola
545d3ead67
WASM: unpremultiplyBuffer fixes (#999) 2021-11-05 10:32:41 +01:00
Michal Maciola
f222124c40 WASM: Use ARGB8888. Convert into ABGR and unmultiply after sync()
Wasm needs ABGR STRAIGHT buffer.
As there is a problem using ABGR for loaders, it is better to use ARGB8888.
This patch makes wasm using ARGB8888 and relocate pixels and unmultiply after sync().
2021-11-04 17:12:05 +09:00
Michal Maciola
479cea74cc common: Unmultiplicated colorspace
This patch introduces _STRAIGHT colorspaces (ABGR8888_STRAIGHT and
ARGB8888_STRAIGHT) whose colors are un-alpha-premultiplied. Unmultiplicated
colors are especially needed for wasm thorvg loader and svg2png / tvg2png.
Only C version now.

@issue: #791
2021-11-01 15:57:13 +09:00
Hermet Park
6f3ff2a355 wasm: update the code.
Yes, now we have standard apis for getting class types,
don't need to hack it anymore.

Now, replaced the redundant id() calls with identifier()
2021-10-22 23:23:09 +09:00
Hermet Park
47334800c6 common: code refactoring
renamed internal module name IteratorModule -> IteratorAccessor
2021-10-22 23:20:29 +09:00
Michal Maciola
1f42f7da89 wasm: saveTvg add compress option 2021-10-13 21:24:53 +09:00
Michal Maciola
1d8625d40d
wasm: paint opacity in the layers list (#804) 2021-09-14 14:27:39 +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
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
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
Michal Maciola
8c4197a8a5 wasm: add force parameter for update() function 2021-09-09 11:48:53 +09:00
Michal Maciola
ed31fc215f wasm: fix loading for binary files
This patch changes load function in thorvgwasm.cpp for using size()
instead of strlen(). It fixes loading of binary files like .tvg.
2021-08-28 16:02:51 +09:00
Michal Maciola
7be4bf4c4f wasm: intoduce saveTvg via File System API
This patch adds saveTvg() function into thorvgwasm.cpp.
Functions saves tvg using File System API.
To enable fs, changed build flag: -s FORCE_FILESYSTEM=1.
Increase in result thorvg-wasm.js size: about 68kB to about 125kB.
2021-08-28 15:35:48 +09:00
Hermet Park
1a7d41ce71 updated copyright 2021-03-23 14:31:58 +09:00
Shinwoo Kim
54e5cdee10 wasm: update picture size for file loading
The width and height was not changed, if there is newly loaded file.
As a result, the scale was not correct after loading a file.
2020-12-15 17:38:22 +09:00
Hermet Park
af88da976d wasm: code refactoring.
Use Picture::size() method instead of scale()

Picture newly supports size() method to resize image.
It's more convenient for users in its usage.
2020-12-08 12:30:58 +09:00
Shinwoo Kim
cc81e46343 thorvg viewer: fix scale problem
If viewer calls load() with a data which does not have size changes of both
viewbox and canvas, then load() does not set a scale value.
This makes incorrect result on viewer side.

So thorvg wasm should set a scale value, whenever load() is called.
2020-10-15 10:19:20 +09:00
Shinwoo Kim
acac884257 thorvg viewer: add getDefualtData interface
The 'getDefaultData' interface will be used when the svg data area
of thorvg viewer does not have any value.
2020-10-14 19:22:13 +09:00
Hermet Park
3e5d3b06c3 improve svg logo design quality. 2020-10-14 17:51:33 +09:00
Shinwoo Kim
0c68c45ef7 thorvg viewer: introduce thorvg viewer
Support Emscripten wasm build for thorvg viewer
2020-10-13 19:04:46 +09:00