title: Converting 16 bit unsigned int array to 32 bit float array
body: <p>I am using directx 9 with 64bit render targets...I need to read the data on the render target surfaces. Each color component( a,r,g,b ) is encoded with 2 bytes( or 16bits x 4 = 64 ). How do I convert each 16 bit color component to a 32 bit floating point variable? Here is what I've tried:</p>
  
  <pre><code>BYTE *pData = ( BYTE* )renderTargetData;
  
  for( UINT y = 0; y &lt; Height; ++y )
  {
  
     for( UINT x = 0; x &lt; width; ++x )
     {
         // declare 4component vector to hold 4 floats
         D3DXVECTOR4 vColor;
  
         // convert the pixel color from 16 to 32 bits
         D3DXFloat16To32Array( ( FLOAT* )&amp;vColor, ( D3DXFLOAT16* )&amp;pData[ y + 8 * x ], 4 );
      }
  }
  </code></pre>
  
  <p>For some reason this is incorrect...In one case after conversion, where the actual renderTargetData for one pixel is ( 0, 0, 0, 65535 ), I get this result: ( 0, 0, 0, -131008.00 ).</p>