Raytracer
Loading...
Searching...
No Matches
ImageHelper.hpp
1#include <string>
2#include <vector>
3#include "Common.hpp"
4
5#ifndef __IMAGE_HELPER_HPP__
6 #define __IMAGE_HELPER_HPP__
7
8namespace Raytracer::Utils
9{
11 private:
12 int _width = 0;
13 int _height = 0;
14 std::vector<unsigned char> data;
15
16 public:
17 ImageHelper() = default;
18 ImageHelper(const char *filename);
19 bool load(const std::string &filename);
20 const unsigned char *pixelData(int x, int y) const;
21 GET_SET(int, width);
22 GET_SET(int, height);
23 };
24} // namespace Raytracer::Utils
25
26#endif /* __IMAGE_HELPER_HPP__ */
Definition ImageHelper.hpp:10
const unsigned char * pixelData(int x, int y) const
Get the pixel data at the given coordinates.
Definition ImageHelper.cpp:78
bool load(const std::string &filename)
Load the image from the given filename.
Definition ImageHelper.cpp:31