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 1.15 by greg, Fri Jan 5 11:34:27 1990 UTC vs.
Revision 1.16 by greg, Sat Jan 6 22:27:10 1990 UTC

# Line 37 | Line 37 | float  *ourzbuf;                       /* corresponding z-buffer */
37  
38   char    *progname;
39  
40 VIEW    theirview = STDVIEW(512);       /* input view */
41 int     gotview;                        /* got input view? */
42
40   int     fill = F_FORE|F_BACK;           /* selected fill algorithm */
41   extern int      backfill(), rcalfill(); /* fill functions */
42   int     (*deffill)() = backfill;        /* selected fill function */
43   COLR    backcolr = BLKCOLR;             /* background color */
44   double  backz = 0.0;                    /* background z value */
45 + int     normdist = 1;                   /* normalized distance? */
46 + double  ourexp = -1;                    /* output picture exposure */
47  
48 + VIEW    theirview = STDVIEW(512);       /* input view */
49 + int     gotview;                        /* got input view? */
50   double  theirs2ours[4][4];              /* transformation matrix */
51 < int     normdist = 1;                   /* normalized distance? */
51 > double  theirexp;                       /* input picture exposure */
52  
53   int     childpid = -1;                  /* id of fill process */
54   FILE    *psend, *precv;                 /* pipes to/from fill calculation */
# Line 213 | Line 214 | char   *argv[];
214                  fprintview(&ourview, stdout);
215                  printf("\n");
216          }
217 +        if (ourexp > 0 && ourexp != 1.0)
218 +                fputexpos(ourexp, stdout);
219          printf("\n");
220                                                          /* write picture */
221          writepicture();
# Line 238 | Line 241 | char   *s;
241  
242          printf("\t%s", s);
243  
244 +        if (isexpos(s)) {
245 +                theirexp *= exposval(s);
246 +                return;
247 +        }
248          for (an = altname; *an != NULL; an++)
249                  if (!strncmp(*an, s, strlen(*an))) {
250                          if (sscanview(&theirview, s+strlen(*an)) == 0)
# Line 262 | Line 269 | char   *pfile, *zspec;
269                  perror(pfile);
270                  exit(1);
271          }
272 <                                        /* get header and view */
273 <        printf("%s:\n", pfile);
272 >                                        /* get header with exposure and view */
273 >        theirexp = 1.0;
274          gotview = 0;
275 +        printf("%s:\n", pfile);
276          getheader(pfp, headline);
277          if (!gotview || fgetresolu(&theirview.hresolu, &theirview.vresolu, pfp)
278                          != (YMAJOR|YDECR)) {
279                  fprintf(stderr, "%s: picture view error\n", pfile);
280                  exit(1);
281          }
282 +        if (ourexp <= 0)
283 +                ourexp = theirexp;
284 +        else if (ABS(theirexp-ourexp) > .01*ourexp)
285 +                fprintf(stderr, "%s: different exposure (warning)\n", pfile);
286          if (err = setview(&theirview)) {
287                  fprintf(stderr, "%s: %s\n", pfile, err);
288                  exit(1);
# Line 714 | Line 726 | clearqueue()                           /* get results from queue */
726                          fprintf(stderr, "%s: read error in clearqueue\n",
727                                          progname);
728                          exit(1);
729 +                }
730 +                if (ourexp > 0 && ourexp != 1.0) {
731 +                        inbuf[0] *= ourexp;
732 +                        inbuf[1] *= ourexp;
733 +                        inbuf[2] *= ourexp;
734                  }
735                  setcolr(pscan(queue[i][1])[queue[i][0]],
736                                  inbuf[0], inbuf[1], inbuf[2]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines