More timing functions
This commit is contained in:
parent
6331a2bf79
commit
321c677da2
12 changed files with 184 additions and 129 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue