mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-21 15:32:49 +00:00

Implemented the ability to revert Lottie slots by calling override with nullptr. This functionality allows for the complete reversal of applied slots. usage: - `animation->override(nullptr)` Co-Authored-By: Hermet Park <hermet@lottiefiles.com>
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#ifndef _THORVG_LOTTIE_H_
|
|
#define _THORVG_LOTTIE_H_
|
|
|
|
#include <thorvg.h>
|
|
|
|
namespace tvg
|
|
{
|
|
|
|
/**
|
|
* @class LottieAnimation
|
|
*
|
|
* @brief The LottieAnimation class enables control of advanced Lottie features.
|
|
*
|
|
* This class extends the Animation and has additional interfaces.
|
|
*
|
|
* @see Animation
|
|
*
|
|
* @note Experimental API
|
|
*/
|
|
class TVG_API LottieAnimation final : public Animation
|
|
{
|
|
public:
|
|
~LottieAnimation();
|
|
|
|
/**
|
|
* @brief Override Lottie properties using slot data.
|
|
*
|
|
* @param[in] slot The Lottie slot data in JSON format to override, or @c nullptr to reset.
|
|
*
|
|
* @retval Result::Success When succeed.
|
|
* @retval Result::InsufficientCondition In case the animation is not loaded.
|
|
* @retval Result::InvalidArguments When the given parameter is invalid.
|
|
*
|
|
* @note Experimental API
|
|
*/
|
|
Result override(const char* slot) noexcept;
|
|
|
|
/**
|
|
* @brief Creates a new LottieAnimation object.
|
|
*
|
|
* @return A new LottieAnimation object.
|
|
*
|
|
* @note Experimental API
|
|
*/
|
|
static std::unique_ptr<LottieAnimation> gen() noexcept;
|
|
};
|
|
|
|
} //namespace
|
|
|
|
#endif //_THORVG_LOTTIE_H_
|