--- ray/src/cv/lampcolor.c 1991/10/22 09:38:17 1.7 +++ ray/src/cv/lampcolor.c 1994/07/05 15:49:51 2.5 @@ -10,10 +10,13 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#include + +#include "color.h" + #define PI 3.14159265358979323846 extern char *gets(), *strcpy(); -extern double atof(); extern float *matchlamp(); /* lamp parameters */ @@ -36,9 +39,9 @@ struct { int (*check)(); char *help; } param[NPARAMS] = { - { "lamp type", "white", typecheck, + { "lamp type", "WHITE", typecheck, "The lamp type is a string which corresponds to one of the types registered\n\ -in the lamp table file. A value of \"white\" means an uncolored source,\n\ +in the lamp table file. A value of \"WHITE\" means an uncolored source,\n\ which may be preferable because it results in a color balanced image." }, { "length unit", "meter", unitcheck, "Unit must be one of: \"meter\", \"centimeter\", \"foot\", or \"inch\".\n\ @@ -173,7 +176,7 @@ compute() /* compute lamp radiance */ { double whiteval; - whiteval = lumens/470./PI/area; + whiteval = lumens/area/(WHTEFFICACY*PI); printf("Lamp color (RGB) = %f %f %f\n", lampcolor[0]*whiteval, @@ -205,11 +208,11 @@ again: getpolygon() /* get projected area for a polygon */ { - static double area = 1.0; + static double parea = 1.0; - getd("Polygon area", &area, + getd("Polygon area", &parea, "Enter the total radiating area of the polygon."); - area = unit2meter*unit2meter * area; + area = unit2meter*unit2meter * parea; return(1); }