2021-03-06 23:42:48 +01:00
|
|
|
//
|
|
|
|
// Created by lukas on 06.03.21.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
|
2021-03-07 17:45:03 +01:00
|
|
|
const std::vector<uint8_t> types::es = calcPixels(0, 0, 2);
|
|
|
|
const std::vector<uint8_t> types::ist = calcPixels(3, 0, 3);
|
|
|
|
const std::vector<uint8_t> types::fuenf = calcPixels(8, 0, 4);
|
|
|
|
const std::vector<uint8_t> types::zehn = calcPixels(0, 1, 4);
|
|
|
|
const std::vector<uint8_t> types::zwanzig = calcPixels(5, 1, 7);
|
|
|
|
const std::vector<uint8_t> types::drei = calcPixels(1, 2, 4);
|
|
|
|
const std::vector<uint8_t> types::viertel = calcPixels(5, 2, 7);
|
|
|
|
const std::vector<uint8_t> types::dreiviertel = calcPixels(1, 2, 11);
|
|
|
|
const std::vector<uint8_t> types::vor = calcPixels(0, 3, 3);
|
|
|
|
const std::vector<uint8_t> types::nach = calcPixels(3, 3, 4);
|
|
|
|
const std::vector<uint8_t> types::halb = calcPixels(8, 3, 4);
|
|
|
|
const std::vector<uint8_t> types::zwoelf = calcPixels(0, 4, 5);
|
|
|
|
const std::vector<uint8_t> types::sieben = calcPixels(6, 4, 6);
|
|
|
|
const std::vector<uint8_t> types::ein = calcPixels(0, 5, 3);
|
|
|
|
const std::vector<uint8_t> types::eins = calcPixels(0, 5, 4);
|
|
|
|
const std::vector<uint8_t> types::vier = calcPixels(4, 5, 4);
|
|
|
|
const std::vector<uint8_t> types::acht = calcPixels(8, 5, 4);
|
|
|
|
const std::vector<uint8_t> types::sechs = calcPixels(0, 6, 5);
|
|
|
|
const std::vector<uint8_t> types::zwei = calcPixels(6, 6, 4);
|
|
|
|
const std::vector<uint8_t> types::fuenf2 = calcPixels(1, 7, 4);
|
|
|
|
const std::vector<uint8_t> types::elf = calcPixels(5, 7, 3);
|
|
|
|
const std::vector<uint8_t> types::zehn2 = calcPixels(8, 7, 4);
|
|
|
|
const std::vector<uint8_t> types::neun = calcPixels(0, 8, 4);
|
|
|
|
const std::vector<uint8_t> types::drei2 = calcPixels(4, 8, 4);
|
|
|
|
const std::vector<uint8_t> types::ein2 = calcPixels(6, 8, 3);
|
|
|
|
const std::vector<uint8_t> types::uhr = calcPixels(9, 8, 3);
|
2021-03-06 23:42:48 +01:00
|
|
|
|
|
|
|
uint8_t types::convert(uint8_t x, uint8_t y) {
|
|
|
|
const bool upRow = (x % 2) == 0;
|
|
|
|
|
|
|
|
int val = x * 9 + y;
|
|
|
|
// if its a row upwards we need to calculate the additional down and up pixels
|
|
|
|
if (upRow)
|
|
|
|
// we need to go the rest down (9 -y) and up (*2) and subtract the too many added 10
|
|
|
|
val += ((9 - y) * 2) - 10;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
2021-03-07 17:45:03 +01:00
|
|
|
std::vector<uint8_t> types::calcPixels(uint8_t x, uint8_t y, uint8_t nrPixels) {
|
|
|
|
std::vector<uint8_t> vec;
|
2021-03-06 23:42:48 +01:00
|
|
|
for (uint8_t i = 0; i < nrPixels; i++) {
|
|
|
|
vec.push_back(convert(x + i, y));
|
|
|
|
}
|
|
|
|
|
|
|
|
return vec;
|
|
|
|
}
|