First commit

This commit is contained in:
David 2021-08-20 23:27:59 +02:00
commit b75663feab
7 changed files with 348 additions and 0 deletions

18
color.hpp Normal file
View file

@ -0,0 +1,18 @@
#ifndef COLOR_H
#define COLOR_H
#include "vec3.hpp"
#include <stdio.h>
#include <stdint.h>
/* Writes color components as a space-delimited string of numbers in the range [0,255] */
void write_color(FILE *fp, color c)
{
fprintf(fp, "%d %d %d\n",
(uint8_t) (255 * c.x),
(uint8_t) (255 * c.y),
(uint8_t) (255 * c.z));
}
#endif