PPM.h
Load and save .ppm files - "portable pixmap format" an image file formats designed to be easily excha...
Definition: PPM.h:46
const Color & getPixel(const int row, const int col) const
Directly access a pixel in the image.
Definition: PPM.h:115
void saveFile(const char *filename)
Save image data to a .ppm file. Throw an exception in case of an error.
Definition: PPM.cpp:84
Color & getPixel(const int row, const int col)
Directly access a pixel in the image.
Definition: PPM.h:121
void setHeight(unsigned int height)
Set the height for the loaded image. This must eventually match the number of pixels, if saveFile() gets called.
Definition: PPM.h:95
void loadFile(const char *filename)
Load a .ppm file. Throw an exception in case of an error.
Definition: PPM.cpp:41
const std::vector< Color > & getPixels() const
Get read-only access to the pixels in the image. To access a pixel at coordinate (row,col), use getPixels()[row * getWidth() + col].
Definition: PPM.h:102
Definition: PPM.h:49
void setWidth(unsigned int width)
Set the width for the loaded image. This must eventually match the number of pixels, if saveFile() gets called.
Definition: PPM.h:88
std::vector< Color > & getPixels()
Get write access to the pixels in the image. To access a pixel at coordinate (row,col), use getPixels()[row * getWidth() + col]. This must eventually match the width & height set by setWidth() and setHeight().
Definition: PPM.h:109