6 #include "../chrono/chrono.h"
7 #include "../signal/signal.h"
8 #include "../geometry/geometry.h"
9 #include "../signal/signal.h"
10 #include "../arithmetic/arithmetic.h"
12 namespace pixled {
namespace animation {
35 return this->
template call<1>(l, t)
36 + this->
template call<2>(l, t) * std::sin(
37 2*
PI * t / this->
template call<0>(l, t)
59 float operator()(
led l,
time t)
const override;
79 float operator()(
led l,
time t)
const override;
91 Cast<float>(
chrono::T()) / Cast<float>(this->arg<0>())
97 float operator()(
led l,
time t)
const override;
112 float operator()(
led l,
time t)
const override;
127 float operator()(
led l,
time t)
const override;
158 / Cast<float>(this->arg<1>())
189 template<
typename Anim>
191 : animation(std::forward<Anim>(animation)), duration(duration) {}
200 std::map<time, FctWrapper<color>> animations;
204 mutable time cache_time = 0;
205 mutable time cache_time_duration = 0;
234 for(
auto item : sequence)
235 this->add(item.animation, item.duration);
255 template<
typename Anim>
257 animations.insert({this->duration, std::forward<Anim>(animation)});
258 cache_time = this->duration;
259 cache = &animations.at(cache_time);
260 this->duration+=duration;
261 cache_time_duration=duration;
Definition: function.h:136
Definition: function.h:349
Function(Fcts &&... fcts)
Definition: function.h:383
Definition: animation.h:154
Definition: animation.h:139
Definition: animation.h:50
Definition: animation.h:123
Definition: animation.h:70
Definition: animation.h:108
Definition: animation.h:88
Definition: animation.h:198
Sequence()
Definition: animation.h:212
Sequence & add(Anim &&animation, time duration)
Definition: animation.h:256
Sequence(std::vector< SequenceItem > sequence)
Definition: animation.h:233
Definition: animation.h:30
R operator()(led l, time t) const override
Definition: animation.h:34
static color rgb(uint8_t r, uint8_t g, uint8_t b)
Definition: color.cpp:169
Definition: animation.cpp:3
float sin(const angle &a)
Definition: geometry.cpp:61
unsigned long time
Definition: time.h:10
static const float PI
Definition: geometry.h:13
Definition: animation.h:172
FctWrapper< color > animation
Definition: animation.h:176
SequenceItem(Anim &&animation, time duration)
Definition: animation.h:190
time duration
Definition: animation.h:180