32 static ScreenMap Circle(
int numLeds,
float cm_between_leds = 1.5f,
float cm_led_diameter = 0.5f);
37 ScreenMap(uint32_t length,
float mDiameter = -1.0f) : length(length), mDiameter(mDiameter) {
38 mLookUpTable = LUTXYFLOATRef::New(length);
41 for (uint32_t x = 0; x < length; x++) {
46 ScreenMap(
const pair_xy_float *lut, uint32_t length,
float diameter = -1.0) : length(length), mDiameter(diameter) {
47 mLookUpTable = LUTXYFLOATRef::New(length);
50 for (uint32_t x = 0; x < length; x++) {
55 template <u
int32_t N>
ScreenMap(
const pair_xy_float (&lut)[N],
float diameter = -1.0) : length(N), mDiameter(diameter) {
56 mLookUpTable = LUTXYFLOATRef::New(length);
59 for (uint32_t x = 0; x < length; x++) {
65 mDiameter = other.mDiameter;
66 length = other.length;
67 mLookUpTable = other.mLookUpTable;
71 if (x >= length || !mLookUpTable) {
81 auto *data = lut.getData();
87 if (x >= length || !mLookUpTable) {
91 auto *data = lut.getData();
97 void setDiameter(
float diameter) { mDiameter = diameter; }
101 if (
this != &other) {
102 mDiameter = other.mDiameter;
103 length = other.length;
104 mLookUpTable = other.mLookUpTable;
110 if (x >= length || !mLookUpTable) {
115 return screen_coords;
118 uint32_t getLength()
const {
return length; }
120 float getDiameter()
const {
return mDiameter; }
122 static void ParseJson(
const char *jsonStrScreenMap,
134 float mDiameter = -1.0f;
135 LUTXYFLOATRef mLookUpTable;