r94: finished c++ conversions
[ctsim.git] / src / if-2.cpp
index 4368c17b7a757043c46c24bb24bc3ae3f29197bb..29aef012299889f0a2cb6dcfbccc4c25db3e441c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if-2.cpp,v 1.2 2000/06/08 16:43:10 kevin Exp $
+**  $Id: if-2.cpp,v 1.4 2000/06/13 16:20: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
@@ -48,7 +48,7 @@ static struct option my_options[] =
 void 
 sdf2_usage (const char *program)
 {
-  fprintf(stdout, "sdf2_usage: %s infile1 infile2 outfile [OPTIONS]\n", kbasename(program));
+  fprintf(stdout, "sdf2_usage: %s infile1 infile2 outfile [OPTIONS]\n", fileBasename(program));
   fprintf(stdout, "Generate an SDF2D file from two input SDF2D files\n");
   fprintf(stdout, "\n");
   fprintf(stdout, "     infile1    Name of first input SDF file\n");
@@ -131,7 +131,7 @@ sdf2_main (int argc, char *const argv[])
   ImageFile& im_in1 = *pim_in1;
   ImageFile& im_in2 = *pim_in2;
 
-  if (! im_in1.adf.fileRead() || ! im_in2.adf.fileRead()) {
+  if (! im_in1.fileRead() || ! im_in2.fileRead()) {
       sys_error (ERR_WARNING, "Error reading an image");
       return (1);
   }
@@ -148,7 +148,7 @@ sdf2_main (int argc, char *const argv[])
 
   pim_out = new ImageFile (out_file, im_in1.nx(), im_in1.ny());
   ImageFile& im_out = *pim_out;
-  if (! im_out.adf.fileCreate()) {
+  if (! im_out.fileCreate()) {
     sys_error (ERR_WARNING, "Could not open output file %s", out_file);
     return (1);
   }
@@ -202,12 +202,12 @@ sdf2_main (int argc, char *const argv[])
     fprintf(stdout, "Average Error = %f\n", abs_error);
   }
 
-  im_out.adf.arrayDataWrite();
-  im_out.adf.labelsCopy (im_in1.adf, "if-2 file 1: ");
-  im_out.adf.labelsCopy (im_in2.adf, "if-2 file 2: ");
-  im_out.adf.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str());
+  im_out.arrayDataWrite();
+  im_out.labelsCopy (im_in1, "if-2 file 1: ");
+  im_out.labelsCopy (im_in2, "if-2 file 2: ");
+  im_out.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str());
 
-  im_out.adf.fileClose();
+  im_out.fileClose();
 
   return (0);
 }