summary refs log tree commit diff
path: root/src/GFX/Image
diff options
context:
space:
mode:
Diffstat (limited to 'src/GFX/Image')
-rw-r--r--src/GFX/Image/PPMParser.cpp2
-rw-r--r--src/GFX/Image/RawImage.hpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/GFX/Image/PPMParser.cpp b/src/GFX/Image/PPMParser.cpp
index b809ef1..31be0ab 100644
--- a/src/GFX/Image/PPMParser.cpp
+++ b/src/GFX/Image/PPMParser.cpp
@@ -17,7 +17,7 @@ RawImage PPMParser::parse() {
 
     auto pixel_count = header.width * header.height;
 
-    RawImage image(pixel_count, header.width, header.height, 3);
+    RawImage image(header.width, header.height, 3);
     for (uint64_t pixel_index = 0; pixel_index < pixel_count; pixel_index++) {
         RawImage::Pixel pixel = parse_pixel(header.max_color);
         image.add(pixel);
diff --git a/src/GFX/Image/RawImage.hpp b/src/GFX/Image/RawImage.hpp
index 916671b..2b10cb0 100644
--- a/src/GFX/Image/RawImage.hpp
+++ b/src/GFX/Image/RawImage.hpp
@@ -10,9 +10,9 @@ class RawImage {
 public:
     RawImage() : m_pixels(), m_width(0), m_height(0), m_channels(0) {};
 
-    explicit RawImage(size_t pixel_count, uint32_t width, uint32_t height, uint8_t channels)
+    explicit RawImage(uint32_t width, uint32_t height, uint8_t channels)
         : m_pixels(), m_width(width), m_height(height), m_channels(channels) {
-        m_pixels.reserve(pixel_count);
+        m_pixels.reserve(width * height);
     }
 
     struct Pixel {