title: How to display HDR picture in Android?
body: <p>I'm doing an android app to decompress, decode and display HDR pictures.<br>
  These HDR pictures use 2 bytes per component (A,R,G,B) so one pixel is represented by a 8 bytes value that can only fit with the long type.  </p>
  
  <p>I'm using android's Bitmap to display picture as they have a constructor allowing to do HDR by using <a href="https://developer.android.com/reference/android/graphics/Bitmap.Config.html#RGBA_F16" rel="noreferrer"><code>Bitmap.Config.RGBA_F16</code></a>:  </p>
  
  <pre><code>int width = 1;
  int height = 1;
  Bitmap image = Bitmap.createBitmap(width, height, Bitmap.Config.RGBA_F16);
  </code></pre>
  
  <p>Unfortunately I can't find any way to fill a pixel of the Bitmap. I use the recommended formula but it cannot be used in the setPixel(x,y,color) method of Bitmap because color has to be a int:  </p>
  
  <pre><code>long color = (A &amp; 0xffff) &lt;&lt; 48 | (B &amp; 0xffff) &lt;&lt; 32 | (G &amp; 0xffff) &lt;&lt; 16 | (R &amp; 0xffff);
  image.setPixel(0,0,color); //Argument type error
  </code></pre>
  
  <p>.<br>
  I have also tried with Color (<a href="https://developer.android.com/reference/android/graphics/Color.html#color-longs" rel="noreferrer">which has a HDR compatible method</a>), Paint and Canvas but no Bitmap method accepts them to set only one pixel.</p>
  
  <p>Thanks for any help!</p>