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

Comparing ray/src/hd/rhpict.c (file contents):
Revision 3.10 by greg, Fri Jun 20 00:25:49 2003 UTC vs.
Revision 3.14 by schorsch, Sun Jul 27 22:12:02 2003 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   * Radiance holodeck picture generator
6   */
7  
8 + #include <string.h>
9 +
10   #include "rholo.h"
11   #include "view.h"
12  
# Line 54 | Line 56 | char   *argv[];
56                                  pixaspect = atof(argv[++i]);
57                          else if (argv[i][2] == 'e') {
58                                  expval = atof(argv[++i]);
59 <                                if (argv[i][0] == '-' | argv[i][0] == '+')
59 >                                if ((argv[i][0] == '-') | (argv[i][0] == '+'))
60                                          expval = pow(2., expval);
61                          } else
62                                  goto userr;
# Line 167 | Line 169 | render_frame(bl, nb)           /* render frame from beam values
169   register PACKHEAD       *bl;
170   int     nb;
171   {
172 <        extern int      pixBeam();
172 >        extern void     pixBeam();
173          register HDBEAMI        *bil;
174          register int    i;
175  
# Line 210 | Line 212 | int    fn;
212          fputs(VIEWSTR, stdout);
213          fprintview(&myview, stdout);
214          fputc('\n', stdout);
215 <        if (pa < 0.99 | pa > 1.01)
215 >        if ((pa < 0.99) | (pa > 1.01))
216                  fputaspect(pa, stdout);
217 <        if (expval < 0.99 | expval > 1.01)
217 >        if ((expval < 0.99) | (expval > 1.01))
218                  fputexpos(expval, stdout);
219          fputformat(COLRFMT, stdout);
220          fputc('\n', stdout);
221                                  /* write resolution (standard order) */
222          fprtresolu(hres, vres, stdout);
223                                  /* prepare image buffers */
224 <        bzero((char *)mypixel, hres*vres*sizeof(COLOR));
225 <        bzero((char *)myweight, hres*vres*sizeof(float));
226 <        bzero((char *)mydepth, hres*vres*sizeof(float));
224 >        memset((char *)mypixel, '\0', hres*vres*sizeof(COLOR));
225 >        memset((char *)myweight, '\0', hres*vres*sizeof(float));
226 >        memset((char *)mydepth, '\0', hres*vres*sizeof(float));
227   }
228  
229  
# Line 235 | Line 237 | endpicture()                   /* finish and write out pixels */
237                                  /* compute final pixel values */
238          for (p = hres*vres; p--; ) {
239                  if (myweight[p] <= FTINY) {
240 <                        if (lastr >= 0)
240 >                        if (lastr >= 0) {
241                                  if (p/hres == lastp/hres)
242                                          copycolor(mypixel[p], mypixel[lastp]);
243                                  else
244                                          copycolor(mypixel[p], mypixel[lastrp]);
245 +                        }
246                          nunrend++;
247                          continue;
248                  }
# Line 289 | Line 292 | initialize()                   /* initialize holodeck and buffers */
292          mypixel = (COLOR *)bmalloc(xres*yres*sizeof(COLOR));
293          myweight = (float *)bmalloc(xres*yres*sizeof(float));
294          mydepth = (float *)bmalloc(xres*yres*sizeof(float));
295 <        if (mypixel == NULL | myweight == NULL | mydepth == NULL)
295 >        if ((mypixel == NULL) | (myweight == NULL) | (mydepth == NULL))
296                  error(SYSTEM, "out of memory in initialize");
297   }
298  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines