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

Comparing ray/src/px/pf3.c (file contents):
Revision 2.18 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 2.19 by greg, Thu Jul 26 23:50:40 2018 UTC

# Line 25 | Line 25 | short  *ringwt;                        /* weight (count) of ring values */
25   short  *ringndx;                /* ring index table */
26   float  *warr;                   /* array of pixel weights */
27  
28 < #define  lookgauss(x)           gausstable[(int)(10.*(x)+.5)]
28 > #define  lookgauss(x)           gausstable[(int)(20.*(x)+.5)]
29  
30   static double pickfilt(double  p0);
31   static void sumans(int  px, int  py, int  rcent, int  ccent, double  m);
32  
33  
34 < extern void
34 > void
35   initmask(void)                  /* initialize gaussian lookup table */
36   {
37          int  gtabsiz;
38          double  gaussN;
39          double  d;
40 <        register int  x;
40 >        int  x;
41  
42 <        gtabsiz = 111*CHECKRAD*CHECKRAD;
42 >        gtabsiz = 444*CHECKRAD*CHECKRAD;
43          gausstable = (float *)malloc(gtabsiz*sizeof(float));
44          if (gausstable == NULL)
45                  goto memerr;
46          d = x_c*y_r*0.25/(rad*rad);
47          gausstable[0] = exp(-d);
48          for (x = 1; x < gtabsiz; x++)
49 <                if (x*0.1 <= d)
49 >                if (x*0.05 <= d)
50                          gausstable[x] = gausstable[0];
51                  else
52 <                        gausstable[x] = exp(-x*0.1);
52 >                        gausstable[x] = exp(-x*0.05);
53          if (obarsize == 0)
54                  return;
55                                          /* compute integral of filter */
# Line 81 | Line 81 | memerr:
81   }
82  
83  
84 < extern void
84 > void
85   dobox(                  /* simple box filter */
86          COLOR  csum,
87          int  xcent,
# Line 93 | Line 93 | dobox(                 /* simple box filter */
93          int  wsum;
94          double  d;
95          int  y;
96 <        register int  x, offs;
97 <        register COLOR  *scan;
96 >        int  x, offs;
97 >        COLOR   *scan;
98          
99          wsum = 0;
100          setcolor(csum, 0.0, 0.0, 0.0);
# Line 123 | Line 123 | dobox(                 /* simple box filter */
123   }
124  
125  
126 < extern void
126 > void
127   dogauss(                /* gaussian filter */
128          COLOR  csum,
129          int  xcent,
# Line 135 | Line 135 | dogauss(               /* gaussian filter */
135          double  dy, dx, weight, wsum;
136          COLOR  ctmp;
137          int  y;
138 <        register int  x, offs;
139 <        register COLOR  *scan;
138 >        int  x, offs;
139 >        COLOR   *scan;
140  
141          wsum = FTINY;
142          setcolor(csum, 0.0, 0.0, 0.0);
# Line 162 | Line 162 | dogauss(               /* gaussian filter */
162   }
163  
164  
165 < extern void
165 > void
166   dothresh(       /* gaussian threshold filter */
167          int  xcent,
168          int  ycent,
# Line 172 | Line 172 | dothresh(      /* gaussian threshold filter */
172   {
173          double  d;
174          int  r, y, offs;
175 <        register int  c, x;
176 <        register float  *gscan;
175 >        int  c, x;
176 >        float  *gscan;
177                                          /* compute ring sums */
178          memset((char *)ringsum, '\0', (orad+1)*sizeof(float));
179          memset((char *)ringwt, '\0', (orad+1)*sizeof(short));
# Line 222 | Line 222 | pickfilt(                      /* find filter multiplier for p0 */
222          double  t, num, denom, avg, wsum;
223          double  mlimit[2];
224          int  ilimit = 4.0/TEPS;
225 <        register int  i;
225 >        int  i;
226                                  /* iterative search for m */
227          mlimit[0] = 1.0; mlimit[1] = orad/rad/CHECKRAD;
228          do {
# Line 287 | Line 287 | sumans(                /* sum input pixel to output */
287          COLOR  pval, ctmp;
288          int  ksiz, r, offs;
289          double  pc, pr, norm;
290 <        register int  i, c;
291 <        register COLOR  *scan;
290 >        int  i, c;
291 >        COLOR   *scan;
292          /*
293           * This normalization method fails at the picture borders because
294           * a different number of input pixels contribute there.
# Line 327 | Line 327 | sumans(                /* sum input pixel to output */
327                  scan = scoutbar[r%obarsize];
328                  for (c = ccent-ksiz; c <= ccent+ksiz; c++) {
329                          offs = c < 0 ? ncols : c >= ncols ? -ncols : 0;
330 <                        if (offs && !wrapfilt)
330 >                        if ((offs != 0) & !wrapfilt)
331                                  continue;
332                          copycolor(ctmp, pval);
333                          dx = norm*warr[i++];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines