summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/font.c6
-rw-r--r--src/font.h6
-rw-r--r--src/image.c3
-rw-r--r--src/image.h3
-rw-r--r--src/text.c6
-rw-r--r--src/text.h6
6 files changed, 16 insertions, 14 deletions
diff --git a/src/font.c b/src/font.c
index c351857..fb54604 100644
--- a/src/font.c
+++ b/src/font.c
@@ -65,19 +65,19 @@ font_find(const char *name)
}
int
-font_get_width(struct font *font)
+font_get_width(const struct font *font)
{
return font->desc.width;
}
int
-font_get_height(struct font *font)
+font_get_height(const struct font *font)
{
return font->desc.height;
}
void
-font_render(struct font *font, png_const_colorp fg, png_const_colorp bg,
+font_render(const struct font *font, png_const_colorp fg, png_const_colorp bg,
unsigned char ch, png_bytepp rows, int row, int col)
{
size_t y;
diff --git a/src/font.h b/src/font.h
index f82f2a0..27cc08e 100644
--- a/src/font.h
+++ b/src/font.h
@@ -30,13 +30,13 @@ struct font *
font_find(const char *name) __attribute__((pure));
int
-font_get_width(struct font *font) __attribute__((pure));
+font_get_width(const struct font *font) __attribute__((pure));
int
-font_get_height(struct font *font) __attribute__((pure));
+font_get_height(const struct font *font) __attribute__((pure));
void
-font_render(struct font *font, png_const_colorp fg, png_const_colorp bg,
+font_render(const struct font *font, png_const_colorp fg, png_const_colorp bg,
unsigned char ch, png_bytepp rows, int row, int col);
#endif /* FONT_H_ */
diff --git a/src/image.c b/src/image.c
index 3c5d98f..e55f955 100644
--- a/src/image.c
+++ b/src/image.c
@@ -76,7 +76,8 @@ image_new(const char *file_name)
}
void
-image_render(struct image *image, struct text *text, struct font *font)
+image_render(struct image *image, const struct text *text,
+ const struct font *font)
{
size_t width;
size_t height;
diff --git a/src/image.h b/src/image.h
index b303c23..ece53f7 100644
--- a/src/image.h
+++ b/src/image.h
@@ -38,7 +38,8 @@ struct image *
image_new(const char *file_name);
void
-image_render(struct image *image, struct text *text, struct font *font);
+image_render(struct image *image, const struct text *text,
+ const struct font *font);
struct image *
image_destroy(struct image **image);
diff --git a/src/text.c b/src/text.c
index fedbd3f..995d10e 100644
--- a/src/text.c
+++ b/src/text.c
@@ -105,13 +105,13 @@ text_new(FILE *stream)
}
size_t
-text_get_width(struct text *text)
+text_get_width(const struct text *text)
{
return text->width;
}
size_t
-text_get_height(struct text *text)
+text_get_height(const struct text *text)
{
return text->height;
}
@@ -129,7 +129,7 @@ text_set_height(struct text *text, size_t height)
}
void
-text_render(struct text *text, struct font *font, png_bytepp rows)
+text_render(const struct text *text, const struct font *font, png_bytepp rows)
{
unsigned char *string_start;
unsigned char *string;
diff --git a/src/text.h b/src/text.h
index 8ee0245..a76e14e 100644
--- a/src/text.h
+++ b/src/text.h
@@ -34,10 +34,10 @@ struct text *
text_new(FILE *stream);
size_t
-text_get_width(struct text *text) __attribute__((pure));
+text_get_width(const struct text *text) __attribute__((pure));
size_t
-text_get_height(struct text *text) __attribute__((pure));
+text_get_height(const struct text *text) __attribute__((pure));
size_t
text_set_width(struct text *text, size_t width);
@@ -46,7 +46,7 @@ size_t
text_set_height(struct text *text, size_t height);
void
-text_render(struct text *text, struct font *font, png_bytepp rows);
+text_render(const struct text *text, const struct font *font, png_bytepp rows);
struct text *
text_destroy(struct text **text_p);