api: Promote experimental Animation APIs to official status.

These APIs have been thoroughly tested and verified.

New API:
- Result Animation::frame(float no)
- Picture* Animation::picture() const
- float Animation::curFrame() const
- float Animation::totalFrame() const
- float Animation::duration() const
- static Animation::std::unique_ptr<Animation> gen()

New CAPI:
- Tvg_Animation* tvg_animation_new()
- Tvg_Result tvg_animation_set_frame(Tvg_Animation* animation, float no)
- Tvg_Paint* tvg_animation_get_picture(Tvg_Animation* animation)
- Tvg_Result tvg_animation_get_frame(Tvg_Animation* animation, float* no)
- Tvg_Result tvg_animation_get_total_frame(Tvg_Animation* animation, float* cnt)
- Tvg_Result tvg_animation_get_duration(Tvg_Animation* animation, float* duration)
- Tvg_Result tvg_animation_del(Tvg_Animation* animation)

issue: https://github.com/thorvg/thorvg/issues/2067
This commit is contained in:
Hermet Park 2024-03-25 14:13:23 +09:00 committed by Hermet Park
parent 1f996c1382
commit e4775727eb
2 changed files with 7 additions and 14 deletions

View file

@ -1785,7 +1785,6 @@ public:
* *
* This class supports the display and control of animation frames. * This class supports the display and control of animation frames.
* *
* @note Experimental API
*/ */
class TVG_API Animation class TVG_API Animation
@ -1804,7 +1803,6 @@ public:
* *
* @see totalFrame() * @see totalFrame()
* *
* @note Experimental API
*/ */
Result frame(float no) noexcept; Result frame(float no) noexcept;
@ -1819,7 +1817,6 @@ public:
* *
* @warning The picture instance is owned by Animation. It should not be deleted manually. * @warning The picture instance is owned by Animation. It should not be deleted manually.
* *
* @note Experimental API
*/ */
Picture* picture() const noexcept; Picture* picture() const noexcept;
@ -1833,7 +1830,6 @@ public:
* @see Animation::frame(float no) * @see Animation::frame(float no)
* @see Animation::totalFrame() * @see Animation::totalFrame()
* *
* @note Experimental API
*/ */
float curFrame() const noexcept; float curFrame() const noexcept;
@ -1845,7 +1841,6 @@ public:
* @note Frame numbering starts from 0. * @note Frame numbering starts from 0.
* @note If the Picture is not properly configured, this function will return 0. * @note If the Picture is not properly configured, this function will return 0.
* *
* @note Experimental API
*/ */
float totalFrame() const noexcept; float totalFrame() const noexcept;
@ -1856,7 +1851,6 @@ public:
* *
* @note If the Picture is not properly configured, this function will return 0. * @note If the Picture is not properly configured, this function will return 0.
* *
* @% Experimental API
*/ */
float duration() const noexcept; float duration() const noexcept;
@ -1865,7 +1859,6 @@ public:
* *
* @return A new Animation object. * @return A new Animation object.
* *
* @note Experimental API
*/ */
static std::unique_ptr<Animation> gen() noexcept; static std::unique_ptr<Animation> gen() noexcept;

View file

@ -97,7 +97,7 @@ typedef struct _Tvg_Gradient Tvg_Gradient;
typedef struct _Tvg_Saver Tvg_Saver; typedef struct _Tvg_Saver Tvg_Saver;
/** /**
* \brief A structure representing an animation controller object. (Experimental API) * \brief A structure representing an animation controller object.
*/ */
typedef struct _Tvg_Animation Tvg_Animation; typedef struct _Tvg_Animation Tvg_Animation;
@ -2231,7 +2231,7 @@ TVG_API Tvg_Result tvg_saver_del(Tvg_Saver* saver);
/************************************************************************/ /************************************************************************/
/*! /*!
* \brief Creates a new Animation object. (Experimental API) * \brief Creates a new Animation object.
* *
* \return Tvg_Animation A new Tvg_Animation object. * \return Tvg_Animation A new Tvg_Animation object.
*/ */
@ -2239,7 +2239,7 @@ TVG_API Tvg_Animation* tvg_animation_new();
/*! /*!
* \brief Specifies the current frame in the animation. (Experimental API) * \brief Specifies the current frame in the animation.
* *
* \param[in] animation A Tvg_Animation pointer to the animation object. * \param[in] animation A Tvg_Animation pointer to the animation object.
* \param[in] no The index of the animation frame to be displayed. The index should be less than the tvg_animatio_total_frame(). * \param[in] no The index of the animation frame to be displayed. The index should be less than the tvg_animatio_total_frame().
@ -2256,7 +2256,7 @@ TVG_API Tvg_Result tvg_animation_set_frame(Tvg_Animation* animation, float no);
/*! /*!
* \brief Retrieves a picture instance associated with this animation instance. (Experimental API) * \brief Retrieves a picture instance associated with this animation instance.
* *
* This function provides access to the picture instance that can be used to load animation formats, such as Lottie(json). * This function provides access to the picture instance that can be used to load animation formats, such as Lottie(json).
* After setting up the picture, it can be pushed to the designated canvas, enabling control over animation frames * After setting up the picture, it can be pushed to the designated canvas, enabling control over animation frames
@ -2272,7 +2272,7 @@ TVG_API Tvg_Paint* tvg_animation_get_picture(Tvg_Animation* animation);
/*! /*!
* \brief Retrieves the current frame number of the animation. (Experimental API) * \brief Retrieves the current frame number of the animation.
* *
* \param[in] animation A Tvg_Animation pointer to the animation object. * \param[in] animation A Tvg_Animation pointer to the animation object.
* \param[in] no The current frame number of the animation, between 0 and totalFrame() - 1. * \param[in] no The current frame number of the animation, between 0 and totalFrame() - 1.
@ -2288,7 +2288,7 @@ TVG_API Tvg_Result tvg_animation_get_frame(Tvg_Animation* animation, float* no);
/*! /*!
* \brief Retrieves the total number of frames in the animation. (Experimental API) * \brief Retrieves the total number of frames in the animation.
* *
* \param[in] animation A Tvg_Animation pointer to the animation object. * \param[in] animation A Tvg_Animation pointer to the animation object.
* \param[in] cnt The total number of frames in the animation. * \param[in] cnt The total number of frames in the animation.
@ -2304,7 +2304,7 @@ TVG_API Tvg_Result tvg_animation_get_total_frame(Tvg_Animation* animation, float
/*! /*!
* \brief Retrieves the duration of the animation in seconds. (Experimental API) * \brief Retrieves the duration of the animation in seconds.
* *
* \param[in] animation A Tvg_Animation pointer to the animation object. * \param[in] animation A Tvg_Animation pointer to the animation object.
* \param[in] duration The duration of the animation in seconds. * \param[in] duration The duration of the animation in seconds.