More timing functions

This commit is contained in:
David 2021-08-28 01:04:31 +02:00
commit 321c677da2
12 changed files with 184 additions and 129 deletions

View file

@ -9,12 +9,12 @@
/* Writes color components as a space-delimited string of numbers in the range [0,255] */
void write_color(FILE *fp, color c, uint32_t samples_per_pixel)
{
double scale = 1.0 / samples_per_pixel;
float scale = 1.0 / samples_per_pixel;
// Divide the color by the number of samples
double r = sqrt(c.x * scale);
double g = sqrt(c.y * scale);
double b = sqrt(c.z * scale);
float r = sqrt(c.x * scale);
float g = sqrt(c.y * scale);
float b = sqrt(c.z * scale);
/* Write output */
fprintf(fp,