r140: *** empty log message ***
[ctsim.git] / src / if2img.cpp
index 1aa8a39d49bf44c04520cbabcec0cbff1332bbf8..6945de8bd8b740ecde72441c0ef6ed20a286a5cd 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: if2img.cpp,v 1.9 2000/06/26 21:15:24 kevin Exp $
+**  $Id: if2img.cpp,v 1.11 2000/07/09 08:16:18 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
 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ******************************************************************************/
 
-/* FILE
- *   if2img.c          Convert an SDF file to a viewable format image
- */
-
 #include "ct.h"
 
+
 #if HAVE_PNG
 void sdf2d_to_png (ImageFile& im, char *outfile, int bitdepth, int nxcell, int nycell, double densmin, double densmax);
 #endif
@@ -61,24 +58,24 @@ static struct option my_options[] =
 };
 
 enum { O_AUTO_FULL, O_AUTO_STD0_1, O_AUTO_STD0_5, O_AUTO_STD1, O_AUTO_STD2, O_AUTO_STD3 };
-#define O_AUTO_FULL_STR  "full"
-#define O_AUTO_STD0_1_STR  "std0.1"
-#define O_AUTO_STD0_5_STR  "std0.5"
-#define O_AUTO_STD1_STR  "std1"
-#define O_AUTO_STD2_STR  "std2"
-#define O_AUTO_STD3_STR  "std3"
+static const char O_AUTO_FULL_STR[]="full";
+static const char O_AUTO_STD0_1_STR[]="std0.1";
+static const char O_AUTO_STD0_5_STR[]="std0.5";
+static const char O_AUTO_STD1_STR[]="std1";
+static const char O_AUTO_STD2_STR[]="std2";
+static const char O_AUTO_STD3_STR[]="std3";
 
 enum { O_CENTER_MEAN, O_CENTER_MODE };
-#define O_CENTER_MEAN_STR  "mean"
-#define O_CENTER_MODE_STR  "mode"
+static const char O_CENTER_MEAN_STR[]="mean";
+static const char O_CENTER_MODE_STR[]="mode";
 
 enum { O_FORMAT_GIF, O_FORMAT_PNG, O_FORMAT_PNG16, O_FORMAT_PGM, O_FORMAT_PGMASC, O_FORMAT_DISP };
-#define O_FORMAT_GIF_STR   "gif"
-#define O_FORMAT_PNG_STR   "png" 
-#define O_FORMAT_PNG16_STR   "png16" 
-#define O_FORMAT_PGM_STR   "pgm"
-#define O_FORMAT_PGMASC_STR "pgmasc"
-#define O_FORMAT_DISP_STR    "disp"
+static const char O_FORMAT_GIF_STR[]="gif";
+static const char O_FORMAT_PNG_STR[]="png" ;
+static const char O_FORMAT_PNG16_STR[]="png16" ;
+static const char O_FORMAT_PGM_STR[]="pgm";
+static const char O_FORMAT_PGMASC_STR[]="pgmasc";
+static const char O_FORMAT_DISP_STR[]="disp";
 
 void 
 if2img_usage (const char *program)
@@ -414,9 +411,9 @@ if2img_main (int argc, char *const argv[])
 #endif
   else if (opt_format == O_FORMAT_DISP) {
 #if HAVE_SGP
-    // image_display_scale (im, opt_scale, densmin, densmax);
-    //  cio_kb_getc();
-      sgp2_close(sgp2_get_active_win());
+    im.displayScaling (opt_scale, densmin, densmax);
+    cio_kb_getc();
+    sgp2_close(sgp2_get_active_win());
 #endif
   }
   else
@@ -573,7 +570,7 @@ sdf2d_to_png (ImageFile& im, char *outfile, int bitdepth, int nxcell, int nycell
 
 #ifdef HAVE_GD
 #include "gd.h"
-#define N_GRAYSCALE 256
+static const int N_GRAYSCALE=256;
 #endif
 
 void