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.

参见

Animation

备注

Experimental API

Public Functions

~LottieAnimation()
Result override(const char *slot) noexcept

Override Lottie properties using slot data.

备注

Experimental API

参数:

slot -- [in] The Lottie slot data in JSON format to override, or nullptr to reset.

返回值:
  • 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.

备注

If a marker is specified, the previously set segment will be disregarded.

备注

Set nullptr to reset the specified segment.

备注

Experimental API

参数:

marker -- [in] The name of the segment marker.

返回值:
  • 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.

备注

Experimental API

返回值:

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.

备注

Experimental API

参数:

idx -- [in] The index of the animation marker, starts from 0.

返回值:

The -- name of marker when succeed, nullptr otherwise.

Public Static Functions

static std::unique_ptr<LottieAnimation> gen() noexcept

Creates a new LottieAnimation object.

备注

Experimental API

返回:

A new LottieAnimation object.