The beginnings of a rework

This commit is contained in:
2026-08-09 21:47:17 -04:00
parent 414a5bb749
commit 02a0bfee2b
13 changed files with 251 additions and 267 deletions

View File

@@ -0,0 +1,31 @@
#ifndef SERPENTINEARRANGEMENT_H
#define SERPENTINEARRANGEMENT_H
#include "ILEDArrangement.h"
class SerpentineArrangement : public ILEDArrangement {
public:
SerpentineArrangement(bool _isColumnSerpentine) : isColumnSerpentine(_isColumnSerpentine) {}
virtual ~SerpentineArrangement() {}
int16_t XY(int16_t x, int16_t y, int16_t width, int16_t height) {
if(isColumnSerpentine) {
if(x & 0x1) {
return x * height + (height - 1 - y);
} else {
return x * height + y;
}
} else {
if(y & 0x1) {
return y * width + (width - 1 - x);
} else {
return y * width + x;
}
}
}
private:
bool
isColumnSerpentine;
};
#endif