summary refs log tree commit diff
path: root/src/Image/PPMParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Image/PPMParser.cpp')
-rw-r--r--src/Image/PPMParser.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/Image/PPMParser.cpp b/src/Image/PPMParser.cpp
index 0a9da54..d7d8c6a 100644
--- a/src/Image/PPMParser.cpp
+++ b/src/Image/PPMParser.cpp
@@ -8,8 +8,6 @@ namespace MC::Image {
 RawImage PPMParser::parse() {
     auto header = parse_header();
 
-    std::cout << header.type << " " << header.width << " " << header.height << " " << (uint64_t)header.max_color << std::endl;
-
     if (header.max_color != 255) {
         throw std::logic_error("PPM max color values other than 255 are not implemented.");
     }
@@ -20,7 +18,7 @@ RawImage PPMParser::parse() {
 
     auto pixel_count = header.width * header.height;
 
-    RawImage image(pixel_count);
+    RawImage image(pixel_count, 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);
@@ -97,16 +95,10 @@ uint64_t PPMParser::chomp_number() {
 
         uint8_t digit = digit_ascii - '0';
 
-        std::cout << "digit_ascii: " << digit_ascii << std::endl;
-        std::cout << "digit: " << (uint64_t)digit << std::endl;
-
         number *= 10;
         number += digit;
-
-        std::cout << "number: " << (uint64_t)number << std::endl;
     }
 
-    std::cout << "chomp number: " << number << std::endl;
     return number;
 }
 
@@ -125,7 +117,6 @@ std::string_view PPMParser::chomp_part() {
     auto part = m_source.substr(m_cursor, length);
     m_cursor += length;
 
-    std::cout << "chomped: " << part << std::endl;
     return part;
 }