r244: *** empty log message ***
[ctsim.git] / libctsim / imagefile.cpp
index 9df4285a8a35904ee88939647bb6a5428f81a51b..96577555ac68a27ea21503f3c6c6eeda23a48059 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: imagefile.cpp,v 1.11 2000/08/25 15:59:13 kevin Exp $
+**  $Id: imagefile.cpp,v 1.16 2000/12/04 05:36:57 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
 #include "ct.h"
 
 
+F32Image::F32Image (int nx, int ny)\r
+      : Array2dFile::Array2dFile (nx, ny, sizeof(kfloat32), Array2dFile::PIXEL_FLOAT32)\r
+  {\r
+  }\r
+\r
+F32Image::F32Image (void)[\r
+      : Array2dFile::Array2dFile()\r
+  {\r
+      setPixelFormat (Array2dFile::PIXEL_FLOAT32);\r
+      setPixelSize (sizeof(kfloat32));\r
+  }\r
+\r
+F64Image::F64Image (int nx, int ny)\r
+      : Array2dFile::Array2dFile (nx, ny, sizeof(kfloat64), Array2dFile::PIXEL_FLOAT64)\r
+  {\r
+  }\r
+\r
+F64Image::F64Image (void)\r
+      : Array2dFile::Array2dFile ()\r
+  {\r
+      setPixelFormat (PIXEL_FLOAT64);\r
+      setPixelSize (sizeof(kfloat64));\r
+  }\r
 
 void 
 ImageFile::filterResponse (const char* const domainName, double bw, const char* const filterName, double filt_param)
@@ -94,7 +117,8 @@ ImageFile::displayScaling (const int scale, const ImageFileValue pmin, const Ima
 
     delete pPens;
     return (id_X11);
-
+#else
+    return 0;
 #endif
 }
 
@@ -317,7 +341,7 @@ ImageFile::writeImagePGM (const char *outfile, int nxcell, int nycell, double de
     }
     for (int ir = 0; ir < nycell; ir++) {
       for (int ic = 0; ic < nx * nxcell; ic++) 
-       fprintf(fp, "%c ", rowp[ic]);
+       fputc( rowp[ic], fp );
     }
   }
 
@@ -333,8 +357,6 @@ ImageFile::writeImagePGMASCII (const char *outfile, int nxcell, int nycell, doub
   ImageFileArray v = getArray();
 
   unsigned char rowp [nx * nxcell];
-  if (rowp == NULL)
-    return;
 
   if ((fp = fopen (outfile, "wb")) == NULL)
      return;