** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: if-2.cpp,v 1.2 2000/07/28 08:28:08 kevin Exp $
+** $Id: if-2.cpp,v 1.3 2000/07/28 10:51:31 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
int opt_sub = 0;
int opt_mul = 0;
int opt_comp = 0;
- int opt_outputFile = 0;
+ bool opt_outputFile = false;
int opt_rowPlot = -1;
int opt_columnPlot = -1;
Timer timerProgram;
switch (c) {
case O_ADD:
opt_add = 1;
- opt_outputFile = 1;
+ opt_outputFile = true;
break;
case O_SUB :
opt_sub = 1;
- opt_outputFile = 1;
+ opt_outputFile = true;
break;
case O_MUL:
opt_mul = 1;
- opt_outputFile = 1;
+ opt_outputFile = true;
break;
case O_ROW_PLOT:
opt_rowPlot = strtol(optarg, &endptr, 10);
if (endptr != optarg + strlen(optarg)) {
if2_usage(argv[0]);
}
+ break;
case O_COLUMN_PLOT:
opt_columnPlot = strtol(optarg, &endptr, 10);
if (endptr != optarg + strlen(optarg)) {
if2_usage(argv[0]);
}
+ break;
case O_COMP:
opt_comp = 1;
break;
SGPDriver driver ("Column Plot");
SGP sgp (driver);
EZPlot ezplot (sgp);
- ezplot.ezset ("clear.");
- ezplot.ezset ("xticks major 5.");
- ezplot.ezset ("xlabel Column");
- ezplot.ezset ("ylabel Pixel");
- ezplot.ezset ("curves 2");
- ezplot.ezset ("box.");
- ezplot.ezset ("grid.");
- ezplot.addCurve (v1[opt_columnPlot], plot_xaxis, im_in1.ny());
- ezplot.addCurve (v2[opt_columnPlot], plot_xaxis, im_in2.ny());
+ ezplot.ezset ("clear.");
+ ezplot.ezset ("xticks major 5.");
+ ezplot.ezset ("xlabel Column");
+ ezplot.ezset ("title Column Plot");
+ ezplot.ezset ("ylabel Pixel");
+ ezplot.ezset ("box.");
+ ezplot.ezset ("grid.");
+ 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;
cio_kb_getc();
#endif
for (int i = 0; i < ny; i++)
plot_xaxis[i] = i;
for (int i = 0; i < nx; i++)
- v1Row[i] = v1[opt_rowPlot][i];
+ v1Row[i] = v1[i][opt_rowPlot];
for (int i = 0; i < nx2; i++)
- v2Row[i] = v2[opt_rowPlot][i];
+ v2Row[i] = v2[i][opt_rowPlot];
#if HAVE_SGP
- SGPDriver driver ("Column Plot");
+ SGPDriver driver ("Row Plot");
SGP sgp (driver);
EZPlot ezplot (sgp);
- ezplot.ezset ("clear.");
- ezplot.ezset ("xticks major 5.");
- ezplot.ezset ("xlabel Column");
- ezplot.ezset ("ylabel Pixel");
- ezplot.ezset ("curves 2");
- ezplot.ezset ("box.");
- ezplot.ezset ("grid.");
- ezplot.addCurve (v1Row, plot_xaxis, im_in1.nx());
- ezplot.addCurve (v2Row, plot_xaxis, im_in2.nx());
+ ezplot.ezset ("clear.");
+ ezplot.ezset ("xticks major 5.");
+ ezplot.ezset ("title Row Plot");
+ ezplot.ezset ("xlabel Row");
+ ezplot.ezset ("ylabel Pixel");
+ ezplot.ezset ("box.");
+ ezplot.ezset ("grid.");
+ ezplot.addCurve (plot_xaxis, v1Row, im_in1.nx());
+ ezplot.addCurve (plot_xaxis, v2Row, im_in2.nx());
+ ezplot.plot();
cout << "Press enter to continue" << flush;
cio_kb_getc();
#endif