#pragma once #include #include struct JsonCoordinateMapping : CoordinateMapping { struct Span { int length = 0; int x = 0; int y = 0; bool reverse = false; uint16_t physicalIdx = 0; Span() {} Span(int length, int x, int y, bool rev, uint16_t idx) : length(length), x(x), y(y), reverse(rev), physicalIdx(idx) {} }; uint8_t rotation = 0; Span displayMap[32]; int strideCount = 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; VirtualCoordinates rotate(const VirtualCoordinates coords, uint8_t rotation) const; };