X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fifinfo.cpp;fp=src%2Fifinfo.cpp;h=6149c9e634faea48a2875c88677fca5070554dc2;hp=321fc5c5890a2fefe6e4b5a3bda926cbefb1804c;hb=6850134e4711a842cc7c0a306a9e4243df06b952;hpb=b8d8c64ac7fe071dd806064ae37f48e0e5b153bd diff --git a/src/ifinfo.cpp b/src/ifinfo.cpp index 321fc5c..6149c9e 100644 --- a/src/ifinfo.cpp +++ b/src/ifinfo.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ifinfo.cpp,v 1.12 2000/06/27 10:48:11 kevin Exp $ +** $Id: ifinfo.cpp,v 1.13 2000/07/09 08:16:18 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -49,7 +49,7 @@ static struct option my_options[] = void ifinfo_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " image1 [image2] [OPTIONS]" << endl; + cout << "usage: " << fileBasename(program) << " image-filename [OPTIONS]" << endl; cout << "Imagefile information" << endl; cout << endl; cout << " infile Name of input IF file" << endl; @@ -68,9 +68,7 @@ int ifinfo_main (int argc, char *const argv[]) { ImageFile *im = NULL; - ImageFile* im2 = NULL; string in_file; - string in2_file; int opt_verbose = 0; int opt_stats = 1; int opt_labels = 1; @@ -120,9 +118,7 @@ ifinfo_main (int argc, char *const argv[]) } } - if (optind + 2 == argc) { - in2_file = argv [optind+1]; - } else if (optind + 1 != argc) { + if (optind + 1 != argc) { ifinfo_usage (argv[0]); return (1); } @@ -130,45 +126,19 @@ ifinfo_main (int argc, char *const argv[]) in_file = argv[optind]; im = new ImageFile (); - if (! im->fileRead (in_file.c_str())) { + if (! im->fileRead (in_file)) { sys_error (ERR_WARNING, "Unable to read file %s", in_file.c_str()); return (1); } - if (in2_file != "") { - im2 = new ImageFile(); - if (! im2->fileRead (in2_file.c_str())) { - sys_error (ERR_WARNING, "Unable to read file %s", in2_file.c_str()); - return (1); - } - } - - if (opt_stats) - cout << "Image size: (" << im->nx() << "," << im->ny() << ")" << endl << endl; - if (im2) - cout << "Image 1: " << im->getFilename() << endl; - if (opt_labels) im->printLabels (cout); if (opt_stats) { + cout << "Size: (" << im->nx() << "," << im->ny() << ")" << endl; im->printStatistics (cout); - - if (im2) { - cout << endl; - - cout << "Image 2: " << im2->getFilename() << endl; - - if (opt_labels) - im2->printLabels(cout); - - im2->printStatistics (cout); - cout << endl; - - im->printComparativeStatistics (*im2, cout); - } } - + return (0); }