mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
Capi: Composite Method binding
This commit is contained in:
parent
7d01a1c232
commit
9b4769076f
2 changed files with 22 additions and 0 deletions
|
@ -105,6 +105,12 @@ typedef enum {
|
|||
TVG_FILL_RULE_EVEN_ODD
|
||||
} Tvg_Fill_Rule;
|
||||
|
||||
typedef enum {
|
||||
TVG_COMPOSITE_METHOD_NONE = 0,
|
||||
TVG_COMPOSITE_METHOD_CLIP_PATH,
|
||||
TVG_COMPOSITE_METHOD_ALPHA_MASK
|
||||
} Tvg_Composite_Method;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y;
|
||||
|
@ -572,6 +578,17 @@ TVG_EXPORT Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint);
|
|||
*/
|
||||
TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h);
|
||||
|
||||
/*!
|
||||
* \fn TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(const Tvg_Paint* paint, Tvg_Composite_Method method)
|
||||
* \brief The function set composition method
|
||||
* \param[in] paint Tvg_Paint pointer
|
||||
* \param[in] method Tvg_Composite_Method used composite method
|
||||
* \return Tvg_Result return value
|
||||
* - TVG_RESULT_SUCCESS: if ok.
|
||||
* - TVG_RESULT_INVALID_PARAMETERS: if paint is invalid
|
||||
*/
|
||||
TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(const Tvg_Paint* paint, Tvg_Composite_Method method);
|
||||
|
||||
/************************************************************************/
|
||||
/* Shape API */
|
||||
/************************************************************************/
|
||||
|
|
|
@ -191,6 +191,11 @@ TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, flo
|
|||
return (Tvg_Result) reinterpret_cast<const Paint*>(paint)->bounds(x, y, w, h);
|
||||
}
|
||||
|
||||
TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(const Tvg_Paint* paint, Tvg_Composite_Method method)
|
||||
{
|
||||
if (!paint) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
return (Tvg_Result) reinterpret_cast<const Paint*>(paint)->composite(unique_ptr<Paint>((Paint*)(paint)), (CompositeMethod)method);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* Shape API */
|
||||
|
|
Loading…
Add table
Reference in a new issue