And get pointer to image bits.
IntPtr input = FreeImage.GetBits(dib);
byte* ptr = (byte*)input.ToPointer();
What is want to do next, is reconstruct first channel value and store it as float;
for (int i2 = 0; i2 < _width; i2++)
{
for (int k = 0; k < _height; k++)
{
byte[] nn = new byte[4];
nn[0] = ptr[(pix * 32)];
nn[1] = ptr[(pix * 32)+ 1];
nn[2] = ptr[(pix * 32)+ 2];
nn[3] = ptr[(pix * 32)+ 3];
float depth = BitConverter.ToInt32(nn,0);
But using this loop, I get out of bit range.
Why?
If channel has 32 bits, I can safely loop through all bits within _width*_height_*32 range?
Pixel bit0per0channel is 96.
Where I might be wrong?