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.1 by greg, Tue Nov 12 16:05:24 1991 UTC vs.
Revision 2.3 by greg, Fri Oct 2 16:23:20 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include  <stdio.h>
14  
15 + #include  <math.h>
16 +
17   #include  "random.h"
18  
19   #include  "color.h"
20  
21 < #define  PI             3.14159265359
21 > #define  PI             3.14159265359
22  
23 < #define  FTINY          (1e-6)
23 > #define  FTINY          (1e-6)
24  
25   extern int  nrows, ncols;       /* number of rows and columns for output */
26  
# Line 36 | Line 38 | extern char  *progname;
38  
39   extern COLOR  exposure;         /* exposure for frame */
40  
41 < #define  AVGLVL         0.5     /* target mean brightness */
41 > #define  AVGLVL         0.5     /* target mean brightness */
42  
43 < double  avgbrt;                 /* average picture brightness */
43 > double  avgbrt;                 /* average picture brightness */
44  
45 < typedef struct  hotpix {        /* structure for avgbrt pixels */
45 > typedef struct  hotpix {        /* structure for avgbrt pixels */
46          struct hotpix  *next;   /* next in list */
47          COLOR  val;             /* pixel color */
48          short  x, y;            /* pixel position */
49          float  slope;           /* random slope for diffraction */
50   }  HOTPIX;
51  
52 < HOTPIX  *head;                  /* head of avgbrt pixel list */
52 > HOTPIX  *head;                  /* head of avgbrt pixel list */
53  
54 < double  sprdfact;               /* computed spread factor */
54 > double  sprdfact;               /* computed spread factor */
55  
56  
57   pass1init()                     /* prepare for first pass */
# Line 67 | Line 69 | pass1default()                 /* for single pass */
69  
70  
71   pass1scan(scan, y)              /* process first pass scanline */
72 < register COLOR  *scan;
72 > register COLOR  *scan;
73   int  y;
74   {
75          extern char  *malloc();
76 <        extern double  tan(), sqrt();
75 <        double  cbrt;
76 >        double  cbrt;
77          register int  x;
78 <        register HOTPIX  *hp;
78 >        register HOTPIX  *hp;
79  
80          for (x = 0; x < xres; x++) {
81          
# Line 118 | Line 119 | pass2init()                    /* prepare for final pass */
119  
120  
121   pass2scan(scan, y)              /* process final pass scanline */
122 < register COLOR  *scan;
122 > register COLOR  *scan;
123   int  y;
124   {
125          int  xmin, xmax;
126          register int  x;
127 <        register HOTPIX  *hp;
127 >        register HOTPIX  *hp;
128          
129          for (hp = head; hp != NULL; hp = hp->next) {
130                  if (hp->slope > FTINY) {
# Line 154 | Line 155 | int  y;
155   starpoint(fcol, x, y, hp)               /* pixel is on the star's point */
156   COLOR  fcol;
157   int  x, y;
158 < register HOTPIX  *hp;
158 > register HOTPIX  *hp;
159   {
160          COLOR  ctmp;
161 <        double  d2;
161 >        double  d2;
162          
163          d2 = (double)(x - hp->x)*(x - hp->x) + (double)(y - hp->y)*(y - hp->y);
164          if (d2 > sprdfact) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines