hyperion.ng/libsrc/bootsequence/RainbowBootSequence.h
T. van der Zwan dd16af0df5 Changed RgbImage to template based Image (with template for pixel type)
Former-commit-id: ef02f164eaf3c2f9dd552c1c17b525cf6eed499c
2013-11-11 09:00:37 +00:00

39 lines
965 B
C++

#pragma once
// QT includes
#include <QTimer>
// Bootsequence include
#include "AbstractBootSequence.h"
///
/// The RainborBootSequence shows a 'rainbow' (all lights have a different color). The rainbow is
/// rotated over each led during the length of the sequence.
///
class RainbowBootSequence : public AbstractBootSequence
{
public:
///
/// Constructs the rainbow boot-sequence. Hyperion is used for writing the led colors. The given
/// duration is the length of the sequence.
///
/// @param[in] hyperion The Hyperion instance
/// @param[in] duration_ms The length of the sequence [ms]
///
RainbowBootSequence(Hyperion * hyperion, const unsigned duration_ms);
protected:
///
/// Moves the rainbow one led further
///
const std::vector<ColorRgb>& nextColors();
private:
/// The current color of the boot sequence (the rainbow)
std::vector<ColorRgb> _ledColors;
/// The counter of the number of iterations left
int _iterationCounter;
};