Phongo Clap RT
1.0
Simple Raytracing Renderer
|
Holds all the operations regarding to input/output of colour information. More...
#include <Film.h>
Public Member Functions | |
Film () | |
Film constructor. More... | |
void | setDimensions (int _w, int _h) |
Sets the dimensions of the Film. More... | |
~Film () | |
Destructor for the Film. More... | |
void | writePixel (ngl::Colour _colour) |
Will create a pixel and push it to the pixel vector. More... | |
void | writeFile (const char *_image_name) |
Iterates over the pixel vector and writes into a file using basic output stream methods. More... | |
Private Attributes | |
int | m_width |
Width of the Film's image. More... | |
int | m_height |
Height of the Film's image. More... | |
std::vector< Pixel > | m_pixels |
Vector of pixels. The index of the pixel corresponds to this equation: i = height * y + x. More... | |
std::ofstream | m_file |
File output stream, in charge of writing the pixels into a file. More... | |
Friends | |
class | Renderer |
Holds all the operations regarding to input/output of colour information.
void Film::setDimensions | ( | int | _w, |
int | _h | ||
) |
void Film::writeFile | ( | const char * | _image_name | ) |
Iterates over the pixel vector and writes into a file using basic output stream methods.
[in] | _image_name | The file will be written with the name [_image_name].ppm |
Definition at line 26 of file Film.cpp.
References m_file, m_height, m_pixels, and m_width.
void Film::writePixel | ( | ngl::Colour | _colour | ) |
Will create a pixel and push it to the pixel vector.
[in] | _colour | Colour that will be written in that pixel. |
Definition at line 17 of file Film.cpp.
References Pixel::b, Pixel::g, m_pixels, and Pixel::r.
|
private |
|
private |