First commit
This commit is contained in:
commit
b75663feab
7 changed files with 348 additions and 0 deletions
18
color.hpp
Normal file
18
color.hpp
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue