ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/macbeth.cal
Revision: 1.2
Committed: Wed Nov 21 18:10:45 2018 UTC (5 years, 5 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R3, HEAD
Changes since 1.1: +1 -0 lines
Log Message:
Added missing RCSid tag

File Contents

# User Rev Content
1 greg 1.2 { RCSid $Id$ }
2 greg 1.1 {
3     Macbeth color checker chart.
4     Creates four rows of 6 color squares each.
5     Color order, starting from lower left and reading right then up:
6    
7     Color x y Y (CIE 1931 under Illuminant C)
8     ===== ===== ===== =====
9     DarkSkin .4002 .3504 10.05
10     LightSkin .3773 .3446 35.82
11     BlueSky .2470 .2514 19.33
12     Foliage .3372 .4220 13.29
13     BlueFlower .2651 .2400 24.27
14     BluishGreen .2608 .3430 43.06
15     Orange .5060 .4070 30.05
16     PurplishBlue .2110 .1750 12.00
17     ModerateRed .4533 .3058 19.77
18     Purple .2845 .2020 6.56
19     YellowGreen .3800 .4887 44.29
20     OrangeYellow .4729 .4375 43.06
21     Blue .1866 .1285 6.11
22     Green .3046 .4782 23.39
23     Red .5385 .3129 12.00
24     Yellow .4480 .4703 59.10
25     Magenta .3635 .2325 19.77
26     Cyan .1958 .2519 19.77
27     White .3101 .3163 90.01
28     Neutral.8 .3101 .3163 59.10
29     Neutral.65 .3101 .3163 36.20
30     Neutral.5 .3101 .3163 19.77
31     Neutral.35 .3101 .3163 9.00
32     Black .3101 .3163 3.13
33     }
34     xres : 512; { settable x resolution }
35     gap : xres/64; { gap between patches }
36     biggap : 16+gap;
37     pwidth : (xres-gap)/6 - gap; { patch width }
38     pheight : pwidth;
39     yres : pheight*4 + biggap*4 + gap; { for square patches }
40     gapgrey : 0; { value for gap pixels }
41     or(a,b) : if( a, a, b );
42     and(a,b) : if( a, b, a );
43     mod(n,d) : n - floor(n/d)*d;
44    
45     ingap = if(or(gap-mod(x,pwidth+gap),biggap-mod(y,pheight+biggap)), 1, -1);
46    
47     ro = if(ingap, gapgrey, redval);
48     go = if(ingap, gapgrey, grnval);
49     bo = if(ingap, gapgrey, bluval);
50    
51     { Patches are numbered starting from 0 at the upper left, English order }
52    
53     n = floor(x/(pwidth+gap)) + 6*floor((yres-1-y)/(pheight+biggap));
54    
55     { The following were computed from the published CIE 1931 XYZ values
56     using the following definitions of the three primaries and white:
57    
58     Color x y
59     ===== = =
60     Red .640 .330
61     Green .290 .600
62     Blue .150 .060
63     White .333 .333
64    
65     redval=select(n+1,0.1486842,0.4729399,0.1079659,0.08712918,
66     0.2051028,0.1392646,0.5821536,0.06337776,0.4590441,0.09402137,
67     0.319248,0.6564189,0.02655103,0.06694206,0.3670574,0.7136942,
68     0.425348,0,0.7898659,0.5186209,0.3176663,0.1734879,0.07897781,
69     0.02746673);
70     grnval=select(n+1,0.08463139,0.3204288,0.2051882,0.1576957,
71     0.2280522,0.5390015,0.2154359,0.1079601,0.09839423,0.0426486,
72     0.5293968,0.3799829,0.04445694,0.3150952,0.02880633,0.5982432,
73     0.09023558,0.2530342,0.925279,0.6075324,0.3721264,0.2032304,
74     0.09251762,0.03217557);
75     bluval=select(n+1,0.06746537,0.2793655,0.4195167,
76     0.06372649,0.5480446,0.5015115,0.02782678,0.47622,0.1554321,
77     0.1866896,0.05423259,0.0301096,0.3746091,0.07726951,0.05228816,
78     0.01403399,0.3776974,0.4719555,1.090738,0.7161716,0.4386702,
79     0.2395721,0.1090617,0.03792922);
80     }
81    
82     { The following were computed from measured spectra, using same primaries: }
83    
84     redval = select(n+1, 0.168584, 0.633823, 0.118789, 0.071288, 0.271119,
85     0.160804, 0.699359, 0.076245, 0.599413, 0.113352,
86     0.325668, 0.745543, 0.037489, 0.056075, 0.537591,
87     0.834969, 0.568191, 0.008597, 0.91942, 0.602537,
88     0.36137, 0.201045, 0.088912, 0.030925);
89     grnval = select(n+1, 0.069446, 0.337209, 0.19066, 0.131171, 0.219394,
90     0.492803, 0.257105, 0.089464, 0.112735, 0.032193,
91     0.50756, 0.415383, 0.03581, 0.301005, 0.025739,
92     0.639189, 0.094541, 0.207922, 0.918992, 0.606277,
93     0.36625, 0.200417, 0.0877122, 0.03085);
94     bluval = select(n+1, 0.031966, 0.252572, 0.344106, 0.025464, 0.455498,
95     0.436593, 0.003501, 0.366442, 0.126229, 0.129459, 0.04907,
96     0.005622, 0.293019, 0.071808, 0.037301, 0, 0.303893,
97     0.395988, 0.884604, 0.596902, 0.360222, 0.195084,
98     0.0852725, 0.030359);