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))); |