27 lines
740 B
C
27 lines
740 B
C
#pragma once
|
|
#include <Figments.h>
|
|
#include <ArduinoJson.h>
|
|
|
|
struct JsonCoordinateMapping : CoordinateMapping {
|
|
struct Span {
|
|
int length = 0;
|
|
int x = 0;
|
|
int y = 0;
|
|
|
|
Span() {}
|
|
Span(int length, int x, int y) : length(length), x(x), y(y) {}
|
|
};
|
|
|
|
Span displayMap[32];
|
|
int strideCount = 0;
|
|
int maxStrideSize = 0;
|
|
|
|
void load(const JsonArray& strides);
|
|
void loadDefault();
|
|
|
|
VirtualCoordinates physicalToVirtualCoords(const PhysicalCoordinates localCoords) const override;
|
|
PhysicalCoordinates virtualToPhysicalCoords(const VirtualCoordinates virtualCoords) const override;
|
|
int physicalCoordsToIndex(const PhysicalCoordinates localCoords) const override;
|
|
unsigned int physicalPixelCount() const override;
|
|
};
|