** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: if-1.cpp,v 1.4 2000/06/08 16:43:10 kevin Exp $
+** $Id: if-1.cpp,v 1.7 2000/06/18 10:27:11 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
void
if1_usage (const char *program)
{
- fprintf(stdout, "if1_usage: %s infile outfile [OPTIONS]\n", kbasename(program));
- fprintf(stdout, "Generate a IF file from a IF file\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " --invert Invert image\n");
- fprintf(stdout, " --log Natural logrithm of image\n");
- fprintf(stdout, " --exp Natural exponential of image\n");
- fprintf(stdout, " --sqr Square of image\n");
- fprintf(stdout, " --sqrt Square root of image\n");
- fprintf(stdout, " --verbose Verbose modem\n");
- fprintf(stdout, " --version Print version\n");
- fprintf(stdout, " --help Print this help message\n");
+ cout << "usage: " << fileBasename(program) << " infile outfile [OPTIONS]" << endl;
+ cout << "Generate a IF file from a IF file" << endl;
+ cout << endl;
+ cout << " --invert Invert image" << endl;
+ cout << " --log Natural logrithm of image" << endl;
+ cout << " --exp Natural exponential of image" << endl;
+ cout << " --sqr Square of image" << endl;
+ cout << " --sqrt Square root of image" << endl;
+ cout << " --verbose Verbose modem" << endl;
+ cout << " --version Print version" << endl;
+ cout << " --help Print this help message" << endl;
}
int
break;
case O_VERSION:
#ifdef VERSION
- fprintf(stdout, "Version %s\n", VERSION);
+ cout << "Version " << VERSION << endl;
#else
- fprintf(stderr, "Unknown version number");
+ cout << "Unknown version number" << endl;
#endif
- exit(0);
+ return (0);
case O_HELP:
case '?':
if1_usage(argv[0]);
int ix, iy;
im_in = new ImageFile (in_file);
- im_in->adf.fileRead ();
+ im_in->fileRead ();
int nx = im_in->nx();
int ny = im_in->ny();
im_out = new ImageFile (out_file, nx, ny);
- im_out->adf.fileCreate ();
+ im_out->fileCreate ();
ImageFileArray vIn = im_in->getArray();
ImageFileArray vOut = im_out->getArray();
histString = "Sqrt transformation";
}
- im_out->adf.arrayDataWrite ();
- im_out->adf.labelsCopy (im_in->adf);
- im_out->adf.labelAdd (Array2dFileLabel::L_HISTORY, histString.c_str());
- im_out->adf.fileClose ();
+ im_out->arrayDataWrite ();
+ im_out->labelsCopy (*im_in);
+ im_out->labelAdd (Array2dFileLabel::L_HISTORY, histString.c_str());
+ im_out->fileClose ();
}
return (0);