ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/testimg.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

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