m18coppola / CSIS335_FinalProject

0 stars 0 forks source link

refactor the ppm file writer in main into write_frame function #3

Open m18coppola opened 2 years ago

m18coppola commented 2 years ago

Prototype:

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.

m18coppola commented 2 years ago

created function in c079d980cfd9b38b08b2e1b9dde8d0f4ee76b11c
Still could use JPEG output.