diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-05-04 00:57:44 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-05-04 00:57:44 +0200 |
commit | f15b53eea4b7054826f79836e207751e86ba1cec (patch) | |
tree | 1373166457009a8ca25f3edf66cbdb99987f0585 /src/character.c | |
parent | 099c4db0a3a8e77deb7af7436faec802fe9401de (diff) | |
download | AsciiMap-f15b53eea4b7054826f79836e207751e86ba1cec.tar.gz |
Reorganised folder structure
Diffstat (limited to 'src/character.c')
-rw-r--r-- | src/character.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/character.c b/src/character.c new file mode 100644 index 0000000..658f0be --- /dev/null +++ b/src/character.c @@ -0,0 +1,10 @@ +#include "character.h" + +const char character_luminance_map [] = {' ', ' ', '.', ',', '`', '-', '~', '"', '*', ':', ';', '<', '!', '/', '?', '%', '&', '=', '$', '#'}; +//const char map[] = {' ', '`', '.', ',', ':', ';', '\"', '+', '#', '@'}; + +char calc_char(uint8_t _c , uint8_t _min, uint8_t _max) +{ + float c = (float)(_c) / (_max - _min); + return character_luminance_map [(int)((sizeof(character_luminance_map)-1) * (c))]; +} |