int write_frame(Color *framebuffer, int width, int height, int frameID);
This function should take the framebuffer and output the image to
framex.ppm, where x is the frameID.
width and height are the size of the framebuffer.
Return 0 if the file successfully writes to disk.
Return 1 if the file fails to write, also print error to stderr reporting the failure and on what frameID.
Public domain stb library has functions for converting color channels and image formats. It would be a plus if we can get .png files instead of .ppm.
Prototype:
This function should take the
framebuffer
and output the image toframex.ppm
, wherex
is the frameID.width
andheight
are the size of the framebuffer. Return 0 if the file successfully writes to disk. Return 1 if the file fails to write, also print error tostderr
reporting the failure and on what frameID.Public domain stb library has functions for converting color channels and image formats. It would be a plus if we can get .png files instead of .ppm.