// // capturestrip.h // // ILEDStrip that records pixels in memory, so host tests can inspect what // the firmware would have pushed to real hardware. // #ifndef _capturestrip_h #define _capturestrip_h #include "ledstrip.h" #include #include class CCaptureLEDStrip : public ILEDStrip { public: std::vector> m_Pixels; unsigned m_nUpdates = 0; explicit CCaptureLEDStrip (unsigned nLEDCount) : m_Pixels (nLEDCount, {0,0,0}) {} bool Initialize (void) override { return true; } unsigned GetLEDCount (void) const override { return m_Pixels.size (); } void SetLED (unsigned n, uint8_t r, uint8_t g, uint8_t b) override { m_Pixels.at (n) = {r,g,b}; } bool Update (void) override { m_nUpdates++; return true; } bool Blackout (void) override { for (auto &p : m_Pixels) p = {0,0,0}; return true; } }; #endif