X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tools%2Fifexport.cpp;h=19d85206b0f9cb464d13f4a89b2a0bf1587ca1a0;hb=HEAD;hp=17656be3764750b98b68fb8d00575178b36fe8d2;hpb=1a050c98763fbbc0662731b0b76953acede6f5d7;p=ctsim.git diff --git a/tools/ifexport.cpp b/tools/ifexport.cpp index 17656be..19d8520 100644 --- a/tools/ifexport.cpp +++ b/tools/ifexport.cpp @@ -7,9 +7,7 @@ ** Date Started: April 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg -** -** $Id$ +** Copyright (C) 1983-2010 Kevin Rosenberg ** ** 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 @@ -63,11 +61,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, O_FORMAT_RAW }; +enum { O_FORMAT_PNG, O_FORMAT_PNG16, O_FORMAT_PGM, O_FORMAT_PGMASC, O_FORMAT_RAW, O_FORMAT_TEXT }; 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_TEXT_STR[]="text"; static const char O_FORMAT_RAW_STR[]="raw"; void @@ -81,6 +80,8 @@ ifexport_usage (const char *program) std::cout << " --format Output format\n"; std::cout << " pgm PGM (portable graymap) format (default)\n"; std::cout << " pgmasc PGM (portable graymap) ASCII format\n"; + std::cout << " text Text format\n"; + std::cout << " raw Raw format\n"; #ifdef HAVE_PNG std::cout << " png PNG (8-bit) format\n"; std::cout << " png16 PNG (16-bit) format\n"; @@ -124,7 +125,9 @@ ifexport_main (int argc, char *const argv[]) int opt_center = O_CENTER_MEDIAN; int opt_format = O_FORMAT_PGM; int opt_labels = 0; - + UNUSED(opt_verbose); + UNUSED(opt_debug); + while (1) { int c = getopt_long (argc, argv, "", my_options, NULL); @@ -213,6 +216,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_TEXT_STR) == 0) + opt_format = O_FORMAT_TEXT; else if (strcmp(optarg, O_FORMAT_RAW_STR) == 0) opt_format = O_FORMAT_RAW; #if HAVE_GIF @@ -350,6 +355,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_TEXT) + im.writeImageText (out_file); else if (opt_format == O_FORMAT_RAW) im.writeImageRaw (out_file, opt_scale, opt_scale); else