ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/testimg.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
Error occurred while calculating annotation data.
Log Message:
Added missing RCSid tag

File Contents

# Content
1 { RCSid $Id$ }
2 {
3 Create a calibration image using pcomb.
4 Run through log scales in each primary and grey from 1/100 to 1.
5 Creates eight rows of 10 color squares each.
6 First two rows are greyscale.
7 Next rows run through red, green, blue, magenta, yellow and cyan.
8 }
9 xres : 512; { settable x resolution }
10 yres : xres * .8; { for square patches }
11 gap : xres/128; { gap between patches }
12 pwidth : (xres-gap)/10 - gap; { patch width }
13 pheight : (yres-gap)/8 - gap; { patch height }
14 gapgrey : 1; { value for gap pixels }
15 minv : 0.01; { minimum value }
16 scale(x) : minv^(1-x);
17 or(a,b) : if( a, a, b );
18 and(a,b) : if( a, b, a );
19 mod(n,d) : n - floor(n/d)*d;
20
21 ingap = if(or(gap-mod(x,pwidth+gap),gap-mod(y,pheight+gap)), 1, -1);
22
23 ro = if(ingap, gapgrey, redval);
24 go = if(ingap, gapgrey, grnval);
25 bo = if(ingap, gapgrey, bluval);
26
27 { Patches are numbered starting from 0 at the lower left, incr. right then up }
28
29 n = floor(x/(pwidth+gap)) + 10*floor(y/(pheight+gap));
30
31 redval = if(19.5-n, scale(n/19),
32 select(floor((n-10)/10), scale((n-20)/9), 0, 0,
33 scale((n-50)/9), scale((n-60)/9), 0));
34 grnval = if(19.5-n, scale(n/19),
35 select(floor((n-10)/10), 0, scale((n-30)/9), 0,
36 0, scale((n-60)/9), scale((n-70)/9)));
37 bluval = if(19.5-n, scale(n/19),
38 select(floor((n-10)/10), 0, 0, scale((n-40)/9),
39 scale((n-50)/9), 0, scale((n-70)/9)));