page.title=Bitmap
page.customHeadTag=<link rel="stylesheet" type="text/css" href="doxygen-dac.css">
@jd:body
<!-- Generated by Doxygen 1.8.6 -->
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Bitmap</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:bitmap_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bitmap_8h.html">bitmap.h</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_android_bitmap_info.html">AndroidBitmapInfo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gafb665ac9fefad34ac5c035f5d1314080"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___bitmap.html#gafb665ac9fefad34ac5c035f5d1314080">ANDROID_BITMAP_RESUT_SUCCESS</a>&#160;&#160;&#160;<a class="el" href="group___bitmap.html#ggadf764cbdea00d65edcd07bb9953ad2b7a07f71cf5c5d4950ac9813ae4bbf6d076">ANDROID_BITMAP_RESULT_SUCCESS</a></td></tr>
<tr class="separator:gafb665ac9fefad34ac5c035f5d1314080"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gadf764cbdea00d65edcd07bb9953ad2b7"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="group___bitmap.html#ggadf764cbdea00d65edcd07bb9953ad2b7a07f71cf5c5d4950ac9813ae4bbf6d076">ANDROID_BITMAP_RESULT_SUCCESS</a> = 0, 
<a class="el" href="group___bitmap.html#ggadf764cbdea00d65edcd07bb9953ad2b7acf7205d1a348d867c63ac2885ce01374">ANDROID_BITMAP_RESULT_BAD_PARAMETER</a> = -1, 
<a class="el" href="group___bitmap.html#ggadf764cbdea00d65edcd07bb9953ad2b7a6b099b9533c38729a6c305f2fe93f98d">ANDROID_BITMAP_RESULT_JNI_EXCEPTION</a> = -2, 
<a class="el" href="group___bitmap.html#ggadf764cbdea00d65edcd07bb9953ad2b7a512f5b95b6b57e78d65502c06391f990">ANDROID_BITMAP_RESULT_ALLOCATION_FAILED</a> = -3
 }</td></tr>
<tr class="separator:gadf764cbdea00d65edcd07bb9953ad2b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaea286a2d4c61ae2abb02b51500499f13"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___bitmap.html#gaea286a2d4c61ae2abb02b51500499f13">AndroidBitmapFormat</a> { <br/>
&#160;&#160;<a class="el" href="group___bitmap.html#ggaea286a2d4c61ae2abb02b51500499f13ac6f0378ea5cfefd9abee2596af5a9021">ANDROID_BITMAP_FORMAT_NONE</a> = 0, 
<a class="el" href="group___bitmap.html#ggaea286a2d4c61ae2abb02b51500499f13ab92ae96ceea06aa534583beadba84057">ANDROID_BITMAP_FORMAT_RGBA_8888</a> = 1, 
<a class="el" href="group___bitmap.html#ggaea286a2d4c61ae2abb02b51500499f13a11b32e10d6db28fae70ec3590cb9ee91">ANDROID_BITMAP_FORMAT_RGB_565</a> = 4, 
<a class="el" href="group___bitmap.html#ggaea286a2d4c61ae2abb02b51500499f13adc2ede06eafe20439271cb8137dc7528">ANDROID_BITMAP_FORMAT_RGBA_4444</a> = 7, 
<br/>
&#160;&#160;<a class="el" href="group___bitmap.html#ggaea286a2d4c61ae2abb02b51500499f13ad29996be25f8f88c96e016a1da5c4bca">ANDROID_BITMAP_FORMAT_A_8</a> = 8
<br/>
 }</td></tr>
