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

◆ init_screenmap()

ScreenMap anonymous_namespace{LedRopeTCL.cpp}::init_screenmap ( )

Definition at line 29 of file LedRopeTCL.cpp.

29 {
31 const int length = cols.length;
32 int sum = 0;
33 for (int i = 0; i < length; ++i) {
34 sum += cols.array[i];
35 }
36 ScreenMap screen_map(sum, 0.8f);
37 int curr_idx = 0;
38 for (int i = 0; i < length; ++i) {
39 int n = cols.array[i];
40 int stagger = i % 2 ? 4 : 0;
41 for (int j = 0; j < n; ++j) {
42 fl::pair_xy_float xy(i*4, j*8 + stagger);
43 screen_map.set(curr_idx++, xy);
44 }
45 }
46
47 return screen_map;
48}
unsigned int xy(unsigned int x, unsigned int y)
LedColumns LedLayoutArray()
pair_xy< float > pair_xy_float
Definition lut.h:24
const int * array

References LedColumns::array, LedLayoutArray(), LedColumns::length, fl::ScreenMap::set(), and xy().

+ Here is the call graph for this function: