Commit graph

94 commits

Author SHA1 Message Date
Mira Grudzinska
00e5c87a79 capi: the version api binding 2024-07-19 08:42:09 +09:00
Mira Grudzinska
08d310111e capi: text c-api binding
@Issue: https://github.com/thorvg/thorvg/issues/2374
2024-06-24 14:55:02 +09:00
Mira Grudzinska
4c546f843f capi: remove the incorrectly named API
There was a typo in the name (tvg_canvas_est_viewport),
which made it seem like it was missing. The correctly
named API has already been added, so this one can be
removed.
2024-06-24 14:51:51 +09:00
Hermet Park
d5f41c85d3 api: corrected return type.
NonSupport indicates unsupported options due to disabled features
or lack of system support. InvalidArgument indicates the case
such as incorrect parameter values.
2024-06-24 14:42:46 +09:00
Mira Grudzinska
710fa22d50 capi: bindings for strokeTrim
Example Capi.cpp modyfied.
2024-06-24 14:41:15 +09:00
Abdelrahman Ashraf
3a2183dfa7 fix: 🐛 missing binding for tvg_canvas_set_viewport c api 2024-06-24 14:32:03 +09:00
Hermet Park
c9d2fee233 capi: support canvas viewport api
New Experimental API:
- Tvg_Result tvg_canvas_set_viewport(Tvg_Canvas* canvas, int32_t x, int32_t y, int32_t w, int32_t h);
2024-06-24 14:21:03 +09:00
Mira Grudzinska
548a201b93 build: add missing ifdef
The thorvg_lottie.h file wasn’t accessible
if the lottie loader was not activated,
causing a compilation error.
2024-06-24 12:18:10 +09:00
Jinny You
e9bd05bad5 bindings/capi: Support lottie segment and marker
new experimental apis for animation segment and lottie marker.

APIs:
- TVG_API Tvg_Result tvg_animation_set_segment(Tvg_Animation* animation, float begin, float end)
- TVG_API Tvg_Result tvg_animation_get_segment(Tvg_Animation* animation, float* begin, float* end = nullptr)
- TVG_API Tvg_Result tvg_lottie_animation_set_marker(Tvg_Animation* animation, const char* marker)
- TVG_API Tvg_Result tvg_lottie_animation_get_marker_cnt(Tvg_Animation* animation, uint32_t* cnt)
- TVG_API Tvg_Result tvg_lottie_animation_get_marker(Tvg_Animation* animation, uint32_t idx, const char** name)
2024-06-24 12:03:24 +09:00
Jinny You
6bfd11a80c capi: added missing lottie header
Currently, the Lottie Animation API is not working due to the missing header.
2024-04-06 12:08:21 +09:00
Hermet Park
0f83850da6 binding/capi: support lottie extensions
these experimental apis are allowed to use
when the lottie loader is enabled.

