38 lines
848 B
C
38 lines
848 B
C
|
#pragma once
|
||
|
|
||
|
#include <array>
|
||
|
|
||
|
#include "Animation.h"
|
||
|
|
||
|
#include "fasttrigon.h"
|
||
|
|
||
|
class RgbwSinusAnimation : public Animation
|
||
|
{
|
||
|
public:
|
||
|
typedef std::array<uint32_t, 4> rgbw_val_array;
|
||
|
RgbwSinusAnimation(Fader *fader,
|
||
|
const rgbw_val_array &speeds = {2273, 2281, 2287, 2293},
|
||
|
uint32_t speed_divider = 1024,
|
||
|
uint16_t brightness_scale = 64); // max: 255
|
||
|
|
||
|
void loop(uint64_t frame) override;
|
||
|
|
||
|
void stop(void) override
|
||
|
{
|
||
|
m_stopping = true;
|
||
|
}
|
||
|
|
||
|
void reset(void) override;
|
||
|
|
||
|
private:
|
||
|
bool m_stopping;
|
||
|
|
||
|
rgbw_val_array m_speeds;
|
||
|
uint32_t m_speedDivider;
|
||
|
uint16_t m_brightnessScale;
|
||
|
|
||
|
rgbw_val_array m_phi;
|
||
|
|
||
|
uint32_t m_overflowInterval;
|
||
|
};
|