From 6ee8f59859b820e11f06a1386052ece06fb53f55 Mon Sep 17 00:00:00 2001 From: nedko Date: Wed, 7 Dec 2022 14:50:09 +0200 Subject: [PATCH] Revert "Added pixel printing to terminal" This reverts commit 7d9e250c68a772c5e7f38afcb490aef4c0aceaf7. --- main.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/main.cpp b/main.cpp index 4c0b7a4..5788556 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,5 @@ #include #include -#include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" @@ -19,15 +18,6 @@ void usage(char *name) cout << "Image must have 3 or more channels" << endl; } -void print_pixel(ColourRGB rgb) -{ - uint8_t r = static_cast(round(rgb.r * 255)); - uint8_t g = static_cast(round(rgb.g * 255)); - uint8_t b = static_cast(round(rgb.b * 255)); - - printf("#%02x%02x%02x - %3d %3d %3d", r, g ,b, r, g, b); -} - int main(int argc, char **argv) { int x_size; @@ -85,6 +75,7 @@ int main(int argc, char **argv) // TODO: Handle alpha here } + // TODO: Add pixel to evaluator here pixel_hsv = RGBtoHSV(pixel); main_extractor.add_pixel(pixel_hsv); comp_extractor.add_pixel(pixel_hsv); @@ -96,12 +87,7 @@ int main(int argc, char **argv) pixel = HSVtoRGB(pixel_hsv); pixel2 = HSVtoRGB(comp_extractor.extract_colour()); - cout << "Main - "; - print_pixel(pixel); - cout << endl; - cout << "Comp - "; - print_pixel(pixel2); - cout << endl; + // TODO: Print them to console x_size = 16; y_size = 16; @@ -120,7 +106,7 @@ int main(int argc, char **argv) image[i * channels + 2] = static_cast(round(pixel.b * 255)); } - stbi_write_png("0 - main.png", x_size, y_size, channels, image, x_size * channels); + stbi_write_png("main.png", x_size, y_size, channels, image, x_size * channels); for (int i = 0; i < x_size * y_size; ++i) { @@ -129,7 +115,7 @@ int main(int argc, char **argv) image[i * channels + 2] = static_cast(round(pixel2.b * 255)); } - stbi_write_png("1 - comp.png", x_size, y_size, channels, image, x_size * channels); + stbi_write_png("comp.png", x_size, y_size, channels, image, x_size * channels); delete[] image;