X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=tools%2Fif-2.cpp;h=b2afcb268d3f9254c389f85f06794fe08b4900b2;hp=9fee32a01286ede9aeb9783f203fa985003a1b89;hb=855f0990a75750c61badd376ff35ffb39fab1c36;hpb=c85a5b31119b4e0903144c55441717a7ad1e0b8b diff --git a/tools/if-2.cpp b/tools/if-2.cpp index 9fee32a..b2afcb2 100644 --- a/tools/if-2.cpp +++ b/tools/if-2.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if-2.cpp,v 1.3 2000/07/28 10:51:31 kevin Exp $ +** $Id: if-2.cpp,v 1.7 2000/12/17 23:30:48 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 @@ -45,24 +45,26 @@ static struct option my_options[] = {0, 0, 0, 0} }; +static const char* g_szIdStr = "$Id: if-2.cpp,v 1.7 2000/12/17 23:30:48 kevin Exp $"; + void if2_usage (const char *program) { - cout << "usage: " << fileBasename(program) << " infile1 infile2 outfile [OPTIONS]" << endl; - cout << "Perform functions on two input image files" << endl; - cout << endl; - cout << " infile1 Name of first input IF file" << endl; - cout << " infile2 Name of second input IF file" << endl; - cout << " outfile Name of output IF file" << endl; - cout << " --add Add images" << endl; - cout << " --sub Subtract image 2 from image 1" << endl; - cout << " --mul Multiply images" << endl; - cout << " --comp Compare images" << endl; - cout << " --column-plot n Plot column\n"; - cout << " --row-plot n Plot row\n"; - cout << " --verbose Verbose modem" << endl; - cout << " --version Print version" << endl; - cout << " --help Print this help message" << endl; + std::cout << "usage: " << fileBasename(program) << " infile1 infile2 outfile [OPTIONS]\n"; + std::cout << "Perform functions on two input image files\n"; + std::cout << std::endl; + std::cout << " infile1 Name of first input IF file\n"; + std::cout << " infile2 Name of second input IF file\n"; + std::cout << " outfile Name of output IF file\n"; + std::cout << " --add Add images\n"; + std::cout << " --sub Subtract image 2 from image 1\n"; + std::cout << " --mul Multiply images\n"; + std::cout << " --comp Compare images\n"; + std::cout << " --column-plot n Plot column\n"; + std::cout << " --row-plot n Plot row\n"; + std::cout << " --verbose Verbose modem\n"; + std::cout << " --version Print version\n"; + std::cout << " --help Print this help message\n"; } int @@ -71,9 +73,9 @@ if2_main (int argc, char *const argv[]) ImageFile* pim_in1; ImageFile* pim_in2; ImageFile* pim_out = NULL; - string in_file1; - string in_file2; - string out_file; + std::string in_file1; + std::string in_file2; + std::string out_file; int opt_verbose = 0; int opt_add = 0; int opt_sub = 0; @@ -124,9 +126,9 @@ if2_main (int argc, char *const argv[]) break; case O_VERSION: #ifdef VERSION - cout << "Version " << VERSION << endl; + std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl; #else - cout << "Unknown version number" << endl; + std::cout << "Unknown version number\n"; #endif return (0); case O_HELP: @@ -182,7 +184,7 @@ if2_main (int argc, char *const argv[]) vout = pim_out->getArray(); } - string strOperation; + std::string strOperation; int nx = im_in1.nx(); int ny = im_in1.ny(); int nx2 = im_in2.nx(); @@ -219,7 +221,7 @@ if2_main (int argc, char *const argv[]) if (opt_comp) { double d, r, e; im_in1.comparativeStatistics (im_in2, d, r, e); - cout << "d=" << d << ", r=" << r << ", e=" << e << endl; + std::cout << "d=" << d << ", r=" << r << ", e=" << e << std::endl; } if (opt_columnPlot > 0) { if (opt_columnPlot >= nx || opt_columnPlot >= nx2) { @@ -243,7 +245,7 @@ if2_main (int argc, char *const argv[]) ezplot.addCurve (plot_xaxis, v1[opt_columnPlot], im_in1.ny()); ezplot.addCurve (plot_xaxis, v2[opt_columnPlot], im_in2.ny()); ezplot.plot(); - cout << "Press enter to continue" << flush; + std::cout << "Press enter to continue" << flush; cio_kb_getc(); #endif } @@ -277,7 +279,7 @@ if2_main (int argc, char *const argv[]) ezplot.addCurve (plot_xaxis, v1Row, im_in1.nx()); ezplot.addCurve (plot_xaxis, v2Row, im_in2.nx()); ezplot.plot(); - cout << "Press enter to continue" << flush; + std::cout << "Press enter to continue" << flush; cio_kb_getc(); #endif } @@ -301,9 +303,9 @@ main (int argc, char *const argv[]) try { retval = if2_main(argc, argv); } catch (exception e) { - cerr << "Exception: " << e.what() << endl; + std::cerr << "Exception: " << e.what() << std::endl; } catch (...) { - cerr << "Unknown exception" << endl; + std::cerr << "Unknown exception\n"; } return (retval);