FastLED 3.9.7
|
Low level pixel data writing class.
Definition in file pixel_controller.h.
#include <stddef.h>
#include "FastLED.h"
#include "rgbw.h"
#include "five_bit_hd_gamma.h"
#include "fl/force_inline.h"
#include "fl/namespace.h"
#include "eorder.h"
#include "dither_mode.h"
#include "pixel_iterator.h"
#include "crgb.h"
Go to the source code of this file.
Classes | |
struct | ColorAdjustment |
struct | PixelController< RGB_ORDER, LANES, MASK > |
Pixel controller class. More... | |
Macros | |
#define | RO(X) RGB_BYTE(RGB_ORDER, X) |
Gets the assigned color channel for a byte's position in the output, using the color order (EOrder) template parameter from the LED controller. | |
#define | RGB_BYTE(RO, X) (((RO)>>(3*(2-(X)))) & 0x3) |
Gets the assigned color channel for a byte's position in the output, using a passed RGB color order. | |
#define | RGB_BYTE0(RO) ((RO>>6) & 0x3) |
Gets the color channel for byte 0. | |
#define | RGB_BYTE1(RO) ((RO>>3) & 0x3) |
Gets the color channel for byte 1. | |
#define | RGB_BYTE2(RO) ((RO) & 0x3) |
Gets the color channel for byte 2. | |
#define | MAX_LIKELY_UPDATE_RATE_HZ 400 |
Predicted max update rate, in Hertz. | |
#define | MIN_ACCEPTABLE_DITHER_RATE_HZ 50 |
Minimum acceptable dithering rate, in Hertz. | |
#define | UPDATES_PER_FULL_DITHER_CYCLE (MAX_LIKELY_UPDATE_RATE_HZ / MIN_ACCEPTABLE_DITHER_RATE_HZ) |
The number of updates in a single dither cycle. | |
#define | RECOMMENDED_VIRTUAL_BITS |
Set "virtual bits" of dithering to the highest level that is not likely to cause excessive flickering at low brightness levels + low update rates. | |
#define | VIRTUAL_BITS RECOMMENDED_VIRTUAL_BITS |
Alias for RECOMMENDED_VIRTUAL_BITS. | |
#define MAX_LIKELY_UPDATE_RATE_HZ 400 |
Predicted max update rate, in Hertz.
Definition at line 189 of file pixel_controller.h.
#define MIN_ACCEPTABLE_DITHER_RATE_HZ 50 |
Minimum acceptable dithering rate, in Hertz.
Definition at line 192 of file pixel_controller.h.
#define RECOMMENDED_VIRTUAL_BITS |
Set "virtual bits" of dithering to the highest level that is not likely to cause excessive flickering at low brightness levels + low update rates.
These pre-set values are a little ambitious, since a 400Hz update rate for WS2811-family LEDs is only possible with 85 pixels or fewer. Once we have a "number of milliseconds since last update" value available here, we can quickly calculate the correct number of "virtual bits" on the fly with a couple of "if" statements – no division required. At this point, the division is done at compile time, so there's no runtime cost, but the values are still hard-coded.
Definition at line 210 of file pixel_controller.h.
Gets the assigned color channel for a byte's position in the output, using a passed RGB color order.
RO | the RGB color order |
X | the byte's position in the output (0-2) |
Definition at line 41 of file pixel_controller.h.
Gets the color channel for byte 0.
Definition at line 45 of file pixel_controller.h.
Gets the color channel for byte 1.
Definition at line 48 of file pixel_controller.h.
Gets the color channel for byte 2.
Definition at line 51 of file pixel_controller.h.
#define RO | ( | X | ) | RGB_BYTE(RGB_ORDER, X) |
Gets the assigned color channel for a byte's position in the output, using the color order (EOrder) template parameter from the LED controller.
X | the byte's position in the output (0-2) |
Definition at line 33 of file pixel_controller.h.
#define UPDATES_PER_FULL_DITHER_CYCLE (MAX_LIKELY_UPDATE_RATE_HZ / MIN_ACCEPTABLE_DITHER_RATE_HZ) |
The number of updates in a single dither cycle.
Definition at line 195 of file pixel_controller.h.
#define VIRTUAL_BITS RECOMMENDED_VIRTUAL_BITS |
Alias for RECOMMENDED_VIRTUAL_BITS.
Definition at line 220 of file pixel_controller.h.