Add image_free to tidy-up

This commit is contained in:
Gareth Evans
2017-02-02 12:41:36 +00:00
parent fb950bafef
commit 6fecec8e4e
3 changed files with 8 additions and 1 deletions

View File

@@ -106,7 +106,7 @@ int image_init(PIMAGE_CTX ctx, \
return success;
}
/*
* image_add_pixel, image_set_pixel, image_get_pixel, image_write
* image_add_pixel, image_set_pixel, image_get_pixel, image_write, image_free
* Various setters ad getters for assigning pixel data. image_write
* takes an open file handle and writes image data to it.
* These functions simply wrap the underlying format-specific functions
@@ -134,6 +134,10 @@ int image_write(PIMAGE_CTX ctx, FILE *fd){
if(ctx->initialized != 1) return EINVAL;
return dt->write(ctx,fd);
}
void image_free(PIMAGE_CTX ctx){
if(ctx->initialized != 1) return;
free(ctx->canvas);
}
/*
* image_get_filename