X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=libctsim%2Fimagefile.cpp;h=96577555ac68a27ea21503f3c6c6eeda23a48059;hb=01ee1e0085970643368d65c38b09008927e24cd5;hp=667156b24cd224de9e45d052aca0b608a0fc6ab2;hpb=113c9b335a1423ff29e945f804c56b5ecee5425f;p=ctsim.git diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index 667156b..9657755 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.12 2000/09/07 05:01:28 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 @@ -28,6 +28,29 @@ #include "ct.h" +F32Image::F32Image (int nx, int ny) + : Array2dFile::Array2dFile (nx, ny, sizeof(kfloat32), Array2dFile::PIXEL_FLOAT32) + { + } + +F32Image::F32Image (void)[ + : Array2dFile::Array2dFile() + { + setPixelFormat (Array2dFile::PIXEL_FLOAT32); + setPixelSize (sizeof(kfloat32)); + } + +F64Image::F64Image (int nx, int ny) + : Array2dFile::Array2dFile (nx, ny, sizeof(kfloat64), Array2dFile::PIXEL_FLOAT64) + { + } + +F64Image::F64Image (void) + : Array2dFile::Array2dFile () + { + setPixelFormat (PIXEL_FLOAT64); + setPixelSize (sizeof(kfloat64)); + } void ImageFile::filterResponse (const char* const domainName, double bw, const char* const filterName, double filt_param) @@ -318,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 ); } } @@ -334,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;