0

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.

Harold
  • 3
  • 2
  • So, just to be clear... you have the data in the form of a huge matrix or how? I don't understand how you are mapping matrix indices to pixel coordinates, could you explain that a bit more in detail? – nico Oct 04 '11 at 07:19
  • The data is currently in a sequential format, just values in a flat file. I would like to be able to write (and read) this to an image, in the form described. – Harold Oct 04 '11 at 07:43
  • Could you provide a snippet of the data file? – nico Oct 04 '11 at 08:13
  • At the moment it's just flat values. The aim is to generate the matrix, I don't have it yet. – Harold Oct 04 '11 at 08:31

0 Answers0