FastLED 3.9.15
Loading...
Searching...
No Matches

◆ operator[]()

Pixel & fl::Pixels::operator[] ( int i)
inline

Definition at line 206 of file ___pixeltypes.h.

206 {
207 switch (_direction) {
208
210
211 return *(ledpointer + i % _size);
212 break;
213
215
216 return *(ledpointer + (_size - i % (_size)-1));
217 break;
218
219 case (leddirection::MAP):
220 if (mapFunction) {
221 int offset = mapFunction(i, arguments);
222 // printf("%d %d\n",i,offset);
223 if (offset == _OUT_OF_BOUND) {
224 return offPixel;
225 } else
226 return *(ledpointer + (mapFunction(i, arguments) % _size));
227 }
228
229 else
230 return *(ledpointer);
231 break;
232 default:
233 return *(ledpointer);
234 break;
235 }
236 }
#define _OUT_OF_BOUND
Pixel * ledpointer
int(* mapFunction)(int i, void *args)
void * arguments
leddirection _direction

References _direction, _OUT_OF_BOUND, _size, arguments, fl::BACKWARD, fl::FORWARD, ledpointer, fl::MAP, mapFunction, and offPixel.