projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed another leftover from libgtk1.2-dev
[ctsim.git]
/
tools
/
if1.cpp
diff --git
a/tools/if1.cpp
b/tools/if1.cpp
index cac6df3f1cf40821dbd1aa058eaa895544bf9db0..413fb0f344276242a29a17a1b70f09664182ee38 100644
(file)
--- a/
tools/if1.cpp
+++ b/
tools/if1.cpp
@@
-9,7
+9,7
@@
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id
: if1.cpp,v 1.4 2000/12/29 19:30:08 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
**
** 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
@@
-46,9
+46,9
@@
static struct option my_options[] =
{0, 0, 0, 0}
};
{0, 0, 0, 0}
};
-static const char* g_szIdStr = "$Id
: if1.cpp,v 1.4 2000/12/29 19:30:08 kevin Exp
$";
+static const char* g_szIdStr = "$Id$";
-void
+void
if1_usage (const char *program)
{
std::cout << "usage: " << fileBasename(program) << " infile outfile [OPTIONS]" << std::endl;
if1_usage (const char *program)
{
std::cout << "usage: " << fileBasename(program) << " infile outfile [OPTIONS]" << std::endl;
@@
-64,7
+64,7
@@
if1_usage (const char *program)
std::cout << " --help Print this help message" << std::endl;
}
std::cout << " --help Print this help message" << std::endl;
}
-int
+int
if1_main (int argc, char *const argv[])
{
char *in_file;
if1_main (int argc, char *const argv[])
{
char *in_file;
@@
-79,45
+79,45
@@
if1_main (int argc, char *const argv[])
while (1)
{
int c = getopt_long (argc, argv, "", my_options, NULL);
while (1)
{
int c = getopt_long (argc, argv, "", my_options, NULL);
-
+
if (c == -1)
if (c == -1)
- break;
-
+
break;
+
switch (c)
switch (c)
- {
- case O_INVERT:
- opt_invert = 1;
- break;
- case O_LOG:
- opt_log = 1;
- break;
- case O_SQR:
- opt_sqr = 1;
- break;
- case O_SQRT:
- opt_sqrt = 1;
- break;
- case O_EXP:
- opt_exp = 1;
- break;
- case O_VERBOSE:
- opt_verbose = 1;
- break;
+
{
+
case O_INVERT:
+
opt_invert = 1;
+
break;
+
case O_LOG:
+
opt_log = 1;
+
break;
+
case O_SQR:
+
opt_sqr = 1;
+
break;
+
case O_SQRT:
+
opt_sqrt = 1;
+
break;
+
case O_EXP:
+
opt_exp = 1;
+
break;
+
case O_VERBOSE:
+
opt_verbose = 1;
+
break;
case O_VERSION:
#ifdef VERSION
case O_VERSION:
#ifdef VERSION
- std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl;
+
std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl;
#else
std::cout << "Unknown version number" << std::endl;
#endif
#else
std::cout << "Unknown version number" << std::endl;
#endif
- return (0);
- case O_HELP:
- case '?':
- if1_usage(argv[0]);
- return (0);
- default:
- if1_usage(argv[0]);
- return (1);
- }
+
return (0);
+
case O_HELP:
+
case '?':
+
if1_usage(argv[0]);
+
return (0);
+
default:
+
if1_usage(argv[0]);
+
return (1);
+
}
}
if (optind + 2 != argc)
}
if (optind + 2 != argc)
@@
-125,7
+125,7
@@
if1_main (int argc, char *const argv[])
if1_usage(argv[0]);
return (1);
}
if1_usage(argv[0]);
return (1);
}
-
+
in_file = argv[optind];
out_file = argv[optind + 1];
in_file = argv[optind];
out_file = argv[optind + 1];
@@
-138,23
+138,23
@@
if1_main (int argc, char *const argv[])
int ny = im_in.ny();
ImageFile im_out (nx, ny);
int ny = im_in.ny();
ImageFile im_out (nx, ny);
- if (opt_invert) {
\r
+ if (opt_invert) {
im_in.invertPixelValues (im_out);
histString = "Invert transformation";
}
im_in.invertPixelValues (im_out);
histString = "Invert transformation";
}
- if (opt_log) {
\r
+ if (opt_log) {
im_in.log (im_out);
histString = "Logrithmic transformation";
}
im_in.log (im_out);
histString = "Logrithmic transformation";
}
- if (opt_exp) {
\r
+ if (opt_exp) {
im_in.exp (im_out);
histString = "Exponential transformation";
}
im_in.exp (im_out);
histString = "Exponential transformation";
}
- if (opt_sqr) {
\r
+ if (opt_sqr) {
im_in.square (im_out);
histString = "Square transformation";
}
im_in.square (im_out);
histString = "Square transformation";
}
- if (opt_sqrt) {
\r
+ if (opt_sqrt) {
im_in.sqrt (im_out);
histString = "Square root transformation";
}
im_in.sqrt (im_out);
histString = "Square root transformation";
}
@@
-168,7
+168,7
@@
if1_main (int argc, char *const argv[])
}
#ifndef NO_MAIN
}
#ifndef NO_MAIN
-int
+int
main (int argc, char *const argv[])
{
int retval = 1;
main (int argc, char *const argv[])
{
int retval = 1;