| 1 |
|
#ifndef lint |
| 2 |
< |
static const char RCSid[] = "$Id$"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 4 |
|
/* |
| 5 |
|
* Radiance animation control program |
| 13 |
|
* See the ranimate(1) man page for further details. |
| 14 |
|
*/ |
| 15 |
|
|
| 16 |
< |
/* ==================================================================== |
| 17 |
< |
* The Radiance Software License, Version 1.0 |
| 18 |
< |
* |
| 19 |
< |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
| 20 |
< |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
| 21 |
< |
* |
| 22 |
< |
* Redistribution and use in source and binary forms, with or without |
| 23 |
< |
* modification, are permitted provided that the following conditions |
| 24 |
< |
* are met: |
| 25 |
< |
* |
| 26 |
< |
* 1. Redistributions of source code must retain the above copyright |
| 27 |
< |
* notice, this list of conditions and the following disclaimer. |
| 28 |
< |
* |
| 29 |
< |
* 2. Redistributions in binary form must reproduce the above copyright |
| 30 |
< |
* notice, this list of conditions and the following disclaimer in |
| 31 |
< |
* the documentation and/or other materials provided with the |
| 32 |
< |
* distribution. |
| 33 |
< |
* |
| 34 |
< |
* 3. The end-user documentation included with the redistribution, |
| 35 |
< |
* if any, must include the following acknowledgment: |
| 36 |
< |
* "This product includes Radiance software |
| 37 |
< |
* (http://radsite.lbl.gov/) |
| 38 |
< |
* developed by the Lawrence Berkeley National Laboratory |
| 39 |
< |
* (http://www.lbl.gov/)." |
| 40 |
< |
* Alternately, this acknowledgment may appear in the software itself, |
| 41 |
< |
* if and wherever such third-party acknowledgments normally appear. |
| 42 |
< |
* |
| 43 |
< |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
| 44 |
< |
* and "The Regents of the University of California" must |
| 45 |
< |
* not be used to endorse or promote products derived from this |
| 46 |
< |
* software without prior written permission. For written |
| 47 |
< |
* permission, please contact [email protected]. |
| 48 |
< |
* |
| 49 |
< |
* 5. Products derived from this software may not be called "Radiance", |
| 50 |
< |
* nor may "Radiance" appear in their name, without prior written |
| 51 |
< |
* permission of Lawrence Berkeley National Laboratory. |
| 52 |
< |
* |
| 53 |
< |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
| 54 |
< |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 55 |
< |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 56 |
< |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
| 57 |
< |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 58 |
< |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 59 |
< |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 60 |
< |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 61 |
< |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 62 |
< |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 63 |
< |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 64 |
< |
* SUCH DAMAGE. |
| 65 |
< |
* ==================================================================== |
| 66 |
< |
* |
| 67 |
< |
* This software consists of voluntary contributions made by many |
| 68 |
< |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
| 69 |
< |
* information on Lawrence Berkeley National Laboratory, please see |
| 70 |
< |
* <http://www.lbl.gov/>. |
| 71 |
< |
*/ |
| 16 |
> |
#include "copyright.h" |
| 17 |
|
|
| 73 |
– |
#include "standard.h" |
| 18 |
|
#include <ctype.h> |
| 19 |
|
#include <sys/stat.h> |
| 20 |
+ |
|
| 21 |
+ |
#include "standard.h" |
| 22 |
+ |
#include "paths.h" |
| 23 |
|
#include "view.h" |
| 24 |
|
#include "vars.h" |
| 25 |
|
#include "netproc.h" |
| 482 |
|
pippt = NULL; |
| 483 |
|
} |
| 484 |
|
if (pippt != NULL) |
| 485 |
< |
strcpy(pippt, "> /dev/null"); /* nothing to match */ |
| 485 |
> |
strcpy(pippt, "> " NULL_DEVICE); /* nothing to match */ |
| 486 |
|
else { |
| 487 |
|
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY)); |
| 488 |
|
cp += 11; /* point to file name */ |
| 631 |
|
if (astat.tnext < astat.fnext) /* other work to do first */ |
| 632 |
|
return; |
| 633 |
|
/* filter each view */ |
| 634 |
< |
for (i = astat.fnext; i < astat.rnext; i++) { |
| 635 |
< |
if ((vp = getview(i)) == NULL) { /* get view i */ |
| 636 |
< |
fprintf(stderr, |
| 690 |
< |
"%s: unexpected error reading view for frame %d\n", |
| 691 |
< |
progname, i); |
| 692 |
< |
quit(1); |
| 693 |
< |
} |
| 694 |
< |
dofilt(i, vp, getexp(i), 0); /* filter frame */ |
| 695 |
< |
} |
| 634 |
> |
for (i = astat.fnext; i < astat.rnext; i++) |
| 635 |
> |
dofilt(i, 0); |
| 636 |
> |
|
| 637 |
|
bwait(0); /* wait for filter processes */ |
| 638 |
|
archive(); /* archive originals */ |
| 639 |
|
astat.fnext = i; /* update status */ |
| 794 |
|
return(1); |
| 795 |
|
/* add frame to recovered list */ |
| 796 |
|
if (nrfrms) |
| 797 |
< |
rfrm = (int *)realloc((char *)rfrm, (nrfrms+1)*sizeof(int)); |
| 797 |
> |
rfrm = (int *)realloc((void *)rfrm, (nrfrms+1)*sizeof(int)); |
| 798 |
|
else |
| 799 |
|
rfrm = (int *)malloc(sizeof(int)); |
| 800 |
|
if (rfrm == NULL) { |
| 810 |
|
frecover(frame) /* recover filtered frame */ |
| 811 |
|
int frame; |
| 812 |
|
{ |
| 813 |
< |
VIEW *vp; |
| 873 |
< |
char *ex; |
| 874 |
< |
|
| 875 |
< |
vp = getview(frame); |
| 876 |
< |
ex = getexp(frame); |
| 877 |
< |
if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1)) |
| 813 |
> |
if (dofilt(frame, 2) && dofilt(frame, 1)) |
| 814 |
|
return(1); |
| 815 |
|
return(0); |
| 816 |
|
} |
| 860 |
|
|
| 861 |
|
|
| 862 |
|
int |
| 863 |
< |
dofilt(frame, vp, ep, rvr) /* filter frame */ |
| 863 |
> |
dofilt(frame, rvr) /* filter frame */ |
| 864 |
|
int frame; |
| 929 |
– |
VIEW *vp; |
| 930 |
– |
char *ep; |
| 865 |
|
int rvr; |
| 866 |
|
{ |
| 867 |
|
extern int frecover(); |
| 868 |
|
static int iter = 0; |
| 869 |
|
double blurf; |
| 870 |
|
int nblur = getblur(&blurf); |
| 871 |
+ |
VIEW *vp = getview(frame); |
| 872 |
+ |
char *ep = getexp(frame); |
| 873 |
|
char fnbefore[128], fnafter[128], *fbase; |
| 874 |
|
char combuf[1024], fname0[128], fname1[128]; |
| 875 |
|
int usepinterp, usepfilt, nora_rgbe; |
| 876 |
|
int frseq[2]; |
| 877 |
|
/* check what is needed */ |
| 878 |
+ |
if (vp == NULL) { |
| 879 |
+ |
fprintf(stderr, |
| 880 |
+ |
"%s: unexpected error reading view for frame %d\n", |
| 881 |
+ |
progname, frame); |
| 882 |
+ |
quit(1); |
| 883 |
+ |
} |
| 884 |
+ |
if (ep == NULL) { |
| 885 |
+ |
fprintf(stderr, |
| 886 |
+ |
"%s: unexpected error reading exposure for frame %d\n", |
| 887 |
+ |
progname, frame); |
| 888 |
+ |
quit(1); |
| 889 |
+ |
} |
| 890 |
|
usepinterp = (nblur > 1); |
| 891 |
|
usepfilt = pfiltalways | ep==NULL; |
| 892 |
|
if (ep != NULL && !strcmp(ep, "1")) |
| 959 |
|
putc('\n', fp); fclose(fp); |
| 960 |
|
} |
| 961 |
|
sprintf(combuf, |
| 962 |
< |
"(pmblur %.3f %d %s %s; rm -f %s %s) | pinterp -B", |
| 962 |
> |
"(pmblur %.3f %d %s %s; rm -f %s %s) | pinterp -B -a", |
| 963 |
|
blurf, nblur, |
| 964 |
|
fname0, fname1, fname0, fname1); |
| 965 |
|
iter++; |
| 974 |
|
if (usepfilt) |
| 975 |
|
sprintf(combuf+strlen(combuf), " %s", rresopt); |
| 976 |
|
else |
| 977 |
< |
sprintf(combuf+strlen(combuf), " %s -e %s", |
| 977 |
> |
sprintf(combuf+strlen(combuf), " -a %s -e %s", |
| 978 |
|
fresopt, ep); |
| 979 |
|
sprintf(combuf+strlen(combuf), " %s.unf %s.zbf", |
| 980 |
|
fnbefore, fnbefore); |
| 1303 |
|
strcpy(com1=buf, com); /* build -PP command */ |
| 1304 |
|
sprintf(com1+(ppins-com), " -PP %s/%s.persist", |
| 1305 |
|
vval(DIRECTORY), phostname(ps)); |
| 1306 |
+ |
unlink(com1+(ppins-com)+5); |
| 1307 |
|
strcat(com1, ppins); |
| 1308 |
|
} else |
| 1309 |
|
com1 = com; |
| 1364 |
|
char *fn; |
| 1365 |
|
{ |
| 1366 |
|
if (!silent) |
| 1367 |
< |
#ifdef MSDOS |
| 1367 |
> |
#ifdef _WIN32 |
| 1368 |
|
printf("\tdel %s\n", fn); |
| 1369 |
|
#else |
| 1370 |
|
printf("\trm -f %s\n", fn); |