thorvg_lottie.h
-
namespace tvg
-
class LottieAnimation : public tvg::Animation
- #include <thorvg_lottie.h>
The LottieAnimation class enables control of advanced Lottie features.
This class extends the Animation and has additional interfaces.
See also
- Since
0.15
Public Functions
-
~LottieAnimation()
-
Result override(const char *slot) noexcept
Override Lottie properties using slot data.
Note
Experimental API
- Parameters:
slot – [in] The Lottie slot data in JSON format to override, or
nullptr
to reset.- Return values:
Result::Success – When succeed.
Result::InsufficientCondition – In case the animation is not loaded.
Result::InvalidArguments – When the given parameter is invalid.
-
Result segment(const char *marker) noexcept
Specifies a segment by marker.
Markers are used to control animation playback by specifying start and end points, eliminating the need to know the exact frame numbers. Generally, markers are designated at the design level, meaning the callers must know the marker name in advance to use it.
Note
If a
marker
is specified, the previously set segment will be disregarded.Note
Set
nullptr
to reset the specified segment.Note
Experimental API
- Parameters:
marker – [in] The name of the segment marker.
- Return values:
Result::Success – When successful.
Result::InsufficientCondition – If the animation is not loaded.
Result::InvalidArguments – When the given parameter is invalid.
Result::NonSupport – When it's not animatable.
-
uint32_t markersCnt() noexcept
Gets the marker count of the animation.
See also
Note
Experimental API
- Return values:
The – count of the markers, zero if there is no marker.
-
const char *marker(uint32_t idx) noexcept
Gets the marker name by a given index.
See also
Note
Experimental API
- Parameters:
idx – [in] The index of the animation marker, starts from 0.
- Return values:
The – name of marker when succeed,
nullptr
otherwise.
Public Static Functions
-
static std::unique_ptr<LottieAnimation> gen() noexcept
Creates a new LottieAnimation object.
- Since
0.15
- Returns:
A new LottieAnimation object.
-
class LottieAnimation : public tvg::Animation