Path Tracer
Functions
Picture.cpp File Reference
#include "Picture.h"
Include dependency graph for Picture.cpp:

Functions

DoubleVec3D toneMapping (const DoubleVec3D &radiance, double middleGrey)
 Converts a radiance to a colour value. More...
 
DoubleVec3D getColourMovingAverage (const std::vector< std::vector< DoubleVec3D >> &pixelValues, unsigned int pixelX, unsigned int pixelY, unsigned int size)
 Computes the value of a pixel when having applied a moving average. More...
 
void to_json (json &j, const Picture &picture)
 Conversion to json. More...
 
Picture importPictureFromJson (const json &j)
 Imports a picture out of json. More...
 

Function Documentation

◆ getColourMovingAverage()

DoubleVec3D getColourMovingAverage ( const std::vector< std::vector< DoubleVec3D >> &  pixelValues,
unsigned int  pixelX,
unsigned int  pixelY,
unsigned int  size 
)

Computes the value of a pixel when having applied a moving average.

Parameters
pixelValuesThe values of all pixels (can be radiance or colour value, depending whether you first use the toneMapping function or not).
pixelXThe x coordinate of the pixel.
pixelYthe y coordinate of the pixel.
sizeThe size of the moving average.
Returns
The colour at that pixel after having applied the moving average.
See also
Picture::export2File()

◆ importPictureFromJson()

Picture importPictureFromJson ( const json j)

Imports a picture out of json.

Parameters
jThe json input.
Returns
The imported picture.

◆ to_json()

void to_json ( json j,
const Picture picture 
)

Conversion to json.

Parameters
jJson output.
pictureThe picture that will be converted to json.
Warning
This is a very inefficient way to store a picture. Only use it to make temporary backups.

◆ toneMapping()

DoubleVec3D toneMapping ( const DoubleVec3D radiance,
double  middleGrey 
)

Converts a radiance to a colour value.

This is a very naive tone mapping. See my TM's report for more explanations.

Parameters
radianceThe radiance we want to convert.
middleGreyThe radiance value that corresponds to the middle-grey.
Returns
The colour that has been computed. Each part of the colour (red, green or blue) range from 0 to MAX_COLOUR_VALUE.
See also
Picture::MAX_COLOUR_VALUE, Picture::export2File()