beautify terminal output

This commit is contained in:
2026-01-31 18:06:37 +03:00
parent f8dc17242e
commit 19e7524809
+7 -5
View File
@@ -41,7 +41,6 @@ int main(int argc, char *argv[]) {
} }
std::string imagefile = argv[1]; std::string imagefile = argv[1];
cout << "File: " << imagefile << "\n";
if (!fs::is_regular_file(imagefile)) { if (!fs::is_regular_file(imagefile)) {
std::cout << "File not found: " << imagefile << "\n"; std::cout << "File not found: " << imagefile << "\n";
@@ -58,11 +57,11 @@ int main(int argc, char *argv[]) {
file.read(reinterpret_cast<char*>(header), 8); file.read(reinterpret_cast<char*>(header), 8);
if (is_png(header)) { if (is_png(header)) {
cout << "PNG detected\n"; cout << "PNG file detected!\n";
} else if (is_jpeg(header)) { } else if (is_jpeg(header)) {
cout << "JPEG detected\n"; cout << "JPEG file detected!\n";
} else { } else {
cout << "Unkown format!\n"; cout << "Unkown image file format!\n";
return 1; return 1;
} }
@@ -77,14 +76,17 @@ int main(int argc, char *argv[]) {
); );
if (!data) { if (!data) {
cout << "Failed to load image\n"; cout << "Failed to load image!\n";
return 1; return 1;
} }
cout << "**********\n";
cout << "Loaded image:\n"; cout << "Loaded image:\n";
cout << "Width: " << width << "\n"; cout << "Width: " << width << "\n";
cout << "Height: " << height << "\n"; cout << "Height: " << height << "\n";
cout << "Channels: " << channels << "\n"; cout << "Channels: " << channels << "\n";
cout << "**********\n";
std::vector<Pixel> samples; std::vector<Pixel> samples;