mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
capi: added the composite getter
This commit is contained in:
parent
733f0b7f9a
commit
b31961e517
2 changed files with 21 additions and 0 deletions
|
@ -809,6 +809,19 @@ TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, flo
|
|||
TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint* target, Tvg_Composite_Method method);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Gets the composition target object and the composition method.
|
||||
*
|
||||
* \param[in] paint The source object of the composition.
|
||||
* \param[out] target The target object of the composition.
|
||||
* \param[out] method The method used to composite the source object with the target.
|
||||
*
|
||||
* \return Tvg_Result enumeration.
|
||||
* \retval TVG_RESULT_SUCCESS Succeed.
|
||||
* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument.
|
||||
*/
|
||||
TVG_EXPORT Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Composite_Method* method);
|
||||
|
||||
/** \} */ // end defgroup ThorVGCapi_Paint
|
||||
|
||||
|
||||
|
|
|
@ -204,6 +204,14 @@ TVG_EXPORT Tvg_Result tvg_paint_set_composite_method(Tvg_Paint* paint, Tvg_Paint
|
|||
return (Tvg_Result) reinterpret_cast<Paint*>(paint)->composite(unique_ptr<Paint>((Paint*)(target)), (CompositeMethod)method);
|
||||
}
|
||||
|
||||
|
||||
TVG_EXPORT Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const Tvg_Paint** target, Tvg_Composite_Method* method)
|
||||
{
|
||||
if (!paint || !target || !method) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
*reinterpret_cast<CompositeMethod*>(method) = reinterpret_cast<const Paint*>(paint)->composite(reinterpret_cast<const Paint**>(target));
|
||||
return TVG_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* Shape API */
|
||||
/************************************************************************/
|
||||
|
|
Loading…
Add table
Reference in a new issue