--- ray/src/px/pf2.c 1994/11/09 15:04:52 2.4 +++ ray/src/px/pf2.c 2003/02/22 02:07:27 2.6 @@ -1,15 +1,14 @@ -/* Copyright (c) 1994 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pf2.c,v 2.6 2003/02/22 02:07:27 greg Exp $"; #endif - /* * pf2.c - routines used by pfilt. */ #include +#include + #include #include "random.h" @@ -36,6 +35,8 @@ extern char *progname; extern COLOR exposure; /* exposure for frame */ +extern double (*ourbright)(); /* brightness calculation function */ + #define AVGLVL 0.5 /* target mean brightness */ double avgbrt; /* average picture brightness */ @@ -73,14 +74,13 @@ pass1scan(scan, y) /* process first pass scanline */ register COLOR *scan; int y; { - extern char *malloc(); double cbrt; register int x; register HOTPIX *hp; for (x = 0; x < xres; x++) { - cbrt = bright(scan[x]); + cbrt = (*ourbright)(scan[x]); if (cbrt <= 0) continue; @@ -118,7 +118,7 @@ pass2init() /* prepare for final pass */ scalecolor(exposure, AVGLVL/avgbrt); - sprdfact = spread / (hotlvl * bright(exposure)) + sprdfact = spread / (hotlvl * (*ourbright)(exposure)) * ((double)xres*xres + (double)yres*yres) / 4.0; }