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

Comparing ray/src/px/pcond3.c (file contents):
Revision 3.15 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 3.16 by greg, Fri Aug 21 05:48:28 2015 UTC

# Line 29 | Line 29 | static void mkcrfimage(void);
29  
30  
31  
32 < extern void
32 > void
33   getfixations(           /* load fixation history list */
34   FILE    *fp
35   )
# Line 37 | Line 37 | FILE   *fp
37   #define FIXHUNK         128
38          RESOLU  fvres;
39          int     pos[2];
40 <        register int    px, py, i;
40 >        int     px, py, i;
41                                  /* initialize our resolution struct */
42          if ((fvres.rt=inpres.rt)&YMAJOR) {
43                  fvres.xr = fvxr;
# Line 92 | Line 92 | FILE   *fp
92   }
93  
94  
95 < extern void
95 > void
96   gethisto(                       /* load precomputed luminance histogram */
97          FILE    *fp
98   )
# Line 101 | Line 101 | gethisto(                      /* load precomputed luminance histogram */
101          double  histart, histep;
102          double  b, lastb, w;
103          int     n;
104 <        register int    i;
104 >        int     i;
105                                          /* load data */
106          for (i = 0; i < MAXPREHIST &&
107                          fscanf(fp, "%lf %lf", &b, &histo[i]) == 2; i++) {
# Line 177 | Line 177 | centprob(                      /* center-weighting probability function *
177   }
178  
179  
180 < extern void
180 > void
181   comphist(void)                  /* create foveal sampling histogram */
182   {
183          double  l, b, w, lwmin, lwmax;
184 <        register int    x, y;
184 >        int     x, y;
185                                          /* check for precalculated histogram */
186          if (what2do&DO_PREHIST)
187                  return;
# Line 190 | Line 190 | comphist(void)                 /* create foveal sampling histogram *
190          for (y = 0; y < fvyr; y++)
191                  for (x = 0; x < fvxr; x++) {
192                          l = plum(fovscan(y)[x]);
193 <                        if (l < lwmin) lwmin = l;
194 <                        if (l > lwmax) lwmax = l;
193 >                        if ((l < lwmin) & (l > LMIN)) lwmin = l;
194 >                        if ((l > lwmax) & (l < LMAX)) lwmax = l;
195                  }
196          lwmax *= 1.01;
197          if (lwmax > LMAX)
# Line 249 | Line 249 | comphist(void)                 /* create foveal sampling histogram *
249   static void
250   mkcumf(void)                    /* make cumulative distribution function */
251   {
252 <        register int    i;
253 <        register double sum;
252 >        int     i;
253 >        double  sum;
254  
255          mhistot = 0.;           /* compute modified total */
256          for (i = 0; i < HISTRES; i++)
# Line 271 | Line 271 | cf(                            /* return cumulative function at b */
271   )
272   {
273          double  x;
274 <        register int    i;
274 >        int     i;
275  
276          i = x = HISTRES*(b - bwmin)/(bwmax - bwmin);
277          x -= (double)i;
# Line 294 | Line 294 | BLw(                           /* map world luminance to display brightness *
294   }
295  
296  
297 < extern double
297 > double
298   htcontrs(               /* human threshold contrast sensitivity, dL(La) */
299          double  La
300   )
# Line 317 | Line 317 | htcontrs(              /* human threshold contrast sensitivity, dL
317   }
318  
319  
320 < extern double
320 > double
321   clampf(                 /* histogram clamping function */
322          double  Lw
323   )
# Line 329 | Line 329 | clampf(                        /* histogram clamping function */
329          return(ratio/(Lb1(bLw)*(Bldmax-Bldmin)*Bl1(Lw)));
330   }
331  
332 < extern double
332 > double
333   crfactor(                       /* contrast reduction factor */
334          double  Lw
335   )
# Line 368 | Line 368 | mkcrfimage(void)                       /* compute contrast reduction facto
368   #endif
369  
370  
371 < extern int
371 > int
372   mkbrmap(void)                   /* make dynamic range map */
373   {
374          double  Tdb, b, s;
375          double  ceiling, trimmings;
376 <        register int    i;
376 >        int     i;
377                                          /* copy initial histogram */
378          memcpy((void *)modhist, (void *)bwhist, sizeof(modhist));
379          s = (bwmax - bwmin)/HISTRES;    /* s is delta b */
# Line 401 | Line 401 | mkbrmap(void)                  /* make dynamic range map */
401   }
402  
403  
404 < extern void
404 > void
405   scotscan(               /* apply scotopic color sensitivity loss */
406          COLOR   *scan,
407          int     xres
# Line 409 | Line 409 | scotscan(              /* apply scotopic color sensitivity loss */
409   {
410          COLOR   ctmp;
411          double  incolor, b, Lw;
412 <        register int    i;
412 >        int     i;
413  
414          for (i = 0; i < xres; i++) {
415                  Lw = plum(scan[i]);
# Line 434 | Line 434 | scotscan(              /* apply scotopic color sensitivity loss */
434   }
435  
436  
437 < extern void
437 > void
438   mapscan(                /* apply tone mapping operator to scanline */
439          COLOR   *scan,
440          int     xres
441   )
442   {
443          double  mult, Lw, b;
444 <        register int    x;
444 >        int     x;
445  
446          for (x = 0; x < xres; x++) {
447                  Lw = plum(scan[x]);
# Line 457 | Line 457 | mapscan(               /* apply tone mapping operator to scanline *
457   }
458  
459  
460 < extern void
460 > void
461   putmapping(                     /* put out mapping function */
462          FILE    *fp
463   )
464   {
465          double  b, s;
466 <        register int    i;
466 >        int     i;
467          double  wlum, sf, dlum;
468  
469          sf = scalef*inpexp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines