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.4 by gregl, Wed Jul 9 11:22:11 1997 UTC vs.
Revision 2.10 by schorsch, Thu Jul 3 22:41:45 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 <stdlib.h>
11 + #include <string.h>
12 +
13 + #include "rtprocess.h" /* Windows: must come first because of conflicts */
14   #include "glare.h"
15 < #include "resolu.h"
15 >
16                                          /* maximum rtrace buffer size */
17   #define MAXPIX          (4096/(6*sizeof(float)))
18  
# Line 17 | Line 20 | static char SCCSid[] = "$SunId$ LBL";
20   #define HSIZE           317     /* size of scanline hash table */
21   #define NRETIRE         16      /* number of scanlines to retire at once */
22  
23 < int     rt_pd[3] = {-1,-1,-1};  /* process id & descriptors for rtrace */
23 > static SUBPROC  rt_pd = SP_INACTIVE; /* process id & descriptors for rtrace */
24  
25   FILE    *pictfp = NULL;         /* picture file pointer */
26   double  exposure;               /* picture exposure */
# Line 186 | Line 189 | int    vh, vv;
189          npixinvw++;
190          if ((res = pict_val(dir)) >= 0.0)
191                  return(res);
192 <        if (rt_pd[0] == -1) {
192 >        if (rt_pd.r == -1) {
193                  npixmiss++;
194                  return(-1.0);
195          }
# Line 225 | Line 228 | float  *vb;
228                  npixinvw++;
229                  if ((vb[vh+hsize] = pict_val(dir)) >= 0.0)
230                          continue;
231 <                if (rt_pd[0] == -1) {           /* missing information */
231 >                if (rt_pd.r == -1) {            /* missing information */
232                          npixmiss++;
233                          continue;
234                  }
# Line 264 | Line 267 | int    np;
267                  fprintf(stderr, "%s: sending %d samples to rtrace...\n",
268                                  progname, np);
269   #endif
270 <        bzero(pb+6*np, 6*sizeof(float));
271 <        if (process(rt_pd, pb, pb, 3*sizeof(float)*(np+1),
270 >        memset(pb+6*np, '\0', 6*sizeof(float));
271 >        if (process(&rt_pd, (char *)pb, (char *)pb, 3*sizeof(float)*(np+1),
272                          6*sizeof(float)*(np+1)) < 3*sizeof(float)*(np+1)) {
273                  fprintf(stderr, "%s: rtrace communication error\n",
274                                  progname);
# Line 274 | Line 277 | int    np;
277   }
278  
279  
280 + int
281   getexpos(s)                     /* get exposure from header line */
282   char    *s;
283   {
# Line 285 | Line 289 | char   *s;
289                  formatval(fmt, s);
290                  wrongformat = strcmp(fmt, COLRFMT);
291          }
292 +        return(0);
293   }
294  
295  
# Line 320 | Line 325 | char   *av[];
325   {
326          int     rval;
327  
328 <        rval = open_process(rt_pd, av);
328 >        rval = open_process(&rt_pd, av);
329          if (rval < 0) {
330                  perror(progname);
331                  exit(1);
# Line 340 | Line 345 | done_rtrace()                  /* wait for rtrace to finish */
345   {
346          int     status;
347  
348 <        status = close_process(rt_pd);
348 >        status = close_process(&rt_pd);
349          if (status > 0) {
350                  fprintf(stderr, "%s: bad status (%d) from rtrace\n",
351                                  progname, status);
352                  exit(1);
353          }
354 <        rt_pd[0] = -1;
354 >        rt_pd.r = -1;
355   }
356  
357  
# Line 411 | Line 416 | initscans()                            /* initialize scanline buffers */
416                  hashtab[i] = NULL;
417                                          /* allocate scanline buffers */
418          scansize = sizeof(SCAN) + pxsiz*sizeof(COLR);
419 < #ifdef ALIGN
420 <        scansize = scansize+(sizeof(ALIGN)-1) & ~(sizeof(ALIGN)-1);
419 > #ifdef ALIGNT
420 >        scansize = scansize+(sizeof(ALIGNT)-1) & ~(sizeof(ALIGNT)-1);
421   #endif
422          i = MAXSBUF / scansize;         /* compute number to allocate */
423          if (i > HSIZE)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines