12 std::vector<Vec3> data;
13 const int width, height;
14 const int color_channels;
15 const bool is_grayscale;
17 void validate_dimensions(
int x,
int y)
const;
28 Image(
int _width,
int _height,
int _channels,
bool _is_grayscale);
44 void draw(
int x,
int y,
const Vec3 &color);
60 void generateBmp(
const std::string &file_name)
const;
89 return color_channels;
107 [[nodiscard]]
const std::vector<Vec3> &
get_data()
const
121 return data[x * width + y];
const std::vector< Vec3 > & get_data() const
Definition image.h:107
void generateBmp(const std::string &file_name) const
Definition image.cpp:75
void add_color(int x, int y, const Vec3 &color)
Definition image.cpp:69
void draw(int x, int y, const Vec3 &color)
Definition image.cpp:63
int get_width() const
Definition image.h:67
bool get_is_grayscale() const
Definition image.h:97
Vec3 get_color(const int x, const int y) const
Definition image.h:119
int get_height() const
Definition image.h:77
Image(int _width, int _height, int _channels, bool _is_grayscale)
Definition image.cpp:48
int get_color_channels() const
Definition image.h:87
Definition raytracer.cpp:24