initialize 3D float array with return from stbi_loadf?

305 Views Asked by At

I'm a novice at C++., and I have a pretty simple program I'm working on and getting stuck. I'm using stb_image to load a png file from disk.

And I want to lay it out in memory so that pixel (x,y) is located at p[y*width + x]. not sure how to initialize the array though.

int main(int argc, char **argv)
{

static const int w = 4096, h = 4096;
int width, height, bpp;


float *rgb = stbi_loadf("/home/proscans/Desktop/test_norm.png", &width, &height, &bpp, 3);

float normal[w*h*3] = {...???};

return 0;



}

curious what should go in the braces to initialize. can anyone weigh in?

thanks

0

There are 0 best solutions below