r1018: *** empty log message ***
[ctsim.git] / tools / ifexport.cpp
index 87603323b143673c0fd248bd3fc38120e01cc5dd..d629422a387085a1aae8d72e1151fda3e46d9379 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ifexport.cpp,v 1.3 2001/01/09 22:31:47 kevin Exp $
+**  $Id: ifexport.cpp,v 1.4 2001/09/24 09:40:42 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[] =
   {0, 0, 0, 0}
 };
 
-static const char* g_szIdStr = "$Id: ifexport.cpp,v 1.3 2001/01/09 22:31:47 kevin Exp $";
+static const char* g_szIdStr = "$Id: ifexport.cpp,v 1.4 2001/09/24 09:40:42 kevin Exp $";
 
 enum { O_AUTO_FULL, O_AUTO_STD0_1, O_AUTO_STD0_5, O_AUTO_STD1, O_AUTO_STD2, O_AUTO_STD3 };
 static const char O_AUTO_FULL_STR[]="full";
@@ -63,11 +63,12 @@ static const char O_CENTER_MEAN_STR[]="mean";
 static const char O_CENTER_MODE_STR[]="mode";
 static const char O_CENTER_MEDIAN_STR[]="median";
 
-enum { O_FORMAT_PNG, O_FORMAT_PNG16, O_FORMAT_PGM, O_FORMAT_PGMASC };
+enum { O_FORMAT_PNG, O_FORMAT_PNG16, O_FORMAT_PGM, O_FORMAT_PGMASC, O_FORMAT_RAW };
 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_RAW_STR[]="raw";
 
 void 
 ifexport_usage (const char *program)
@@ -212,6 +213,8 @@ ifexport_main (int argc, char *const argv[])
          else if (strcmp(optarg, O_FORMAT_PNG16_STR) == 0)
            opt_format = O_FORMAT_PNG16;
 #endif
+         else if (strcmp(optarg, O_FORMAT_RAW_STR) == 0)
+               opt_format = O_FORMAT_RAW;
 #if HAVE_GIF
          else if (strcmp(optarg, O_FORMAT_GIF_STR) == 0)
            opt_format = O_FORMAT_GIF;
@@ -347,6 +350,8 @@ ifexport_main (int argc, char *const argv[])
   else if (opt_format == O_FORMAT_GIF) 
     im.writeImageGIF (out_file, opt_scale, opt_scale, densmin, densmax);
 #endif
+  else if (opt_format == O_FORMAT_RAW)
+       im.writeImageRaw (out_file, opt_scale, opt_scale);
   else
     {
       sys_error (ERR_SEVERE, "Internal Error: Invalid format mode %d", opt_format);