Add progress bars and argument parsing

This commit is contained in:
David 2021-08-29 21:24:17 +02:00
commit a45ae025d6
7 changed files with 4897 additions and 29 deletions

View file

@ -24,4 +24,12 @@ void write_color(FILE *fp, color c, uint32_t samples_per_pixel)
(uint8_t) (255 * clamp(b, 0, 1)));
}
void write_image(color *image, uint64_t n, FILE *fp, uint32_t samples_per_pixel)
{
for (int64_t i = n-1; i >= 0; --i)
{
write_color(fp, image[i], samples_per_pixel);
}
}
#endif