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

Comparing ray/src/px/pf2.c (file contents):
Revision 2.10 by greg, Thu Dec 7 21:15:54 2023 UTC vs.
Revision 2.11 by greg, Fri Dec 8 17:56:26 2023 UTC

# Line 24 | Line 24 | HOTPIX *head;                  /* head of avgbrt pixel list */
24  
25   double  sprdfact;               /* computed spread factor */
26  
27 < static void starpoint(COLOR  fcol, int  x, int  y, HOTPIX        *hp);
27 > static void starpoint(SCOLOR fcol, int  x, int  y, HOTPIX        *hp);
28  
29  
30   void
# Line 47 | Line 47 | pass1default(void)                     /* for single pass */
47  
48   void
49   pass1scan(              /* process first pass scanline */
50 <        COLOR   *scan,
50 >        COLORV  *scan,
51          int  y
52   )
53   {
# Line 57 | Line 57 | pass1scan(             /* process first pass scanline */
57  
58          for (x = 0; x < xres; x++) {
59          
60 <                cbrt = (*ourbright)(scan[x]);
60 >                cbrt = (*ourbright)(scan+x*NCSAMP);
61  
62                  if (cbrt <= 0)
63                          continue;
# Line 73 | Line 73 | pass1scan(             /* process first pass scanline */
73                                                  progname);
74                                  quit(1);
75                          }
76 <                        copycolor(hp->val, scan[x]);
76 >                        scolor_color(hp->val, scan+x*NCSAMP);
77                          hp->x = x;
78                          hp->y = y;
79 <                        hp->slope = tan(PI*(0.5-(irandom(npts)+0.5)/npts));
79 >                        hp->slope = ttan(PI*(0.5-(irandom(npts)+0.5)/npts));
80                          hp->next = head;
81                          head = hp;
82                  }
# Line 96 | Line 96 | pass2init(void)                        /* prepare for final pass */
96  
97          scalecolor(exposure,  AVGLVL/avgbrt);
98          
99 <        sprdfact = spread / (hotlvl * (*ourbright)(exposure))
99 >        sprdfact = spread / (hotlvl * bright(exposure))
100                          * ((double)xres*xres + (double)yres*yres) / 4.0;
101   }
102  
103  
104   void
105   pass2scan(              /* process final pass scanline */
106 <        COLOR   *scan,
106 >        COLORV  *scan,
107          int  y
108   )
109   {
# Line 130 | Line 130 | pass2scan(             /* process final pass scanline */
130                  if (xmax >= xres)
131                          xmax = xres-1;
132                  for (x = xmin; x <= xmax; x++)
133 <                        starpoint(scan[x], x, y, hp);
133 >                        starpoint(scan+x*NCSAMP, x, y, hp);
134          }
135          for (x = 0; x < xres; x++)
136 <                multcolor(scan[x], exposure);
136 >                smultcolor(scan+x*NCSAMP, exposure);
137   }
138  
139  
140   static void
141   starpoint(              /* pixel is on the star's point */
142 <        COLOR  fcol,
142 >        SCOLOR  fcol,
143          int  x,
144          int  y,
145          HOTPIX   *hp
# Line 155 | Line 155 | starpoint(             /* pixel is on the star's point */
155                          return;
156                  copycolor(ctmp, hp->val);
157                  scalecolor(ctmp, d2);
158 <                addcolor(fcol, ctmp);
158 >                saddcolor(fcol, ctmp);
159          } else if (d2 > FTINY) {
160 <                addcolor(fcol, hp->val);
160 >                saddcolor(fcol, hp->val);
161          }
162   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines