r339: ''
[ctsim.git] / libctsim / imagefile.cpp
index c21c17f6858facaa7114cd9a92e90b9667dbc35b..cc7e23489af837a9b99ef30f9f42369abce3b090 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: imagefile.cpp,v 1.31 2001/01/02 08:15:02 kevin Exp $
+**  $Id: imagefile.cpp,v 1.32 2001/01/02 10:23:46 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
@@ -89,7 +89,6 @@ ImageFile::filterResponse (const char* const domainName, double bw, const char*
   ImageFileArray v = getArray();\r
   SignalFilter filter (filterName, domainName, bw, filt_param);\r
   \r
-#if 1\r
   int iXCenter, iYCenter;\r
   if (isEven (m_nx))\r
     iXCenter = m_nx / 2;\r
@@ -106,18 +105,6 @@ ImageFile::filterResponse (const char* const domainName, double bw, const char*
       double r = ::sqrt (static_cast<double>(lD2)) * dInputScale;\r
       v[ix][iy] = filter.response (r) * dOutputScale;\r
     }\r
-#else
-    int hx = (m_nx - 1) / 2;
-    int hy = (m_ny - 1) / 2;
-    
-    for (int i = -hx; i <= hx; i++) {
-      for (int j = -hy; j <= hy; j++) {
-        double r = ::sqrt (i * i + j * j);
-        
-        v[i+hx][j+hy] = filter.response (r);
-      }
-    }\r
-#endif
 }
 
 int
@@ -1255,8 +1242,8 @@ ImageFile::writeImagePNG (const char* const outfile, int bitdepth, int nxcell, i
           rowp[p] = outval;
         else {
           int rowpos = p * 2;
-          rowp[rowpos] = (outval >> 8) & 0xFF;
-          rowp[rowpos+1] = (outval & 0xFF);
+          rowp[rowpos+1] = (outval >> 8) & 0xFF;
+          rowp[rowpos] = (outval & 0xFF);
         }
       }
     }