adding getPixelColorRestored()

similar to getPixelColor, but returns the original pixel without brightness adjustments.

* getPixelColorRestored is used by segment::sPC and segment::gPC
* getPixelColor is still used by ABL (auto brightness limiter)
This commit is contained in:
Frank
2024-09-28 02:43:12 +02:00
parent b245112d2a
commit 2aa0d47036
6 changed files with 68 additions and 2 deletions

View File

@@ -976,6 +976,7 @@ class WS2812FX { // 96 bytes
now,
timebase;
uint32_t __attribute__((pure)) getPixelColor(uint_fast16_t) const; // WLEDMM attribute pure = does not have side-effects
uint32_t __attribute__((pure)) getPixelColorRestored(uint_fast16_t i) const;// WLEDMM gets the original color from the driver (without downscaling by _bri)
inline uint32_t getLastShow(void) const { return _lastShow; }
inline uint32_t segColor(uint8_t i) const { return _colors_t[i]; }
@@ -1068,6 +1069,8 @@ class WS2812FX { // 96 bytes
std::vector<segment> _segments;
friend class Segment;
uint32_t getPixelColorXYRestored(uint16_t x, uint16_t y) const; // WLEDMM gets the original color from the driver (without downscaling by _bri)
private:
uint16_t _length;
uint8_t _brightness;