PPM.h
const Color & getPixel(const int row, const int col) const
Directly access a pixel in the image.
Definition: PPM.h:109
void saveFile(const char *filename)
Save image data to a .ppm file. Throw an exception in case of an error.
Definition: PPM.cpp:82
Color & getPixel(const int row, const int col)
Directly access a pixel in the image.
Definition: PPM.h:115
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:89
void loadFile(const char *filename)
Load a .ppm file. Throw an exception in case of an error.
Definition: PPM.cpp:46
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:96
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:82
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:103