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.33 by greg, Sat Feb 22 02:07:27 2003 UTC vs.
Revision 2.35 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   *      Greg Ward       09Dec89
8   */
9  
10 < #include "standard.h"
10 > #include "copyright.h"
11  
12   #include <ctype.h>
13 + #include <string.h>
14  
15 + #include "standard.h"
16 + #include "rtprocess.h" /* Windows: must come before color.h */
17   #include "view.h"
15
18   #include "color.h"
19  
20   #define LOG2            0.69314718055994530942
# Line 84 | Line 86 | double theirexp;                       /* input picture exposure */
86   MAT4    theirs2ours;                    /* transformation matrix */
87   int     hasmatrix = 0;                  /* has transformation matrix */
88  
89 < int     PDesc[3] = {-1,-1,-1};          /* rtrace process descriptor */
88 < #define childpid        (PDesc[2])
89 > static SUBPROC PDesc = SP_INACTIVE; /* rtrace process descriptor */
90   unsigned short  queue[PACKSIZ][2];      /* pending pixels */
91   int     packsiz;                        /* actual packet size */
92   int     queuesiz = 0;                   /* number of pixels pending */
# Line 277 | Line 278 | char   *argv[];
278          fputnow(stdout);
279                                                          /* run pictures */
280          do {
281 <                bzero((char *)ourzbuf, hresolu*vresolu*sizeof(float));
281 >                memset((char *)ourzbuf, '\0', hresolu*vresolu*sizeof(float));
282                  for (i = an; i < argc; i += 2)
283                          addpicture(argv[i], argv[i+1]);
284                  if (fillo&F_BACK)                       /* fill in spaces */
# Line 961 | Line 962 | clipaft()                      /* perform aft clipping as indicated */
962                                                  continue;
963                                  }
964                                  if (averaging)
965 <                                        bzero(sscan(y)[x], sizeof(COLOR));
965 >                                        memset(sscan(y)[x], '\0', sizeof(COLOR));
966                                  else
967 <                                        bzero(pscan(y)[x], sizeof(COLR));
967 >                                        memset(pscan(y)[x], '\0', sizeof(COLR));
968                                  zscan(y)[x] = 0.0;
969                          }
970          }
# Line 1095 | Line 1096 | char   *prog, *args;
1096          int     rval;
1097          register char   **wp, *cp;
1098  
1099 <        if (childpid != -1) {
1099 >        if (PDesc.running) {
1100                  fprintf(stderr, "%s: too many calculations\n", progname);
1101                  exit(1);
1102          }
# Line 1114 | Line 1115 | char   *prog, *args;
1115          }
1116          *wp = NULL;
1117                                                  /* start process */
1118 <        if ((rval = open_process(PDesc, argv)) < 0)
1118 >        if ((rval = open_process(&PDesc, argv)) < 0)
1119                  syserror(progname);
1120          if (rval == 0) {
1121                  fprintf(stderr, "%s: command not found\n", argv[0]);
# Line 1129 | Line 1130 | char   *prog, *args;
1130  
1131   caldone()                               /* done with calculation */
1132   {
1133 <        if (childpid == -1)
1133 >        if (!PDesc.running)
1134                  return;
1135          clearqueue();
1136 <        close_process(PDesc);
1136 <        childpid = -1;
1136 >        close_process(&PDesc);
1137   }
1138  
1139  
# Line 1168 | Line 1168 | clearqueue()                           /* process queue */
1168                  *fbp++ = dir[0]; *fbp++ = dir[1]; *fbp++ = dir[2];
1169          }
1170                                          /* mark end and get results */
1171 <        bzero((char *)fbp, 6*sizeof(float));
1172 <        if (process(PDesc, (char *)fbuf, (char *)fbuf,
1171 >        memset((char *)fbp, '\0', 6*sizeof(float));
1172 >        if (process(&PDesc, (char *)fbuf, (char *)fbuf,
1173                          4*sizeof(float)*(queuesiz+1),
1174                          6*sizeof(float)*(queuesiz+1)) !=
1175                          4*sizeof(float)*(queuesiz+1)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines