summaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/image.c b/src/image.c
index 45c3352..04dca72 100644
--- a/src/image.c
+++ b/src/image.c
@@ -30,10 +30,6 @@
#include "i18n.h"
#include "text.h"
-#define BIT_DEPTH 8
-#define CHANNELS 3
-#define PIXEL_SIZE ((BIT_DEPTH + 7) / 8) * CHANNELS
-
struct image {
png_structp png_ptr;
png_infop info_ptr;
@@ -84,12 +80,12 @@ image_render(struct image *image, struct text *text, struct font *font)
height = text_get_height(text) * font_get_height(font);
png_set_IHDR(image->png_ptr, image->info_ptr, width, height,
- BIT_DEPTH, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
+ IMAGE_BIT_DEPTH, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
rows = png_malloc(image->png_ptr, height * sizeof(*rows));
for (i = 0; i < height; ++i) {
- rows[i] = png_malloc(image->png_ptr, width * PIXEL_SIZE);
+ rows[i] = png_malloc(image->png_ptr, width * IMAGE_PIXEL_SIZE);
}
png_set_rows(image->png_ptr, image->info_ptr, rows);