|
FastLED 3.9.15
|
Pixel controller class.
This is the class that we use to centralize pixel access in a block of data, including support for things like RGB reordering, scaling, dithering, skipping (for ARGB data), and eventually, we will centralize 8/12/16 conversions here as well.
| RGB_ORDER | the rgb ordering for the LEDs (e.g. what order red, green, and blue data is written out in) |
| LANES | how many parallel lanes of output to write |
| MASK | bitmask for the output lanes |
Definition at line 102 of file pixel_controller.h.
#include <pixel_controller.h>
Collaboration diagram for PixelController< RGB_ORDER, LANES, MASK >:Public Types | |
| enum | { kLanes = LANES , kMask = MASK } |
Static Public Member Functions | |
Template'd static functions for output | |
These functions are used for retrieving LED data for the LED chipset output controllers. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | loadByte (PixelController &pc) |
| Read a byte of LED data. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | loadByte (PixelController &pc, int lane) |
| Read a byte of LED data for parallel output. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | dither (PixelController &pc, fl::u8 b) |
| Add dither offset to pixel value (BEFORE scaling). | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | dither (PixelController &, fl::u8 b, fl::u8 d) |
| Add explicit dither offset to pixel value (BEFORE scaling). | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | scale (PixelController &pc, fl::u8 b) |
| Scale a value using the per-channel scale data. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | scale (PixelController &, fl::u8 b, fl::u8 scale) |
| Scale a value. | |
Composite shortcut functions for loading, dithering, and scaling | |
These composite functions will load color data, dither it, and scale it all at once so that it's ready for the output controller to send to the LEDs. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | loadAndScale (PixelController &pc) |
| Complete pipeline: load → dither → scale (THE MAGIC HAPPENS HERE!) Order is critical: pixel + dither FIRST, then scale by brightness. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | loadAndScale (PixelController &pc, int lane) |
| Complete pipeline: load → dither → scale (parallel output version) | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | loadAndScale (PixelController &pc, int lane, fl::u8 d, fl::u8 scale) |
| Complete pipeline: load → dither → scale (explicit dither/scale values) | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | loadAndScale (PixelController &pc, int lane, fl::u8 scale) |
| Loads and scales a single byte for a given output slot and lane. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | advanceAndLoadAndScale (PixelController &pc) |
| A version of loadAndScale() that advances the output data pointer. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | advanceAndLoadAndScale (PixelController &pc, int lane) |
| A version of loadAndScale() that advances the output data pointer. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | advanceAndLoadAndScale (PixelController &pc, int lane, fl::u8 scale) |
| A version of loadAndScale() that advances the output data pointer without dithering. | |
Data retrieval functions | |
These functions retrieve channel-specific data from the class, arranged in output order. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | getd (PixelController &pc) |
| Gets the dithering data for the provided output slot. | |
| template<int SLOT> | |
| static FASTLED_FORCE_INLINE fl::u8 | getscale (PixelController &pc) |
| Gets the scale data for the provided output slot. | |
Public Attributes | |
| fl::u8 | d [3] |
| [DITHER] Current dither offset per R,G,B channel (toggles via stepDithering) | |
| fl::u8 | e [3] |
| [DITHER] Max dither range per R,G,B channel (inversely proportional to brightness) | |
| fl::i8 | mAdvance |
| how many bytes to advance the pointer by each time. For CRGB this is 3. | |
| ColorAdjustment | mColorAdjustment |
| const fl::u8 * | mData |
| pointer to the underlying LED data | |
| int | mLen |
| number of LEDs in the data for one lane | |
| int | mLenRemaining |
| counter for the number of LEDs left to process | |
| int | mOffsets [LANES] |
| the number of bytes to offset each lane from the starting pointer | |