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

Comparing ray/src/px/pinterp.c (file contents):
Revision 2.4 by greg, Thu Mar 26 13:03:34 1992 UTC vs.
Revision 2.9 by greg, Fri Oct 2 16:24:22 1992 UTC

# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include "standard.h"
14  
15 #include <fcntl.h>
16
15   #include <ctype.h>
16  
17   #include "view.h"
# Line 161 | Line 159 | char   *argv[];
159                          vresolu = atoi(argv[++i]);
160                          break;
161                  case 'p':                               /* pixel aspect */
162 <                        check(2,"f");
162 >                        if (argv[i][2] != 'a')
163 >                                goto badopt;
164 >                        check(3,"f");
165                          pixaspect = atof(argv[++i]);
166                          break;
167                  case 'v':                               /* view file */
# Line 197 | Line 197 | char   *argv[];
197          }
198          normaspect(viewaspect(&ourview), &pixaspect, &hresolu, &vresolu);
199                                                  /* allocate frame */
200 <        ourpict = (COLR *)malloc(hresolu*vresolu*sizeof(COLR));
201 <        ourzbuf = (float *)calloc(hresolu*vresolu,sizeof(float));
200 >        ourpict = (COLR *)bmalloc(hresolu*vresolu*sizeof(COLR));
201 >        ourzbuf = (float *)bmalloc(hresolu*vresolu*sizeof(float));
202          if (ourpict == NULL || ourzbuf == NULL)
203                  syserror();
204 +        bzero((char *)ourzbuf, hresolu*vresolu*sizeof(float));
205                                                          /* get input */
206          for ( ; i < argc; i += 2)
207                  addpicture(argv[i], argv[i+1]);
# Line 243 | Line 244 | userr:
244   headline(s)                             /* process header string */
245   char    *s;
246   {
246        static char     *altname[] = {VIEWSTR,"rpict","rview","pinterp",NULL};
247        register char   **an;
247          char    fmt[32];
248  
249          if (isformat(s)) {
# Line 259 | Line 258 | char   *s;
258                  theirexp *= exposval(s);
259                  return;
260          }
261 <        for (an = altname; *an != NULL; an++)
262 <                if (!strncmp(*an, s, strlen(*an))) {
264 <                        if (sscanview(&theirview, s+strlen(*an)) > 0)
265 <                                gotview++;
266 <                        break;
267 <                }
261 >        if (isview(s) && sscanview(&theirview, s) > 0)
262 >                gotview++;
263   }
264  
265  
# Line 391 | Line 386 | COLR   *pline;
386   float   *zline;
387   struct position *lasty;         /* input/output */
388   {
394        extern double   sqrt();
389          FVECT   pos;
390          struct position lastx, newpos;
391          register int    x;
# Line 639 | Line 633 | writepicture()                         /* write out picture */
633   writedistance(fname)                    /* write out z file */
634   char    *fname;
635   {
642        extern double   sqrt();
636          int     donorm = normdist && ourview.type == VT_PER;
637          int     fd;
638          int     y;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines