mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 14:48:24 +00:00
capi: add tvg_paint_get_transform() api.
This commit is contained in:
parent
6b7aa8ad9e
commit
b299157123
2 changed files with 20 additions and 0 deletions
|
@ -721,6 +721,19 @@ TVG_EXPORT Tvg_Result tvg_paint_translate(Tvg_Paint* paint, float x, float y);
|
|||
TVG_EXPORT Tvg_Result tvg_paint_transform(Tvg_Paint* paint, const Tvg_Matrix* m);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Gets the matrix of the affine transformation of the given Tvg_Paint object.
|
||||
*
|
||||
* \param[in] paint The Tvg_Paint object of which to get the transformation matrix.
|
||||
* \param[out] m The 3x3 augmented matrix.
|
||||
*
|
||||
* \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_transform(Tvg_Paint* paint, Tvg_Matrix* m);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Sets the opacity of the given Tvg_Paint.
|
||||
*
|
||||
|
|
|
@ -161,6 +161,13 @@ TVG_EXPORT Tvg_Result tvg_paint_transform(Tvg_Paint* paint, const Tvg_Matrix* m)
|
|||
return (Tvg_Result) reinterpret_cast<Paint*>(paint)->transform(*(reinterpret_cast<const Matrix*>(m)));
|
||||
}
|
||||
|
||||
TVG_EXPORT Tvg_Result tvg_paint_get_transform(Tvg_Paint* paint, Tvg_Matrix* m)
|
||||
{
|
||||
if (!paint || !m) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
*reinterpret_cast<Matrix*>(m) = reinterpret_cast<Paint*>(paint)->transform();
|
||||
return TVG_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
TVG_EXPORT Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue