9#define _OUT_OF_BOUND -12
26 inline Pixel(uint8_t r, uint8_t g, uint8_t b, uint8_t w)
27 __attribute__((always_inline))
28 : red(r), green(g), blue(b), white(w) {
32 inline Pixel(uint8_t r, uint8_t g, uint8_t b) __attribute__((always_inline))
33 : red(r), green(g), blue(b) {
34 white =
MIN(red, green);
35 white =
MIN(white, blue);
37 green = green - white;
41 inline Pixel() __attribute__((always_inline)) {}
49 white =
MIN(red, green);
50 white =
MIN(white, blue);
52 green = green - white;
58 inline Pixel(
const Pixel &rhs) __attribute__((always_inline)) {
66 __attribute__((always_inline)) {
68 red = (colorcode >> 24) & 0xFF;
69 green = (colorcode >> 16) & 0xFF;
70 blue = (colorcode >> 8) & 0xFF;
71 white = colorcode & 0xFF;
87 inline Pixel(uint8_t r, uint8_t g, uint8_t b) __attribute__((always_inline))
88 : red(r), green(g), blue(b) {
92 inline Pixel() __attribute__((always_inline)) {}
107 inline Pixel(
const CRGB &rhs) __attribute__((always_inline)) {
114 inline Pixel(
const Pixel &rhs) __attribute__((always_inline)) {
121 __attribute__((always_inline)) {
123 red = (colorcode >> 16) & 0xFF;
124 green = (colorcode >> 8) & 0xFF;
125 blue = (colorcode >> 0) & 0xFF;
129 return (red == rhs.red) && (green == rhs.green) && (blue == rhs.blue);
132 return !((red == rhs.red) && (green == rhs.green) &&
143 inline Pixels() __attribute__((always_inline)) {}
149 _sizes[i] = rhs._sizes[i];
161 __Pixels(size, ledpoi, direction,
this);
173 Pixels(
int num_led_per_strip,
int num_strips) {
175 for (
int i = 0; i < num_strips; i++) {
176 sizes[i] = num_led_per_strip;
186 __Pixels(sizes, num_strips, direction,
this);
191 for (
int i = 0; i < num_strips; i++) {
193 pib->
_sizes[i] = sizes[i];
244 for (
int i = 0; i < ori.
_size; i++) {
248 (*this)[i] = ori[ori.
_size - i % (ori.
_size) - 1];
257 return Pixels(d, 1, direction);
260 for (
int i = 0; i < num_strip %
_num_strips; i++) {
313 arguments = (
void *)malloc(
sizeof(size));
central include file for FastLED, defines the CFastLED class/object
int(* mapFunction)(int i, void *args)
Pixels(int *sizes, int num_strips)
void setMapFunction(int(*fptr)(int i, void *args), void *args, int size)
void __Pixels(int *sizes, int num_strips, leddirection direction, Pixels *pib)
Pixels(int *sizes, int num_strips, leddirection direction)
Pixel & operator[](int i)
Pixels(int size, Pixel *ledpoi, leddirection direction)
Pixels(int size, Pixel *ledpoi)
Pixels(const Pixels &rhs)
Pixels(int num_led_per_strip, int num_strips)
void __Pixels(int size, Pixel *ledpoi, leddirection direction, Pixels *pib)
Pixels createSubset(int start, int length, leddirection direction)
Pixels getStrip(int num_strip, leddirection direction)
Pixels createSubset(int start, leddirection direction)
Pixels createSubset(int start, int length)
void copy(Pixels ori, leddirection dir)
Pixels getStrip(int num_strip)
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)
bool operator!=(const Pixel &rhs)
bool operator==(const Pixel &rhs)
Pixel(uint8_t r, uint8_t g, uint8_t b)
Pixel & operator=(const uint32_t colorcode)