snoopy/src/colour.h

14 lines
375 B
C
Raw Normal View History

2020-06-01 02:49:50 +02:00
#pragma once
#include "vec3.h"
#include <iostream>
2020-06-06 05:09:13 +02:00
void write_colour(std::ostream &out, colour pixel_colour)
2020-06-01 02:49:50 +02:00
{
// write the translated [0,255] value of each colour component.
2020-06-06 05:09:13 +02:00
out << static_cast<int>(255.999 * pixel_colour.x()) << ' '
<< static_cast<int>(255.999 * pixel_colour.y()) << ' '
<< static_cast<int>(255.999 * pixel_colour.z()) << '\n';
2020-06-01 02:49:50 +02:00
}