1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef HELPER_H
- #define HELPER_H
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- #include <unistd.h>
- #include <string.h>
- #include <time.h>
- #include <math.h>
- const char EASE_IN[] = "@\x15\r\t\x07\x06\x05\x04\x04\x03\x03\x03\x03\x02\x02\x02\x02\x02\x02\x02\x02";
- const char EASE_OUT[] = "\x02\x02\x02\x02\x02\x02\x02\x02\x03\x03\x03\x03\x04\x04\x05\x06\x07\t\r\x15@";
- void umlauts(char *cTemp, int cLen) {
- for(int i=0; i<cLen-1; i++) {
- if(cTemp[i] == 0xC2) {
- if(cTemp[i+1] == 0xB0) {//°
- cTemp[i] = '\'';
- if(i < cLen-2) {
- memcpy(&cTemp[i+1], &cTemp[i+2], cLen-2-i);
- cTemp[cLen-1] = '\0';
- }
- else
- cTemp[i+1] = '\0';
- }
- } else if(cTemp[i] == 0xC3) {
- switch (cTemp[i+1]) {
- case 0xA4:
- memcpy(&cTemp[i], "ae", 2);
- break;
- case 0xB6:
- memcpy(&cTemp[i], "oe", 2);
- break;
- case 0xBC:
- memcpy(&cTemp[i], "ue", 2);
- break;
- case 0x84:
- memcpy(&cTemp[i], "Ae", 2);
- break;
- case 0x96:
- memcpy(&cTemp[i], "Oe", 2);
- break;
- case 0x9C:
- memcpy(&cTemp[i], "Ue", 2);
- break;
- case 0x9F:
- memcpy(&cTemp[i], "ss", 2);
- break;
- default:
- break;
- }
- }
- }
- }
- void debugPrint(uint8_t *bImg, int iPitch) {
- for(int row=0; row<8; row++) {
- for(int col=0; col<iPitch*8; col++) {
- char c = ' ';
- if(bImg[col/8+row*iPitch] & (1 << (7-col%8))) c = '#';
- putchar(c);
- }
- putchar('\n');
- }
- }
- #endif
|