1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
3 |
|
/* SCCSid "$SunId$ LBL" */ |
4 |
|
|
42 |
|
|
43 |
|
#ifdef NTSC |
44 |
|
#define bright(col) (.295*(col)[RED]+.636*(col)[GRN]+.070*(col)[BLU]) |
45 |
< |
#define normbright(c) (int)((74L*(c)[RED]+164L*(c)[GRN]+18L*(c)[BLU])/256) |
45 |
> |
#define normbright(c) (int)((74L*(c)[RED]+164L*(c)[GRN]+18L*(c)[BLU])>>8) |
46 |
|
#else |
47 |
|
#define bright(col) (.263*(col)[RED]+.655*(col)[GRN]+.082*(col)[BLU]) |
48 |
< |
#define normbright(c) (int)((67L*(c)[RED]+168L*(c)[GRN]+21L*(c)[BLU])/256) |
48 |
> |
#define normbright(c) (int)((67L*(c)[RED]+168L*(c)[GRN]+21L*(c)[BLU])>>8) |
49 |
|
#endif |
50 |
|
|
51 |
< |
#define D65EFFICACY 203. /* luminous efficacy of D65 */ |
52 |
< |
#define luminance(col) (D65EFFICACY * bright(col)) |
51 |
> |
/* luminous efficacies over visible spectrum */ |
52 |
> |
#define MAXEFFICACY 683. /* defined maximum at 550 nm */ |
53 |
> |
#define WHTEFFICACY 179. /* uniform white light */ |
54 |
> |
#define D65EFFICACY 203. /* standard illuminant D65 */ |
55 |
> |
#define INCEFFICACY 160. /* illuminant A (incand.) */ |
56 |
> |
#define SUNEFFICACY 208. /* illuminant B (solar dir.) */ |
57 |
> |
#define SKYEFFICACY D65EFFICACY /* skylight */ |
58 |
> |
#define DAYEFFICACY D65EFFICACY /* combined sky and solar */ |
59 |
|
|
60 |
+ |
#define luminance(col) (WHTEFFICACY * bright(col)) |
61 |
+ |
|
62 |
|
#define intens(col) ( (col)[0] > (col)[1] \ |
63 |
|
? (col)[0] > (col)[2] ? (col)[0] : (col)[2] \ |
64 |
|
: (col)[1] > (col)[2] ? (col)[1] : (col)[2] ) |
72 |
|
#define WHTCOLR {128,128,128,COLXS+1} |
73 |
|
#define BLKCOLR {0,0,0,0} |
74 |
|
|
67 |
– |
/* definitions for resolution header */ |
68 |
– |
#define XDECR 1 |
69 |
– |
#define YDECR 2 |
70 |
– |
#define YMAJOR 4 |
71 |
– |
|
75 |
|
/* picture format identifier */ |
76 |
|
#define COLRFMT "32-bit_rle_rgbe" |
77 |
|
|
98 |
|
#define fputcolcor(cc,fp) fprintf(fp,"%s %f %f %f\n",COLCORSTR, \ |
99 |
|
(cc)[RED],(cc)[GRN],(cc)[BLU]) |
100 |
|
|
101 |
< |
extern double ldexp(), atof(); |
101 |
> |
#ifdef DCL_ATOF |
102 |
> |
extern double atof(), ldexp(), frexp(); |
103 |
> |
#endif |