20 |
|
|
21 |
|
#define GAMMA 2.0 /* gamma correction factor */ |
22 |
|
|
23 |
+ |
FILE *popen(); |
24 |
+ |
|
25 |
+ |
char *pcom = NULL; /* pipe command */ |
26 |
+ |
|
27 |
|
BYTE gammamap[256]; /* gamma correction table */ |
28 |
|
|
29 |
|
|
39 |
|
for (progname = *argv++; --argc; argv++) |
40 |
|
if (!strcmp(*argv, "-p") && argv[1]) { |
41 |
|
port = atoi(*++argv); argc--; |
42 |
+ |
} else if (!strcmp(*argv, "-u") && argv[1]) { |
43 |
+ |
pcom = *++argv; argc--; |
44 |
|
} else |
45 |
|
break; |
46 |
|
if (!argc) { |
47 |
|
fputs("Usage: ", stderr); |
48 |
|
fputs(progname, stderr); |
49 |
< |
fputs(" [-p port] hostname [-c copies][-r record] [frame] ..\n", |
49 |
> |
fputs(" [-p port] [-u uncompress] hostname [-c copies][-r record] [frame] ..\n", |
50 |
|
stderr); |
51 |
|
exit(1); |
52 |
|
} |
77 |
|
sendframe(file) /* convert and send a frame */ |
78 |
|
char *file; |
79 |
|
{ |
80 |
+ |
char command[128]; |
81 |
|
COLR scanin[SCANLINE]; |
82 |
|
int xres, yres; |
83 |
|
int xbeg, ybeg; |
86 |
|
register int x; |
87 |
|
/* open file */ |
88 |
|
if (file == NULL) { |
89 |
< |
fp = stdin; |
89 |
> |
if (pcom != NULL) |
90 |
> |
fp = popen(pcom, "r"); |
91 |
> |
else |
92 |
> |
fp = stdin; |
93 |
|
file = "<stdin>"; |
94 |
< |
} else if ((fp = fopen(file, "r")) == NULL) { |
94 |
> |
} else { |
95 |
> |
if (pcom != NULL) { |
96 |
> |
sprintf(command, "( %s ) < %s", pcom, file); |
97 |
> |
fp = popen(command, "r"); |
98 |
> |
} else |
99 |
> |
fp = fopen(file, "r"); |
100 |
> |
} |
101 |
> |
if (fp == NULL) { |
102 |
|
perror(file); |
103 |
|
exit(1); |
104 |
|
} |
132 |
|
/* send frame */ |
133 |
|
scry_send_frame(); |
134 |
|
/* close file */ |
135 |
< |
fclose(fp); |
135 |
> |
if (pcom != NULL) |
136 |
> |
pclose(fp); |
137 |
> |
else |
138 |
> |
fclose(fp); |
139 |
|
} |
140 |
|
|
141 |
|
|