ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/color.h
(Generate patch)

Comparing ray/src/common/color.h (file contents):
Revision 1.8 by greg, Fri Dec 14 16:28:20 1990 UTC vs.
Revision 2.2 by greg, Thu Dec 19 14:45:43 1991 UTC

# Line 1 | Line 1
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  
# Line 48 | Line 48 | typedef float  COLOR[3];       /* red, green, blue */
48   #define  normbright(c)          (int)((67L*(c)[RED]+168L*(c)[GRN]+21L*(c)[BLU])/256)
49   #endif
50  
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] )
# Line 61 | Line 72 | typedef float  COLOR[3];       /* red, green, blue */
72   #define  WHTCOLR                {128,128,128,COLXS+1}
73   #define  BLKCOLR                {0,0,0,0}
74  
75 <                                /* definitions for resolution header */
76 < #define  XDECR                  1
66 < #define  YDECR                  2
67 < #define  YMAJOR                 4
75 >                                /* picture format identifier */
76 > #define  COLRFMT                "32-bit_rle_rgbe"
77  
78                                  /* macros for exposures */
79   #define  EXPOSSTR               "EXPOSURE="
80 < #define  EXPOSSTRL              9
81 < #define  isexpos(hl)            (!strncmp(hl,EXPOSSTR,EXPOSSTRL))
82 < #define  exposval(hl)           atof((hl)+EXPOSSTRL)
80 > #define  LEXPOSSTR              9
81 > #define  isexpos(hl)            (!strncmp(hl,EXPOSSTR,LEXPOSSTR))
82 > #define  exposval(hl)           atof((hl)+LEXPOSSTR)
83   #define  fputexpos(ex,fp)       fprintf(fp,"%s%e\n",EXPOSSTR,ex)
84  
85                                  /* macros for pixel aspect ratios */
86   #define  ASPECTSTR              "PIXASPECT="
87 < #define  ASPECTSTRL             10
88 < #define  isaspect(hl)           (!strncmp(hl,ASPECTSTR,ASPECTSTRL))
89 < #define  aspectval(hl)          atof((hl)+ASPECTSTRL)
87 > #define  LASPECTSTR             10
88 > #define  isaspect(hl)           (!strncmp(hl,ASPECTSTR,LASPECTSTR))
89 > #define  aspectval(hl)          atof((hl)+LASPECTSTR)
90   #define  fputaspect(pa,fp)      fprintf(fp,"%s%f\n",ASPECTSTR,pa)
91  
92                                  /* macros for color correction */
93   #define  COLCORSTR              "COLORCORR="
94 < #define  COLCORSTRL             10
95 < #define  iscolcor(hl)           (!strncmp(hl,COLCORSTR,COLCORSTRL))
96 < #define  colcorval(cc,hl)       sscanf(hl+COLCORSTRL,"%f %f %f", \
94 > #define  LCOLCORSTR             10
95 > #define  iscolcor(hl)           (!strncmp(hl,COLCORSTR,LCOLCORSTR))
96 > #define  colcorval(cc,hl)       sscanf(hl+LCOLCORSTR,"%f %f %f", \
97                                          &(cc)[RED],&(cc)[GRN],&(cc)[BLU])
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 > extern double  ldexp();
102 > #ifndef atof                    /* atof's a macro on some systems! */
103 > extern double  atof();
104 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines