Hermet Park
0a16152d75
api: renamed the composite with mask.
...
Since we've separated ClipPath and Masking,
Masking now has a distinct and independent purpose.
API Modification:
- enum class CompositeMethod -> enum class MaskMethod
- Result Paint::composite(std::unique_ptr<Paint> target, CompositeMethod method) -> Result Paint::mask(std::unique_ptr<Paint> target, MaskMethod method)
- CompositeMethod Paint::mask(const Paint** target) const -> MaskMethod Paint::mask(const Paint** target) const
issue: https://github.com/thorvg/thorvg/issues/1372
2024-10-16 14:41:26 +09:00
Hermet Park
76fb3f3cd9
api: clean up
...
promoted offical c++ apis (v0.15)
- enum class BlendMethod
- enum class CanvasEngine::Wg
- virtual Result Canvas::viewport(int32_t x, int32_t y, int32_t w, int32_t h);
- class Text
- Result Text::fill(uint8_t r, uint8_t g, uint8_t b)
- Result Text::fill(std::unique_ptr<Fill> f)
- static Result Text::unload(const std::string& path)
- static Result Text::load(const std::string& path)
- static Result Text::load(const char* name, const char* data, uint32_t size, const std::string& mimeType = "ttf", bool copy = false)
- static std::unique_ptr<Text> Text::gen()
- class WgCanvas
- static std::unique_ptr<WgCanvas> WgCanvas::gen()
- static const char* Initializer::version(uint32_t* major, uint32_t* minor, uint32_t* micro)
- class LottieAnimation
promoted official c apis (v0.15)
- Tvg_Blend_Method
- Tvg_Result tvg_engine_version(uint32_t* major, uint32_t* minor, uint32_t* micro, const char** version)
- Tvg_Result tvg_canvas_set_viewport(Tvg_Canvas* canvas, int32_t x, int32_t y, int32_t w, int32_t h)
- Tvg_Result tvg_paint_set_blend_method(Tvg_Paint* paint, Tvg_Blend_Method method)
- Tvg_Paint* tvg_text_new(void)
- Tvg_Result tvg_text_set_fill_color(Tvg_Paint* paint, uint8_t r, uint8_t g, uint8_t b)
- Tvg_Result tvg_text_set_gradient(Tvg_Paint* paint, Tvg_Gradient* gradient)
- Tvg_Result tvg_font_load(const char* path)
- Tvg_Result tvg_font_load_data(const char* name, const char* data, uint32_t size, const char *mimetype, bool copy)
- Tvg_Result tvg_font_unload(const char* path)
- Tvg_Animation* tvg_lottie_animation_new(void)
removed experimental apis
- BlendMethod paint::blend() const
- bool Shape::strokeTrim(float* begin, float* end) const
- Tvg_Result tvg_paint_get_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method* method)
- Tvg_Result tvg_shape_get_stroke_trim(Tvg_Paint* paint, float* begin, float* end, bool* simultaneous)
- tvg_text_set_linear_gradient(Paint* paint, Tvg_Gradient* gradient)
- tvg_text_set_radial_gradient(Paint* paint, Tvg_Gradient* gradient)
issue: https://github.com/thorvg/thorvg/issues/1372
2024-09-23 21:53:50 +09:00
Hermet Park
d70aa68dcc
test: replaced ClipPath with clip()
2024-09-19 14:46:05 +09:00
Hermet Park
a746e1fcd6
renderer: blending refactoring++
...
- reordered the blending types to align with lottie spec.
- removed source over.
2024-09-09 21:18:13 +09:00
Hermet Park
43c87b4eb5
renderer/paint: revise the Paint::bounds() behavior
...
The current Paint::bounds(transform=true) returns the coordinates
of the paint in its local coordinates after transformation.
However, it did not convert the origin to the world coordinate.
This is problematic when the user wants to determine
the paint's position and size with the origin being the canvas.
Specifically, this matters that when the paint is belonged
to a certain scene.
Now, the bounds() method returns the coordinates
of the paint's bounding box with the corrected world space.
User can figure out the actual boundary within the painted result.
Remark that, this may break the functional behavior compatibility.
2024-08-07 12:02:22 +09:00
Hermet Park
eb86ac539c
renderer: Rectified the paint transforms.
...
This corrects the return value to Result::InsufficientCondition
when a custom transform is applied.
Additionally, unnecessary x and y member fields have been removed.
2024-07-07 21:43:30 +09:00
Jinny You
2c6c8d3b21
updated copyright date ( #1866 )
2023-12-28 10:43:25 +09:00
Mira Grudzinska
c5a02b90df
tests: bounds test ++
...
The 'transformed' arg of the 'bounds' api
wasn't tested. Added.
2023-08-01 14:53:12 +02:00
Hermet Park
3512beab9f
test: ++blending
2023-06-20 11:30:18 +09:00
Martin Capitanio
4def2a679c
Fix clang compiler warnings in unit tests.
...
[clang] Warn on unqualified calls to std::move and std::forward
See: https://reviews.llvm.org/D119670
[141/166] Compiling C++ object test/tvgUnitTests.p/testAccessor.cpp.o
../thorvg-git/test/testAccessor.cpp:58:29: warning: unqualified call to
'std::move' [-Wunqualified-std-cast-call]
picture = accessor->set(move(picture), nullptr);
^
std::
...
2023-06-07 16:56:30 +09:00
Hermet Park
72f89fcf53
test: add Inverse Luma Mask test cases
2023-05-20 20:11:58 +09:00
Hermet Park
9d9f38c875
common: code refactoring
...
Replace standard casting with tvg::cast()
2023-05-15 12:07:55 +09:00
Hermet Park
89dc7616cf
test paint: ++CompositeMethod coverage
2023-05-09 23:19:15 +09:00
Hermet Park
5d930e51e4
test/examples: -- deprecated apis call warnings.
...
Result load(const char* data, uint32_t size, bool copy = false)
-> Result load(const char* data, uint32_t size, const std::string& mimeType, bool copy = false)
Result bounds(float* x, float* y, float* w, float* h)
-> Result bounds(float* x, float* y, float* w, float* h, bool transformed)
2023-04-22 18:32:22 +09:00
Hermet Park
f0ae3e9cee
test: fix broken plugin support.
...
The thorvg test should not attempt to perform features
that were not enabled, as this will cause them to fail.
@Issues: https://github.com/thorvg/thorvg/issues/1251
2023-04-06 19:47:10 +09:00
Hermet Park
9b3c34c3b1
updated copyright.
2023-01-14 13:48:11 +09:00
Rémi Verschelde
46c3fc1f94
Format code files with dos2unix, ensure newline at EOF
2022-07-10 23:21:05 +09:00
Hermet Park
f0141e63de
updated copyright date.
2022-01-12 14:08:48 +09:00
Hermet Park
fd74e0fae8
test: fix memory leak.
...
these duplicates are not unique_ptr, should be taken care.
@Issue: https://github.com/Samsung/thorvg/issues/995
2021-11-05 21:48:24 +09:00
Hermet Park
b3b9d8edf6
test paint: add missing Paint utc
2021-07-27 10:21:09 +09:00