esp32-sk6812/include/Animation/ImageScrollerAnimation.h

34 lines
597 B
C
Raw Normal View History

#pragma once
#include <random>
#include <vector>
#include "Animation.h"
#include "Bitmap.h"
class ImageScrollerAnimation : public Animation
{
public:
ImageScrollerAnimation(Fader *fader, Bitmap *image, uint32_t interval = 3, bool finish_scrolling = false);
void loop(uint64_t frame) override;
void stop(void) override
{
m_stopping = true;
}
void reset(void) override;
private:
Bitmap m_image;
int32_t m_startIdx;
uint32_t m_interval;
bool m_finishScrolling;
bool m_stopping;
};