summaryrefslogtreecommitdiff
path: root/src/painter/canvas.c
diff options
context:
space:
mode:
authorpacien2017-12-28 01:53:30 +0100
committerpacien2017-12-28 01:53:30 +0100
commit9da884a72cb43462444c5fba7cf7ac010b1d3e4c (patch)
tree91b2d36145f6886c3396c5e86e4cf8695b105c72 /src/painter/canvas.c
parentca8d91787e297b69d3d34a136b60df19b207a4f4 (diff)
downloadmorpher-9da884a72cb43462444c5fba7cf7ac010b1d3e4c.tar.gz
Add canvas image init. impl.
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src/painter/canvas.c')
-rw-r--r--src/painter/canvas.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/painter/canvas.c b/src/painter/canvas.c
index 53deeb9..306dc9c 100644
--- a/src/painter/canvas.c
+++ b/src/painter/canvas.c
@@ -7,6 +7,12 @@ Canvas *canvas_create(IntVector width, IntVector height) {
7 return c; 7 return c;
8} 8}
9 9
10Canvas *canvas_create_from_image(const char *fpath) {
11 Canvas *c = malloc_or_die(sizeof(Canvas));
12 c->mlv = MLV_load_image(fpath);
13 return c;
14}
15
10void canvas_destroy(Canvas *c) { 16void canvas_destroy(Canvas *c) {
11 MLV_free_image(c->mlv); 17 MLV_free_image(c->mlv);
12 free(c); 18 free(c);