22 |
|
#define WINSIZ 9 /* scanline window size */ |
23 |
|
#define MIDSCN 4 /* current scan position */ |
24 |
|
|
25 |
– |
#define BRT (-1) /* special index for brightness */ |
26 |
– |
|
25 |
|
struct { |
26 |
|
char *name; /* file or command name */ |
27 |
|
FILE *fp; /* stream pointer */ |
32 |
|
|
33 |
|
int nfiles; /* number of input files */ |
34 |
|
|
35 |
< |
char *vcolin[3] = {"ri", "gi", "bi"}; |
36 |
< |
char *vcolout[3] = {"ro", "go", "bo"}; |
35 |
> |
char vcolin[3][4] = {"ri", "gi", "bi"}; |
36 |
> |
char vcolout[3][4] = {"ro", "go", "bo"}; |
37 |
|
char vbrtin[] = "li"; |
38 |
|
char vbrtout[] = "lo"; |
39 |
< |
char *vcolexp[3] = {"re", "ge", "be"}; |
39 |
> |
char vcolexp[3][4] = {"re", "ge", "be"}; |
40 |
|
char vbrtexp[] = "le"; |
41 |
|
|
42 |
|
char vnfiles[] = "nfiles"; |
66 |
|
int argc; |
67 |
|
char *argv[]; |
68 |
|
{ |
71 |
– |
char buf[128]; |
69 |
|
int original; |
70 |
|
double f; |
71 |
|
int a, i; |
108 |
|
break; |
109 |
|
case 'o': |
110 |
|
original++; |
111 |
< |
break; |
111 |
> |
continue; |
112 |
|
case 's': |
113 |
|
f = atof(argv[++a]); |
114 |
|
scalecolor(input[nfiles].coef, f); |
149 |
|
if (argv[a][0] == '-') |
150 |
|
switch (argv[a][1]) { |
151 |
|
case 'x': |
152 |
< |
strcpy(buf, vxres); |
156 |
< |
strcat(buf, ":"); |
157 |
< |
strcat(buf, argv[++a]); |
158 |
< |
scompile(buf, NULL, 0); |
152 |
> |
varset(vxres, ':', eval(argv[++a])); |
153 |
|
continue; |
154 |
|
case 'y': |
155 |
< |
strcpy(buf, vyres); |
162 |
< |
strcat(buf, ":"); |
163 |
< |
strcat(buf, argv[++a]); |
164 |
< |
scompile(buf, NULL, 0); |
155 |
> |
varset(vyres, ':', eval(argv[++a])); |
156 |
|
continue; |
157 |
|
case 'w': |
158 |
|
continue; |
189 |
|
eputs("Usage: "); |
190 |
|
eputs(argv[0]); |
191 |
|
eputs( |
192 |
< |
" [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); |
192 |
> |
" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); |
193 |
|
quit(1); |
194 |
|
} |
195 |
|
|