24 lines
550 B
C++
24 lines
550 B
C++
#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 |