Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::LottieAnimation Class Reference

#include <lottie_animation.hpp>

Public Member Functions

 LottieAnimation ()
 ~LottieAnimation ()
 LottieAnimation (LottieAnimation &&) noexcept
LottieAnimation & operator= (LottieAnimation &&) noexcept
 LottieAnimation (const LottieAnimation &)=delete
LottieAnimation & operator= (const LottieAnimation &)=delete
bool load_json (const std::string &json)
 Load a Lottie animation from a JSON string.
bool load_file (const std::string &path)
 Load a Lottie animation from a .json file path.
bool valid () const noexcept
double duration_seconds () const noexcept
 0 when invalid.
double frame_rate () const noexcept
 0 when invalid.
float intrinsic_width () const noexcept
 Authored composition width.
float intrinsic_height () const noexcept
 Authored composition height.
void render (Canvas &canvas, double t_seconds, float x, float y, float w, float h)
 Render the frame at t_seconds (clamped to [0, duration]) into the rectangle (x, y, w, h) on canvas.

Static Public Member Functions

static bool supported () noexcept
 True when Lottie support is compiled in (PULP_HAS_LOTTIE).

Constructor & Destructor Documentation

◆ LottieAnimation() [1/3]

pulp::canvas::LottieAnimation::LottieAnimation ( )

◆ ~LottieAnimation()

pulp::canvas::LottieAnimation::~LottieAnimation ( )

◆ LottieAnimation() [2/3]

pulp::canvas::LottieAnimation::LottieAnimation ( LottieAnimation && )
noexcept

◆ LottieAnimation() [3/3]

pulp::canvas::LottieAnimation::LottieAnimation ( const LottieAnimation & )
delete

Member Function Documentation

◆ duration_seconds()

double pulp::canvas::LottieAnimation::duration_seconds ( ) const
noexcept

0 when invalid.

◆ frame_rate()

double pulp::canvas::LottieAnimation::frame_rate ( ) const
noexcept

0 when invalid.

◆ intrinsic_height()

float pulp::canvas::LottieAnimation::intrinsic_height ( ) const
noexcept

Authored composition height.

◆ intrinsic_width()

float pulp::canvas::LottieAnimation::intrinsic_width ( ) const
noexcept

Authored composition width.

◆ load_file()

bool pulp::canvas::LottieAnimation::load_file ( const std::string & path)

Load a Lottie animation from a .json file path.

◆ load_json()

bool pulp::canvas::LottieAnimation::load_json ( const std::string & json)

Load a Lottie animation from a JSON string.

Returns false on parse failure or when support is not compiled in.

◆ operator=() [1/2]

LottieAnimation & pulp::canvas::LottieAnimation::operator= ( const LottieAnimation & )
delete

◆ operator=() [2/2]

LottieAnimation & pulp::canvas::LottieAnimation::operator= ( LottieAnimation && )
noexcept

◆ render()

void pulp::canvas::LottieAnimation::render ( Canvas & canvas,
double t_seconds,
float x,
float y,
float w,
float h )

Render the frame at t_seconds (clamped to [0, duration]) into the rectangle (x, y, w, h) on canvas.

No-op when invalid, when w/h are non-positive, or when the canvas has no image pipeline.

◆ supported()

bool pulp::canvas::LottieAnimation::supported ( )
staticnoexcept

True when Lottie support is compiled in (PULP_HAS_LOTTIE).

◆ valid()

bool pulp::canvas::LottieAnimation::valid ( ) const
noexcept

The documentation for this class was generated from the following file: