diff --git a/inc/thorvg.h b/inc/thorvg.h index 02bcb6a1..104cd733 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -1625,6 +1625,30 @@ public: _TVG_DECLARE_PRIVATE(Accessor); }; + +/** + * @brief The cast() function is a utility function used to cast a 'Paint' to type 'T'. + * + * @BETA_API + */ +template +std::unique_ptr cast(Paint* paint) +{ + return std::unique_ptr(static_cast(paint)); +} + +/** + * @brief The cast() function is a utility function used to cast a 'Fill' to type 'T'. + * + * @BETA_API + */ +template +std::unique_ptr cast(Fill* fill) +{ + return std::unique_ptr(static_cast(fill)); +} + + /** @}*/ } //namespace