hyperion.ng/libsrc/bootsequence/KittBootSequence.h

57 lines
1.3 KiB
C
Raw Normal View History

#pragma once
// Bootsequence includes
#include "AbstractBootSequence.h"
// Hyperion includes
#include <hyperion/Hyperion.h>
#include <hyperion/ImageProcessor.h>
2013-09-09 19:14:49 +02:00
///
/// The KITT BootSequence is a boot sequence inspired by the Knight Rider car: Knight Industries Two
/// Thousand (aka KITT)
///
class KittBootSequence : public AbstractBootSequence
{
public:
2013-09-09 19:14:49 +02:00
///
/// Constructs the KITT BootSequence
///
/// @param[in] hyperion The Hyperion instance
/// @param[in] duration_ms The length of the sequence [ms]
///
KittBootSequence(Hyperion * hyperion, const unsigned duration_ms);
2013-09-09 19:14:49 +02:00
///
/// Destructor, deletes the processor
///
virtual ~KittBootSequence();
2013-09-09 19:14:49 +02:00
///
/// Returns the next led color sequence
///
/// @return The next colors for the leds
///
virtual const std::vector<ColorRgb>& nextColors();
private:
/// Image processor to compute led-colors from the image
ImageProcessor * _processor;
/// 1D-Image of the KITT-grill contains a single red pixel and the rest black
Image<ColorRgb> _image;
/// The vector with led-colors
std::vector<ColorRgb> _ledColors;
2013-09-09 19:14:49 +02:00
/// Direction the red-light is currently moving
bool _forwardMove = true;
2013-09-09 19:14:49 +02:00
/// The location of the current red-light
unsigned _currentLight = 0;
2013-09-09 19:14:49 +02:00
/// Moves the current light to the next (increase or decrease depending on direction)
void moveNextLight();
};