about summary refs log tree commit diff stats
path: root/apps/raytracing/color.h
blob: a8a34b26868dda13bd4d978807edf5df62122aa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef COLOR_H
#define COLOR_H

#include "vec3.h"

#include <iostream>

void write_color(std::ostream &out, color pixel_color) {
    // Write the translated [0,255] value of each color component.
    out << static_cast<int>(255.999 * pixel_color.x()) << ' '
        << static_cast<int>(255.999 * pixel_color.y()) << ' '
        << static_cast<int>(255.999 * pixel_color.z()) << '\n';
}

#endif