The beginnings of a rework
This commit is contained in:
24
include/ScanArrangement.h
Normal file
24
include/ScanArrangement.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef SCANARRANGEMENT_H
|
||||
#define SCANARRANGEMENT_H
|
||||
|
||||
#include "ILEDArrangement.h"
|
||||
|
||||
class ScanArrangement : public ILEDArrangement {
|
||||
public:
|
||||
ScanArrangement(bool _isColumnScan) : isColumnScan(_isColumnScan) {}
|
||||
virtual ~ScanArrangement() {}
|
||||
|
||||
int16_t XY(int16_t x, int16_t y, int16_t width, int16_t height) {
|
||||
if(isColumnScan) {
|
||||
return height * x + y;
|
||||
} else {
|
||||
return width * y + x;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool
|
||||
isColumnScan;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user