diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2017-11-26 12:13:28 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2017-11-26 12:13:28 +0000 |
commit | a8eec46b5c8d6d895a0b4e746e934b073cdb129a (patch) | |
tree | 51d6de33e29d901fd44fbd311a24adb699a65a25 /src/image.c | |
parent | 3ceb0eac655e04da262b8148b35ee37a8ae3402a (diff) | |
download | imv-a8eec46b5c8d6d895a0b4e746e934b073cdb129a.tar.gz |
Make imv_image interface opaque
Diffstat (limited to 'src/image.c')
-rw-r--r-- | src/image.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index 5c9d9b5..155a57b 100644 --- a/src/image.c +++ b/src/image.c @@ -1,5 +1,19 @@ #include "image.h" +struct imv_image { + int width; /* width of the image overall */ + int height; /* height of the image overall */ + int num_chunks; /* number of chunks allocated */ + SDL_Texture **chunks; /* array of chunks */ + int num_chunks_wide; /* number of chunks per row of the image */ + int num_chunks_tall; /* number of chunks per column of the image */ + int chunk_width; /* chunk width */ + int chunk_height; /* chunk height */ + int last_chunk_width; /* width of rightmost chunk */ + int last_chunk_height; /* height of bottommost chunk */ + SDL_Renderer *renderer; /* SDL renderer to draw to */ +}; + struct imv_image *imv_image_create(SDL_Renderer *r) { struct imv_image *image = malloc(sizeof(struct imv_image)); @@ -128,5 +142,14 @@ void imv_image_draw(struct imv_image *image, int bx, int by, double scale) } } +int imv_image_width(const struct imv_image *image) +{ + return image->width; +} + +int imv_image_height(const struct imv_image *image) +{ + return image->height; +} /* vim:set ts=2 sts=2 sw=2 et: */ |