<tr class="separator:gaea286a2d4c61ae2abb02b51500499f13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga80292ee39d8a675928e38849742b54bf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___bitmap.html#ga80292ee39d8a675928e38849742b54bf">AndroidBitmap_getInfo</a> (JNIEnv *env, jobject jbitmap, <a class="el" href="struct_android_bitmap_info.html">AndroidBitmapInfo</a> *info)</td></tr>
<tr class="separator:ga80292ee39d8a675928e38849742b54bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2908d42fa4db286c34b7f8c11f29206f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___bitmap.html#ga2908d42fa4db286c34b7f8c11f29206f">AndroidBitmap_lockPixels</a> (JNIEnv *env, jobject jbitmap, void **addrPtr)</td></tr>
<tr class="separator:ga2908d42fa4db286c34b7f8c11f29206f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4aca91f37baddd42d0051dca8179d4ed"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___bitmap.html#ga4aca91f37baddd42d0051dca8179d4ed">AndroidBitmap_unlockPixels</a> (JNIEnv *env, jobject jbitmap)</td></tr>
<tr class="separator:ga4aca91f37baddd42d0051dca8179d4ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gafb665ac9fefad34ac5c035f5d1314080"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ANDROID_BITMAP_RESUT_SUCCESS&#160;&#160;&#160;<a class="el" href="group___bitmap.html#ggadf764cbdea00d65edcd07bb9953ad2b7a07f71cf5c5d4950ac9813ae4bbf6d076">ANDROID_BITMAP_RESULT_SUCCESS</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Backward compatibility: this macro used to be misspelled. </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gadf764cbdea00d65edcd07bb9953ad2b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">anonymous enum</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>AndroidBitmap functions result code. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ggadf764cbdea00d65edcd07bb9953ad2b7a07f71cf5c5d4950ac9813ae4bbf6d076"></a>ANDROID_BITMAP_RESULT_SUCCESS</em>&#160;</td><td class="fielddoc">
<p>Operation was successful. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggadf764cbdea00d65edcd07bb9953ad2b7acf7205d1a348d867c63ac2885ce01374"></a>ANDROID_BITMAP_RESULT_BAD_PARAMETER</em>&#160;</td><td class="fielddoc">
<p>Bad parameter. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggadf764cbdea00d65edcd07bb9953ad2b7a6b099b9533c38729a6c305f2fe93f98d"></a>ANDROID_BITMAP_RESULT_JNI_EXCEPTION</em>&#160;</td><td class="fielddoc">
<p>JNI exception occured. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggadf764cbdea00d65edcd07bb9953ad2b7a512f5b95b6b57e78d65502c06391f990"></a>ANDROID_BITMAP_RESULT_ALLOCATION_FAILED</em>&#160;</td><td class="fielddoc">
<p>Allocation failed. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="gaea286a2d4c61ae2abb02b51500499f13"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___bitmap.html#gaea286a2d4c61ae2abb02b51500499f13">AndroidBitmapFormat</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Bitmap pixel format. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ggaea286a2d4c61ae2abb02b51500499f13ac6f0378ea5cfefd9abee2596af5a9021"></a>ANDROID_BITMAP_FORMAT_NONE</em>&#160;</td><td class="fielddoc">
<p>No format. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaea286a2d4c61ae2abb02b51500499f13ab92ae96ceea06aa534583beadba84057"></a>ANDROID_BITMAP_FORMAT_RGBA_8888</em>&#160;</td><td class="fielddoc">
<p>Red: 8 bits, Green: 8 bits, Blue: 8 bits, Alpha: 8 bits. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaea286a2d4c61ae2abb02b51500499f13a11b32e10d6db28fae70ec3590cb9ee91"></a>ANDROID_BITMAP_FORMAT_RGB_565</em>&#160;</td><td class="fielddoc">
<p>Red: 5 bits, Green: 6 bits, Blue: 5 bits. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaea286a2d4c61ae2abb02b51500499f13adc2ede06eafe20439271cb8137dc7528"></a>ANDROID_BITMAP_FORMAT_RGBA_4444</em>&#160;</td><td class="fielddoc">
<p>Red: 4 bits, Green: 4 bits, Blue: 4 bits, Alpha: 4 bits. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggaea286a2d4c61ae2abb02b51500499f13ad29996be25f8f88c96e016a1da5c4bca"></a>ANDROID_BITMAP_FORMAT_A_8</em>&#160;</td><td class="fielddoc">
<p>Deprecated. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga80292ee39d8a675928e38849742b54bf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AndroidBitmap_getInfo </td>
          <td>(</td>
          <td class="paramtype">JNIEnv *&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jobject&#160;</td>
          <td class="paramname"><em>jbitmap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_android_bitmap_info.html">AndroidBitmapInfo</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Given a java bitmap object, fill out the <a class="el" href="struct_android_bitmap_info.html">AndroidBitmapInfo</a> struct for it. If the call fails, the info parameter will be ignored. </p>

</div>
</div>
<a class="anchor" id="ga2908d42fa4db286c34b7f8c11f29206f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AndroidBitmap_lockPixels </td>
          <td>(</td>
          <td class="paramtype">JNIEnv *&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jobject&#160;</td>
          <td class="paramname"><em>jbitmap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void **&#160;</td>
          <td class="paramname"><em>addrPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Given a java bitmap object, attempt to lock the pixel address. Locking will ensure that the memory for the pixels will not move until the unlockPixels call, and ensure that, if the pixels had been previously purged, they will have been restored.</p>
<p>If this call succeeds, it must be balanced by a call to AndroidBitmap_unlockPixels, after which time the address of the pixels should no longer be used.</p>
<p>If this succeeds, *addrPtr will be set to the pixel address. If the call fails, addrPtr will be ignored. </p>

</div>
</div>
<a class="anchor" id="ga4aca91f37baddd42d0051dca8179d4ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AndroidBitmap_unlockPixels </td>
          <td>(</td>
          <td class="paramtype">JNIEnv *&#160;</td>
          <td class="paramname"><em>env</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">jobject&#160;</td>
          <td class="paramname"><em>jbitmap</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call this to balance a successful call to AndroidBitmap_lockPixels. </p>

</div>
</div>
</div><!-- contents -->