TinyRaytracer 0.1
A simple C++ raytracer
Loading...
Searching...
No Matches
Functions
helper.hpp File Reference
#include <string>
#include <tuple>
#include <cmath>
#include "vec3.hpp"
#include "struct.hpp"
#include "object.hpp"

Go to the source code of this file.

Functions

void print (std::string str)
 print a string More...
 
double RGBtosRGB (double l)
 Translate color from linear RGB to sRGB. More...
 
double sRGBtoRGB (double l)
 Translate color from sRGB to linear RGB. More...
 
void setImageColor (Image &img, RGBA rgba, int x, int y)
 Set the Image Color at pixel (x,y) based on the RGBA input. More...
 
double setExpose (double c)
 
ObjectInfo unpackIntersection (const ObjectInfo &sphere, const ObjectInfo &plane)
 
std::tuple< double, double, double > getBarycentric (const Triangle &tri, const point3 &point)
 
double randD (double start, double end)
 
double standerdD (double stddev)
 
point3 spherePoint ()
 
void print (int i)
 
void print (double f)
 
void printErr (std::string str)
 

Detailed Description

Author
Jin (jinj2.nosp@m.@ill.nosp@m.inois.nosp@m..edu)
Version
0.1
Date
2024-11-06

Function Documentation

◆ print()

void print ( string  str)

print a string

◆ RGBtosRGB()

double RGBtosRGB ( double  l)

Translate color from linear RGB to sRGB.

Parameters
lLinear RGB value. (0~1)
Returns
double sRGB value. (0~1)

◆ setImageColor()

void setImageColor ( Image &  img,
RGBA  rgba,
int  x,
int  y 
)

Set the Image Color at pixel (x,y) based on the RGBA input.

Parameters
imgThe image to set.
rgbaThe color to use, in linear RGB color space.
xx coordinate of the pixel.
yy coordinate of the pixel.

◆ sRGBtoRGB()

double sRGBtoRGB ( double  l)

Translate color from sRGB to linear RGB.

Parameters
lsRGB value. (0~255)
Returns
double Linear RGB value.(0~1)