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

Comparing ray/src/util/glareval.c (file contents):
Revision 2.5 by gwlarson, Tue Oct 27 08:47:18 1998 UTC vs.
Revision 2.9 by schorsch, Mon Jun 30 14:59:13 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Compute pixels for glare calculation
6   */
7  
8 + #include "copyright.h"
9 +
10 + #include <string.h>
11 +
12 + #include "rtprocess.h" /* Windows: must come first because of conflicts */
13   #include "glare.h"
14 < #include "resolu.h"
14 >
15                                          /* maximum rtrace buffer size */
16   #define MAXPIX          (4096/(6*sizeof(float)))
17  
# Line 17 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19   #define HSIZE           317     /* size of scanline hash table */
20   #define NRETIRE         16      /* number of scanlines to retire at once */
21  
22 < int     rt_pd[3] = {-1,-1,-1};  /* process id & descriptors for rtrace */
22 > static SUBPROC  rt_pd = SP_INACTIVE; /* process id & descriptors for rtrace */
23  
24   FILE    *pictfp = NULL;         /* picture file pointer */
25   double  exposure;               /* picture exposure */
# Line 186 | Line 188 | int    vh, vv;
188          npixinvw++;
189          if ((res = pict_val(dir)) >= 0.0)
190                  return(res);
191 <        if (rt_pd[0] == -1) {
191 >        if (rt_pd.r == -1) {
192                  npixmiss++;
193                  return(-1.0);
194          }
# Line 225 | Line 227 | float  *vb;
227                  npixinvw++;
228                  if ((vb[vh+hsize] = pict_val(dir)) >= 0.0)
229                          continue;
230 <                if (rt_pd[0] == -1) {           /* missing information */
230 >                if (rt_pd.r == -1) {            /* missing information */
231                          npixmiss++;
232                          continue;
233                  }
# Line 264 | Line 266 | int    np;
266                  fprintf(stderr, "%s: sending %d samples to rtrace...\n",
267                                  progname, np);
268   #endif
269 <        bzero(pb+6*np, 6*sizeof(float));
270 <        if (process(rt_pd, pb, pb, 3*sizeof(float)*(np+1),
269 >        memset(pb+6*np, '\0', 6*sizeof(float));
270 >        if (process(&rt_pd, (char *)pb, (char *)pb, 3*sizeof(float)*(np+1),
271                          6*sizeof(float)*(np+1)) < 3*sizeof(float)*(np+1)) {
272                  fprintf(stderr, "%s: rtrace communication error\n",
273                                  progname);
# Line 322 | Line 324 | char   *av[];
324   {
325          int     rval;
326  
327 <        rval = open_process(rt_pd, av);
327 >        rval = open_process(&rt_pd, av);
328          if (rval < 0) {
329                  perror(progname);
330                  exit(1);
# Line 342 | Line 344 | done_rtrace()                  /* wait for rtrace to finish */
344   {
345          int     status;
346  
347 <        status = close_process(rt_pd);
347 >        status = close_process(&rt_pd);
348          if (status > 0) {
349                  fprintf(stderr, "%s: bad status (%d) from rtrace\n",
350                                  progname, status);
351                  exit(1);
352          }
353 <        rt_pd[0] = -1;
353 >        rt_pd.r = -1;
354   }
355  
356  
# Line 413 | Line 415 | initscans()                            /* initialize scanline buffers */
415                  hashtab[i] = NULL;
416                                          /* allocate scanline buffers */
417          scansize = sizeof(SCAN) + pxsiz*sizeof(COLR);
418 < #ifdef ALIGN
419 <        scansize = scansize+(sizeof(ALIGN)-1) & ~(sizeof(ALIGN)-1);
418 > #ifdef ALIGNT
419 >        scansize = scansize+(sizeof(ALIGNT)-1) & ~(sizeof(ALIGNT)-1);
420   #endif
421          i = MAXSBUF / scansize;         /* compute number to allocate */
422          if (i > HSIZE)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines