added gfximage_new() function
authorMatthias Kramm <kramm@quiss.org>
Tue, 20 Apr 2010 22:55:14 +0000 (15:55 -0700)
committerMatthias Kramm <kramm@quiss.org>
Tue, 20 Apr 2010 22:55:14 +0000 (15:55 -0700)
lib/gfximage.c
lib/gfximage.h

index 62b60c5..661f9cd 100644 (file)
@@ -7,6 +7,15 @@
 #include "gfximage.h"
 #include "types.h"
 
+gfximage_t*gfximage_new(int width, int height)
+{
+    gfximage_t*i = rfx_calloc(sizeof(gfximage_t));
+    i->data = rfx_calloc(width*height*4);
+    i->width = width;
+    i->height = height;
+    return i;
+}
+
 void gfximage_save_jpeg(gfximage_t*img, const char*filename, int quality)
 {
     int x,y;
index 6520205..5ac8242 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "gfxdevice.h"
 
+gfximage_t*gfximage_new(int width, int height);
 void gfximage_save_jpeg(gfximage_t*image, const char*filename, int quality);
 void gfximage_save_png(gfximage_t*image, const char*filename);
 gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight);