TinyRaytracer 0.1
A simple C++ raytracer
Loading...
Searching...
No Matches
helper.hpp
Go to the documentation of this file.
1
11#ifndef HELPER_H
12#define HELPER_H
13#include <string>
14#include <tuple>
15#include <cmath>
16#include "vec3.hpp"
17#include "struct.hpp"
18#include "object.hpp"
19
20
21void print(std::string str);
22
23/*The color functions*/
24double RGBtosRGB(double l);
25double sRGBtoRGB(double l);
26void setImageColor(Image& img,RGBA rgba,int x,int y);
27double setExpose(double c);
28
29ObjectInfo unpackIntersection(const ObjectInfo& sphere,
30 const ObjectInfo& plane);
31std::tuple<double,double,double> getBarycentric(const Triangle& tri,const point3& point);
32
33double randD(double start,double end);
34
35double standerdD(double stddev);
36
37point3 spherePoint();
38
39void print(int i);
40void print(double f);
41
42void printErr(std::string str);
43
44#endif
ObjectInfo is a class that passes the parameters of a ray hit, and the details of the object that was...
Definition: object.hpp:50
Definition: struct.hpp:39
Class Triangle, with 3 vertices that made it up.
Definition: object.hpp:163
Definition: vec3.hpp:18
void print(std::string str)
print a string
Definition: helper.cpp:24
void setImageColor(Image &img, RGBA rgba, int x, int y)
Set the Image Color at pixel (x,y) based on the RGBA input.
Definition: helper.cpp:74
double RGBtosRGB(double l)
Translate color from linear RGB to sRGB.
Definition: helper.cpp:46
double sRGBtoRGB(double l)
Translate color from sRGB to linear RGB.
Definition: helper.cpp:62