| 558 |
|
unlink(illumtmp); |
| 559 |
|
quit(1); |
| 560 |
|
} |
| 561 |
+ |
rmfile(oct0name); |
| 562 |
|
/* make octree1 (frozen) */ |
| 563 |
|
if (octreedate) |
| 564 |
|
sprintf(combuf, "%s%s -f -i %s %s > %s", c_oconv, |
| 773 |
|
d = ambval(); |
| 774 |
|
sprintf(op, " -av %.2g %.2g %.2g", d, d, d); |
| 775 |
|
op += strlen(op); |
| 776 |
< |
op = addarg(op, "-lr 6 -lw .01"); |
| 776 |
> |
op = addarg(op, "-lr 6 -lw .003"); |
| 777 |
|
} |
| 778 |
|
|
| 779 |
|
|
| 851 |
|
d = ambval(); |
| 852 |
|
sprintf(op, " -av %.2g %.2g %.2g", d, d, d); |
| 853 |
|
op += strlen(op); |
| 854 |
< |
op = addarg(op, "-lr 8 -lw .002"); |
| 854 |
> |
op = addarg(op, "-lr 8 -lw 1e-4"); |
| 855 |
|
} |
| 856 |
|
|
| 857 |
|
|
| 927 |
|
d = ambval(); |
| 928 |
|
sprintf(op, " -av %.2g %.2g %.2g", d, d, d); |
| 929 |
|
op += strlen(op); |
| 930 |
< |
op = addarg(op, "-lr 12 -lw .0005"); |
| 930 |
> |
op = addarg(op, "-lr 12 -lw 1e-5"); |
| 931 |
|
} |
| 932 |
|
|
| 933 |
|
|
| 1255 |
|
} |
| 1256 |
|
|
| 1257 |
|
|
| 1258 |
+ |
static int |
| 1259 |
+ |
syncf_done( /* check if an rpiece sync file is complete */ |
| 1260 |
+ |
char *sfname |
| 1261 |
+ |
) |
| 1262 |
+ |
{ |
| 1263 |
+ |
FILE *fp = fopen(sfname, "r"); |
| 1264 |
+ |
int todo = 1; |
| 1265 |
+ |
int x, y; |
| 1266 |
+ |
|
| 1267 |
+ |
if (fp == NULL) |
| 1268 |
+ |
return(0); |
| 1269 |
+ |
if (fscanf(fp, "%d %d", &x, &y) != 2) |
| 1270 |
+ |
goto checked; |
| 1271 |
+ |
todo = x*y; /* total number of tiles */ |
| 1272 |
+ |
if (fscanf(fp, "%d %d", &x, &y) != 2 || (x != 0) | (y != 0)) |
| 1273 |
+ |
goto checked; |
| 1274 |
+ |
/* XXX assume no redundant tiles */ |
| 1275 |
+ |
while (fscanf(fp, "%d %d", &x, &y) == 2) |
| 1276 |
+ |
if (!--todo) |
| 1277 |
+ |
break; |
| 1278 |
+ |
checked: |
| 1279 |
+ |
fclose(fp); |
| 1280 |
+ |
return(!todo); |
| 1281 |
+ |
} |
| 1282 |
+ |
|
| 1283 |
+ |
|
| 1284 |
|
static void |
| 1285 |
|
rpict( /* run rpict and pfilt for each view */ |
| 1286 |
|
char *opts, |
| 1297 |
|
int vn, mult; |
| 1298 |
|
FILE *fp; |
| 1299 |
|
time_t rfdt, pfdt; |
| 1300 |
+ |
int xres, yres; |
| 1301 |
+ |
double aspect; |
| 1302 |
+ |
int n; |
| 1303 |
|
/* get pfilt options */ |
| 1304 |
|
pfiltopts(pfopts); |
| 1305 |
|
/* get resolution, reporting */ |
| 1314 |
|
mult = 3; |
| 1315 |
|
break; |
| 1316 |
|
} |
| 1317 |
< |
{ |
| 1318 |
< |
int xres, yres; |
| 1319 |
< |
double aspect; |
| 1320 |
< |
int n; |
| 1321 |
< |
n = sscanf(vval(RESOLUTION), "%d %d %lf", &xres, &yres, &aspect); |
| 1322 |
< |
if (n == 3) |
| 1323 |
< |
sprintf(res, "-x %d -y %d -pa %.3f", |
| 1324 |
< |
mult*xres, mult*yres, aspect); |
| 1325 |
< |
else if (n) { |
| 1326 |
< |
if (n == 1) yres = xres; |
| 1297 |
< |
sprintf(res, "-x %d -y %d", mult*xres, mult*yres); |
| 1298 |
< |
} else |
| 1299 |
< |
badvalue(RESOLUTION); |
| 1300 |
< |
} |
| 1317 |
> |
n = sscanf(vval(RESOLUTION), "%d %d %lf", &xres, &yres, &aspect); |
| 1318 |
> |
if (n == 3) |
| 1319 |
> |
sprintf(res, "-x %d -y %d -pa %.3f", |
| 1320 |
> |
mult*xres, mult*yres, aspect); |
| 1321 |
> |
else if (n) { |
| 1322 |
> |
aspect = 1.; |
| 1323 |
> |
if (n == 1) yres = xres; |
| 1324 |
> |
sprintf(res, "-x %d -y %d", mult*xres, mult*yres); |
| 1325 |
> |
} else |
| 1326 |
> |
badvalue(RESOLUTION); |
| 1327 |
|
rep[0] = '\0'; |
| 1328 |
|
if (vdef(REPORT)) { |
| 1329 |
|
double minutes; |
| 1304 |
– |
int n; |
| 1330 |
|
n = sscanf(vval(REPORT), "%lf %s", &minutes, rawfile); |
| 1331 |
|
if (n == 2) |
| 1332 |
|
sprintf(rep, " -t %d -e %s", (int)(minutes*60), rawfile); |
| 1388 |
|
int xdiv = 8+nprocs/3, ydiv = 8+nprocs/3; |
| 1389 |
|
if (rfdt >= oct1date) { |
| 1390 |
|
fprintf(stderr, |
| 1391 |
< |
"%s: partial output not created with rpiece\n", rawfile); |
| 1391 |
> |
"%s: partial output not created with %s\n", rawfile, c_rpiece); |
| 1392 |
|
quit(1); |
| 1393 |
|
} |
| 1394 |
|
if (rfdt) { /* start fresh */ |
| 1477 |
|
if (do_rpiece) { /* need to finish raw, first */ |
| 1478 |
|
finish_process(); |
| 1479 |
|
wait_process(1); |
| 1480 |
< |
/* XXX should check sync file to see if really done? */ |
| 1480 |
> |
if (!syncf_done(sfile)) { |
| 1481 |
> |
fprintf(stderr, |
| 1482 |
> |
"%s: %s did not complete rendering of view %s\n", |
| 1483 |
> |
progname, c_rpiece, vs); |
| 1484 |
> |
quit(1); |
| 1485 |
> |
} |
| 1486 |
|
} |
| 1487 |
|
if (!vdef(RAWFILE) || strcmp(vval(RAWFILE),vval(PICTURE))) { |
| 1488 |
|
/* build pfilt command */ |
| 1489 |
< |
if (mult > 1) |
| 1489 |
> |
if (do_rpiece) |
| 1490 |
> |
sprintf(combuf, |
| 1491 |
> |
"%s%s -x %d -y %d -p %.3f %s > %s", |
| 1492 |
> |
c_pfilt, pfopts, xres, yres, aspect, |
| 1493 |
> |
rawfile, picfile); |
| 1494 |
> |
else if (mult > 1) |
| 1495 |
|
sprintf(combuf, "%s%s -x /%d -y /%d %s > %s", |
| 1496 |
|
c_pfilt, pfopts, mult, mult, |
| 1497 |
|
rawfile, picfile); |