// // Created by lukas on 06.03.21. // #include "Types.h" const std::vector types::es = calcPixels(0, 0, 2); const std::vector types::ist = calcPixels(3, 0, 3); const std::vector types::fuenf = calcPixels(8, 0, 4); const std::vector types::zehn = calcPixels(0, 1, 4); const std::vector types::zwanzig = calcPixels(5, 1, 7); const std::vector types::drei = calcPixels(1, 2, 4); const std::vector types::viertel = calcPixels(5, 2, 7); const std::vector types::dreiviertel = calcPixels(1, 2, 11); const std::vector types::vor = calcPixels(0, 3, 3); const std::vector types::nach = calcPixels(3, 3, 4); const std::vector types::halb = calcPixels(8, 3, 4); const std::vector types::zwoelf = calcPixels(0, 4, 5); const std::vector types::sieben = calcPixels(6, 4, 6); const std::vector types::ein = calcPixels(0, 5, 3); const std::vector types::eins = calcPixels(0, 5, 4); const std::vector types::vier = calcPixels(4, 5, 4); const std::vector types::acht = calcPixels(8, 5, 4); const std::vector types::sechs = calcPixels(0, 6, 5); const std::vector types::zwei = calcPixels(6, 6, 4); const std::vector types::fuenf2 = calcPixels(1, 7, 4); const std::vector types::elf = calcPixels(5, 7, 3); const std::vector types::zehn2 = calcPixels(8, 7, 4); const std::vector types::neun = calcPixels(0, 8, 4); const std::vector types::drei2 = calcPixels(4, 8, 4); const std::vector types::ein2 = calcPixels(6, 8, 3); const std::vector types::uhr = calcPixels(9, 8, 3); 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; } std::vector types::calcPixels(uint8_t x, uint8_t y, uint8_t nrPixels) { std::vector vec; for (uint8_t i = 0; i < nrPixels; i++) { vec.push_back(convert(x + i, y)); } return vec; }