diff --git a/src/fart/Image.cpp b/src/fart/Image.cpp index c520094..960358c 100644 --- a/src/fart/Image.cpp +++ b/src/fart/Image.cpp @@ -1,12 +1,6 @@ #include Image::Image(size_t width, size_t height) - : width(width), height(height) + : width(width), height(height), pixels(width * height) { - this->pixels = new Color[width * height]; -} - -Image::~Image() -{ - delete[] this->pixels; } diff --git a/src/fart/Image.h b/src/fart/Image.h index a7bbd6f..f4c7078 100644 --- a/src/fart/Image.h +++ b/src/fart/Image.h @@ -2,14 +2,14 @@ #include #include +#include struct Image { size_t width; size_t height; - Color * pixels; + std::vector pixels; Image(size_t width, size_t height); - ~Image(); Color & operator[](size_t x, size_t y) {