diff options
Diffstat (limited to 'src/image.c')
-rw-r--r-- | src/image.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c index b2cefc9..c96ffcd 100644 --- a/src/image.c +++ b/src/image.c @@ -27,6 +27,7 @@ #include <png.h> #include "i18n.h" +#include "text.h" #define BIT_DEPTH 4 #define PALETTE_SIZE (1 << BIT_DEPTH) @@ -73,13 +74,16 @@ image_new(const char *file_name) } void -image_render(struct image *image) +image_render(struct image *image, struct text *text) { - size_t width = 32; - size_t height = 32; + size_t width; + size_t height; png_bytepp rows; size_t i; + width = text_get_width(text); + height = text_get_height(text); + png_set_IHDR(image->png_ptr, image->info_ptr, width, height, BIT_DEPTH, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); |