|
| ImageHelper (const char *filename) |
| Construct a new ImageHelper object.
|
|
bool | load (const std::string &filename) |
| Load the image from the given filename.
|
|
const unsigned char * | pixelData (int x, int y) const |
| Get the pixel data at the given coordinates.
|
|
| GET_SET (int, width) |
|
| GET_SET (int, height) |
|
◆ ImageHelper()
Raytracer::Utils::ImageHelper::ImageHelper |
( |
const char * | filename | ) |
|
Construct a new ImageHelper object.
This function constructs a new ImageHelper object with the given filename. The ImageHelper object is used to load and read PPM images.
- Parameters
-
filename | The filename of the image. |
- Returns
- A new ImageHelper object.
◆ load()
bool Raytracer::Utils::ImageHelper::load |
( |
const std::string & | filename | ) |
|
Load the image from the given filename.
This function loads the image from the given filename. The image must be in PPM format (P6). The function returns true if the image was successfully loaded, and false otherwise.
- Parameters
-
filename | The filename of the image. |
- Returns
- True if the image was successfully loaded, and false otherwise.
◆ pixelData()
const unsigned char * Raytracer::Utils::ImageHelper::pixelData |
( |
int | x, |
|
|
int | y ) const |
Get the pixel data at the given coordinates.
This function returns the pixel data at the given coordinates. The function returns magenta if the coordinates are out of bounds.
- Parameters
-
x | The x-coordinate. |
y | The y-coordinate. |
- Returns
- The pixel data at the given coordinates.
The documentation for this class was generated from the following files:
- /Users/javii/Code/raytracer/include/utils/ImageHelper.hpp
- /Users/javii/Code/raytracer/sources/utils/ImageHelper.cpp