|
|
|
@ -21,7 +21,7 @@ float global_fvalue;
@@ -21,7 +21,7 @@ float global_fvalue;
|
|
|
|
|
/* --------------------------------------------------------------------- */ |
|
|
|
|
enum nCmd { Equalize=1, Rotate, Sfx0, F3x3, MIRE, Wfits, Wpng, Wtiff, |
|
|
|
|
Histo, Hsv, Classif, Ctr2x2, Qsortrgb, |
|
|
|
|
Displace, ReadPNG }; |
|
|
|
|
Displace, ReadPNG, Plasmas }; |
|
|
|
|
typedef struct { |
|
|
|
|
char *name; |
|
|
|
|
int Cmd; |
|
|
|
@ -43,6 +43,7 @@ Command commands[] = {
@@ -43,6 +43,7 @@ Command commands[] = {
|
|
|
|
|
{ "qsortrgb", Qsortrgb }, |
|
|
|
|
{ "displace", Displace }, |
|
|
|
|
{ "readpng", ReadPNG }, |
|
|
|
|
{ "plasma", Plasmas }, |
|
|
|
|
{ NULL, 0 } |
|
|
|
|
} ; |
|
|
|
|
|
|
|
|
@ -64,7 +65,7 @@ void help(int k)
@@ -64,7 +65,7 @@ void help(int k)
|
|
|
|
|
{ |
|
|
|
|
Command *pcmd; |
|
|
|
|
|
|
|
|
|
fprintf(stderr, "usage:\n\t./t [options] command filename\n"); |
|
|
|
|
fprintf(stderr, "usage:\n\t./t [options] command [filename]\n"); |
|
|
|
|
|
|
|
|
|
fprintf(stderr, "options:\n"); |
|
|
|
|
fprintf(stderr, "\t-o outfile\n"); |
|
|
|
@ -89,8 +90,9 @@ fprintf(stderr, "++++++++ test des fonctions pid=%d\n", getpid());
@@ -89,8 +90,9 @@ fprintf(stderr, "++++++++ test des fonctions pid=%d\n", getpid());
|
|
|
|
|
fprintf(stderr, "++++++++ compiled "__DATE__" at " __TIME__ "\n"); |
|
|
|
|
|
|
|
|
|
global_fvalue = 1.0; |
|
|
|
|
outfile = "out.pnm"; |
|
|
|
|
outfile = "out.pnm"; |
|
|
|
|
command = "none"; |
|
|
|
|
filename = "in.fimg"; |
|
|
|
|
|
|
|
|
|
while ((opt = getopt(argc, argv, "hk:o:p:v")) != -1) { |
|
|
|
|
switch(opt) { |
|
|
|
@ -103,17 +105,22 @@ while ((opt = getopt(argc, argv, "hk:o:p:v")) != -1) {
@@ -103,17 +105,22 @@ while ((opt = getopt(argc, argv, "hk:o:p:v")) != -1) {
|
|
|
|
|
|
|
|
|
|
// fprintf(stderr, "argc %d optind %d\n", argc, optind);
|
|
|
|
|
|
|
|
|
|
filename = NULL; |
|
|
|
|
if (2 != argc-optind) { |
|
|
|
|
fprintf(stderr, "%s: bad command line\n", argv[0]); |
|
|
|
|
help(1); |
|
|
|
|
switch (argc-optind) { |
|
|
|
|
case 1: /* only command */ |
|
|
|
|
command = argv[optind]; |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
command = argv[optind]; |
|
|
|
|
filename = argv[optind+1]; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
fprintf(stderr, "%s: bad command line ?\n", argv[0]); |
|
|
|
|
help(1); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
command = argv[optind]; |
|
|
|
|
filename = argv[optind+1]; |
|
|
|
|
|
|
|
|
|
if (verbosity) { |
|
|
|
|
fprintf(stderr, "%s : running command '%s' on '%s'\n", |
|
|
|
|
fprintf(stderr, "++++++++ %s : running command '%s' on '%s'\n", |
|
|
|
|
argv[0], command, filename); |
|
|
|
|
fprintf(stderr, "global fvalue : %f\n", global_fvalue); |
|
|
|
|
} |
|
|
|
@ -163,6 +170,10 @@ switch(opt) {
@@ -163,6 +170,10 @@ switch(opt) {
|
|
|
|
|
case ReadPNG: |
|
|
|
|
foo = essai_lecture_png(filename, outfile, 0); |
|
|
|
|
break; |
|
|
|
|
case Plasmas: |
|
|
|
|
foo = essai_plasma(filename, outfile, 1, 13.37); |
|
|
|
|
fprintf(stderr, "we are all plasmafields\n"); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
fprintf(stderr, "%s : bad command\n", command); |
|
|
|
|
exit(1); |
|
|
|
|