|
Path Tracer
|
Stores radiance for every pixel. More...
#include <Picture.h>
Public Member Functions | |
| Picture () | |
| Default constructor. More... | |
| Picture (unsigned int width, unsigned int height, double renderTime=-1) | |
| Main constructor. More... | |
| Picture (const Picture &picture) | |
| Copy constructor. More... | |
| ~Picture () | |
| Destructor. More... | |
| unsigned int | getWidth () const |
| Getter for the width. More... | |
| unsigned int | getHeight () const |
| Getter for the height. More... | |
| double | getRenderTime () const |
| Getter for the render time. More... | |
| std::vector< std::vector< DoubleVec3D > > | getPixels () const |
| Getter for the pixels. More... | |
| void | addValuePix (unsigned int x, unsigned int y, DoubleVec3D value) |
| Adds a value to a pixel. More... | |
| void | setValuePix (unsigned int x, unsigned int y, DoubleVec3D value) |
| Sets a pixel value. More... | |
| void | setRenderTime (double renderTime) |
| Setter for the render time. More... | |
| void | export2File (double middleGrey, std::string fileName, unsigned int movingAverage=0) const |
| Writes this as a picture file. More... | |
| void | printAll () const |
| Prints the whole page. More... | |
| void | modify () |
| Interactive modification of this picture. More... | |
Static Public Attributes | |
| static constexpr unsigned int | MAX_COLOUR_VALUE = 255 |
| The maximum value that will be used to write a colour in a file. More... | |
Stores radiance for every pixel.
| Picture::Picture | ( | ) |
Default constructor.
By default, width and height are both set to 500.
| Picture::Picture | ( | unsigned int | width, |
| unsigned int | height, | ||
| double | renderTime = -1 |
||
| ) |
Main constructor.
All pixels are set to (0, 0, 0).
| width | The picture width. |
| height | The picture height. |
| renderTime | The time in seconds it took to compute this picture. |
| Picture::Picture | ( | const Picture & | picture | ) |
Copy constructor.
| picture | The picture that will be copied. |
| Picture::~Picture | ( | ) |
Destructor.
| void Picture::addValuePix | ( | unsigned int | x, |
| unsigned int | y, | ||
| DoubleVec3D | value | ||
| ) |
Adds a value to a pixel.
| x | The x coordinate of the pixel. |
| y | The y coordinate of the pixel. |
| value | The value that will be added to that pixel. |
| void Picture::export2File | ( | double | middleGrey, |
| std::string | fileName, | ||
| unsigned int | movingAverage = 0 |
||
| ) | const |
Writes this as a picture file.
Uses the CImg library.
| middleGrey | The middle-grey value that will be used for the toneMapping() function. |
| fileName | The path to the file where we want to write this picture. If it is "-", it will give a very nice bugged result. This could be easily fixed, but it is very fun and purely nondestructive. |
| movingAverage | The size of the moving average (see getColourMovingAverage()). |
| unsigned int Picture::getHeight | ( | ) | const |
Getter for the height.
| Picture::getPixels | ( | ) | const |
Getter for the pixels.
| double Picture::getRenderTime | ( | ) | const |
Getter for the render time.
| unsigned int Picture::getWidth | ( | ) | const |
Getter for the width.
| void Picture::modify | ( | ) |
Interactive modification of this picture.
This is a page on its own. It allows the user to write the picture under different names, different middle-grey values and different moving average size.
| void Picture::printAll | ( | ) | const |
Prints the whole page.
Clears the page, prints the header, information and the available commands.
| void Picture::setRenderTime | ( | double | renderTime | ) |
Setter for the render time.
This method can be used if the time was not set when the picture was instanciated (which is very likely to happen).
| renderTime | The new time this picture took to be computed. |
| void Picture::setValuePix | ( | unsigned int | x, |
| unsigned int | y, | ||
| DoubleVec3D | value | ||
| ) |
Sets a pixel value.
| x | The x coordinate of the pixel. |
| y | The y coordinate of the pixel. |
| value | The value to which that pixel will be set. |
|
staticconstexpr |
The maximum value that will be used to write a colour in a file.