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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines