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

Comparing ray/src/common/ccolor.h (file contents):
Revision 3.1 by greg, Fri Feb 18 00:40:25 2011 UTC vs.
Revision 3.8 by greg, Sat Jan 23 18:58:35 2016 UTC

# Line 33 | Line 33 | typedef struct {
33          float   eff;            /* efficacy (lumens/watt) */
34   } C_COLOR;
35  
36 + typedef unsigned short  C_CHROMA;       /* encoded (x,y) chromaticity */
37 +
38   #define C_DEFCOLOR      { 1, NULL, C_CDXY|C_CSXY|C_CSSPEC|C_CSEFF,\
39                          {C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,\
40                          C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,\
# Line 43 | Line 45 | typedef struct {
45                          C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV,C_CMAXV},\
46                          (long)C_CNSS*C_CMAXV, 1./3., 1./3., 178.006 }
47  
48 < #define c_cval(c,l)     ((double)(c)->ssamp[((l)-C_MINWL)/C_CWLI] / (c)->ssum)
48 > #define c_cval(c,l)     ((c)->ssamp[((l)+(C_CWLI/2.-C_MINWL))/C_CWLI] \
49 >                                                / (double)(c)->ssum)
50  
51 < extern C_COLOR          c_dfcolor;              /* default color */
51 > extern const C_COLOR    c_dfcolor;              /* default color */
52 > extern const C_CHROMA   c_dfchroma;             /* c_encodeChroma(&c_dfcolor) */
53  
54 < extern void     c_ccvt(C_COLOR *, int);         /* fix color representation */
55 < extern int      c_isgrey(C_COLOR *);            /* check if color is grey */
54 > extern const C_COLOR    c_x31, c_y31, c_z31;    /* 1931 standard observer */
55 >
56 >                                                /* set CIE (x,y) chromaticity */
57 > #define c_cset(c,x,y)   ((c)->cx=(x),(c)->cy=(y),(c)->flags=C_CDXY|C_CSXY)
58 >
59 >                                                /* set black body spectrum */
60 > extern int      c_bbtemp(C_COLOR *clr, double tk);
61 >                                                /* assign arbitrary spectrum */
62 > extern double   c_sset(C_COLOR *clr, double wlmin, double wlmax,
63 >                                const float spec[], int nwl);
64 > extern void     c_ccvt(C_COLOR *clr, int fl);   /* fix color representation */
65 > extern int      c_isgrey(C_COLOR *clr);         /* check if color is grey */
66                                                  /* mix two colors */
67   extern void     c_cmix(C_COLOR *cres, double w1, C_COLOR *c1,
68                                  double w2, C_COLOR *c2);
69 <                                                /* set black body spectrum */
70 < extern int      c_bbtemp(C_COLOR *clr, double tk);
69 >                                                /* multiply two colors */
70 > extern double   c_cmult(C_COLOR *cres, C_COLOR *c1, double y1,
71 >                                C_COLOR *c2, double y2);
72 >                                                /* convert to sharpened RGB */
73 > extern void     c_toSharpRGB(C_COLOR *cin, double cieY, float cout[3]);
74 >                                                /* convert from sharpened RGB */
75 > extern double   c_fromSharpRGB(float cin[3], C_COLOR *cout);
76 >                                                /* encode (x,y) chromaticity */
77 > extern C_CHROMA c_encodeChroma(C_COLOR *clr);
78 >                                                /* decode (x,y) chromaticity */
79 > extern void     c_decodeChroma(C_COLOR *cres, C_CHROMA ccode);
80 >
81 > /* The following two routines are not defined in ccolor.c */
82                                                  /* convert to RGB color */
83   extern void     ccy2rgb(C_COLOR *cin, double cieY, float cout[3]);
84                                                  /* convert from RGB color */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines