image make_random_image(int w, int h, int c) { image out = make_empty_image(w,h,c); out.data = calloc(h*w*c, sizeof(float)); int i; for(i = 0; i < w*h*c; ++i){ out.data[i] = (rand_normal() * .25) + .5; } return out; }
image float_to_image(int w, int h, int c, float *data) { image out = make_empty_image(w,h,c); out.data = data; return out; }
image make_image(int w, int h, int c) { image out = make_empty_image(w,h,c); out.data = calloc(h*w*c, sizeof(float)); return out; }
static image_t make_image_custom(int w, int h, int c) { image_t out = make_empty_image(w, h, c); out.data = (float *)calloc(h*w*c, sizeof(float)); return out; }