aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-07-29 00:46:16 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-07-29 00:46:16 +0200
commit57b73d286ad68a71547cdfbb31c772fb46c96c67 (patch)
treed4410076f2b598fc6c8d0a07409c96eb0142e4b4 /src/main.c
parent6ef2e7f779497f1761331cc823a73d685f0d436b (diff)
downloadAsciiMap-57b73d286ad68a71547cdfbb31c772fb46c96c67.tar.gz
rebuilding functions
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 532b93a..e9e04e3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,3 +1,9 @@
+/*
+ * src/main.c
+ * (c) 2020 Jonas Gunz <himself@jonasgunz.de>
+ * License: MIT
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -9,7 +15,7 @@
#include "m.h"
#include "color.h"
-/* #define CLEANUP 1 */
+// #define CLEANUP 1
#ifdef _DEBUG
#warning "Compiling with DEBUG"
@@ -50,10 +56,8 @@ int main(int argc, char *argv[])
uint8_t brightness_max = 0x00;
uint8_t brightness_min = 0xff;
- struct bitmap_pixel_data bitmap;
- bitmap = bitmap_read(args.filename);
-
- if(bitmap.error) {
+ struct bitmap_image bitmap;
+ if ( bitmap_read(args.filename, &bitmap) ) {
printf("Error reading file\n");
return 1;
}
@@ -172,6 +176,7 @@ int main(int argc, char *argv[])
DEBUG_PRINTF("Finished!\n");
#ifdef CLEANUP
+#warning "Cleanup included"
for(int i = 0; i < size_x; i++)
free (image_monochrome[i]);
free(image_monochrome);