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.
tvg file stores the version info of thorvg when it's generated,
in order to compare it with the runtime thorvg version when it's loaded.
For this, thorvg builds up the current version of symbol on the initilaization step,
that can be referred by the tvg loader.
Changes:
- Added 'neon' vector option in build system
- Introduced neon version of rasterRGBA32 API, which improves
speed of the funciton on ARM cpu's around ~35%
tvg saver is a new module to export tvg files.
In this patch, it also contains the infrastructure of saver module
to expand other types of savers such as png, jpg, etc.
To save the tvg file from a paint, you can use the Saver feature, for example:
auto saver = tvg::Saver::gen();
saver->save(paint, "sample.tvg");
saver->sync();
Later, you can read the "sample.tvg" using Picture.
auto picture = tvg::Picture::gen();
picture->load("sample.tvg");
...
The behavior of the saver will work on sync/async based on the threading setting of the initializer.
Thus if you wish to have a benefit of it, you must call sync() after the save() in the proper delayed time.
Otherwise, you can call sync() immediately.
Note that, the asynchronous tasking is depent on the saver module implementation.
Also, you need to enable tvg saver/loader modules from meson option. (yet this feature is under the beta)
@API Addition:
Result Saver::save(std::unique_ptr<Paint> paint, const std::string& path) noexcept;
Result Saver::sync() noexcept;
@Examples: tvgSaver
@Co-author: Mira Grudzinska <m.grudzinska@samsung.com>
This patch introduces a jpg loader.
For decoding the image, libjpeg-turbo library is used. Library was found to be
fast (SIMD instructions accelerated) and portable.
@issue: #517
for optimial library, we removed some peripheral information in default,
this breaks asan environment.
This patch changes it to make it both.
if you want to use asan, please change the meson option.
default is disabled.
example)
$meson . build -Db_sanitize=address
$meson . build -Db_sanitize=address,undefined
Catch2 is a multi-paradigm test framework for C++.
It is primarily distributed as a single header file,
very easy and simple to adopt this to thorvg project.
This patch introduces catch2 infrastsructure and one prototype as a sample.
You can refer "testInitializer.cpp", how to add unit test!
while ignoring else files such as "catch2.hpp", "testMain.cpp"
Also, enable Unit-tests with meson option when you change any thorvg code.
$meson build -Dtests=true.
launch tvgUnitTest in the build result then verify 100% coverage
before submitting any patches.
Add RawLoader class that loads and display raw images,
and adds a Rasterizer for image data.
Image data can be loaded via picture.
Loaded image supports Composition, Transformation and Alpha blending.
New API
Result load(uint32_t* data, uint32_t width, uint32_t height, bool isCopy) noexcept;
tests is now officially placed in src/examples,
default is turned off, only necessaries turn it on.
ex) meson . build -Dexamples=true
+ this examples are required efl 'elementary' package.
avx is the cutting edge method for intel & amd cpus simd instruction.
We are going to support this feature for the desktop environment (instead of sse)
You can turn on this with configuration something like this:
$meson . build -Dvectors=avx
Current patch supports only for raster solid color
Change-Id: I068ba30a1f63d480415e2762f8021fc8d6d28a39
memset() is more than 10x faster than manual loop.
Thus we replace it to manipulate buffer pixels.
Change-Id: If0f255578f7d49ff6704c4f15e2eefe435cc3c15