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 2.31 by greg, Fri May 20 02:06:38 2011 UTC vs.
Revision 2.35 by greg, Sun Nov 14 17:30:02 2021 UTC

# Line 10 | Line 10
10   #ifndef _RAD_COLOR_H_
11   #define _RAD_COLOR_H_
12  
13 + #include <stdio.h>
14   #include <stdlib.h>
15  
16   #ifdef __cplusplus
# Line 54 | Line 55 | typedef float  COLORMAT[3][3]; /* color coordinate con
55  
56   #define  multcolor(c1,c2)       ((c1)[0]*=(c2)[0],(c1)[1]*=(c2)[1],(c1)[2]*=(c2)[2])
57  
58 < #ifdef  NTSC
58 > #if defined(NTSC_RGB)
59   #define  CIE_x_r                0.670           /* standard NTSC primaries */
60   #define  CIE_y_r                0.330
61   #define  CIE_x_g                0.210
62   #define  CIE_y_g                0.710
63   #define  CIE_x_b                0.140
64   #define  CIE_y_b                0.080
65 < #define  CIE_x_w                0.3333          /* use true white */
66 < #define  CIE_y_w                0.3333
65 > #define  CIE_x_w                (1./3.)         /* use EE white */
66 > #define  CIE_y_w                (1./3.)
67 > #elif defined(SHARP_RGB)
68 > #define  CIE_x_r                0.6898          /* "sharp" RGB primaries */
69 > #define  CIE_y_r                0.3206
70 > #define  CIE_x_g                0.0736
71 > #define  CIE_y_g                0.9003
72 > #define  CIE_x_b                0.1166
73 > #define  CIE_y_b                0.0374
74 > #define  CIE_x_w                (1./3.)         /* use EE white */
75 > #define  CIE_y_w                (1./3.)
76   #else
77   #define  CIE_x_r                0.640           /* nominal CRT primaries */
78   #define  CIE_y_r                0.330
# Line 70 | Line 80 | typedef float  COLORMAT[3][3]; /* color coordinate con
80   #define  CIE_y_g                0.600
81   #define  CIE_x_b                0.150
82   #define  CIE_y_b                0.060
83 < #define  CIE_x_w                0.3333          /* use true white */
84 < #define  CIE_y_w                0.3333
83 > #define  CIE_x_w                (1./3.)         /* use EE white */
84 > #define  CIE_y_w                (1./3.)
85   #endif
86  
87   #define  STDPRIMS       {{CIE_x_r,CIE_y_r},{CIE_x_g,CIE_y_g}, \
# Line 97 | Line 107 | typedef float  COLORMAT[3][3]; /* color coordinate con
107   #define CIE_gf          (CIE_y_g*CIE_C_gD/CIE_D)
108   #define CIE_bf          (CIE_y_b*CIE_C_bD/CIE_D)
109  
110 < /* As of 9-94, CIE_rf=.265074126, CIE_gf=.670114631 and CIE_bf=.064811243 */
110 > /* Default CIE_rf=.265074126, CIE_gf=.670114631 and CIE_bf=.064811243 */
111  
112   /***** The following definitions are valid for RGB colors only... *****/
113  
# Line 156 | Line 166 | typedef float  COLORMAT[3][3]; /* color coordinate con
166   #define  PRIMARYSTR             "PRIMARIES="
167   #define  LPRIMARYSTR            10
168   #define  isprims(hl)            (!strncmp(hl,PRIMARYSTR,LPRIMARYSTR))
169 < #define  primsval(p,hl)         sscanf((hl)+LPRIMARYSTR, \
169 > #define  primsval(p,hl)         (sscanf((hl)+LPRIMARYSTR, \
170                                          "%f %f %f %f %f %f %f %f", \
171                                          &(p)[RED][CIEX],&(p)[RED][CIEY], \
172                                          &(p)[GRN][CIEX],&(p)[GRN][CIEY], \
173                                          &(p)[BLU][CIEX],&(p)[BLU][CIEY], \
174 <                                        &(p)[WHT][CIEX],&(p)[WHT][CIEY])
174 >                                        &(p)[WHT][CIEX],&(p)[WHT][CIEY]) == 8)
175   #define  fputprims(p,fp)        fprintf(fp, \
176                                  "%s %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",\
177                                          PRIMARYSTR, \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines