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

Comparing ray/src/px/pcomb.c (file contents):
Revision 2.21 by gwlarson, Tue Oct 27 09:08:25 1998 UTC vs.
Revision 2.22 by greg, Sat Feb 22 02:07:27 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 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   *  Combine picture files according to calcomp functions.
6   *
# Line 14 | Line 11 | static char SCCSid[] = "$SunId$ LBL";
11  
12   #include "color.h"
13  
17 #include "resolu.h"
18
14   #include "calcomp.h"
15  
16   #include "view.h"
17  
18   #define MAXINP          32              /* maximum number of input files */
19 < #define WINSIZ          17              /* scanline window size */
19 > #define WINSIZ          64              /* scanline window size */
20   #define MIDSCN          ((WINSIZ-1)/2+1)
21  
22   struct {
# Line 114 | Line 109 | char   *argv[];
109                  break;
110          }
111          newheader("RADIANCE", stdout);  /* start header */
112 +        fputnow(stdout);
113                                          /* process files */
114          for (nfiles = 0; nfiles < MAXINP; nfiles++) {
115                  setcolor(input[nfiles].coef, 1.0, 1.0, 1.0);
# Line 171 | Line 167 | char   *argv[];
167                                          colval(input[nfiles].expos,GRN);
168                          colval(input[nfiles].coef,BLU) /=
169                                          colval(input[nfiles].expos,BLU);
170 +                        setcolor(input[nfiles].expos, 1.0, 1.0, 1.0);
171                  }
172                  nfiles++;
173                  original = 0;
# Line 227 | Line 224 | usage:
224   }
225  
226  
227 < tputs(s)                        /* put out string preceded by a tab */
227 > tabputs(s)                      /* put out string preceded by a tab */
228   char    *s;
229   {
230          char    fmt[32];
# Line 241 | Line 238 | char   *s;
238                          wrongformat = 0;
239                          strcpy(ourfmt, fmt);
240                  } else
241 <                        wrongformat = 1;
241 >                        wrongformat = globmatch(PICFMT, fmt) ? 1 : -1;
242                  return(0);      /* don't echo */
243          }
244          if (isexpos(s)) {                       /* exposure */
# Line 267 | Line 264 | checkfile()                    /* ready a file */
264          gotview = 0;
265          fputs(input[nfiles].name, stdout);
266          fputs(":\n", stdout);
267 <        getheader(input[nfiles].fp, tputs, NULL);
268 <        if (wrongformat) {
267 >        getheader(input[nfiles].fp, tabputs, NULL);
268 >        if (wrongformat < 0) {
269                  eputs(input[nfiles].name);
270 <                eputs(": not in Radiance picture format\n");
270 >                eputs(": not a Radiance picture\n");
271                  quit(1);
272          }
273 +        if (wrongformat > 0) {
274 +                wputs(input[nfiles].name);
275 +                wputs(": warning -- incompatible picture format\n");
276 +        }
277          if (!gotview || setview(&input[nfiles].vw) != NULL)
278                  input[nfiles].vw.type = 0;
279          if (!fgetsresolu(&input[nfiles].rs, input[nfiles].fp)) {
# Line 397 | Line 398 | combine()                      /* combine pictures */
398                      quit(1);
399              }
400          }
401 <        efree(scanout);
401 >        efree((char *)scanout);
402   }
403  
404  
# Line 531 | Line 532 | register char  *nam;
532                  errno = EDOM;
533                  return(0.0);
534          }
535 <        if (ltick[fn] < eclock) {               /* need to compute? */
535 >        if (ltick[fn] != eclock) {              /* need to compute? */
536                  lorg[fn][0] = lorg[fn][1] = lorg[fn][2] = 0.0;
537                  ldir[fn][0] = ldir[fn][1] = ldir[fn][2] = 0.0;
538                  ldist[fn] = -1.0;
# Line 571 | Line 572 | l_psize()                      /* compute pixel size in steradians */
572                  return(0.0);
573          }
574          fn = d - .5;
575 <        if (ltick[fn] < eclock) {               /* need to compute? */
575 >        if (ltick[fn] != eclock) {              /* need to compute? */
576                  psize[fn] = 0.0;
577                  if (input[fn].vw.type == 0)
578                          errno = EDOM;
# Line 591 | Line 592 | l_psize()                      /* compute pixel size in steradians */
592                                          diry[i] -= dir0[i];
593                                  }
594                                  fcross(dir0, dirx, diry);
595 <                                psize[fn] = 0.5 * sqrt(DOT(dir0,dir0));
595 >                                psize[fn] = sqrt(DOT(dir0,dir0));
596                          }
597                  }
598                  ltick[fn] = eclock;
# Line 600 | Line 601 | l_psize()                      /* compute pixel size in steradians */
601   }
602  
603  
604 + void
605   wputs(msg)
606   char    *msg;
607   {
# Line 608 | Line 610 | char   *msg;
610   }
611  
612  
613 + void
614   eputs(msg)
615   char    *msg;
616   {
# Line 615 | Line 618 | char   *msg;
618   }
619  
620  
621 + void
622   quit(code)              /* exit gracefully */
623   int  code;
624   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines