122 const unsigned int width;
123 const unsigned int height;
131 Picture(
unsigned int width,
unsigned int height,
double renderTime = -1);
138 std::vector<std::vector<DoubleVec3D>>
getPixels()
const;
144 void export2File(
double middleGrey, std::string fileName,
unsigned int movingAverage = 0)
const;
Defines functions that are used to ask for values to the user, and to interactively create 3D objects...
nlohmann::json json
Definition: InterfaceGestion.h:14
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.
Definition: Picture.cpp:176
DoubleVec3D toneMapping(const DoubleVec3D &radiance, double middleGrey)
Converts a radiance to a colour value.
Definition: Picture.cpp:167
Picture importPictureFromJson(const json &j)
Imports a picture out of json.
Definition: Picture.cpp:212
void to_json(json &j, const Picture &picture)
Conversion to json.
Definition: Picture.cpp:207
A three-dimensional vector using double values.
Definition: DoubleVec3D.h:190
Stores radiance for every pixel.
Definition: Picture.h:120
static constexpr unsigned int MAX_COLOUR_VALUE
The maximum value that will be used to write a colour in a file.
Definition: Picture.h:128
~Picture()
Destructor.
Definition: Picture.cpp:17
unsigned int getHeight() const
Getter for the height.
Definition: Picture.cpp:26
void export2File(double middleGrey, std::string fileName, unsigned int movingAverage=0) const
Writes this as a picture file.
Definition: Picture.cpp:47
void setRenderTime(double renderTime)
Setter for the render time.
Definition: Picture.cpp:44
Picture()
Default constructor.
Definition: Picture.cpp:4
unsigned int getWidth() const
Getter for the width.
Definition: Picture.cpp:25
void setValuePix(unsigned int x, unsigned int y, DoubleVec3D value)
Sets a pixel value.
Definition: Picture.cpp:43
void printAll() const
Prints the whole page.
Definition: Picture.cpp:82
std::vector< std::vector< DoubleVec3D > > getPixels() const
Getter for the pixels.
Definition: Picture.cpp:29
double getRenderTime() const
Getter for the render time.
Definition: Picture.cpp:27
void addValuePix(unsigned int x, unsigned int y, DoubleVec3D value)
Adds a value to a pixel.
Definition: Picture.cpp:42
void modify()
Interactive modification of this picture.
Definition: Picture.cpp:98