1 |
< |
/* Copyright (c) 1993 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1994 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
11 |
|
#include "standard.h" |
12 |
|
#include "paths.h" |
13 |
|
#include <ctype.h> |
14 |
+ |
#include <sys/types.h> |
15 |
|
|
16 |
|
|
17 |
|
typedef struct { |
22 |
|
int (*fixval)(); /* assignment checking function */ |
23 |
|
} VARIABLE; |
24 |
|
|
25 |
< |
int onevalue(), catvalues(); |
25 |
> |
int onevalue(), catvalues(), boolvalue(), |
26 |
> |
qualvalue(), fltvalue(), intvalue(); |
27 |
|
|
28 |
|
/* variables */ |
29 |
|
#define OBJECT 0 /* object files */ |
63 |
|
{"pfilt", 2, 0, NULL, catvalues}, |
64 |
|
{"view", 2, 0, NULL, NULL}, |
65 |
|
{"ZONE", 2, 0, NULL, onevalue}, |
66 |
< |
{"QUALITY", 3, 0, NULL, onevalue}, |
66 |
> |
{"QUALITY", 3, 0, NULL, qualvalue}, |
67 |
|
{"OCTREE", 3, 0, NULL, onevalue}, |
68 |
|
{"PICTURE", 3, 0, NULL, onevalue}, |
69 |
|
{"AMBFILE", 3, 0, NULL, onevalue}, |
70 |
|
{"OPTFILE", 3, 0, NULL, onevalue}, |
71 |
< |
{"EXPOSURE", 3, 0, NULL, onevalue}, |
71 |
> |
{"EXPOSURE", 3, 0, NULL, fltvalue}, |
72 |
|
{"RESOLUTION", 3, 0, NULL, onevalue}, |
73 |
|
{"UP", 2, 0, NULL, onevalue}, |
74 |
< |
{"INDIRECT", 3, 0, NULL, onevalue}, |
75 |
< |
{"DETAIL", 3, 0, NULL, onevalue}, |
76 |
< |
{"PENUMBRAS", 3, 0, NULL, onevalue}, |
77 |
< |
{"VARIABILITY", 3, 0, NULL, onevalue}, |
74 |
> |
{"INDIRECT", 3, 0, NULL, intvalue}, |
75 |
> |
{"DETAIL", 3, 0, NULL, qualvalue}, |
76 |
> |
{"PENUMBRAS", 3, 0, NULL, boolvalue}, |
77 |
> |
{"VARIABILITY", 3, 0, NULL, qualvalue}, |
78 |
|
{"REPORT", 3, 0, NULL, onevalue}, |
79 |
|
}; |
80 |
|
|
81 |
|
VARIABLE *matchvar(); |
82 |
|
char *nvalue(); |
81 |
– |
int vscale(); |
83 |
|
|
84 |
|
#define UPPER(c) ((c)&~0x20) /* ASCII trick */ |
85 |
|
|
88 |
|
#define vval(vc) (vv[vc].value) |
89 |
|
#define vint(vc) atoi(vval(vc)) |
90 |
|
#define vlet(vc) UPPER(vval(vc)[0]) |
91 |
+ |
#define vscale vlet |
92 |
|
#define vbool(vc) (vlet(vc)=='T') |
93 |
|
|
94 |
< |
#define HIGH 2 |
95 |
< |
#define MEDIUM 1 |
96 |
< |
#define LOW 0 |
94 |
> |
#define HIGH 'H' |
95 |
> |
#define MEDIUM 'M' |
96 |
> |
#define LOW 'L' |
97 |
|
|
96 |
– |
int lowqopts(), medqopts(), hiqopts(); |
97 |
– |
int (*setqopts[3])() = {lowqopts, medqopts, hiqopts}; |
98 |
– |
|
99 |
– |
#define renderopts (*setqopts[vscale(QUALITY)]) |
100 |
– |
|
98 |
|
/* overture calculation file */ |
99 |
|
#ifdef NIX |
100 |
|
char overfile[] = "overture.raw"; |
102 |
|
char overfile[] = "/dev/null"; |
103 |
|
#endif |
104 |
|
|
105 |
< |
extern unsigned long fdate(), time(); |
105 |
> |
extern time_t fdate(), time(); |
106 |
|
|
107 |
< |
unsigned long scenedate; /* date of latest scene or object file */ |
108 |
< |
unsigned long octreedate; /* date of octree */ |
109 |
< |
unsigned long matdate; /* date of latest material file */ |
110 |
< |
unsigned long illumdate; /* date of last illum file */ |
107 |
> |
time_t scenedate; /* date of latest scene or object file */ |
108 |
> |
time_t octreedate; /* date of octree */ |
109 |
> |
time_t matdate; /* date of latest material file */ |
110 |
> |
time_t illumdate; /* date of last illum file */ |
111 |
|
|
112 |
|
char *oct0name; /* name of pre-mkillum octree */ |
113 |
< |
unsigned long oct0date; /* date of pre-mkillum octree */ |
113 |
> |
time_t oct0date; /* date of pre-mkillum octree */ |
114 |
|
char *oct1name; /* name of post-mkillum octree */ |
115 |
< |
unsigned long oct1date; /* date of post-mkillum octree (>= matdate) */ |
115 |
> |
time_t oct1date; /* date of post-mkillum octree (>= matdate) */ |
116 |
|
|
117 |
+ |
int nowarn = 0; /* no warnings */ |
118 |
|
int explicate = 0; /* explicate variables */ |
119 |
|
int silent = 0; /* do work silently */ |
120 |
|
int noaction = 0; /* don't do anything */ |
135 |
|
char *argv[]; |
136 |
|
{ |
137 |
|
char ropts[512]; |
138 |
+ |
char popts[64]; |
139 |
|
int i; |
140 |
|
|
141 |
|
progname = argv[0]; |
160 |
|
case 'v': |
161 |
|
viewselect = argv[++i]; |
162 |
|
break; |
163 |
+ |
case 'w': |
164 |
+ |
nowarn++; |
165 |
+ |
break; |
166 |
|
default: |
167 |
|
goto userr; |
168 |
|
} |
190 |
|
/* check date on ambient file */ |
191 |
|
checkambfile(); |
192 |
|
/* run simulation */ |
193 |
< |
renderopts(ropts); |
193 |
> |
renderopts(ropts, popts); |
194 |
|
xferopts(ropts); |
195 |
|
if (rvdevice != NULL) |
196 |
< |
rview(ropts); |
196 |
> |
rview(ropts, popts); |
197 |
|
else |
198 |
< |
rpict(ropts); |
198 |
> |
rpict(ropts, popts); |
199 |
|
exit(0); |
200 |
|
userr: |
201 |
|
fprintf(stderr, |
258 |
|
register char *ass; |
259 |
|
{ |
260 |
|
char varname[32]; |
259 |
– |
char varval[512]; |
261 |
|
int n; |
262 |
|
register char *cp; |
263 |
|
register VARIABLE *vp; |
278 |
|
for (n = strlen(ass); n > 0; n--) |
279 |
|
if (!isspace(ass[n-1])) |
280 |
|
break; |
281 |
< |
if (!n) { |
281 |
> |
if (!n && !nowarn) { |
282 |
|
fprintf(stderr, "%s: warning - missing value for variable '%s'\n", |
283 |
|
progname, varname); |
284 |
|
return; |
349 |
|
} |
350 |
|
|
351 |
|
|
351 |
– |
int |
352 |
– |
vscale(vc) /* return scale for variable vc */ |
353 |
– |
int vc; |
354 |
– |
{ |
355 |
– |
switch(vlet(vc)) { |
356 |
– |
case 'H': |
357 |
– |
return(HIGH); |
358 |
– |
case 'M': |
359 |
– |
return(MEDIUM); |
360 |
– |
case 'L': |
361 |
– |
return(LOW); |
362 |
– |
} |
363 |
– |
badvalue(vc); |
364 |
– |
} |
365 |
– |
|
366 |
– |
|
352 |
|
checkvalues() /* check assignments */ |
353 |
|
{ |
354 |
|
register int i; |
364 |
|
{ |
365 |
|
if (vp->nass < 2) |
366 |
|
return; |
367 |
< |
fprintf(stderr, "%s: warning - multiple assignment of variable '%s'\n", |
367 |
> |
if (!nowarn) |
368 |
> |
fprintf(stderr, |
369 |
> |
"%s: warning - multiple assignment of variable '%s'\n", |
370 |
|
progname, vp->name); |
371 |
|
do |
372 |
|
vp->value += strlen(vp->value)+1; |
389 |
|
} |
390 |
|
|
391 |
|
|
392 |
< |
unsigned long |
392 |
> |
int |
393 |
> |
badmatch(tv, cv) /* case insensitive truncated comparison */ |
394 |
> |
register char *tv, *cv; |
395 |
> |
{ |
396 |
> |
if (!*tv) return(1); /* null string cannot match */ |
397 |
> |
do |
398 |
> |
if (UPPER(*tv) != *cv++) |
399 |
> |
return(1); |
400 |
> |
while (*++tv); |
401 |
> |
return(0); /* OK */ |
402 |
> |
} |
403 |
> |
|
404 |
> |
|
405 |
> |
boolvalue(vp) /* check boolean for legal values */ |
406 |
> |
register VARIABLE *vp; |
407 |
> |
{ |
408 |
> |
if (!vp->nass) return; |
409 |
> |
onevalue(vp); |
410 |
> |
switch (UPPER(vp->value[0])) { |
411 |
> |
case 'T': |
412 |
> |
if (badmatch(vp->value, "TRUE")) break; |
413 |
> |
return; |
414 |
> |
case 'F': |
415 |
> |
if (badmatch(vp->value, "FALSE")) break; |
416 |
> |
return; |
417 |
> |
} |
418 |
> |
fprintf(stderr, "%s: illegal value for boolean variable '%s'\n", |
419 |
> |
progname, vp->name); |
420 |
> |
exit(1); |
421 |
> |
} |
422 |
> |
|
423 |
> |
|
424 |
> |
qualvalue(vp) /* check qualitative var. for legal values */ |
425 |
> |
register VARIABLE *vp; |
426 |
> |
{ |
427 |
> |
if (!vp->nass) return; |
428 |
> |
onevalue(vp); |
429 |
> |
switch (UPPER(vp->value[0])) { |
430 |
> |
case 'L': |
431 |
> |
if (badmatch(vp->value, "LOW")) break; |
432 |
> |
return; |
433 |
> |
case 'M': |
434 |
> |
if (badmatch(vp->value, "MEDIUM")) break; |
435 |
> |
return; |
436 |
> |
case 'H': |
437 |
> |
if (badmatch(vp->value, "HIGH")) break; |
438 |
> |
return; |
439 |
> |
} |
440 |
> |
fprintf(stderr, "%s: illegal value for qualitative variable '%s'\n", |
441 |
> |
progname, vp->name); |
442 |
> |
exit(1); |
443 |
> |
} |
444 |
> |
|
445 |
> |
|
446 |
> |
intvalue(vp) /* check integer variable for legal values */ |
447 |
> |
register VARIABLE *vp; |
448 |
> |
{ |
449 |
> |
if (!vp->nass) return; |
450 |
> |
onevalue(vp); |
451 |
> |
if (isint(vp->value)) return; |
452 |
> |
fprintf(stderr, "%s: illegal value for integer variable '%s'\n", |
453 |
> |
progname, vp->name); |
454 |
> |
exit(1); |
455 |
> |
} |
456 |
> |
|
457 |
> |
|
458 |
> |
fltvalue(vp) /* check float variable for legal values */ |
459 |
> |
register VARIABLE *vp; |
460 |
> |
{ |
461 |
> |
if (!vp->nass) return; |
462 |
> |
onevalue(vp); |
463 |
> |
if (isflt(vp->value)) return; |
464 |
> |
fprintf(stderr, "%s: illegal value for real variable '%s'\n", |
465 |
> |
progname, vp->name); |
466 |
> |
exit(1); |
467 |
> |
} |
468 |
> |
|
469 |
> |
|
470 |
> |
time_t |
471 |
|
checklast(fnames) /* check files and find most recent */ |
472 |
|
register char *fnames; |
473 |
|
{ |
474 |
|
char thisfile[MAXPATH]; |
475 |
< |
unsigned long thisdate, lastdate = 0; |
475 |
> |
time_t thisdate, lastdate = 0; |
476 |
|
register char *cp; |
477 |
|
|
478 |
|
if (fnames == NULL) |
520 |
|
|
521 |
|
checkfiles() /* check for existence and modified times */ |
522 |
|
{ |
523 |
< |
unsigned long objdate; |
523 |
> |
time_t objdate; |
524 |
|
|
525 |
|
if (!vdef(OCTREE)) { |
526 |
|
if ((vval(OCTREE) = bmalloc(strlen(radname)+5)) == NULL) |
648 |
|
|
649 |
|
printvals() /* print variable values */ |
650 |
|
{ |
651 |
< |
register int i, j; |
651 |
> |
int i, j, clipline; |
652 |
> |
register char *cp; |
653 |
> |
register int k; |
654 |
|
|
655 |
< |
for (i = 0; i < NVARS; i++) |
656 |
< |
for (j = 0; j < vdef(i); j++) |
657 |
< |
printf("%s= %s\n", vnam(i), nvalue(vv+i, j)); |
655 |
> |
for (i = 0; i < NVARS; i++) /* print each variable */ |
656 |
> |
for (j = 0; j < vdef(i); j++) { /* print each assignment */ |
657 |
> |
fputs(vnam(i), stdout); |
658 |
> |
fputs("= ", stdout); |
659 |
> |
k = clipline = ( vv[i].fixval == catvalues ? 64 : 320 ) |
660 |
> |
- strlen(vnam(i)) ; |
661 |
> |
cp = nvalue(vv+i, j); |
662 |
> |
while (*cp) { |
663 |
> |
putchar(*cp++); |
664 |
> |
if (--k <= 0) { /* line too long */ |
665 |
> |
while (*cp && !isspace(*cp)) |
666 |
> |
putchar(*cp++); /* finish this word */ |
667 |
> |
if (*cp) { /* start new line */ |
668 |
> |
putchar('\n'); |
669 |
> |
fputs(vnam(i), stdout); |
670 |
> |
putchar('='); |
671 |
> |
k = clipline; |
672 |
> |
} |
673 |
> |
} |
674 |
> |
} |
675 |
> |
putchar('\n'); |
676 |
> |
} |
677 |
|
fflush(stdout); |
678 |
|
} |
679 |
|
|
700 |
|
unlink(vval(OCTREE)); |
701 |
|
exit(1); |
702 |
|
} |
703 |
< |
octreedate = time(0); |
703 |
> |
octreedate = time((time_t *)NULL); |
704 |
|
} |
705 |
|
if (oct1name == vval(OCTREE)) /* no mkillum? */ |
706 |
|
oct1date = octreedate > matdate ? octreedate : matdate; |
726 |
|
unlink(oct0name); |
727 |
|
exit(1); |
728 |
|
} |
729 |
< |
oct0date = time(0); |
729 |
> |
oct0date = time((time_t *)NULL); |
730 |
|
} |
731 |
|
mkillumopts(mkopts); /* build mkillum command */ |
732 |
|
mktemp(illumtmp); |
754 |
|
unlink(oct1name); |
755 |
|
exit(1); |
756 |
|
} |
757 |
< |
oct1date = time(0); |
757 |
> |
oct1date = time((time_t *)NULL); |
758 |
|
rmfile(illumtmp); |
759 |
|
} |
760 |
|
|
794 |
|
|
795 |
|
checkambfile() /* check date on ambient file */ |
796 |
|
{ |
797 |
< |
unsigned long afdate; |
797 |
> |
time_t afdate; |
798 |
|
|
799 |
|
if (!vdef(AMBFILE)) |
800 |
|
return; |
809 |
|
ambval() /* compute ambient value */ |
810 |
|
{ |
811 |
|
if (vdef(EXPOSURE)) { |
726 |
– |
if (!isflt(vval(EXPOSURE))) |
727 |
– |
badvalue(EXPOSURE); |
812 |
|
if (vval(EXPOSURE)[0] == '+' || vval(EXPOSURE)[0] == '-') |
813 |
|
return(.5/pow(2.,atof(vval(EXPOSURE)))); |
814 |
|
return(.5/atof(vval(EXPOSURE))); |
821 |
|
} |
822 |
|
|
823 |
|
|
824 |
< |
lowqopts(op) /* low quality rendering options */ |
824 |
> |
renderopts(op, po) /* set rendering options */ |
825 |
> |
char *op, *po; |
826 |
> |
{ |
827 |
> |
switch(vscale(QUALITY)) { |
828 |
> |
case LOW: |
829 |
> |
lowqopts(op, po); |
830 |
> |
break; |
831 |
> |
case MEDIUM: |
832 |
> |
medqopts(op, po); |
833 |
> |
break; |
834 |
> |
case HIGH: |
835 |
> |
hiqopts(op, po); |
836 |
> |
break; |
837 |
> |
} |
838 |
> |
} |
839 |
> |
|
840 |
> |
|
841 |
> |
lowqopts(op, po) /* low quality rendering options */ |
842 |
|
register char *op; |
843 |
+ |
char *po; |
844 |
|
{ |
845 |
|
double d, org[3], siz[3]; |
846 |
|
|
847 |
|
*op = '\0'; |
848 |
+ |
*po = '\0'; |
849 |
|
if (sscanf(vval(ZONE), "%*s %lf %lf %lf %lf %lf %lf", &org[0], |
850 |
|
&siz[0], &org[1], &siz[1], &org[2], &siz[2]) != 6) |
851 |
|
badvalue(ZONE); |
852 |
|
siz[0] -= org[0]; siz[1] -= org[1]; siz[2] -= org[2]; |
853 |
+ |
if (siz[0] <= FTINY | siz[1] <= FTINY | siz[2] <= FTINY) |
854 |
+ |
badvalue(ZONE); |
855 |
|
getoctcube(org, &d); |
856 |
|
d *= 3./(siz[0]+siz[1]+siz[2]); |
857 |
|
switch (vscale(DETAIL)) { |
858 |
|
case LOW: |
859 |
< |
op = addarg(op, "-ps 16 -dp 64"); |
859 |
> |
po = addarg(po, "-ps 16"); |
860 |
> |
op = addarg(op, "-dp 64"); |
861 |
|
sprintf(op, " -ar %d", (int)(4*d)); |
862 |
|
op += strlen(op); |
863 |
|
break; |
864 |
|
case MEDIUM: |
865 |
< |
op = addarg(op, "-ps 8 -dp 128"); |
865 |
> |
po = addarg(po, "-ps 8"); |
866 |
> |
op = addarg(op, "-dp 128"); |
867 |
|
sprintf(op, " -ar %d", (int)(8*d)); |
868 |
|
op += strlen(op); |
869 |
|
break; |
870 |
|
case HIGH: |
871 |
< |
op = addarg(op, "-ps 4 -dp 256"); |
871 |
> |
po = addarg(po, "-ps 4"); |
872 |
> |
op = addarg(op, "-dp 256"); |
873 |
|
sprintf(op, " -ar %d", (int)(16*d)); |
874 |
|
op += strlen(op); |
875 |
|
break; |
876 |
|
} |
877 |
< |
op = addarg(op, "-pt .16"); |
877 |
> |
po = addarg(po, "-pt .16"); |
878 |
|
if (vbool(PENUMBRAS)) |
879 |
|
op = addarg(op, "-ds .4"); |
880 |
|
else |
906 |
|
} |
907 |
|
|
908 |
|
|
909 |
< |
medqopts(op) /* medium quality rendering options */ |
909 |
> |
medqopts(op, po) /* medium quality rendering options */ |
910 |
|
register char *op; |
911 |
+ |
char *po; |
912 |
|
{ |
913 |
|
double d, org[3], siz[3]; |
914 |
|
|
915 |
|
*op = '\0'; |
916 |
+ |
*po = '\0'; |
917 |
|
if (sscanf(vval(ZONE), "%*s %lf %lf %lf %lf %lf %lf", &org[0], |
918 |
|
&siz[0], &org[1], &siz[1], &org[2], &siz[2]) != 6) |
919 |
|
badvalue(ZONE); |
920 |
|
siz[0] -= org[0]; siz[1] -= org[1]; siz[2] -= org[2]; |
921 |
+ |
if (siz[0] <= FTINY | siz[1] <= FTINY | siz[2] <= FTINY) |
922 |
+ |
badvalue(ZONE); |
923 |
|
getoctcube(org, &d); |
924 |
|
d *= 3./(siz[0]+siz[1]+siz[2]); |
925 |
|
switch (vscale(DETAIL)) { |
926 |
|
case LOW: |
927 |
< |
op = addarg(op, vbool(PENUMBRAS) ? "-ps 4" : "-ps 8"); |
927 |
> |
po = addarg(po, vbool(PENUMBRAS) ? "-ps 4" : "-ps 8"); |
928 |
|
op = addarg(op, "-dp 256"); |
929 |
|
sprintf(op, " -ar %d", (int)(8*d)); |
930 |
|
op += strlen(op); |
931 |
|
break; |
932 |
|
case MEDIUM: |
933 |
< |
op = addarg(op, vbool(PENUMBRAS) ? "-ps 3" : "-ps 6"); |
933 |
> |
po = addarg(po, vbool(PENUMBRAS) ? "-ps 3" : "-ps 6"); |
934 |
|
op = addarg(op, "-dp 512"); |
935 |
|
sprintf(op, " -ar %d", (int)(16*d)); |
936 |
|
op += strlen(op); |
937 |
|
break; |
938 |
|
case HIGH: |
939 |
< |
op = addarg(op, vbool(PENUMBRAS) ? "-ps 2" : "-ps 4"); |
939 |
> |
po = addarg(po, vbool(PENUMBRAS) ? "-ps 2" : "-ps 4"); |
940 |
|
op = addarg(op, "-dp 1024"); |
941 |
|
sprintf(op, " -ar %d", (int)(32*d)); |
942 |
|
op += strlen(op); |
943 |
|
break; |
944 |
|
} |
945 |
< |
op = addarg(op, "-pt .08"); |
945 |
> |
po = addarg(po, "-pt .08"); |
946 |
|
if (vbool(PENUMBRAS)) |
947 |
< |
op = addarg(op, "-ds .2 -dj .35"); |
947 |
> |
op = addarg(op, "-ds .2 -dj .5"); |
948 |
|
else |
949 |
|
op = addarg(op, "-ds .3"); |
950 |
|
op = addarg(op, "-dt .1 -dc .5 -dr 1 -sj .7 -st .1"); |
977 |
|
} |
978 |
|
|
979 |
|
|
980 |
< |
hiqopts(op) /* high quality rendering options */ |
980 |
> |
hiqopts(op, po) /* high quality rendering options */ |
981 |
|
register char *op; |
982 |
+ |
char *po; |
983 |
|
{ |
984 |
|
double d, org[3], siz[3]; |
985 |
|
|
986 |
|
*op = '\0'; |
987 |
+ |
*po = '\0'; |
988 |
|
if (sscanf(vval(ZONE), "%*s %lf %lf %lf %lf %lf %lf", &org[0], |
989 |
|
&siz[0], &org[1], &siz[1], &org[2], &siz[2]) != 6) |
990 |
|
badvalue(ZONE); |
991 |
|
siz[0] -= org[0]; siz[1] -= org[1]; siz[2] -= org[2]; |
992 |
+ |
if (siz[0] <= FTINY | siz[1] <= FTINY | siz[2] <= FTINY) |
993 |
+ |
badvalue(ZONE); |
994 |
|
getoctcube(org, &d); |
995 |
|
d *= 3./(siz[0]+siz[1]+siz[2]); |
996 |
|
switch (vscale(DETAIL)) { |
997 |
|
case LOW: |
998 |
< |
op = addarg(op, vbool(PENUMBRAS) ? "-ps 1" : "-ps 8"); |
998 |
> |
po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 8"); |
999 |
|
op = addarg(op, "-dp 1024"); |
1000 |
|
sprintf(op, " -ar %d", (int)(16*d)); |
1001 |
|
op += strlen(op); |
1002 |
|
break; |
1003 |
|
case MEDIUM: |
1004 |
< |
op = addarg(op, vbool(PENUMBRAS) ? "-ps 1" : "-ps 5"); |
1004 |
> |
po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 5"); |
1005 |
|
op = addarg(op, "-dp 2048"); |
1006 |
|
sprintf(op, " -ar %d", (int)(32*d)); |
1007 |
|
op += strlen(op); |
1008 |
|
break; |
1009 |
|
case HIGH: |
1010 |
< |
op = addarg(op, vbool(PENUMBRAS) ? "-ps 1" : "-ps 3"); |
1010 |
> |
po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 3"); |
1011 |
|
op = addarg(op, "-dp 4096"); |
1012 |
|
sprintf(op, " -ar %d", (int)(64*d)); |
1013 |
|
op += strlen(op); |
1014 |
|
break; |
1015 |
|
} |
1016 |
< |
op = addarg(op, "-pt .04"); |
1016 |
> |
po = addarg(po, "-pt .04"); |
1017 |
|
if (vbool(PENUMBRAS)) |
1018 |
|
op = addarg(op, "-ds .1 -dj .7"); |
1019 |
|
else |
1163 |
|
badvalue(ZONE); |
1164 |
|
for (i = 0; i < 3; i++) { |
1165 |
|
dim[i] -= cent[i]; |
1166 |
+ |
if (dim[i] <= FTINY) |
1167 |
+ |
badvalue(ZONE); |
1168 |
|
cent[i] += .5*dim[i]; |
1169 |
|
} |
1170 |
|
mult = vlet(ZONE)=='E' ? 2. : .45 ; |
1328 |
|
} |
1329 |
|
|
1330 |
|
|
1331 |
< |
rview(opts) /* run rview with first view */ |
1332 |
< |
char *opts; |
1331 |
> |
rview(opts, po) /* run rview with first view */ |
1332 |
> |
char *opts, *po; |
1333 |
|
{ |
1334 |
|
char *vw; |
1335 |
|
char combuf[512]; |
1338 |
|
return; |
1339 |
|
if (sayview) |
1340 |
|
printview(vw); |
1341 |
< |
sprintf(combuf, "rview %s%s -R %s ", vw, opts, rifname); |
1341 |
> |
sprintf(combuf, "rview %s%s%s -R %s ", vw, po, opts, rifname); |
1342 |
|
if (rvdevice != NULL) |
1343 |
|
sprintf(combuf+strlen(combuf), "-o %s ", rvdevice); |
1344 |
+ |
if (vdef(EXPOSURE)) |
1345 |
+ |
sprintf(combuf+strlen(combuf), "-pe %s ", vval(EXPOSURE)); |
1346 |
|
strcat(combuf, oct1name); |
1347 |
|
if (runcom(combuf)) { /* run it */ |
1348 |
|
fprintf(stderr, "%s: error running rview\n", progname); |
1351 |
|
} |
1352 |
|
|
1353 |
|
|
1354 |
< |
rpict(opts) /* run rpict and pfilt for each view */ |
1355 |
< |
char *opts; |
1354 |
> |
rpict(opts, po) /* run rpict and pfilt for each view */ |
1355 |
> |
char *opts, *po; |
1356 |
|
{ |
1357 |
|
char combuf[1024]; |
1358 |
|
char rawfile[MAXPATH], picfile[MAXPATH], rep[MAXPATH+16], res[32]; |
1362 |
|
/* get pfilt options */ |
1363 |
|
pfiltopts(pfopts); |
1364 |
|
/* get resolution, reporting */ |
1365 |
< |
mult = vscale(QUALITY)+1; |
1365 |
> |
switch (vscale(QUALITY)) { |
1366 |
> |
case LOW: |
1367 |
> |
mult = 1; |
1368 |
> |
break; |
1369 |
> |
case MEDIUM: |
1370 |
> |
mult = 2; |
1371 |
> |
break; |
1372 |
> |
case HIGH: |
1373 |
> |
mult = 3; |
1374 |
> |
break; |
1375 |
> |
} |
1376 |
|
{ |
1377 |
|
int xres, yres; |
1378 |
|
double aspect; |
1413 |
|
/* build rpict command */ |
1414 |
|
sprintf(rawfile, "%s_%s.raw", vval(PICTURE), vs); |
1415 |
|
if (fdate(rawfile) >= oct1date) /* recover */ |
1416 |
< |
sprintf(combuf, "rpict%s%s -ro %s %s", |
1417 |
< |
rep, opts, rawfile, oct1name); |
1416 |
> |
sprintf(combuf, "rpict%s%s%s -ro %s %s", |
1417 |
> |
rep, po, opts, rawfile, oct1name); |
1418 |
|
else { |
1419 |
|
if (overture) { /* run overture calculation */ |
1420 |
|
sprintf(combuf, |
1431 |
|
rmfile(overfile); |
1432 |
|
#endif |
1433 |
|
} |
1434 |
< |
sprintf(combuf, "rpict%s %s %s%s %s > %s", |
1435 |
< |
rep, vw, res, opts, |
1436 |
< |
oct1name, rawfile); |
1434 |
> |
sprintf(combuf, "rpict%s %s %s%s%s %s > %s", |
1435 |
> |
rep, vw, res, po, opts, |
1436 |
> |
oct1name, rawfile); |
1437 |
|
} |
1438 |
|
if (runcom(combuf)) { /* run rpict */ |
1439 |
|
fprintf(stderr, "%s: error rendering view %s\n", |