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

Comparing ray/src/rt/data.c (file contents):
Revision 2.1 by greg, Tue Nov 12 17:10:07 1991 UTC vs.
Revision 2.4 by greg, Thu Nov 12 10:11:51 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 20 | Line 20 | static char SCCSid[] = "$SunId$ LBL";
20  
21  
22   extern char  *fgetword();
23 extern double  atof();
23  
24   extern char  *libpath;                  /* library search path */
25  
26 < static DATARRAY  *dlist = NULL;         /* data array list */
26 > static DATARRAY  *dlist = NULL;         /* data array list */
27  
28 < static DATARRAY  *plist = NULL;         /* picture list */
28 > static DATARRAY  *plist = NULL;         /* picture list */
29  
30  
31   DATARRAY *
# Line 140 | Line 139 | scanerr:
139   }
140  
141  
143 static double  inpaspect;               /* aspect ratio of input picture */
144
142   static
143 < headaspect(s)                           /* check string for aspect ratio */
143 > headaspect(s, iap)                      /* check string for aspect ratio */
144   char  *s;
145 + double  *iap;
146   {
147          if (isaspect(s))
148 <                inpaspect *= aspectval(s);
148 >                *iap *= aspectval(s);
149   }
150  
151  
# Line 156 | Line 154 | getpict(pname)                         /* get picture pname */
154   char  *pname;
155   {
156          extern char  *libpath;
157 +        double  inpaspect;
158          char  *pfname;
159          FILE  *fp;
160          COLOR  *scanin;
161          int  sl, ns;
162 <        RESOLU  inpres;
162 >        RESOLU  inpres;
163          FLOAT  loc[2];
164          int  y;
165          register int  x, i;
# Line 185 | Line 184 | char  *pname;
184                  sprintf(errmsg, "cannot open picture file \"%s\"", pfname);
185                  error(SYSTEM, errmsg);
186          }
187 + #ifdef MSDOS
188 +        setmode(fileno(fp), O_BINARY);
189 + #endif
190                                                  /* get dimensions */
191          inpaspect = 1.0;
192 <        getheader(fp, headaspect);
192 >        getheader(fp, headaspect, &inpaspect);
193          if (!fgetsresolu(&inpres, fp))
194                  goto readerr;
195          for (i = 0; i < 3; i++) {
# Line 290 | Line 292 | char  *pname;
292   double
293   datavalue(dp, pt)               /* interpolate data value at a point */
294   register DATARRAY  *dp;
295 < double  *pt;
295 > double  *pt;
296   {
297          DATARRAY  sd;
298          int  asize;
299          int  lower, upper;
300          register int  i;
301 <        double  x, y, y0, y1;
301 >        double  x, y, y0, y1;
302                                          /* set up dimensions for recursion */
303          sd.nd = dp->nd - 1;
304          asize = 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines