If I have this code in C#:
int index = 10;
float value = 20;
float* pixels = getPixelData();
pixels[index+1] = (byte)(value/256);
pixels[index+0] = (byte)(value & 0xFF);
Then, the question is how to calculate the 'value' if I have:
int index = 10;
pixels[index+1] = X;
pixels[index+0] = Y;
float value = ?