FastLED 3.9.3
Loading...
Searching...
No Matches
xymap.cpp
1
2#include <stdint.h>
3#include <string.h>
4
5#include "force_inline.h"
6#include "namespace.h"
7#include "xymap.h"
8#include "screenmap.h"
9
10FASTLED_NAMESPACE_BEGIN
11
12ScreenMap XYMap::toScreenMap() const {
13 const uint16_t length = width * height;
14 ScreenMap out(length);
15 for (uint16_t w = 0; w < width; w++) {
16 for (uint16_t h = 0; h < height; h++) {
17 uint16_t index = mapToIndex(w, h);
18 pair_xy_float p = {
19 static_cast<float>(w),
20 static_cast<float>(h)
21 };
22 out.set(index, p);
23 }
24 }
25 return out;
26}
27
28FASTLED_NAMESPACE_END
Definition lut.h:17