APIs:
- Tvg_Animation* tvg_lottie_animation_new()
- Tvg_Result tvg_lottie_animation_override(Tvg_Animation* animation, const char* slot)
2024-04-06 12:08:21 +09:00
Jinny You
92288c8291 updated copyright date (#1866) 2024-01-02 20:34:12 +09:00
Hermet Park
0832a188fe animation/lottie: updated the frame count unit.
replace the frame count unit from the int32_t to float
since animations could smoothly interpolate key-frames.

This notificably improve the animation smoothness in Lottie

Beta API changes:
Result Animation::frame(uint32_t no) -> Result Animation::frame(float no)
uint32_t Animation::curFrame() const -> float Animation::curFrame() const
uint32_t Animation::totalFrame() const -> float Animation::totalFrame() const
2023-12-26 17:51:53 +09:00
Sergii Liebodkin
da72a57f8a capi: introduce missing blend functions in capi bindings 2023-12-26 17:50:22 +09:00
Hermet Park
749523b709 capi/animation: support animation features under the beta.
New APIs:
- Tvg_Animation* tvg_animation_new();
- Tvg_Result tvg_animation_set_frame(Tvg_Animation* animation, uint32_t no);
- Tvg_Paint* tvg_animation_get_picture(Tvg_Animation* animation);
- Tvg_Result tvg_animation_get_cur_frame(Tvg_Animation* animation, uint32_t* no);
- Tvg_Result tvg_animation_get_total_frame(Tvg_Animation* animation, uint32_t* cnt);
- Tvg_Result tvg_animatoon_get_duration(Tvg_Animation* animation, float* duration);
- Tvg_Result tvg_animation_del(Tvg_Animation* animation);
2023-09-25 12:27:22 +09:00
Hermet Park
7d797ee548 Yet we don't break apis, this patch reverts the next:
cb36c25aff
8c0fc2b25a
c1e4e0808a

Those reverted changes sholud be in the bucket, the next issue item:

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-08-24 01:00:57 +09:00
Mira Grudzinska
8c0fc2b25a capi: dashed stroke setter and getter modyfied
tvg_shape_set_stroke_dash() and tvg_shape_get_stroke_dash()
require an extra argument: offset
2023-08-23 12:40:27 +09:00
Hermet Park
4f26a84b53 common: optimize paint data size.
packing the data fields with the appropriate size.

96 -> 24 (-9 bytes per one paint)
2023-06-14 10:46:30 +09:00
Martin Capitanio
44a750ee5d API, CAPI, sw_engine: add suport for stroke-miterlimit. 2023-06-13 10:42:20 +09:00
Hermet Park
b214fd23bc common canvas/scene: introduce paints() api that returns the list of the paints.
These new apis would enable users to easily modify the motion scene,
The data structure of the paints has been changed from an array to a list.

@APIs:
std::list<Paint*>& Canvas::paints() noexcept;
std::list<Paint*>& Scene::paints() noexcept;

@Deprecated:
Result Canvas::reserve(uint32_t size) noexcept;
Result Scene::reserve(uint32_t size) noexcept;

@Issue: https://github.com/thorvg/thorvg/issues/1203
2023-06-09 10:54:03 +09:00
Mira Grudzinska
2309a48369 capi: tvg_shape_set_paint_order introduced
Capi sets the rendering order of the stroke and the fill.
2023-05-20 13:23:47 +09:00
Hermet Park
5ceeb32ef0 api: remove a beta api.
- Result Picture::viewbox(float* x, float* y, float* w, float* h) const;  //c++
- vg_Result tvg_picture_get_viewbox(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);  //c

@Issue: https://github.com/thorvg/thorvg/issues/1372
2023-05-20 13:22:52 +09:00
Mira Grudzinska
cc75928c23 capi: type identifier apis added
The tvg_gradient_get_identifier and tvg_paint_get_identifier
apis have been introduced. They set the newly introduced
Tvg_Identifier enum, which indicates the paint and gradient
types, respectively.
2023-04-25 09:15:28 +09:00
Hermet Park
69063d2405 infra: specify TVG_API for both static/dynamic linking.
The previous meson script was incomplete,
therefore this change requires it to be revised.

To enable static linking use the next meson option.
"-Ddefault_library=static"

Issue: https://github.com/thorvg/thorvg/issues/1234
2023-04-22 18:32:22 +09:00
Hermet Park
9b3c34c3b1 updated copyright. 2023-01-14 13:48:11 +09:00
Hermet Park
f0141e63de updated copyright date. 2022-01-12 14:08:48 +09:00
Mira Grudzinska
2780d77a52 capi: tvg_paint_transform -> tvg_paint_set_transform 2021-10-26 19:20:15 +09:00
Mira Grudzinska
8c52f2a870 capi: casting on 'const Paint*' instead of constness removing 2021-10-26 11:51:35 +09:00
Hermet Park
5be27a151e capi: ++missing const in capis.
Non-changeable apis should keep the const parameter so that
user knows the api won't change the internal data.

Thanksfully, we didn't release the capis, we can change it.
2021-10-25 22:21:09 +09:00
Mira Grudzinska
d25a285b4c capi: gradient transformation apis added 2021-10-25 19:35:00 +09:00
Mira Grudzinska
280d27ac83 capi: added pointer validation 2021-10-23 12:18:23 +09:00
Mira Grudzinska
95430fc645 capi: change defines to enum
Tvg_Engine enum introduced to replace TVG_ENGINE_SW/GL defs.
2021-10-14 12:39:54 +09:00
Mira Grudzinska
e6debdbf15
capi: tvg_swcanvas_set_mempool capi added (#903)
* capi: tvg_swcanvas_set_mempool capi added

* tests: tvg_swcanvas_set_mempool added to the tests
2021-10-13 19:31:39 +09:00
Hermet Park
0f0a0ae4f0 bindings capi: code refactoring
fix for code consistency, no logical changes.
2021-10-13 19:02:55 +09:00
Mira Grudzinska
600055dacd capi: saver capis added 2021-10-13 18:58:18 +09:00
Mira Grudzinska
d40d2ea288 capi: introduced Tvg_Colorspace enum instead of defs
Used in the tvg_swcanvas_set_target() capi.
2021-10-13 18:55:17 +09:00
Mira Grudzinska
e0488f4a8d capi: tvg_gradient_duplicate() added 2021-10-13 18:34:02 +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
5b7f94a527 capi: picture size apis added 2021-10-05 16:03:10 +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
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
a4ccf4d812 common picture: recover viewbox() api.
though picture has size() api, we have a regression issue in tizen,
we can't remove this api until we resolve any regression conditions.
2021-08-09 12:39:21 +09:00
Michal Maciola
cff8815404
loaders: Pass mimetype to picture::load
* loaders: Pass mimetype to picture::load

Added mimetype attribute to enfaster loading using a proper loader.

@Changed api: Picture::load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)
@issue: #571
2021-08-05 11:02:26 +09:00
Hermet Park
f7f241cff5 common picture: remove viewbox() api.
picture provides size() interface to return the image size,
viewbox() is conceptually not correct with the Picture.

Remove it under the beta api.
2021-07-28 13:07:43 +09:00
Michal Maciola
dc516df9d8
capi binding: added missing null paint check (#616) 2021-07-14 12:19:42 +02: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
Michal Maciola
9453273fc8 capi: picture load data
Added 'tvg_picture_load_data' capi.
2021-06-11 20:54:07 +09:00
Hermet Park
b299157123 capi: add tvg_paint_get_transform() api. 2021-06-04 16:48:00 +09:00
Hermet Park
c7a156d5a6 capi: fix usage after this - 2c37191584. 2021-06-02 20:14:10 +09:00