summaryrefslogtreecommitdiffstats
path: root/docs/html/ndk/reference/group___bitmap.jd
blob: 2f2b1999b495d9dbcfc407db3ffde9e13addc1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
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 -->