Commit graph

9 commits

Author SHA1 Message Date
Sergii Liebodkin
9afa1742be examples: fixed manual loading of binary data (jpg, png, raw ect)
To load binary data operations must be performed in binary mode rather than text.
The issue appears on windows platform, especially for PNG loading
2023-11-17 20:46:28 +09:00
Sergii
4da90b2847 picture: added ability to support premultiplied for picture raw loader
[issues 1479: picture raw loader to support premultiplied](https://github.com/thorvg/thorvg/issues/1764)

api changes:
    Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy);
    Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool premultiplied, bool copy);

capi changes
    TVG_API Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool copy);
    TVG_API Tvg_Result tvg_picture_load_raw(Tvg_Paint* paint, uint32_t *data, uint32_t w, uint32_t h, bool premultiplied, bool copy);
2023-11-08 10:46:23 +09:00
Hermet Park
d6fffd13c2 api: revise the engine initializer for the 1.0 release.
This change introduces the CanvasEngine::All type to automatically
initialize the engines available on the current system.

These revisions improve the usability of these APIs.

Addtions:
- enum class CanvasEngine::All

Modifications:
- Result Initializer::init(CanvasEngine engine, uint32_t threads) ->
Result Initializer::init(uint32_t threads, CanvasEngine engine = tvg::CanvasEngine::All)
2023-10-30 11:48:02 +09:00
Hermet Park
ad9d9d0ecd loader/lottie: support trimpath feature 2023-09-01 13:16:18 +09:00
Hermet Park
21413b1872 sw_engine: optimizing the masking feature
replaced 32-bit operations with 8-bit operations for masking buffers.

We might need a grasycale image support for applying 1-byte channel masking input(Picture).
Some of masking implementation are disabled by this reason.

Also, I don't expecct it's necessary for the thorvg now.
2023-08-28 11:55:10 +09:00
Hermet Park
624b275628 sw_engine: improve the masking methods
Corrected subtract/intersect masking behaviors that were inaccurately functioning
within chain-masking.

This also helps to enhance the masking performance by reducing the
masking region when applying subtract/intersect.

@Issue: https://github.com/thorvg/thorvg/issues/1606
2023-08-28 11:55:01 +09:00
Hermet Park
4627daf6f7 api: enhance API usability
Set the default values of rx = 0 and ry = 0 for the shape.
Only the round rectangle shape requires the usage of these values.
2023-06-13 10:42:57 +09:00
Hermet Park
1ae92daa9d api: enhance Shape::fill() method usage.
Designate a default value for alpha which is mostly optional.
2023-06-07 12:10:31 +09:00
Hermet Park
d4dc625481 examples MaskMethods: add a new example
This is introduced for Masking Methods.
2023-06-03 15:50:48 +09:00