diff options
author | pacien | 2017-12-28 01:53:30 +0100 |
---|---|---|
committer | pacien | 2017-12-28 01:53:30 +0100 |
commit | 9da884a72cb43462444c5fba7cf7ac010b1d3e4c (patch) | |
tree | 91b2d36145f6886c3396c5e86e4cf8695b105c72 /src/painter/canvas.c | |
parent | ca8d91787e297b69d3d34a136b60df19b207a4f4 (diff) | |
download | morpher-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.c | 6 |
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 | ||
10 | Canvas *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 | |||
10 | void canvas_destroy(Canvas *c) { | 16 | void canvas_destroy(Canvas *c) { |
11 | MLV_free_image(c->mlv); | 17 | MLV_free_image(c->mlv); |
12 | free(c); | 18 | free(c); |