-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathanimation.h
41 lines (34 loc) · 828 Bytes
/
animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "leds.h"
#include "visualization.h"
namespace pixl {
/* An Animation takes a visualization and maps it to LED segments */
class Animation {
public:
virtual void init()=0;
virtual void update()=0;
virtual void draw(float interpolation)=0;
};
class ScaledAnimation : public Animation {
public:
ScaledAnimation(Visualization* viz, LEDs& leds);
void init();
void update();
void draw(float interpolation);
void upscale();
void downscale();
private:
LEDs& leds_;
Visualization* viz_;
};
class PassThroughAnimation : public Animation {
public:
PassThroughAnimation(Visualization* viz, LEDs& leds);
void init();
void update();
void draw(float interpolation);
private:
LEDs& leds_;
Visualization* viz_;
};
} // end namespace pixl