I have a large amount of data that I'd like to be able to read out, pixel by pixel, into a Hilbert Curve using PHP's GD library.
The aim is to create a lookup table of an arbitrary size mapping an address to a point on a pixel grid. eg.
0 1 2 3
+-------------
0 | 0 1 14 15 ->
1 | 3 2 13 12
2 | 4 7 8 11
3 | 5 6 9 10
The eighth sequential address in this example would be 2,2. The end-result lookup table will just consist of points that can be referenced from.
1 - 0,0
2 - 0,1
3 - 1,1
4 - 0,2
I realise there is most certainly an effective way to generate this, I just haven't thought of it yet.