![]() |
ThorVG
v0.11
|
The Animation class enables manipulation of animatable images. More...
Public Member Functions | |
Result | frame (uint32_t no) noexcept |
Specifies the current frame in the animation. More... | |
Picture * | picture () const noexcept |
Retrieves a picture instance associated with this animation instance. More... | |
uint32_t | curFrame () const noexcept |
Retrieves the current frame number of the animation. More... | |
uint32_t | totalFrame () const noexcept |
Retrieves the total number of frames in the animation. More... | |
float | duration () const noexcept |
Retrieves the duration of the animation in seconds. More... | |
Static Public Member Functions | |
static std::unique_ptr< Animation > | gen () noexcept |
Creates a new Animation object. More... | |
The Animation class enables manipulation of animatable images.
This class supports the display and control of animation frames.
@BETA_API
|
noexcept |
Retrieves the current frame number of the animation.
@BETA_API
|
noexcept |
Retrieves the duration of the animation in seconds.
@BETA_API
|
noexcept |
Specifies the current frame in the animation.
[in] | no | The index of the animation frame to be displayed. The index should be less than the totalFrame(). |
Result::Success | Successfully set the frame. |
Result::InsufficientCondition | No animatable data loaded from the Picture. |
Result::NonSupport | The Picture data does not support animations. |
@BETA_API
|
staticnoexcept |
|
noexcept |
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). After setting up the picture, it can be pushed to the designated canvas, enabling control over animation frames with this Animation instance.
@BETA_API
|
noexcept |
Retrieves the total number of frames in the animation.
@BETA_API