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.4 by greg, Fri Oct 20 20:35:21 1989 UTC vs.
Revision 1.10 by greg, Tue Mar 19 12:06:33 1991 UTC

# Line 40 | Line 40 | typedef float  COLOR[3];       /* red, green, blue */
40  
41   #define  multcolor(c1,c2)       ((c1)[0]*=(c2)[0],(c1)[1]*=(c2)[1],(c1)[2]*=(c2)[2])
42  
43 < #define  bright(col)            (.30*(col)[RED]+.59*(col)[GRN]+.11*(col)[BLU])
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)
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)
49 > #endif
50  
51 + #define  luminance(col)         (470. * bright(col))
52 +
53   #define  intens(col)            ( (col)[0] > (col)[1] \
54                                  ? (col)[0] > (col)[2] ? (col)[0] : (col)[2] \
55                                  : (col)[1] > (col)[2] ? (col)[1] : (col)[2] )
# Line 50 | Line 58 | typedef float  COLOR[3];       /* red, green, blue */
58                                  ldexp((c)[p]+.5,(int)(c)[EXP]-(COLXS+8)) : \
59                                  0. )
60  
53 #define  normbright(c)          (int)((77L*(c)[RED]+151L*(c)[GRN]+28L*(c)[BLU])/256)
54
61   #define  WHTCOLOR               {1.0,1.0,1.0}
62   #define  BLKCOLOR               {0.0,0.0,0.0}
63   #define  WHTCOLR                {128,128,128,COLXS+1}
# Line 62 | Line 68 | typedef float  COLOR[3];       /* red, green, blue */
68   #define  YDECR                  2
69   #define  YMAJOR                 4
70  
71 < extern double  ldexp();
71 >                                /* macros for exposures */
72 > #define  EXPOSSTR               "EXPOSURE="
73 > #define  EXPOSSTRL              9
74 > #define  isexpos(hl)            (!strncmp(hl,EXPOSSTR,EXPOSSTRL))
75 > #define  exposval(hl)           atof((hl)+EXPOSSTRL)
76 > #define  fputexpos(ex,fp)       fprintf(fp,"%s%e\n",EXPOSSTR,ex)
77 >
78 >                                /* macros for pixel aspect ratios */
79 > #define  ASPECTSTR              "PIXASPECT="
80 > #define  ASPECTSTRL             10
81 > #define  isaspect(hl)           (!strncmp(hl,ASPECTSTR,ASPECTSTRL))
82 > #define  aspectval(hl)          atof((hl)+ASPECTSTRL)
83 > #define  fputaspect(pa,fp)      fprintf(fp,"%s%f\n",ASPECTSTR,pa)
84 >
85 >                                /* macros for color correction */
86 > #define  COLCORSTR              "COLORCORR="
87 > #define  COLCORSTRL             10
88 > #define  iscolcor(hl)           (!strncmp(hl,COLCORSTR,COLCORSTRL))
89 > #define  colcorval(cc,hl)       sscanf(hl+COLCORSTRL,"%f %f %f", \
90 >                                        &(cc)[RED],&(cc)[GRN],&(cc)[BLU])
91 > #define  fputcolcor(cc,fp)      fprintf(fp,"%s %f %f %f\n",COLCORSTR, \
92 >                                        (cc)[RED],(cc)[GRN],(cc)[BLU])
93 >
94 > extern double  ldexp(), atof();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines