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.14 by schorsch, Mon Jun 30 14:59:12 2003 UTC vs.
Revision 3.15 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 19 | Line 19 | double modhist[HISTRES];               /* modified histogram */
19   double  mhistot;                        /* modified histogram total */
20   double  cumf[HISTRES+1];                /* cumulative distribution function */
21  
22 + static double centprob(int      x, int  y);
23 + static void mkcumf(void);
24 + static double cf(double b);
25 + static double BLw(double        Lw);
26 + #if ADJ_VEIL
27 + static void mkcrfimage(void);
28 + #endif
29  
30 < getfixations(fp)                /* load fixation history list */
31 < FILE    *fp;
30 >
31 >
32 > extern void
33 > getfixations(           /* load fixation history list */
34 > FILE    *fp
35 > )
36   {
37   #define FIXHUNK         128
38          RESOLU  fvres;
# Line 81 | Line 92 | FILE   *fp;
92   }
93  
94  
95 < gethisto(fp)                    /* load precomputed luminance histogram */
96 < FILE    *fp;
95 > extern void
96 > gethisto(                       /* load precomputed luminance histogram */
97 >        FILE    *fp
98 > )
99   {
100          double  histo[MAXPREHIST];
101          double  histart, histep;
102 <        double  l, b, lastb, w;
102 >        double  b, lastb, w;
103          int     n;
104          register int    i;
105                                          /* load data */
# Line 149 | Line 162 | FILE   *fp;
162   }
163  
164  
165 < double
166 < centprob(x, y)                  /* center-weighting probability function */
167 < int     x, y;
165 > static double
166 > centprob(                       /* center-weighting probability function */
167 >        int     x,
168 >        int     y
169 > )
170   {
171          double  xr, yr, p;
172                                  /* paraboloid, 0 at 90 degrees from center */
# Line 162 | Line 177 | int    x, y;
177   }
178  
179  
180 < comphist()                      /* create foveal sampling histogram */
180 > extern void
181 > comphist(void)                  /* create foveal sampling histogram */
182   {
183          double  l, b, w, lwmin, lwmax;
184          register int    x, y;
# Line 230 | Line 246 | comphist()                     /* create foveal sampling histogram */
246   }
247  
248  
249 < mkcumf()                        /* make cumulative distribution function */
249 > static void
250 > mkcumf(void)                    /* make cumulative distribution function */
251   {
252          register int    i;
253          register double sum;
# Line 248 | Line 265 | mkcumf()                       /* make cumulative distribution function */
265   }
266  
267  
268 < double
269 < cf(b)                           /* return cumulative function at b */
270 < double  b;
268 > static double
269 > cf(                             /* return cumulative function at b */
270 >        double  b
271 > )
272   {
273          double  x;
274          register int    i;
# Line 261 | Line 279 | double b;
279   }
280  
281  
282 < double
283 < BLw(Lw)                         /* map world luminance to display brightness */
284 < double  Lw;
282 > static double
283 > BLw(                            /* map world luminance to display brightness */
284 >        double  Lw
285 > )
286   {
287          double  b;
288  
# Line 275 | Line 294 | double Lw;
294   }
295  
296  
297 < double
298 < htcontrs(La)            /* human threshold contrast sensitivity, dL(La) */
299 < double  La;
297 > extern double
298 > htcontrs(               /* human threshold contrast sensitivity, dL(La) */
299 >        double  La
300 > )
301   {
302          double  l10La, l10dL;
303                                  /* formula taken from Ferwerda et al. [SG96] */
# Line 297 | Line 317 | double La;
317   }
318  
319  
320 < double
321 < clampf(Lw)                      /* histogram clamping function */
322 < double  Lw;
320 > extern double
321 > clampf(                 /* histogram clamping function */
322 >        double  Lw
323 > )
324   {
325          double  bLw, ratio;
326  
# Line 308 | Line 329 | double Lw;
329          return(ratio/(Lb1(bLw)*(Bldmax-Bldmin)*Bl1(Lw)));
330   }
331  
332 < double
333 < crfactor(Lw)                    /* contrast reduction factor */
334 < double  Lw;
332 > extern double
333 > crfactor(                       /* contrast reduction factor */
334 >        double  Lw
335 > )
336   {
337          int     i = HISTRES*(Bl(Lw) - bwmin)/(bwmax - bwmin);
338          double  bLw, ratio, Tdb;
# Line 327 | Line 349 | double Lw;
349  
350  
351   #if ADJ_VEIL
352 < mkcrfimage()                    /* compute contrast reduction factor image */
352 > static void
353 > mkcrfimage(void)                        /* compute contrast reduction factor image */
354   {
355          int     i;
356          float   *crfptr;
# Line 345 | Line 368 | mkcrfimage()                   /* compute contrast reduction factor im
368   #endif
369  
370  
371 < int
372 < mkbrmap()                       /* make dynamic range map */
371 > extern int
372 > mkbrmap(void)                   /* make dynamic range map */
373   {
374          double  Tdb, b, s;
375          double  ceiling, trimmings;
# Line 378 | Line 401 | mkbrmap()                      /* make dynamic range map */
401   }
402  
403  
404 < scotscan(scan, xres)            /* apply scotopic color sensitivity loss */
405 < COLOR   *scan;
406 < int     xres;
404 > extern void
405 > scotscan(               /* apply scotopic color sensitivity loss */
406 >        COLOR   *scan,
407 >        int     xres
408 > )
409   {
410          COLOR   ctmp;
411          double  incolor, b, Lw;
# Line 409 | Line 434 | int    xres;
434   }
435  
436  
437 < mapscan(scan, xres)             /* apply tone mapping operator to scanline */
438 < COLOR   *scan;
439 < int     xres;
437 > extern 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;
# Line 430 | Line 457 | int    xres;
457   }
458  
459  
460 < putmapping(fp)                  /* put out mapping function */
461 < FILE    *fp;
460 > extern void
461 > putmapping(                     /* put out mapping function */
462 >        FILE    *fp
463 > )
464   {
465          double  b, s;
466          register int    i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines