summaryrefslogtreecommitdiff
path: root/bmp.h
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-04 21:46:20 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-04 21:46:20 +0200
commit8c5065f8a99eee0b0edeeab3d9a7f815fa4d50df (patch)
treee868de7513b10dedeee6cd52a26adc6943518013 /bmp.h
parent96919bf34222c0c3f37e1085342b81c63da386c8 (diff)
downloadnebula2-8c5065f8a99eee0b0edeeab3d9a7f815fa4d50df.tar.gz
nebula2-8c5065f8a99eee0b0edeeab3d9a7f815fa4d50df.tar.bz2
nebula2-8c5065f8a99eee0b0edeeab3d9a7f815fa4d50df.zip
Moved BMP stuff to own file and fixed BMP generation.
Diffstat (limited to 'bmp.h')
-rw-r--r--bmp.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/bmp.h b/bmp.h
index e9b2821..89ab893 100644
--- a/bmp.h
+++ b/bmp.h
@@ -6,7 +6,15 @@
#include "color.h"
-extern int bmp_write_header(FILE* fh, int32_t width, int32_t height);
-extern int bmp_write_pixel(FILE* fh, color_t col);
+typedef struct {
+ int32_t width, height;
+ size_t line_padding;
+ size_t line_left;
+ FILE* fh;
+} bmp_write_handle_t;
+
+extern bmp_write_handle_t* bmp_create(const char* fn, int32_t width, int32_t height);
+extern int bmp_write_pixel(bmp_write_handle_t* bmph, color_t col);
+extern void bmp_destroy(bmp_write_handle_t* bmph);
#endif \ No newline at end of file