** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ifexport.cpp,v 1.2 2000/12/17 23:00:33 kevin Exp $
+** $Id$
**
** 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
{0, 0, 0, 0}
};
-static const char* g_szIdStr = "$Id: ifexport.cpp,v 1.2 2000/12/17 23:00:33 kevin Exp $";
+static const char* g_szIdStr = "$Id$";
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";
static const char O_CENTER_MODE_STR[]="mode";
static const char O_CENTER_MEDIAN_STR[]="median";
-enum { O_FORMAT_GIF, O_FORMAT_PNG, O_FORMAT_PNG16, O_FORMAT_PGM, O_FORMAT_PGMASC, O_FORMAT_DISP };
-static const char O_FORMAT_GIF_STR[]="gif";
+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_DISP_STR[]="disp";
+static const char O_FORMAT_RAW_STR[]="raw";
void
ifexport_usage (const char *program)
std::cout << " png PNG (8-bit) format\n";
std::cout << " png16 PNG (16-bit) format\n";
#endif
-#if HAVE_G2
- std::cout << " gif GIF format\n";
-#endif
- std::cout << " disp Display on screen\n";
std::cout << " --center Center of window\n";
std::cout << " median Median is center of window (default)\n";
std::cout << " mode Mode is center of window\n";
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;
#endif
- else if (strcmp(optarg, O_FORMAT_DISP_STR) == 0)
- opt_format = O_FORMAT_DISP;
- else {
+ else {
sys_error (ERR_SEVERE, "Invalid format mode %s", optarg);
ifexport_usage(argv[0]);
return (1);
}
}
-#if HAVE_SGP
- if (optind + 1 == argc)
- opt_format = O_FORMAT_DISP; // display image if no options
-#endif
-
- if ((opt_format == O_FORMAT_DISP && optind + 1 != argc)
- || (opt_format != O_FORMAT_DISP && optind + 2 != argc)) {
+ if (optind + 2 != argc) {
ifexport_usage(argv[0]);
return (1);
}
in_file = argv[optind];
-
- if (opt_format != O_FORMAT_DISP)
- out_file = argv[optind+1];
- else out_file = NULL;
+ out_file = argv[optind+1];
pim = new ImageFile ();
ImageFile& im = *pim;
else if (opt_format == O_FORMAT_GIF)
im.writeImageGIF (out_file, opt_scale, opt_scale, densmin, densmax);
#endif
- else if (opt_format == O_FORMAT_DISP) {
-#if HAVE_SGP
- im.displayScaling (opt_scale, densmin, densmax);
- std::cout << "Press enter to continue\n";
- cio_kb_getc();
-#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);