mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			57 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| 
 | |
| #pragma once
 | |
| 
 | |
| // Bootsequence includes
 | |
| #include "AbstractBootSequence.h"
 | |
| 
 | |
| // Hyperion includes
 | |
| #include <hyperion/Hyperion.h>
 | |
| #include <hyperion/ImageProcessor.h>
 | |
| 
 | |
| ///
 | |
| /// The KITT BootSequence is a boot sequence inspired by the Knight Rider car: Knight Industries Two
 | |
| /// Thousand (aka KITT)
 | |
| ///
 | |
| class KittBootSequence : public AbstractBootSequence
 | |
| {
 | |
| public:
 | |
| 	///
 | |
| 	/// 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);
 | |
| 
 | |
| 	///
 | |
| 	/// Destructor, deletes the processor
 | |
| 	///
 | |
| 	virtual ~KittBootSequence();
 | |
| 
 | |
| 	///
 | |
| 	/// 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;
 | |
| 
 | |
| 	/// Direction the red-light is currently moving
 | |
| 	bool _forwardMove;
 | |
| 	/// The location of the current red-light
 | |
| 	unsigned _currentLight;
 | |
| 
 | |
| 	/// Moves the current light to the next (increase or decrease depending on direction)
 | |
| 	void moveNextLight();
 | |
| };
 | |
| 
 |