ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimate.c
(Generate patch)

Comparing ray/src/util/ranimate.c (file contents):
Revision 2.30 by greg, Mon Feb 24 16:44:40 2003 UTC vs.
Revision 2.38 by greg, Fri Jun 6 20:04:06 2003 UTC

# Line 13 | Line 13 | static const char RCSid[] = "$Id$";
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  
18   #include "standard.h"
19   #include <ctype.h>
# Line 684 | Line 629 | filterframes()                         /* catch up with filtering */
629          if (astat.tnext < astat.fnext)  /* other work to do first */
630                  return;
631                                          /* filter each view */
632 <        for (i = astat.fnext; i < astat.rnext; i++) {
633 <                if ((vp = getview(i)) == NULL) {        /* get view i */
634 <                        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 <        }
632 >        for (i = astat.fnext; i < astat.rnext; i++)
633 >                dofilt(i, 0);
634 >
635          bwait(0);                       /* wait for filter processes */
636          archive();                      /* archive originals */
637          astat.fnext = i;                /* update status */
# Line 853 | Line 792 | int    frame;
792                  return(1);
793                                          /* add frame to recovered list */
794          if (nrfrms)
795 <                rfrm = (int *)realloc((char *)rfrm, (nrfrms+1)*sizeof(int));
795 >                rfrm = (int *)realloc((void *)rfrm, (nrfrms+1)*sizeof(int));
796          else
797                  rfrm = (int *)malloc(sizeof(int));
798          if (rfrm == NULL) {
# Line 869 | Line 808 | int
808   frecover(frame)                         /* recover filtered frame */
809   int     frame;
810   {
811 <        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))
811 >        if (dofilt(frame, 2) && dofilt(frame, 1))
812                  return(1);
813          return(0);
814   }
# Line 924 | Line 858 | archive()                      /* archive and remove renderings */
858  
859  
860   int
861 < dofilt(frame, vp, ep, rvr)                      /* filter frame */
861 > dofilt(frame, rvr)                              /* filter frame */
862   int     frame;
929 VIEW    *vp;
930 char    *ep;
863   int     rvr;
864   {
865          extern int      frecover();
866          static int      iter = 0;
867          double  blurf;
868          int     nblur = getblur(&blurf);
869 +        VIEW    *vp = getview(frame);
870 +        char    *ep = getexp(frame);
871          char    fnbefore[128], fnafter[128], *fbase;
872          char    combuf[1024], fname0[128], fname1[128];
873          int     usepinterp, usepfilt, nora_rgbe;
874          int     frseq[2];
875                                                  /* check what is needed */
876 +        if (vp == NULL) {
877 +                 fprintf(stderr,
878 +                        "%s: unexpected error reading view for frame %d\n",
879 +                                          progname, frame);
880 +                quit(1);
881 +        }
882 +        if (ep == NULL) {
883 +                 fprintf(stderr,
884 +                        "%s: unexpected error reading exposure for frame %d\n",
885 +                                          progname, frame);
886 +                quit(1);
887 +        }
888          usepinterp = (nblur > 1);
889          usepfilt = pfiltalways | ep==NULL;
890          if (ep != NULL && !strcmp(ep, "1"))
# Line 1026 | Line 972 | int    rvr;
972                  if (usepfilt)
973                          sprintf(combuf+strlen(combuf), " %s", rresopt);
974                  else
975 <                        sprintf(combuf+strlen(combuf), "-a %s -e %s",
975 >                        sprintf(combuf+strlen(combuf), " -a %s -e %s",
976                                          fresopt, ep);
977                  sprintf(combuf+strlen(combuf), " %s.unf %s.zbf",
978                                  fnbefore, fnbefore);
# Line 1355 | Line 1301 | int    maxcopies;
1301                          strcpy(com1=buf, com);  /* build -PP command */
1302                          sprintf(com1+(ppins-com), " -PP %s/%s.persist",
1303                                          vval(DIRECTORY), phostname(ps));
1304 +                        unlink(com1+(ppins-com)+5);
1305                          strcat(com1, ppins);
1306                  } else
1307                          com1 = com;
# Line 1415 | Line 1362 | rmfile(fn)                     /* remove a file */
1362   char    *fn;
1363   {
1364          if (!silent)
1365 < #ifdef MSDOS
1365 > #ifdef _WIN32
1366                  printf("\tdel %s\n", fn);
1367   #else
1368                  printf("\trm -f %s\n", fn);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines