tim003 tim003
/
LukaIElmir26
Novo
Fork of LukaIElmir by
Diff: Mapa.h
- Revision:
- 4:ba24ce878e87
- Child:
- 5:654e3398c1ef
diff -r 43648fa57d55 -r ba24ce878e87 Mapa.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Mapa.h Mon May 26 17:39:37 2014 +0000 @@ -0,0 +1,92 @@ +#include "mbed.h" +#ifndef MAPA_H +#define MAPA_H +#include <vector> +#include "Znak.h" + +class Mapa +{ + std::vector<Znak> znakovi; + public: + Mapa() + { + znakovi.reserve(75); + znakovi.push_back(Znak(0x7e, 0x11, 0x11, 0x7e)); //A + znakovi.push_back(Znak(0x7e, 0x49, 0x49, 0x36)); //B + znakovi.push_back(Znak(0x3e, 0x41, 0x41, 0x22)); //C + znakovi.push_back(Znak(0x7f, 0x41, 0x41, 0x3e)); //D + znakovi.push_back(Znak(0x7f, 0x49, 0x49, 0x41)); //E + znakovi.push_back(Znak(0x7f, 0x09, 0x09, 0x01)); //F + znakovi.push_back(Znak(0x3e, 0x41, 0x51, 0x32, 0x70)); //G + znakovi.push_back(Znak(0x7f, 0x08, 0x08, 0x7f)); //H + znakovi.push_back(Znak(0x41, 0x7f, 0x41)); //I + znakovi.push_back(Znak(0x21, 0x41, 0x41, 0x3f)); //J + znakovi.push_back(Znak(0x7f, 0x08, 0x14, 0x63)); //K + znakovi.push_back(Znak(0x7f, 0x40, 0x40, 0x40)); //L + znakovi.push_back(Znak(0x7f, 0x02, 0x0c, 0x02, 0x7f)); //M + znakovi.push_back(Znak(0x7f, 0x04, 0x08, 0x10, 0x7f)); //N + znakovi.push_back(Znak(0x3e, 0x41, 0x41, 0x3e)); //O + znakovi.push_back(Znak(0x7f, 0x09, 0x09, 0x06)); //P + znakovi.push_back(Znak(0x3e, 0x41, 0x51, 0x3e, 0x40)); //Q + znakovi.push_back(Znak(0x7f, 0x09, 0x09, 0x76)); //R + znakovi.push_back(Znak(0x26, 0x89, 0x89, 0x32)); //S + znakovi.push_back(Znak(0x03, 0x01, 0x7f, 0x01, 0x03)); //T + znakovi.push_back(Znak(0x1f, 0x20, 0x40, 0x40, 0x20, 0x3f)); //U + znakovi.push_back(Znak(0x1f, 0x20, 0x40, 0x20, 0x1f)); //V + znakovi.push_back(Znak(0x3f, 0x40, 0x38, 0x40, 0x3f)); //W + znakovi.push_back(Znak(0x63, 0x14, 0x08, 0x14, 0x63)); //X + znakovi.push_back(Znak(0x07, 0x08, 0x70, 0x08, 0x07)); //Y + znakovi.push_back(Znak(0x61, 0x51, 0x49, 0x45, 0x43)); //Z + znakovi.push_back(Znak(0x20, 0x54, 0x54, 0x78)); //a + znakovi.push_back(Znak(0x7f, 0x44, 0x44, 0x38)); //b + znakovi.push_back(Znak(0x38, 0x44, 0x44, 0x28)); //c + znakovi.push_back(Znak(0x38, 0x44, 0x44, 0x7f)); //d + znakovi.push_back(Znak(0x38, 0x54, 0x54, 0x18)); //e + znakovi.push_back(Znak(0xf8, 0x24, 0x24, 0x08)); //f + znakovi.push_back(Znak(0x98, 0xa4, 0xa4, 0x78)); //g + znakovi.push_back(Znak(0x7f, 0x04, 0x04, 0x78)); //h + znakovi.push_back(Znak(0x44, 0x7d, 0x40)); //i + znakovi.push_back(Znak(0x40, 0x80, 0x88, 0x7a)); //j + znakovi.push_back(Znak(0x7f, 0x10, 0x28, 0x44)); //k + znakovi.push_back(Znak(0x41, 0x7f, 0x40)); //l + znakovi.push_back(Znak(0x7c, 0x04, 0x7c, 0x04, 0x78)); //m + znakovi.push_back(Znak(0x7c, 0x04, 0x04, 0x78)); //n + znakovi.push_back(Znak(0x38, 0x44, 0x44, 0x38)); //o + znakovi.push_back(Znak(0xfc, 0x24, 0x24, 0x18)); //p + znakovi.push_back(Znak(0x18, 0x24, 0x24, 0xfc)); //q + znakovi.push_back(Znak(0x7c, 0x08, 0x04, 0x04)); //r + znakovi.push_back(Znak(0x48, 0x54, 0x54, 0x24)); //s + znakovi.push_back(Znak(0x04, 0x3f, 0x44)); //t + znakovi.push_back(Znak(0x3c, 0x40, 0x40, 0x7c)); //u + znakovi.push_back(Znak(0x1c, 0x20, 0x40, 0x20, 0x1c)); //v + znakovi.push_back(Znak(0x1c, 0x20, 0x10, 0x20, 0x1c)); //w + znakovi.push_back(Znak(0x44, 0x28, 0x10, 0x28, 0x44)); //x + znakovi.push_back(Znak(0x9c, 0xa0, 0xa0, 0x7c)); //y + znakovi.push_back(Znak(0x44, 0x64, 0x54, 0x4c, 0x44)); //z + znakovi.push_back(Znak(0x3e, 0x51, 0x49, 0x45, 0x3e)); //0 + znakovi.push_back(Znak(0x42, 0x7f, 0x40)); //1 + znakovi.push_back(Znak(0x42, 0x61, 0x51, 0x49, 0x46)); //2 + znakovi.push_back(Znak(0x22, 0x41, 0x49, 0x36)); //3 + znakovi.push_back(Znak(0x08, 0x0c, 0x0a, 0x7c, 0x08)); //4 + znakovi.push_back(Znak(0x27, 0x45, 0x45, 0x39)); //5 + znakovi.push_back(Znak(0x3e, 0x49, 0x49, 0x32)); //6 + znakovi.push_back(Znak(0x63, 0x11, 0x09, 0x05, 0x03)); //7 + znakovi.push_back(Znak(0x36, 0x49, 0x49, 0x36)); //8 + znakovi.push_back(Znak(0x26, 0x49, 0x49, 0x3e)); //9 + znakovi.push_back(Znak(0xb0, 0x70)); //, + znakovi.push_back(Znak(0x60, 0x60)); //. + + + } + + ~Mapa() {} + + std::vector<int> operator[](char c) + { + if(c >= 'A' && c <= 'Z') return znakovi[c - 'A'].registri; + else if(c >= 'a' && c <= 'z') return znakovi[26 + c -'a' ].registri; + else if(c >= '0' && c <= '9') return znakovi[52 + c - '0' ].registri; + } +}; + +#endif // MAPA_H