Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Image* make_image(int width, int height, int bytes_per_pixel) {
  2. // todo: implement
  3. if (width == 0 || height == 0) return NULL;
  4.  
  5. Image* i = xmalloc(sizeof(Image));
  6.  
  7. i->width = width;
  8. i->height = height;
  9. i->bytes_per_pixel = bytes_per_pixel;
  10.  
  11. i->data = xmalloc(sizeof(Byte) * bytes_per_pixel * width * height);
  12.  
  13. clear_image(i);
  14.  
  15. return i;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement