#include <image.h>
Public Member Functions | |
Image () | |
Default constructor. | |
Image (int width, int height) | |
Creates an image buffer of the specified size. | |
~Image () | |
Destroys the object. | |
void | load (const std::string &filename) |
Loads an image from a file. | |
void | save (const std::string &filename) const |
Writes the image to a file. | |
void | setPixel (int x, int y, const Color &c) |
Sets the pixel at (x,y) to color c. | |
void | getPixel (int x, int y, Color &c) const |
Returns the pixel value at (x,y) in the reference c. | |
Color | getPixel (int x, int y) const |
Returns the pixel at (x,y). | |
int | getWidth () const |
Returns the width in pixels. | |
int | getHeight () const |
Returns the height in pixels. |
Each pixel in the image is a Color object with red, green, blue components. There are functions for loading and saving the image in OpenEXR (.exr) format, and for getting and setting pixel values. This class is used as frame buffer in the raytracer, storing the output color of each pixel, and also used in the LightProbe class for representing the environment map.