Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
lottie_animation.hpp
Go to the documentation of this file.
1#pragma once
2
17
18#include <memory>
19#include <string>
20
21namespace pulp::canvas {
22
23class Canvas;
24
26public:
30 LottieAnimation& operator=(LottieAnimation&&) noexcept;
32 LottieAnimation& operator=(const LottieAnimation&) = delete;
33
35 static bool supported() noexcept;
36
39 bool load_json(const std::string& json);
40
42 bool load_file(const std::string& path);
43
44 bool valid() const noexcept;
45 double duration_seconds() const noexcept;
46 double frame_rate() const noexcept;
47 float intrinsic_width() const noexcept;
48 float intrinsic_height() const noexcept;
49
53 void render(Canvas& canvas, double t_seconds,
54 float x, float y, float w, float h);
55
56private:
57 struct Impl;
58 std::unique_ptr<Impl> impl_;
59};
60
61} // namespace pulp::canvas
Definition canvas.hpp:240
double duration_seconds() const noexcept
0 when invalid.
double frame_rate() const noexcept
0 when invalid.
float intrinsic_height() const noexcept
Authored composition height.
float intrinsic_width() const noexcept
Authored composition width.
bool valid() const noexcept
bool load_file(const std::string &path)
Load a Lottie animation from a .json file path.
LottieAnimation(LottieAnimation &&) noexcept
bool load_json(const std::string &json)
Load a Lottie animation from a JSON string.
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,...
static bool supported() noexcept
True when Lottie support is compiled in (PULP_HAS_LOTTIE).
Definition affine_transform.hpp:24
@ path
Definition scene_node.hpp:93
STL namespace.