I want to pre-render a scene in different positions and store the color an depth images in a png. I do this with PNGWriter.
pngwriter image(640, 480, 0.0, path.c_str());
for(int i = 0; i < 640*480 ; ++i){
int x = i % 640;
int y = i/640;
image.plot(x, y, data[i*3], data[i*3+1], data[i*3+2]);
}
image.close();
and in a different application I want to load this informations with SOIL.
int width, height;
unsigned char* image = SOIL_load_image(path.c_str(), &width, &height, 0, SOIL_LOAD_RGB);
But here my image is NULL, also width and height is 0.
Are there different kind of png formats? Can someone explain how to load the image with SOIL?