aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
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);