Graphics Reference
In-Depth Information
1
4
2
3
Fig. 3.3. 4-connected chain code.
H 2 : 123221412144341,1,214112321233432,2,214112321233432,
3,341443234322123.
Below we present a c-program fragment that provides four connected chain
codes for different resolutions of a Hilbert curve and the corresponding Hilbert
scanned image.
printf(”Enter resolution of the Hilbert curve : ”);
scanf(”%d”,&k);
l=1;
p=(int)pow(4.0,(double) l);
for (i=1; i < p; i++);
x2[i]=i;
printf(”The curve H 0 , seed pattern, is : ”);
for (i=1; i < p; i++)
printf(”%d”,x2[i]);
while (l < =k)
{
/*—————find first copy——————-*/
for (i=1; i < p; i++)
{
x1[i]=x2[i]+1;
if (x1[i] > 4)
x1[i]=x1[i] - 4;
for (i=1; i < p; i++)
{
x1[i]=x1[i]+2;
if (x1[i] > 4)
x1[i]=x1[i] - 4;
j=0;
for (i=p-1; i > 0; i-)
{
++j;
Search WWH ::




Custom Search