1page.title=RenderScript Object Types 2 3@jd:body 4 5<div class='renderscript'> 6<h2>Overview</h2> 7<p> The types below are used to manipulate RenderScript objects like allocations, samplers, 8elements, and scripts. Most of these object are created using the Java RenderScript APIs. 9</p> 10<h2>Summary</h2> 11<table class='jd-sumtable'><tbody> 12 <tr><th colspan='2'>Types</th></tr> 13 <tr class='alt-color api apilevel-1'> 14 <td class='jd-linkcol'> 15 <a href='rs_object_types.html#android_rs:rs_allocation'>rs_allocation</a> 16 </td> 17 <td class='jd-descrcol' width='100%'> 18 Handle to an allocation 19 </td> 20 </tr> 21 <tr class='alt-color api apilevel-1'> 22 <td class='jd-linkcol'> 23 <a href='rs_object_types.html#android_rs:rs_allocation_cubemap_face'>rs_allocation_cubemap_face</a> 24 </td> 25 <td class='jd-descrcol' width='100%'> 26 Enum for selecting cube map faces 27 </td> 28 </tr> 29 <tr class='alt-color api apilevel-1'> 30 <td class='jd-linkcol'> 31 <a href='rs_object_types.html#android_rs:rs_allocation_usage_type'>rs_allocation_usage_type</a> 32 </td> 33 <td class='jd-descrcol' width='100%'> 34 Bitfield to specify how an allocation is used 35 </td> 36 </tr> 37 <tr class='alt-color api apilevel-1'> 38 <td class='jd-linkcol'> 39 <a href='rs_object_types.html#android_rs:rs_data_kind'>rs_data_kind</a> 40 </td> 41 <td class='jd-descrcol' width='100%'> 42 Element data kind 43 </td> 44 </tr> 45 <tr class='alt-color api apilevel-1'> 46 <td class='jd-linkcol'> 47 <a href='rs_object_types.html#android_rs:rs_data_type'>rs_data_type</a> 48 </td> 49 <td class='jd-descrcol' width='100%'> 50 Element basic data type 51 </td> 52 </tr> 53 <tr class='alt-color api apilevel-1'> 54 <td class='jd-linkcol'> 55 <a href='rs_object_types.html#android_rs:rs_element'>rs_element</a> 56 </td> 57 <td class='jd-descrcol' width='100%'> 58 Handle to an element 59 </td> 60 </tr> 61 <tr class='alt-color api apilevel-1'> 62 <td class='jd-linkcol'> 63 <a href='rs_object_types.html#android_rs:rs_sampler'>rs_sampler</a> 64 </td> 65 <td class='jd-descrcol' width='100%'> 66 Handle to a Sampler 67 </td> 68 </tr> 69 <tr class='alt-color api apilevel-1'> 70 <td class='jd-linkcol'> 71 <a href='rs_object_types.html#android_rs:rs_sampler_value'>rs_sampler_value</a> 72 </td> 73 <td class='jd-descrcol' width='100%'> 74 Sampler wrap T value 75 </td> 76 </tr> 77 <tr class='alt-color api apilevel-1'> 78 <td class='jd-linkcol'> 79 <a href='rs_object_types.html#android_rs:rs_script'>rs_script</a> 80 </td> 81 <td class='jd-descrcol' width='100%'> 82 Handle to a Script 83 </td> 84 </tr> 85 <tr class='alt-color api apilevel-1'> 86 <td class='jd-linkcol'> 87 <a href='rs_object_types.html#android_rs:rs_type'>rs_type</a> 88 </td> 89 <td class='jd-descrcol' width='100%'> 90 Handle to a Type 91 </td> 92 </tr> 93</tbody></table> 94<h2>Types</h2> 95<a name='android_rs:rs_allocation'></a> 96<div class='jd-details'> 97 <h4 class='jd-details-title'> 98 <span class='sympad'>rs_allocation</span> 99 <span class='normal'>: Handle to an allocation</span> 100 </h4> 101 <div class='jd-details-descr'> 102<p></p> 103<p> An opaque handle to a RenderScript allocation. 104</p> 105 106<p> See <a href="http://developer.android.com/reference/android/renderscript/Allocation.html">android.renderscript.Allocation</a>. 107</p> 108 </div> 109</div> 110 111<a name='android_rs:rs_allocation_cubemap_face'></a> 112<div class='jd-details'> 113 <h4 class='jd-details-title'> 114 <span class='sympad'>rs_allocation_cubemap_face</span> 115 <span class='normal'>: Enum for selecting cube map faces</span> 116 </h4> 117 <div class='jd-details-descr'> 118<p>An enum with the following values: 119Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a> 120</p> 121 <table class='jd-tagtable'><tbody> 122 <tr><th>RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0</th><td></td></tr> 123 <tr><th>RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1</th><td></td></tr> 124 <tr><th>RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2</th><td></td></tr> 125 <tr><th>RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3</th><td></td></tr> 126 <tr><th>RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4</th><td></td></tr> 127 <tr><th>RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5</th><td></td></tr> 128 </tbody></table><br/> 129<p> An enum used to specify one the six faces of a cubemap. 130</p> 131 </div> 132</div> 133 134<a name='android_rs:rs_allocation_usage_type'></a> 135<div class='jd-details'> 136 <h4 class='jd-details-title'> 137 <span class='sympad'>rs_allocation_usage_type</span> 138 <span class='normal'>: Bitfield to specify how an allocation is used</span> 139 </h4> 140 <div class='jd-details-descr'> 141<p>An enum with the following values: 142Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a> 143</p> 144 <table class='jd-tagtable'><tbody> 145 <tr><th>RS_ALLOCATION_USAGE_SCRIPT = 0x0001</th><td>Allocation is bound to and accessed by scripts.</td></tr> 146 <tr><th>RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002</th><td>Deprecated.</td></tr> 147 <tr><th>RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004</th><td>Deprecated.</td></tr> 148 <tr><th>RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008</th><td>Deprecated.</td></tr> 149 <tr><th>RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010</th><td>Deprecated.</td></tr> 150 <tr><th>RS_ALLOCATION_USAGE_IO_INPUT = 0x0020</th><td>Allocation is used as a Surface consumer.</td></tr> 151 <tr><th>RS_ALLOCATION_USAGE_IO_OUTPUT = 0x0040</th><td>Allocation is used as a Surface producer.</td></tr> 152 <tr><th>RS_ALLOCATION_USAGE_SHARED = 0x0080</th><td>Allocation's backing store is shared with another object (usually a Bitmap). Copying to or from the original source Bitmap will cause a synchronization rather than a full copy.</td></tr> 153 </tbody></table><br/> 154<p> These values are ORed together to specify which usages or memory spaces are 155relevant to an allocation or an operation on an allocation. 156</p> 157 </div> 158</div> 159 160<a name='android_rs:rs_data_kind'></a> 161<div class='jd-details'> 162 <h4 class='jd-details-title'> 163 <span class='sympad'>rs_data_kind</span> 164 <span class='normal'>: Element data kind</span> 165 </h4> 166 <div class='jd-details-descr'> 167<p>An enum with the following values: 168Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a> 169</p> 170 <table class='jd-tagtable'><tbody> 171 <tr><th>RS_KIND_USER = 0</th><td>No special interpretation.</td></tr> 172 <tr><th>RS_KIND_PIXEL_L = 7</th><td>Luminance.</td></tr> 173 <tr><th>RS_KIND_PIXEL_A = 8</th><td>Alpha.</td></tr> 174 <tr><th>RS_KIND_PIXEL_LA = 9</th><td>Luminance and Alpha.</td></tr> 175 <tr><th>RS_KIND_PIXEL_RGB = 10</th><td>Red, Green, Blue.</td></tr> 176 <tr><th>RS_KIND_PIXEL_RGBA = 11</th><td>Red, Green, Blue, and Alpha.</td></tr> 177 <tr><th>RS_KIND_PIXEL_DEPTH = 12</th><td>Depth for a depth texture.</td></tr> 178 <tr><th>RS_KIND_PIXEL_YUV = 13</th><td>Luminance and chrominance.</td></tr> 179 <tr><th>RS_KIND_INVALID = 100</th><td></td></tr> 180 </tbody></table><br/> 181<p> This enumeration is primarly useful for graphical data. It provides additional information to 182help interpret the rs_data_type. 183</p> 184 185<p> RS_KIND_USER indicates no special interpretation is expected. 186</p> 187 188<p> The RS_KIND_PIXEL_* values are used in conjunction with the standard data types for representing 189texture formats. 190</p> 191 192<p> See the <a href='http://developer.android.com/reference/android/renderscript/Element.html#createPixel(android.renderscript.RenderScript,%20android.renderscript.Element.DataType, android.renderscript.Element.DataKind)'>Element.createPixel()</a> method. 193</p> 194 </div> 195</div> 196 197<a name='android_rs:rs_data_type'></a> 198<div class='jd-details'> 199 <h4 class='jd-details-title'> 200 <span class='sympad'>rs_data_type</span> 201 <span class='normal'>: Element basic data type</span> 202 </h4> 203 <div class='jd-details-descr'> 204<p>An enum with the following values: 205Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a> 206</p> 207 <table class='jd-tagtable'><tbody> 208 <tr><th>RS_TYPE_NONE = 0</th><td>Element is a complex type, i.e. a struct.</td></tr> 209 <tr><th>RS_TYPE_FLOAT_32 = 2</th><td>A 32 bit float point value.</td></tr> 210 <tr><th>RS_TYPE_FLOAT_64 = 3</th><td>A 64 bit floating point value.</td></tr> 211 <tr><th>RS_TYPE_SIGNED_8 = 4</th><td>An 8 bit signed integer.</td></tr> 212 <tr><th>RS_TYPE_SIGNED_16 = 5</th><td>A 16 bit signed integer.</td></tr> 213 <tr><th>RS_TYPE_SIGNED_32 = 6</th><td>A 32 bit signed integer.</td></tr> 214 <tr><th>RS_TYPE_SIGNED_64 = 7</th><td>A 64 bit signed integer.</td></tr> 215 <tr><th>RS_TYPE_UNSIGNED_8 = 8</th><td>An 8 bit unsigned integer.</td></tr> 216 <tr><th>RS_TYPE_UNSIGNED_16 = 9</th><td>A 16 bit unsigned integer.</td></tr> 217 <tr><th>RS_TYPE_UNSIGNED_32 = 10</th><td>A 32 bit unsigned integer.</td></tr> 218 <tr><th>RS_TYPE_UNSIGNED_64 = 11</th><td>A 64 bit unsigned integer.</td></tr> 219 <tr><th>RS_TYPE_BOOLEAN = 12</th><td>0 or 1 (false or true) stored in an 8 bit container.</td></tr> 220 <tr><th>RS_TYPE_UNSIGNED_5_6_5 = 13</th><td>A 16 bit unsigned integer packing graphical data in 5, 6, and 5 bit sections.</td></tr> 221 <tr><th>RS_TYPE_UNSIGNED_5_5_5_1 = 14</th><td>A 16 bit unsigned integer packing graphical data in 5, 5, 5, and 1 bit sections.</td></tr> 222 <tr><th>RS_TYPE_UNSIGNED_4_4_4_4 = 15</th><td>A 16 bit unsigned integer packing graphical data in 4, 4, 4, and 4 bit sections.</td></tr> 223 <tr><th>RS_TYPE_MATRIX_4X4 = 16</th><td>A 4x4 matrix of 32 bit floats, aligned on a 32 bit boundary.</td></tr> 224 <tr><th>RS_TYPE_MATRIX_3X3 = 17</th><td>A 3x3 matrix of 32 bit floats, aligned on a 32 bit boundary.</td></tr> 225 <tr><th>RS_TYPE_MATRIX_2X2 = 18</th><td>A 2x2 matrix of 32 bit floats, aligned on a 32 bit boundary.</td></tr> 226 <tr><th>RS_TYPE_ELEMENT = 1000</th><td>A handle to an Element.</td></tr> 227 <tr><th>RS_TYPE_TYPE = 1001</th><td>A handle to a Type.</td></tr> 228 <tr><th>RS_TYPE_ALLOCATION = 1002</th><td>A handle to an Allocation.</td></tr> 229 <tr><th>RS_TYPE_SAMPLER = 1003</th><td>A handle to a Sampler.</td></tr> 230 <tr><th>RS_TYPE_SCRIPT = 1004</th><td>A handle to a Script.</td></tr> 231 <tr><th>RS_TYPE_MESH = 1005</th><td>Deprecated.</td></tr> 232 <tr><th>RS_TYPE_PROGRAM_FRAGMENT = 1006</th><td>Deprecated.</td></tr> 233 <tr><th>RS_TYPE_PROGRAM_VERTEX = 1007</th><td>Deprecated.</td></tr> 234 <tr><th>RS_TYPE_PROGRAM_RASTER = 1008</th><td>Deprecated.</td></tr> 235 <tr><th>RS_TYPE_PROGRAM_STORE = 1009</th><td>Deprecated.</td></tr> 236 <tr><th>RS_TYPE_FONT = 1010</th><td>Deprecated.</td></tr> 237 <tr><th>RS_TYPE_INVALID = 10000</th><td></td></tr> 238 </tbody></table><br/> 239<p> rs_data_type is used to encode the type information of a basic element. 240</p> 241 242<p> RS_TYPE_UNSIGNED_5_6_5, RS_TYPE_UNSIGNED_5_5_5_1, RS_TYPE_UNSIGNED_4_4_4_4 are for packed 243graphical data formats and represent vectors with per vector member sizes which are treated 244as a single unit for packing and alignment purposes. 245</p> 246 </div> 247</div> 248 249<a name='android_rs:rs_element'></a> 250<div class='jd-details'> 251 <h4 class='jd-details-title'> 252 <span class='sympad'>rs_element</span> 253 <span class='normal'>: Handle to an element</span> 254 </h4> 255 <div class='jd-details-descr'> 256<p></p> 257<p> An opaque handle to a RenderScript element. 258</p> 259 260<p> See <a href="http://developer.android.com/reference/android/renderscript/Element.html">android.renderscript.Element</a>. 261</p> 262 </div> 263</div> 264 265<a name='android_rs:rs_sampler'></a> 266<div class='jd-details'> 267 <h4 class='jd-details-title'> 268 <span class='sympad'>rs_sampler</span> 269 <span class='normal'>: Handle to a Sampler</span> 270 </h4> 271 <div class='jd-details-descr'> 272<p></p> 273<p> An opaque handle to a RenderScript sampler object. 274</p> 275 276<p> See <a href="http://developer.android.com/reference/android/renderscript/Sampler.html">android.renderscript.Sampler</a>. 277</p> 278 </div> 279</div> 280 281<a name='android_rs:rs_sampler_value'></a> 282<div class='jd-details'> 283 <h4 class='jd-details-title'> 284 <span class='sympad'>rs_sampler_value</span> 285 <span class='normal'>: Sampler wrap T value</span> 286 </h4> 287 <div class='jd-details-descr'> 288<p>An enum with the following values: 289Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 16</a> 290</p> 291 <table class='jd-tagtable'><tbody> 292 <tr><th>RS_SAMPLER_NEAREST = 0</th><td></td></tr> 293 <tr><th>RS_SAMPLER_LINEAR = 1</th><td></td></tr> 294 <tr><th>RS_SAMPLER_LINEAR_MIP_LINEAR = 2</th><td></td></tr> 295 <tr><th>RS_SAMPLER_WRAP = 3</th><td></td></tr> 296 <tr><th>RS_SAMPLER_CLAMP = 4</th><td></td></tr> 297 <tr><th>RS_SAMPLER_LINEAR_MIP_NEAREST = 5</th><td></td></tr> 298 <tr><th>RS_SAMPLER_MIRRORED_REPEAT = 6</th><td></td></tr> 299 <tr><th>RS_SAMPLER_INVALID = 100</th><td></td></tr> 300 </tbody></table><br/> 301 </div> 302</div> 303 304<a name='android_rs:rs_script'></a> 305<div class='jd-details'> 306 <h4 class='jd-details-title'> 307 <span class='sympad'>rs_script</span> 308 <span class='normal'>: Handle to a Script</span> 309 </h4> 310 <div class='jd-details-descr'> 311<p></p> 312<p> An opaque handle to a RenderScript script object. 313</p> 314 315<p> See <a href="http://developer.android.com/reference/android/renderscript/ScriptC.html">android.renderscript.ScriptC</a>. 316</p> 317 </div> 318</div> 319 320<a name='android_rs:rs_type'></a> 321<div class='jd-details'> 322 <h4 class='jd-details-title'> 323 <span class='sympad'>rs_type</span> 324 <span class='normal'>: Handle to a Type</span> 325 </h4> 326 <div class='jd-details-descr'> 327<p></p> 328<p> An opaque handle to a RenderScript type. 329</p> 330 331<p> See <a href="http://developer.android.com/reference/android/renderscript/Type.html">android.renderscript.Type</a>. 332</p> 333 </div> 334</div> 335 336</div> 337