Commit graph

26 commits

Author SHA1 Message Date
Hermet Park
e56476b7bd common: code refactoring.
renamed loader classes same to Saver classes

tvgLoaderMgr -> tvgLoader (tvgSaver)
tvgLoader -> tvgLoadModule (tvgSaveModule)
2021-07-22 17:30:02 +09:00
Hermet Park
8059a23f7c tvg format: code refactoring #2
code clean up, removed reserved data sector
2021-07-20 12:53:16 +09:00
Michal Maciola
0435f29f11 jpg_loader: introduced jpg decode using libjpeg-turbo
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
2021-07-07 13:44:16 +09:00
Hermet Park
8aa941c4ab common picture: ++exception case.
Fixed load() to return InvalidArgument if the file path is invalid.
2021-07-02 14:01:52 +09:00
Hermet Park
cadbbb8028 common loadermgr: fix missing break; in switch-case. 2021-06-23 10:18:46 +09:00
Michal Maciola
cce4b443b3 loaders: added copy param for Picture::load
@API Changed:
Result Picture::load(const char* data, uint32_t size, bool copy /*=false*/) noexcept
TVG_EXPORT Tvg_Result tvg_picture_load_data(Tvg_Paint* paint, const char *data, uint32_t size, bool copy);
2021-06-21 19:52:38 +09:00
Hermet Park
4795927dc1 fix build break.
regression by - 15b56a66de
2021-06-11 21:04:43 +09:00
mmaciola
16e39ee81b
TVG Loader/Saver: tvg loader introduced
This patch introduces tvg loader module for loading .tvg binary files.
This allows to load and reuse pregenerated scene.

tvg file format:
.tvg is a binary file format designed for saving/restoring the scene content.
It allows to save scenes and reuse them in other apps or to restore state of
the application.

@Example:
   auto picture = tvg::Picture::gen();
   picture->load(EXAMPLE_DIR"/tvg_file.tvg");
   canvas->push(move(picture));

@API Additions:
   Result paint(std::unique_ptr<Paint> paint) noexcept;

@Issue: Issue ticket is #375.
2021-06-11 12:49:37 +09:00
Hermet Park
6276e209a7 common initializer: counting engine init count properly.
Manage the reference count in common so that
all common resources can be initialized/terminated identically.
2021-04-14 20:18:06 +09:00
Hermet Park
fdd14a51a7 loader loaderMgr: add a useful debug message.
Print info if file format is not supported.
2021-04-01 21:12:49 +09:00
Mateusz Palkowski
832568e07a Added libpng based png loading 2021-04-01 19:38:00 +09:00
Hermet Park
1a7d41ce71 updated copyright 2021-03-23 14:31:58 +09:00
Hermet Park
53d23e9862
common picture: fix crash at picture duplication.
A duplicated picture needs to access internal picture loader data
to get its properties while rasterizing.

But it missed the loader since it's not copied from origin.

Thus, we fix this by sharing the internal loader among the duplications and origin.

@Examples: Duplicate
2021-03-19 19:41:18 +09:00
JunsuChoi
08c37978a9 common: Pointer that can declare const are refactored to use const
Pointer and reference parameters should be "const" if the corresponding object is not modified
2021-02-19 16:51:50 +09:00
Hermet Park
932cc65543 loaders: fix memory leak.
While looking for image loader, it occured memory leaks.
Fixed it properly.

@Issues: 178
2020-12-10 11:57:38 +09:00
JunsuChoi
e00f948705
raw_loader Loader: Introduce Raw image loader
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;
2020-11-23 18:12:36 +09:00
Hermet Park
3ab1194773 common sw_engine: code refactoring
replaced names and fixed out of coding convention.
2020-11-04 19:18:59 +09:00
Hermet Park
200016fea0 common LoaderMgr: code refactoring
keep clean & neat thorvg coding style.
2020-11-03 14:21:19 +09:00
JunsuChoi
af85eb22ad svg_loader LoaderMgr: Delegates file validation check to LoaderMgr.
Delegates extension string check and header(open) check
for file to LoaderMgr.
This makes it easy to add a loader afterwards.
2020-11-03 12:15:12 +09:00
Hermet Park
6365d02a96 optimization: cut off file dependencies.
we should avoid code insertion during file dependencies,
such as #include "xxx.h" which has implementations.

This could increase binary size, we can avoid it as possible.

Current patch improves binary size like this:

From: file(2059008) = text(120360) data(8096) bss(80) dec(128536)
To  : file(1921832) = text(118429) data(7872) bss(56) dec(126357)

More additional patches will come in to optmize binary size.
2020-09-23 20:57:30 +09:00
Hermet Park
04c6295974 code refactoring
remove unnecessary condition.
implementation won't be included multiple times not like headers.

Thus this condition is unnecessary.

Change-Id: Id37e675c40ce7213a06c950da8e5ca17ff7245c9
2020-08-20 16:16:46 +09:00
Hermet Park
7ab71c52d0 picture svg: introduce load() with memory data input source.
picture now affords the memory data as input source so that
user can pass svg data memory directly.

Change-Id: I246c09b682a2d60e53ad556ce0c90337142ee4f1
2020-08-14 19:41:04 +09:00
Hermet Park
9dd3cc5edc common: code refactoring.
we can return nullptr directly here.

Change-Id: Ic1d987f2701d20ff1b69af2854f9cfee7e2fe065
2020-08-13 20:05:37 +09:00
Hermet Park
9893af979f replace license from Apache 2.0 to MIT
Change-Id: I61f7cb2b0e407bc035f3b2ec7da9b7f230057e24
2020-08-13 16:53:38 +09:00
Hermet Park
99428ee80a build: support features toggling in meson option.
Change-Id: Id1ebda70fe8380aaa913f79af26e5c39893a6df5
2020-07-08 15:30:12 +09:00
Hermet Park
01e52c7c7a common loader: build up loader infrastructure.
Change-Id: I62aaed43015301ec39e414833f37d6c5485d8043
2020-06-19 15:46:02 +09:00