ThorVG
v0.15
|
The Animation class enables manipulation of animatable images. More...
Public Member Functions | |
Result | frame (float no) noexcept |
Specifies the current frame in the animation. More... | |
Picture * | picture () const noexcept |
Retrieves a picture instance associated with this animation instance. More... | |
float | curFrame () const noexcept |
Retrieves the current frame number of the animation. More... | |
float | 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... | |
Result | segment (float begin, float end) noexcept |
Specifies the playback segment of the animation. More... | |
Result | segment (float *begin, float *end=nullptr) noexcept |
Gets the current segment. 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.
|
noexcept |
Retrieves the current frame number of the animation.
|
noexcept |
Retrieves the duration of the animation in seconds.
|
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::InsufficientCondition | if the given no is the same as the current frame value. |
Result::NonSupport | The current Picture data does not support animations. |
Result::InsufficientCondition
. Values less than 0.001 may be disregarded and may not be accurately retained by the Animation.
|
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.
|
noexcept |
Gets the current segment.
[out] | begin | segment start. |
[out] | end | segment end. |
Result::InsufficientCondition | In case the animation is not loaded. |
Result::NonSupport | When it's not animatable. |
|
noexcept |
Specifies the playback segment of the animation.
The set segment is designated as the play area of the animation. This is useful for playing a specific segment within the entire animation. After setting, the number of animation frames and the playback time are calculated by mapping the playback segment as the entire range.
[in] | begin | segment start. |
[in] | end | segment end. |
Result::InsufficientCondition | In case the animation is not loaded. |
Result::NonSupport | When it's not animatable. |
end
should not be higher than begin
.
|
noexcept |
Retrieves the total number of frames in the animation.