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

Comparing ray/src/px/pcond2.c (file contents):
Revision 3.1 by greg, Thu Oct 3 16:52:49 1996 UTC vs.
Revision 3.4 by greg, Thu Jan 9 13:56:28 1997 UTC

# Line 20 | Line 20 | double inpexp = 1.0;                   /* input exposure value */
20  
21   char    *mbcalfile = NULL;              /* macbethcal mapping file */
22  
23 < static struct mbc       mbcond;         /* macbethcal conditioning struct */
23 > static struct mbc {
24 >        float   xa[3][6], ya[3][6];
25 >        COLORMAT        cmat;
26 > }       mbcond;                         /* macbethcal conditioning struct */
27  
28   static COLOR    *scanbuf;               /* scanline processing buffer */
29   static int      nread;                  /* number of scanlines processed */
# Line 60 | Line 63 | nextscan()                             /* read and condition next scanline */
63   #ifdef DEBUG
64                  fputs("done\n", stderr);
65   #endif
66 <                return(NULL);
66 >                free((char *)scanbuf);
67 >                return(scanbuf = NULL);
68          }
69 <        if (freadscan(scanbuf, scanlen(&inpres), infp) < 0) {
69 >        if (what2do&DO_ACUITY)
70 >                acuscan(scanbuf, nread);
71 >        else if (freadscan(scanbuf, scanlen(&inpres), infp) < 0) {
72                  fprintf(stderr, "%s: %s: scanline read error\n",
73                                  progname, infn);
74                  exit(1);
75          }
70        nread++;
76          if (what2do&DO_VEIL)                    /* add veiling */
77 <                addveil(scanbuf, nread-1);
77 >                addveil(scanbuf, nread);
78          if (what2do&DO_COLOR)                   /* scotopic color loss */
79                  scotscan(scanbuf, scanlen(&inpres));
80          if (what2do&DO_LINEAR)                  /* map luminances */
# Line 80 | Line 85 | nextscan()                             /* read and condition next scanline */
85                  mbscan(scanbuf, scanlen(&inpres), &mbcond);
86          else if (lumf == cielum | inprims != outprims)
87                  matscan(scanbuf, scanlen(&inpres), mbcond.cmat);
88 +        nread++;
89          return(scanbuf);
90   }
91  
# Line 94 | Line 100 | firstscan()                            /* return first processed scanline */
100                          comprgb2rgbmat(mbcond.cmat, inprims, outprims);
101                  else
102                          compxyz2rgbmat(mbcond.cmat, outprims);
103 +        if (what2do&DO_ACUITY) {
104 + #ifdef DEBUG
105 +                fprintf(stderr, "%s: initializing acuity sampling...",
106 +                                progname);
107 + #endif
108 +                initacuity();
109 + #ifdef DEBUG
110 +                fprintf(stderr, "done\n");
111 + #endif
112 +        }
113          scanbuf = (COLOR *)malloc(scanlen(&inpres)*sizeof(COLOR));
114          if (scanbuf == NULL)
115                  syserror("malloc");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines