aboutsummaryrefslogtreecommitdiff
path: root/character.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-03 03:07:07 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-03 03:07:07 +0200
commit620a534e46a78e2664f1a105c694330fc267453b (patch)
tree0bff0c9b6e0bd7ed11855450cad03a0ed2ba31f1 /character.c
parent4aa0cf5afc35509ccbfc23c722672c5a7a89001c (diff)
downloadAsciiMap-620a534e46a78e2664f1a105c694330fc267453b.tar.gz
Did a fuck ton.
Diffstat (limited to 'character.c')
-rw-r--r--character.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/character.c b/character.c
new file mode 100644
index 0000000..658f0be
--- /dev/null
+++ b/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))];
+}