blob: 68723109ac9f885a684a29b1f61ed6c5d8b36283 [file] [log] [blame]
Jason Sams36e612a2009-07-31 16:26:13 -07001/*
Stephen Hines3beb60e2012-02-14 20:38:20 -08002 * Copyright (C) 2008-2012 The Android Open Source Project
Jason Sams36e612a2009-07-31 16:26:13 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.renderscript;
18
Jason Sams43ee06852009-08-12 17:54:11 -070019import java.lang.reflect.Field;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -070020import android.util.Log;
Jason Sams36e612a2009-07-31 16:26:13 -070021
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -070022/** @deprecated renderscript is deprecated in J
Robert Ly11518ac2011-02-09 13:57:06 -080023 * <p>The most basic data type. An element represents one cell of a memory allocation.
Alex Sakhartchouk34769772011-02-28 16:01:28 -080024 * Element is the basic data type of Renderscript. An element can be of two forms: Basic elements or Complex forms.
Robert Ly11518ac2011-02-09 13:57:06 -080025 * Examples of basic elements are:</p>
26 * <ul>
27 * <li>Single float value</li>
28 * <li>4 element float vector</li>
29 * <li>single RGB-565 color</li>
30 * <li>single unsigned int 16</li>
31 * </ul>
Alex Sakhartchouk34769772011-02-28 16:01:28 -080032 * <p>Complex elements contain a list of sub-elements and names that
Robert Ly11518ac2011-02-09 13:57:06 -080033 * represents a structure of data. The fields can be accessed by name
34 * from a script or shader. The memory layout is defined and ordered. Data
Stephen Hinesf257e512011-06-14 14:54:29 -070035 * alignment is determined by the most basic primitive type. i.e. a float4
36 * vector will be aligned to sizeof(float) and not sizeof(float4). The
Jason Samsa1b13ed2010-11-12 14:58:37 -080037 * ordering of elements in memory will be the order in which they were added
Robert Ly11518ac2011-02-09 13:57:06 -080038 * with each component aligned as necessary. No re-ordering will be done.</p>
Jason Samsa1b13ed2010-11-12 14:58:37 -080039 *
Robert Ly11518ac2011-02-09 13:57:06 -080040 * <p>The primary source of elements are from scripts. A script that exports a
41 * bind point for a data structure generates a Renderscript element to represent the
42 * data exported by the script. The other common source of elements is from bitmap formats.</p>
Joe Fernandez3aef8e1d2011-12-20 10:38:34 -080043 *
44 * <div class="special reference">
45 * <h3>Developer Guides</h3>
46 * <p>For more information about creating an application that uses Renderscript, read the
47 * <a href="{@docRoot}guide/topics/graphics/renderscript.html">Renderscript</a> developer guide.</p>
48 * </div>
Jason Sams36e612a2009-07-31 16:26:13 -070049 **/
50public class Element extends BaseObj {
Jason Samsea84a7c2009-09-04 14:42:41 -070051 int mSize;
Jason Sams718cd1f2009-12-23 14:35:29 -080052 Element[] mElements;
53 String[] mElementNames;
Jason Sams70d4e502010-09-02 17:35:23 -070054 int[] mArraySizes;
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -070055 int[] mOffsetInBytes;
Jason Sams36e612a2009-07-31 16:26:13 -070056
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -080057 int[] mVisibleElementMap;
58
Jason Sams718cd1f2009-12-23 14:35:29 -080059 DataType mType;
60 DataKind mKind;
61 boolean mNormalized;
62 int mVectorSize;
Jason Sams768bc022009-09-21 19:41:04 -070063
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -080064 private void updateVisibleSubElements() {
65 if (mElements == null) {
66 return;
67 }
68
69 int noPaddingFieldCount = 0;
70 int fieldCount = mElementNames.length;
71 // Find out how many elements are not padding
72 for (int ct = 0; ct < fieldCount; ct ++) {
73 if (mElementNames[ct].charAt(0) != '#') {
74 noPaddingFieldCount ++;
75 }
76 }
77 mVisibleElementMap = new int[noPaddingFieldCount];
78
79 // Make a map that points us at non-padding elements
80 for (int ct = 0, ctNoPadding = 0; ct < fieldCount; ct ++) {
81 if (mElementNames[ct].charAt(0) != '#') {
82 mVisibleElementMap[ctNoPadding ++] = ct;
83 }
84 }
85 }
86
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -070087 /** @hide renderscript is deprecated in J
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -070088 * @return element size in bytes
89 */
Alex Sakhartchouk918e8402012-04-11 14:04:23 -070090 public int getBytesSize() {return mSize;}
Jason Sams36e612a2009-07-31 16:26:13 -070091
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -070092 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -070093 * Returns the number of vector components. 2 for float2, 4 for
94 * float4, etc.
Alex Sakhartchoukfd79e022011-12-22 14:30:55 -080095 * @return element vector size
96 */
97 public int getVectorSize() {return mVectorSize;}
98
Jason Samsa1b13ed2010-11-12 14:58:37 -080099
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700100 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800101 * DataType represents the basic type information for a basic element. The
Alex Sakhartchoukf5d8ac72011-12-16 09:44:26 -0800102 * naming convention follows. For numeric types it is FLOAT,
103 * SIGNED, or UNSIGNED followed by the _BITS where BITS is the
104 * size of the data. BOOLEAN is a true / false (1,0)
105 * represented in an 8 bit container. The UNSIGNED variants
106 * with multiple bit definitions are for packed graphical data
107 * formats and represent vectors with per vector member sizes
108 * which are treated as a single unit for packing and alignment
109 * purposes.
Jason Samsa1b13ed2010-11-12 14:58:37 -0800110 *
111 * MATRIX the three matrix types contain FLOAT_32 elements and are treated
112 * as 32 bits for alignment purposes.
113 *
114 * RS_* objects. 32 bit opaque handles.
115 */
Jason Sams36e612a2009-07-31 16:26:13 -0700116 public enum DataType {
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700117 /** @hide
118 */
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800119 NONE (0, 0),
Jason Sams718cd1f2009-12-23 14:35:29 -0800120 //FLOAT_16 (1, 2),
121 FLOAT_32 (2, 4),
Stephen Hines02f417052010-09-30 15:19:22 -0700122 FLOAT_64 (3, 8),
Jason Sams718cd1f2009-12-23 14:35:29 -0800123 SIGNED_8 (4, 1),
124 SIGNED_16 (5, 2),
125 SIGNED_32 (6, 4),
Stephen Hinesef1dac22010-10-01 15:39:33 -0700126 SIGNED_64 (7, 8),
Jason Sams718cd1f2009-12-23 14:35:29 -0800127 UNSIGNED_8 (8, 1),
128 UNSIGNED_16 (9, 2),
129 UNSIGNED_32 (10, 4),
Stephen Hines52d83632010-10-11 16:10:42 -0700130 UNSIGNED_64 (11, 8),
Jason Sams718cd1f2009-12-23 14:35:29 -0800131
Jason Samsf110d4b2010-06-21 17:42:41 -0700132 BOOLEAN(12, 1),
Jason Sams718cd1f2009-12-23 14:35:29 -0800133
Jason Samsf110d4b2010-06-21 17:42:41 -0700134 UNSIGNED_5_6_5 (13, 2),
135 UNSIGNED_5_5_5_1 (14, 2),
136 UNSIGNED_4_4_4_4 (15, 2),
137
Jason Sams1d45c472010-08-25 14:31:48 -0700138 MATRIX_4X4 (16, 64),
139 MATRIX_3X3 (17, 36),
140 MATRIX_2X2 (18, 16),
141
142 RS_ELEMENT (1000, 4),
143 RS_TYPE (1001, 4),
144 RS_ALLOCATION (1002, 4),
145 RS_SAMPLER (1003, 4),
146 RS_SCRIPT (1004, 4),
147 RS_MESH (1005, 4),
148 RS_PROGRAM_FRAGMENT (1006, 4),
149 RS_PROGRAM_VERTEX (1007, 4),
150 RS_PROGRAM_RASTER (1008, 4),
Stephen Hines3a291412012-04-11 17:27:29 -0700151 RS_PROGRAM_STORE (1009, 4),
152 RS_FONT (1010, 4);
Jason Sams36e612a2009-07-31 16:26:13 -0700153
154 int mID;
Jason Sams718cd1f2009-12-23 14:35:29 -0800155 int mSize;
156 DataType(int id, int size) {
Jason Sams36e612a2009-07-31 16:26:13 -0700157 mID = id;
Jason Sams718cd1f2009-12-23 14:35:29 -0800158 mSize = size;
Jason Sams36e612a2009-07-31 16:26:13 -0700159 }
160 }
161
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700162 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800163 * The special interpretation of the data if required. This is primarly
164 * useful for graphical data. USER indicates no special interpretation is
165 * expected. PIXEL is used in conjunction with the standard data types for
166 * representing texture formats.
167 */
Jason Sams36e612a2009-07-31 16:26:13 -0700168 public enum DataKind {
169 USER (0),
Jason Sams718cd1f2009-12-23 14:35:29 -0800170
171 PIXEL_L (7),
172 PIXEL_A (8),
173 PIXEL_LA (9),
174 PIXEL_RGB (10),
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700175 PIXEL_RGBA (11),
176 PIXEL_DEPTH (12);
Jason Sams36e612a2009-07-31 16:26:13 -0700177
178 int mID;
179 DataKind(int id) {
180 mID = id;
181 }
182 }
183
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700184 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800185 * Return if a element is too complex for use as a data source for a Mesh or
186 * a Program.
187 *
188 * @return boolean
189 */
Jason Samsc1d62102010-11-04 14:32:19 -0700190 public boolean isComplex() {
191 if (mElements == null) {
192 return false;
193 }
194 for (int ct=0; ct < mElements.length; ct++) {
195 if (mElements[ct].mElements != null) {
196 return true;
197 }
198 }
199 return false;
200 }
201
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700202 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700203 * Elements could be simple, such as an int or a float, or a
204 * structure with multiple sub elements, such as a collection of
205 * floats, float2, float4. This function returns zero for simple
206 * elements or the number of sub-elements otherwise.
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700207 * @return number of sub-elements in this element
208 */
209 public int getSubElementCount() {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800210 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700211 return 0;
212 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800213 return mVisibleElementMap.length;
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700214 }
215
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700216 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700217 * For complex elements, this function will return the
218 * sub-element at index
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700219 * @param index index of the sub-element to return
220 * @return sub-element in this element at given index
221 */
222 public Element getSubElement(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800223 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700224 throw new RSIllegalArgumentException("Element contains no sub-elements");
225 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800226 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700227 throw new RSIllegalArgumentException("Illegal sub-element index");
228 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800229 return mElements[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700230 }
231
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700232 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700233 * For complex elements, this function will return the
234 * sub-element name at index
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700235 * @param index index of the sub-element
236 * @return sub-element in this element at given index
237 */
238 public String getSubElementName(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800239 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700240 throw new RSIllegalArgumentException("Element contains no sub-elements");
241 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800242 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700243 throw new RSIllegalArgumentException("Illegal sub-element index");
244 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800245 return mElementNames[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700246 }
247
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700248 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700249 * For complex elements, some sub-elements could be statically
250 * sized arrays. This function will return the array size for
251 * sub-element at index
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700252 * @param index index of the sub-element
253 * @return array size of sub-element in this element at given index
254 */
255 public int getSubElementArraySize(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800256 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700257 throw new RSIllegalArgumentException("Element contains no sub-elements");
258 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800259 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700260 throw new RSIllegalArgumentException("Illegal sub-element index");
261 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800262 return mArraySizes[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700263 }
264
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700265 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700266 * This function specifies the location of a sub-element within
267 * the element
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700268 * @param index index of the sub-element
269 * @return offset in bytes of sub-element in this element at given index
270 */
271 public int getSubElementOffsetBytes(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800272 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700273 throw new RSIllegalArgumentException("Element contains no sub-elements");
274 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800275 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700276 throw new RSIllegalArgumentException("Illegal sub-element index");
277 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800278 return mOffsetInBytes[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700279 }
280
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700281 /** @hide renderscript is deprecated in J
Alex Sakhartchoukf5d8ac72011-12-16 09:44:26 -0800282 * @return element data type
283 */
284 public DataType getDataType() {
285 return mType;
286 }
287
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700288 /** @hide renderscript is deprecated in J
Alex Sakhartchoukf5d8ac72011-12-16 09:44:26 -0800289 * @return element data kind
290 */
291 public DataKind getDataKind() {
292 return mKind;
293 }
294
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700295 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800296 * Utility function for returning an Element containing a single Boolean.
297 *
298 * @param rs Context to which the element will belong.
299 *
300 * @return Element
301 */
Jason Samsf110d4b2010-06-21 17:42:41 -0700302 public static Element BOOLEAN(RenderScript rs) {
303 if(rs.mElement_BOOLEAN == null) {
304 rs.mElement_BOOLEAN = createUser(rs, DataType.BOOLEAN);
305 }
306 return rs.mElement_BOOLEAN;
307 }
308
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700309 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800310 * Utility function for returning an Element containing a single UNSIGNED_8.
311 *
312 * @param rs Context to which the element will belong.
313 *
314 * @return Element
315 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700316 public static Element U8(RenderScript rs) {
317 if(rs.mElement_U8 == null) {
318 rs.mElement_U8 = createUser(rs, DataType.UNSIGNED_8);
Jason Sams718cd1f2009-12-23 14:35:29 -0800319 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700320 return rs.mElement_U8;
Jason Sams718cd1f2009-12-23 14:35:29 -0800321 }
322
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700323 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800324 * Utility function for returning an Element containing a single SIGNED_8.
325 *
326 * @param rs Context to which the element will belong.
327 *
328 * @return Element
329 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700330 public static Element I8(RenderScript rs) {
331 if(rs.mElement_I8 == null) {
332 rs.mElement_I8 = createUser(rs, DataType.SIGNED_8);
Jason Sams718cd1f2009-12-23 14:35:29 -0800333 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700334 return rs.mElement_I8;
Jason Sams718cd1f2009-12-23 14:35:29 -0800335 }
336
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700337 /** @deprecated renderscript is deprecated in J
338 */
Jason Samse29f3e72010-06-08 15:40:48 -0700339 public static Element U16(RenderScript rs) {
340 if(rs.mElement_U16 == null) {
341 rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16);
342 }
343 return rs.mElement_U16;
344 }
345
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700346 /** @deprecated renderscript is deprecated in J
347 */
Jason Samse29f3e72010-06-08 15:40:48 -0700348 public static Element I16(RenderScript rs) {
349 if(rs.mElement_I16 == null) {
350 rs.mElement_I16 = createUser(rs, DataType.SIGNED_16);
351 }
352 return rs.mElement_I16;
353 }
354
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700355 /** @deprecated renderscript is deprecated in J
356 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700357 public static Element U32(RenderScript rs) {
358 if(rs.mElement_U32 == null) {
359 rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32);
Jason Sams718cd1f2009-12-23 14:35:29 -0800360 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700361 return rs.mElement_U32;
Jason Sams718cd1f2009-12-23 14:35:29 -0800362 }
363
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700364 /** @deprecated renderscript is deprecated in J
365 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700366 public static Element I32(RenderScript rs) {
367 if(rs.mElement_I32 == null) {
368 rs.mElement_I32 = createUser(rs, DataType.SIGNED_32);
Jason Sams718cd1f2009-12-23 14:35:29 -0800369 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700370 return rs.mElement_I32;
Jason Sams718cd1f2009-12-23 14:35:29 -0800371 }
372
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700373 /** @deprecated renderscript is deprecated in J
374 */
Stephen Hines52d83632010-10-11 16:10:42 -0700375 public static Element U64(RenderScript rs) {
376 if(rs.mElement_U64 == null) {
377 rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64);
378 }
379 return rs.mElement_U64;
380 }
381
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700382 /** @deprecated renderscript is deprecated in J
383 */
Stephen Hinesef1dac22010-10-01 15:39:33 -0700384 public static Element I64(RenderScript rs) {
385 if(rs.mElement_I64 == null) {
386 rs.mElement_I64 = createUser(rs, DataType.SIGNED_64);
387 }
388 return rs.mElement_I64;
389 }
390
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700391 /** @deprecated renderscript is deprecated in J
392 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700393 public static Element F32(RenderScript rs) {
394 if(rs.mElement_F32 == null) {
395 rs.mElement_F32 = createUser(rs, DataType.FLOAT_32);
Jason Sams718cd1f2009-12-23 14:35:29 -0800396 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700397 return rs.mElement_F32;
Jason Sams718cd1f2009-12-23 14:35:29 -0800398 }
399
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700400 /** @deprecated renderscript is deprecated in J
401 */
Stephen Hines02f417052010-09-30 15:19:22 -0700402 public static Element F64(RenderScript rs) {
403 if(rs.mElement_F64 == null) {
404 rs.mElement_F64 = createUser(rs, DataType.FLOAT_64);
405 }
406 return rs.mElement_F64;
407 }
408
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700409 /** @deprecated renderscript is deprecated in J
410 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700411 public static Element ELEMENT(RenderScript rs) {
412 if(rs.mElement_ELEMENT == null) {
413 rs.mElement_ELEMENT = createUser(rs, DataType.RS_ELEMENT);
Jason Samsa70f4162010-03-26 15:33:42 -0700414 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700415 return rs.mElement_ELEMENT;
Jason Samsa70f4162010-03-26 15:33:42 -0700416 }
417
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700418 /** @deprecated renderscript is deprecated in J
419 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700420 public static Element TYPE(RenderScript rs) {
421 if(rs.mElement_TYPE == null) {
422 rs.mElement_TYPE = createUser(rs, DataType.RS_TYPE);
Jason Samsa70f4162010-03-26 15:33:42 -0700423 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700424 return rs.mElement_TYPE;
Jason Samsa70f4162010-03-26 15:33:42 -0700425 }
426
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700427 /** @deprecated renderscript is deprecated in J
428 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700429 public static Element ALLOCATION(RenderScript rs) {
430 if(rs.mElement_ALLOCATION == null) {
431 rs.mElement_ALLOCATION = createUser(rs, DataType.RS_ALLOCATION);
Jason Samsa70f4162010-03-26 15:33:42 -0700432 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700433 return rs.mElement_ALLOCATION;
Jason Samsa70f4162010-03-26 15:33:42 -0700434 }
435
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700436 /** @deprecated renderscript is deprecated in J
437 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700438 public static Element SAMPLER(RenderScript rs) {
439 if(rs.mElement_SAMPLER == null) {
440 rs.mElement_SAMPLER = createUser(rs, DataType.RS_SAMPLER);
Jason Samsa70f4162010-03-26 15:33:42 -0700441 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700442 return rs.mElement_SAMPLER;
Jason Samsa70f4162010-03-26 15:33:42 -0700443 }
444
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700445 /** @deprecated renderscript is deprecated in J
446 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700447 public static Element SCRIPT(RenderScript rs) {
448 if(rs.mElement_SCRIPT == null) {
449 rs.mElement_SCRIPT = createUser(rs, DataType.RS_SCRIPT);
Jason Samsa70f4162010-03-26 15:33:42 -0700450 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700451 return rs.mElement_SCRIPT;
Jason Samsa70f4162010-03-26 15:33:42 -0700452 }
453
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700454 /** @deprecated renderscript is deprecated in J
455 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700456 public static Element MESH(RenderScript rs) {
457 if(rs.mElement_MESH == null) {
458 rs.mElement_MESH = createUser(rs, DataType.RS_MESH);
Jason Samsa70f4162010-03-26 15:33:42 -0700459 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700460 return rs.mElement_MESH;
Jason Samsa70f4162010-03-26 15:33:42 -0700461 }
462
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700463 /** @deprecated renderscript is deprecated in J
464 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700465 public static Element PROGRAM_FRAGMENT(RenderScript rs) {
466 if(rs.mElement_PROGRAM_FRAGMENT == null) {
467 rs.mElement_PROGRAM_FRAGMENT = createUser(rs, DataType.RS_PROGRAM_FRAGMENT);
Jason Samsa70f4162010-03-26 15:33:42 -0700468 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700469 return rs.mElement_PROGRAM_FRAGMENT;
Jason Samsa70f4162010-03-26 15:33:42 -0700470 }
471
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700472 /** @deprecated renderscript is deprecated in J
473 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700474 public static Element PROGRAM_VERTEX(RenderScript rs) {
475 if(rs.mElement_PROGRAM_VERTEX == null) {
476 rs.mElement_PROGRAM_VERTEX = createUser(rs, DataType.RS_PROGRAM_VERTEX);
Jason Samsa70f4162010-03-26 15:33:42 -0700477 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700478 return rs.mElement_PROGRAM_VERTEX;
Jason Samsa70f4162010-03-26 15:33:42 -0700479 }
480
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700481 /** @deprecated renderscript is deprecated in J
482 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700483 public static Element PROGRAM_RASTER(RenderScript rs) {
484 if(rs.mElement_PROGRAM_RASTER == null) {
485 rs.mElement_PROGRAM_RASTER = createUser(rs, DataType.RS_PROGRAM_RASTER);
Jason Samsa70f4162010-03-26 15:33:42 -0700486 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700487 return rs.mElement_PROGRAM_RASTER;
Jason Samsa70f4162010-03-26 15:33:42 -0700488 }
489
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700490 /** @deprecated renderscript is deprecated in J
491 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700492 public static Element PROGRAM_STORE(RenderScript rs) {
493 if(rs.mElement_PROGRAM_STORE == null) {
494 rs.mElement_PROGRAM_STORE = createUser(rs, DataType.RS_PROGRAM_STORE);
Jason Samsa70f4162010-03-26 15:33:42 -0700495 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700496 return rs.mElement_PROGRAM_STORE;
Jason Samsa70f4162010-03-26 15:33:42 -0700497 }
498
Stephen Hines9da1b5d2012-04-30 16:36:04 -0700499 /** @deprecated renderscript is deprecated in J
500 */
Stephen Hines3a291412012-04-11 17:27:29 -0700501 public static Element FONT(RenderScript rs) {
502 if(rs.mElement_FONT == null) {
503 rs.mElement_FONT = createUser(rs, DataType.RS_FONT);
504 }
505 return rs.mElement_FONT;
506 }
507
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700508 /** @deprecated renderscript is deprecated in J
509 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800510 public static Element A_8(RenderScript rs) {
511 if(rs.mElement_A_8 == null) {
512 rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A);
513 }
514 return rs.mElement_A_8;
515 }
516
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700517 /** @deprecated renderscript is deprecated in J
518 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800519 public static Element RGB_565(RenderScript rs) {
520 if(rs.mElement_RGB_565 == null) {
521 rs.mElement_RGB_565 = createPixel(rs, DataType.UNSIGNED_5_6_5, DataKind.PIXEL_RGB);
522 }
523 return rs.mElement_RGB_565;
524 }
525
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700526 /** @deprecated renderscript is deprecated in J
527 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800528 public static Element RGB_888(RenderScript rs) {
529 if(rs.mElement_RGB_888 == null) {
530 rs.mElement_RGB_888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGB);
531 }
532 return rs.mElement_RGB_888;
533 }
534
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700535 /** @deprecated renderscript is deprecated in J
536 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800537 public static Element RGBA_5551(RenderScript rs) {
538 if(rs.mElement_RGBA_5551 == null) {
539 rs.mElement_RGBA_5551 = createPixel(rs, DataType.UNSIGNED_5_5_5_1, DataKind.PIXEL_RGBA);
540 }
541 return rs.mElement_RGBA_5551;
542 }
543
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700544 /** @deprecated renderscript is deprecated in J
545 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800546 public static Element RGBA_4444(RenderScript rs) {
547 if(rs.mElement_RGBA_4444 == null) {
548 rs.mElement_RGBA_4444 = createPixel(rs, DataType.UNSIGNED_4_4_4_4, DataKind.PIXEL_RGBA);
549 }
550 return rs.mElement_RGBA_4444;
551 }
552
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700553 /** @deprecated renderscript is deprecated in J
554 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800555 public static Element RGBA_8888(RenderScript rs) {
556 if(rs.mElement_RGBA_8888 == null) {
557 rs.mElement_RGBA_8888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGBA);
558 }
559 return rs.mElement_RGBA_8888;
560 }
561
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700562 /** @deprecated renderscript is deprecated in J
563 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700564 public static Element F32_2(RenderScript rs) {
565 if(rs.mElement_FLOAT_2 == null) {
566 rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2);
Jason Sams718cd1f2009-12-23 14:35:29 -0800567 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700568 return rs.mElement_FLOAT_2;
Jason Sams718cd1f2009-12-23 14:35:29 -0800569 }
570
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700571 /** @deprecated renderscript is deprecated in J
572 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700573 public static Element F32_3(RenderScript rs) {
574 if(rs.mElement_FLOAT_3 == null) {
575 rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_32, 3);
Jason Sams718cd1f2009-12-23 14:35:29 -0800576 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700577 return rs.mElement_FLOAT_3;
Jason Sams718cd1f2009-12-23 14:35:29 -0800578 }
579
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700580 /** @deprecated renderscript is deprecated in J
581 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700582 public static Element F32_4(RenderScript rs) {
583 if(rs.mElement_FLOAT_4 == null) {
584 rs.mElement_FLOAT_4 = createVector(rs, DataType.FLOAT_32, 4);
Jason Sams718cd1f2009-12-23 14:35:29 -0800585 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700586 return rs.mElement_FLOAT_4;
Jason Sams718cd1f2009-12-23 14:35:29 -0800587 }
588
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700589 /** @deprecated renderscript is deprecated in J
590 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700591 public static Element F64_2(RenderScript rs) {
592 if(rs.mElement_DOUBLE_2 == null) {
593 rs.mElement_DOUBLE_2 = createVector(rs, DataType.FLOAT_64, 2);
594 }
595 return rs.mElement_DOUBLE_2;
596 }
597
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700598 /** @deprecated renderscript is deprecated in J
599 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700600 public static Element F64_3(RenderScript rs) {
601 if(rs.mElement_DOUBLE_3 == null) {
602 rs.mElement_DOUBLE_3 = createVector(rs, DataType.FLOAT_64, 3);
603 }
604 return rs.mElement_DOUBLE_3;
605 }
606
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700607 /** @deprecated renderscript is deprecated in J
608 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700609 public static Element F64_4(RenderScript rs) {
610 if(rs.mElement_DOUBLE_4 == null) {
611 rs.mElement_DOUBLE_4 = createVector(rs, DataType.FLOAT_64, 4);
612 }
613 return rs.mElement_DOUBLE_4;
614 }
615
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700616 /** @deprecated renderscript is deprecated in J
617 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700618 public static Element U8_2(RenderScript rs) {
619 if(rs.mElement_UCHAR_2 == null) {
620 rs.mElement_UCHAR_2 = createVector(rs, DataType.UNSIGNED_8, 2);
621 }
622 return rs.mElement_UCHAR_2;
623 }
624
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700625 /** @deprecated renderscript is deprecated in J
626 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700627 public static Element U8_3(RenderScript rs) {
628 if(rs.mElement_UCHAR_3 == null) {
629 rs.mElement_UCHAR_3 = createVector(rs, DataType.UNSIGNED_8, 3);
630 }
631 return rs.mElement_UCHAR_3;
632 }
633
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700634 /** @deprecated renderscript is deprecated in J
635 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700636 public static Element U8_4(RenderScript rs) {
637 if(rs.mElement_UCHAR_4 == null) {
638 rs.mElement_UCHAR_4 = createVector(rs, DataType.UNSIGNED_8, 4);
Jason Sams718cd1f2009-12-23 14:35:29 -0800639 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700640 return rs.mElement_UCHAR_4;
Jason Sams718cd1f2009-12-23 14:35:29 -0800641 }
642
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700643 /** @deprecated renderscript is deprecated in J
644 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700645 public static Element I8_2(RenderScript rs) {
646 if(rs.mElement_CHAR_2 == null) {
647 rs.mElement_CHAR_2 = createVector(rs, DataType.SIGNED_8, 2);
648 }
649 return rs.mElement_CHAR_2;
650 }
651
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700652 /** @deprecated renderscript is deprecated in J
653 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700654 public static Element I8_3(RenderScript rs) {
655 if(rs.mElement_CHAR_3 == null) {
656 rs.mElement_CHAR_3 = createVector(rs, DataType.SIGNED_8, 3);
657 }
658 return rs.mElement_CHAR_3;
659 }
660
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700661 /** @deprecated renderscript is deprecated in J
662 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700663 public static Element I8_4(RenderScript rs) {
664 if(rs.mElement_CHAR_4 == null) {
665 rs.mElement_CHAR_4 = createVector(rs, DataType.SIGNED_8, 4);
666 }
667 return rs.mElement_CHAR_4;
668 }
669
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700670 /** @deprecated renderscript is deprecated in J
671 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700672 public static Element U16_2(RenderScript rs) {
673 if(rs.mElement_USHORT_2 == null) {
674 rs.mElement_USHORT_2 = createVector(rs, DataType.UNSIGNED_16, 2);
675 }
676 return rs.mElement_USHORT_2;
677 }
678
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700679 /** @deprecated renderscript is deprecated in J
680 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700681 public static Element U16_3(RenderScript rs) {
682 if(rs.mElement_USHORT_3 == null) {
683 rs.mElement_USHORT_3 = createVector(rs, DataType.UNSIGNED_16, 3);
684 }
685 return rs.mElement_USHORT_3;
686 }
687
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700688 /** @deprecated renderscript is deprecated in J
689 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700690 public static Element U16_4(RenderScript rs) {
691 if(rs.mElement_USHORT_4 == null) {
692 rs.mElement_USHORT_4 = createVector(rs, DataType.UNSIGNED_16, 4);
693 }
694 return rs.mElement_USHORT_4;
695 }
696
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700697 /** @deprecated renderscript is deprecated in J
698 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700699 public static Element I16_2(RenderScript rs) {
700 if(rs.mElement_SHORT_2 == null) {
701 rs.mElement_SHORT_2 = createVector(rs, DataType.SIGNED_16, 2);
702 }
703 return rs.mElement_SHORT_2;
704 }
705
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700706 /** @deprecated renderscript is deprecated in J
707 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700708 public static Element I16_3(RenderScript rs) {
709 if(rs.mElement_SHORT_3 == null) {
710 rs.mElement_SHORT_3 = createVector(rs, DataType.SIGNED_16, 3);
711 }
712 return rs.mElement_SHORT_3;
713 }
714
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700715 /** @deprecated renderscript is deprecated in J
716 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700717 public static Element I16_4(RenderScript rs) {
718 if(rs.mElement_SHORT_4 == null) {
719 rs.mElement_SHORT_4 = createVector(rs, DataType.SIGNED_16, 4);
720 }
721 return rs.mElement_SHORT_4;
722 }
723
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700724 /** @deprecated renderscript is deprecated in J
725 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700726 public static Element U32_2(RenderScript rs) {
727 if(rs.mElement_UINT_2 == null) {
728 rs.mElement_UINT_2 = createVector(rs, DataType.UNSIGNED_32, 2);
729 }
730 return rs.mElement_UINT_2;
731 }
732
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700733 /** @deprecated renderscript is deprecated in J
734 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700735 public static Element U32_3(RenderScript rs) {
736 if(rs.mElement_UINT_3 == null) {
737 rs.mElement_UINT_3 = createVector(rs, DataType.UNSIGNED_32, 3);
738 }
739 return rs.mElement_UINT_3;
740 }
741
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700742 /** @deprecated renderscript is deprecated in J
743 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700744 public static Element U32_4(RenderScript rs) {
745 if(rs.mElement_UINT_4 == null) {
746 rs.mElement_UINT_4 = createVector(rs, DataType.UNSIGNED_32, 4);
747 }
748 return rs.mElement_UINT_4;
749 }
750
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700751 /** @deprecated renderscript is deprecated in J
752 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700753 public static Element I32_2(RenderScript rs) {
754 if(rs.mElement_INT_2 == null) {
755 rs.mElement_INT_2 = createVector(rs, DataType.SIGNED_32, 2);
756 }
757 return rs.mElement_INT_2;
758 }
759
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700760 /** @deprecated renderscript is deprecated in J
761 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700762 public static Element I32_3(RenderScript rs) {
763 if(rs.mElement_INT_3 == null) {
764 rs.mElement_INT_3 = createVector(rs, DataType.SIGNED_32, 3);
765 }
766 return rs.mElement_INT_3;
767 }
768
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700769 /** @deprecated renderscript is deprecated in J
770 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700771 public static Element I32_4(RenderScript rs) {
772 if(rs.mElement_INT_4 == null) {
773 rs.mElement_INT_4 = createVector(rs, DataType.SIGNED_32, 4);
774 }
775 return rs.mElement_INT_4;
776 }
777
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700778 /** @deprecated renderscript is deprecated in J
779 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700780 public static Element U64_2(RenderScript rs) {
781 if(rs.mElement_ULONG_2 == null) {
782 rs.mElement_ULONG_2 = createVector(rs, DataType.UNSIGNED_64, 2);
783 }
784 return rs.mElement_ULONG_2;
785 }
786
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700787 /** @deprecated renderscript is deprecated in J
788 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700789 public static Element U64_3(RenderScript rs) {
790 if(rs.mElement_ULONG_3 == null) {
791 rs.mElement_ULONG_3 = createVector(rs, DataType.UNSIGNED_64, 3);
792 }
793 return rs.mElement_ULONG_3;
794 }
795
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700796 /** @deprecated renderscript is deprecated in J
797 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700798 public static Element U64_4(RenderScript rs) {
799 if(rs.mElement_ULONG_4 == null) {
800 rs.mElement_ULONG_4 = createVector(rs, DataType.UNSIGNED_64, 4);
801 }
802 return rs.mElement_ULONG_4;
803 }
804
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700805 /** @deprecated renderscript is deprecated in J
806 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700807 public static Element I64_2(RenderScript rs) {
808 if(rs.mElement_LONG_2 == null) {
809 rs.mElement_LONG_2 = createVector(rs, DataType.SIGNED_64, 2);
810 }
811 return rs.mElement_LONG_2;
812 }
813
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700814 /** @deprecated renderscript is deprecated in J
815 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700816 public static Element I64_3(RenderScript rs) {
817 if(rs.mElement_LONG_3 == null) {
818 rs.mElement_LONG_3 = createVector(rs, DataType.SIGNED_64, 3);
819 }
820 return rs.mElement_LONG_3;
821 }
822
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700823 /** @deprecated renderscript is deprecated in J
824 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700825 public static Element I64_4(RenderScript rs) {
826 if(rs.mElement_LONG_4 == null) {
827 rs.mElement_LONG_4 = createVector(rs, DataType.SIGNED_64, 4);
828 }
829 return rs.mElement_LONG_4;
830 }
831
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700832 /** @deprecated renderscript is deprecated in J
833 */
Jason Sams1d45c472010-08-25 14:31:48 -0700834 public static Element MATRIX_4X4(RenderScript rs) {
835 if(rs.mElement_MATRIX_4X4 == null) {
836 rs.mElement_MATRIX_4X4 = createUser(rs, DataType.MATRIX_4X4);
837 }
838 return rs.mElement_MATRIX_4X4;
839 }
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700840 /** @deprecated renderscript is deprecated in J
841 */
Jason Sams1d45c472010-08-25 14:31:48 -0700842 public static Element MATRIX4X4(RenderScript rs) {
843 return MATRIX_4X4(rs);
844 }
845
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700846 /** @deprecated renderscript is deprecated in J
847 */
Jason Sams1d45c472010-08-25 14:31:48 -0700848 public static Element MATRIX_3X3(RenderScript rs) {
849 if(rs.mElement_MATRIX_3X3 == null) {
850 rs.mElement_MATRIX_3X3 = createUser(rs, DataType.MATRIX_3X3);
851 }
Alex Sakhartchouk34769772011-02-28 16:01:28 -0800852 return rs.mElement_MATRIX_3X3;
Jason Sams1d45c472010-08-25 14:31:48 -0700853 }
854
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700855 /** @deprecated renderscript is deprecated in J
856 */
Jason Sams1d45c472010-08-25 14:31:48 -0700857 public static Element MATRIX_2X2(RenderScript rs) {
858 if(rs.mElement_MATRIX_2X2 == null) {
859 rs.mElement_MATRIX_2X2 = createUser(rs, DataType.MATRIX_2X2);
860 }
861 return rs.mElement_MATRIX_2X2;
862 }
Jason Sams718cd1f2009-12-23 14:35:29 -0800863
Jason Sams70d4e502010-09-02 17:35:23 -0700864 Element(int id, RenderScript rs, Element[] e, String[] n, int[] as) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700865 super(id, rs);
Jason Samsea84a7c2009-09-04 14:42:41 -0700866 mSize = 0;
Alex Sakhartchoukfd79e022011-12-22 14:30:55 -0800867 mVectorSize = 1;
Jason Sams718cd1f2009-12-23 14:35:29 -0800868 mElements = e;
869 mElementNames = n;
Jason Sams70d4e502010-09-02 17:35:23 -0700870 mArraySizes = as;
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800871 mType = DataType.NONE;
872 mKind = DataKind.USER;
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700873 mOffsetInBytes = new int[mElements.length];
Jason Sams718cd1f2009-12-23 14:35:29 -0800874 for (int ct = 0; ct < mElements.length; ct++ ) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700875 mOffsetInBytes[ct] = mSize;
Alex Sakhartchouk9e401bc2010-10-13 14:22:02 -0700876 mSize += mElements[ct].mSize * mArraySizes[ct];
Jason Sams718cd1f2009-12-23 14:35:29 -0800877 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800878 updateVisibleSubElements();
Jason Sams718cd1f2009-12-23 14:35:29 -0800879 }
880
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700881 Element(int id, RenderScript rs, DataType dt, DataKind dk, boolean norm, int size) {
882 super(id, rs);
Jason Sams252c0782011-01-11 17:42:52 -0800883 if ((dt != DataType.UNSIGNED_5_6_5) &&
884 (dt != DataType.UNSIGNED_4_4_4_4) &&
885 (dt != DataType.UNSIGNED_5_5_5_1)) {
Alex Sakhartchouke60149d2011-11-15 15:15:21 -0800886 if (size == 3) {
887 mSize = dt.mSize * 4;
888 } else {
889 mSize = dt.mSize * size;
890 }
Jason Sams252c0782011-01-11 17:42:52 -0800891 } else {
892 mSize = dt.mSize;
893 }
Jason Sams718cd1f2009-12-23 14:35:29 -0800894 mType = dt;
895 mKind = dk;
896 mNormalized = norm;
897 mVectorSize = size;
Jason Sams36e612a2009-07-31 16:26:13 -0700898 }
899
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700900 Element(int id, RenderScript rs) {
901 super(id, rs);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700902 }
903
904 @Override
905 void updateFromNative() {
Jason Sams06d69de2010-11-09 17:11:40 -0800906 super.updateFromNative();
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700907
908 // we will pack mType; mKind; mNormalized; mVectorSize; NumSubElements
909 int[] dataBuffer = new int[5];
Jason Samse07694b2012-04-03 15:36:36 -0700910 mRS.nElementGetNativeData(getID(mRS), dataBuffer);
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700911
912 mNormalized = dataBuffer[2] == 1 ? true : false;
913 mVectorSize = dataBuffer[3];
914 mSize = 0;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700915 for (DataType dt: DataType.values()) {
916 if(dt.mID == dataBuffer[0]){
917 mType = dt;
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700918 mSize = mType.mSize * mVectorSize;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700919 }
920 }
921 for (DataKind dk: DataKind.values()) {
922 if(dk.mID == dataBuffer[1]){
923 mKind = dk;
924 }
925 }
926
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700927 int numSubElements = dataBuffer[4];
928 if(numSubElements > 0) {
929 mElements = new Element[numSubElements];
930 mElementNames = new String[numSubElements];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700931 mArraySizes = new int[numSubElements];
932 mOffsetInBytes = new int[numSubElements];
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700933
934 int[] subElementIds = new int[numSubElements];
Jason Samse07694b2012-04-03 15:36:36 -0700935 mRS.nElementGetSubElements(getID(mRS), subElementIds, mElementNames, mArraySizes);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700936 for(int i = 0; i < numSubElements; i ++) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700937 mElements[i] = new Element(subElementIds[i], mRS);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700938 mElements[i].updateFromNative();
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700939 mOffsetInBytes[i] = mSize;
940 mSize += mElements[i].mSize * mArraySizes[i];
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700941 }
942 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800943 updateVisibleSubElements();
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700944 }
945
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700946 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800947 * Create a custom Element of the specified DataType. The DataKind will be
948 * set to USER and the vector size to 1 indicating non-vector.
949 *
950 * @param rs The context associated with the new Element.
951 * @param dt The DataType for the new element.
952 * @return Element
953 */
Jason Samsbf6ef8d72010-12-06 15:59:59 -0800954 static Element createUser(RenderScript rs, DataType dt) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700955 DataKind dk = DataKind.USER;
956 boolean norm = false;
957 int vecSize = 1;
958 int id = rs.nElementCreate(dt.mID, dk.mID, norm, vecSize);
959 return new Element(id, rs, dt, dk, norm, vecSize);
Jason Sams718cd1f2009-12-23 14:35:29 -0800960 }
961
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700962 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800963 * Create a custom vector element of the specified DataType and vector size.
Stephen Hines3beb60e2012-02-14 20:38:20 -0800964 * DataKind will be set to USER. Only primitive types (FLOAT_32, FLOAT_64,
965 * SIGNED_8, SIGNED_16, SIGNED_32, SIGNED_64, UNSIGNED_8, UNSIGNED_16,
966 * UNSIGNED_32, UNSIGNED_64, BOOLEAN) are supported.
Jason Samsa1b13ed2010-11-12 14:58:37 -0800967 *
968 * @param rs The context associated with the new Element.
Stephen Hines3beb60e2012-02-14 20:38:20 -0800969 * @param dt The DataType for the new Element.
Jason Samsa1b13ed2010-11-12 14:58:37 -0800970 * @param size Vector size for the new Element. Range 2-4 inclusive
971 * supported.
972 *
973 * @return Element
974 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800975 public static Element createVector(RenderScript rs, DataType dt, int size) {
Jason Sams718cd1f2009-12-23 14:35:29 -0800976 if (size < 2 || size > 4) {
Jason Samsbf6ef8d72010-12-06 15:59:59 -0800977 throw new RSIllegalArgumentException("Vector size out of range 2-4.");
Jason Samsea84a7c2009-09-04 14:42:41 -0700978 }
Stephen Hines3beb60e2012-02-14 20:38:20 -0800979
980 switch (dt) {
981 // Support only primitive integer/float/boolean types as vectors.
982 case FLOAT_32:
983 case FLOAT_64:
984 case SIGNED_8:
985 case SIGNED_16:
986 case SIGNED_32:
987 case SIGNED_64:
988 case UNSIGNED_8:
989 case UNSIGNED_16:
990 case UNSIGNED_32:
991 case UNSIGNED_64:
992 case BOOLEAN: {
993 DataKind dk = DataKind.USER;
994 boolean norm = false;
995 int id = rs.nElementCreate(dt.mID, dk.mID, norm, size);
996 return new Element(id, rs, dt, dk, norm, size);
997 }
998
999 default: {
1000 throw new RSIllegalArgumentException("Cannot create vector of " +
1001 "non-primitive type.");
1002 }
1003 }
Jason Samsea84a7c2009-09-04 14:42:41 -07001004 }
1005
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001006 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001007 * Create a new pixel Element type. A matching DataType and DataKind must
1008 * be provided. The DataType and DataKind must contain the same number of
1009 * components. Vector size will be set to 1.
1010 *
1011 * @param rs The context associated with the new Element.
1012 * @param dt The DataType for the new element.
1013 * @param dk The DataKind to specify the mapping of each component in the
1014 * DataType.
1015 *
1016 * @return Element
1017 */
Jason Sams718cd1f2009-12-23 14:35:29 -08001018 public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) {
Jason Sams718cd1f2009-12-23 14:35:29 -08001019 if (!(dk == DataKind.PIXEL_L ||
1020 dk == DataKind.PIXEL_A ||
1021 dk == DataKind.PIXEL_LA ||
1022 dk == DataKind.PIXEL_RGB ||
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001023 dk == DataKind.PIXEL_RGBA ||
1024 dk == DataKind.PIXEL_DEPTH)) {
Jason Samsc1d62102010-11-04 14:32:19 -07001025 throw new RSIllegalArgumentException("Unsupported DataKind");
Jason Sams718cd1f2009-12-23 14:35:29 -08001026 }
1027 if (!(dt == DataType.UNSIGNED_8 ||
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001028 dt == DataType.UNSIGNED_16 ||
Jason Sams718cd1f2009-12-23 14:35:29 -08001029 dt == DataType.UNSIGNED_5_6_5 ||
1030 dt == DataType.UNSIGNED_4_4_4_4 ||
1031 dt == DataType.UNSIGNED_5_5_5_1)) {
Jason Samsc1d62102010-11-04 14:32:19 -07001032 throw new RSIllegalArgumentException("Unsupported DataType");
Jason Sams718cd1f2009-12-23 14:35:29 -08001033 }
1034 if (dt == DataType.UNSIGNED_5_6_5 && dk != DataKind.PIXEL_RGB) {
Jason Samsc1d62102010-11-04 14:32:19 -07001035 throw new RSIllegalArgumentException("Bad kind and type combo");
Jason Sams718cd1f2009-12-23 14:35:29 -08001036 }
1037 if (dt == DataType.UNSIGNED_5_5_5_1 && dk != DataKind.PIXEL_RGBA) {
Jason Samsc1d62102010-11-04 14:32:19 -07001038 throw new RSIllegalArgumentException("Bad kind and type combo");
Jason Sams718cd1f2009-12-23 14:35:29 -08001039 }
1040 if (dt == DataType.UNSIGNED_4_4_4_4 && dk != DataKind.PIXEL_RGBA) {
Jason Samsc1d62102010-11-04 14:32:19 -07001041 throw new RSIllegalArgumentException("Bad kind and type combo");
Jason Sams718cd1f2009-12-23 14:35:29 -08001042 }
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001043 if (dt == DataType.UNSIGNED_16 &&
1044 dk != DataKind.PIXEL_DEPTH) {
1045 throw new RSIllegalArgumentException("Bad kind and type combo");
1046 }
Jason Sams718cd1f2009-12-23 14:35:29 -08001047
1048 int size = 1;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001049 switch (dk) {
1050 case PIXEL_LA:
Jason Sams718cd1f2009-12-23 14:35:29 -08001051 size = 2;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001052 break;
1053 case PIXEL_RGB:
Jason Sams718cd1f2009-12-23 14:35:29 -08001054 size = 3;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001055 break;
1056 case PIXEL_RGBA:
Jason Sams718cd1f2009-12-23 14:35:29 -08001057 size = 4;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001058 break;
1059 case PIXEL_DEPTH:
1060 size = 2;
1061 break;
Jason Sams718cd1f2009-12-23 14:35:29 -08001062 }
1063
Alex Sakhartchouk0de94442010-08-11 14:41:28 -07001064 boolean norm = true;
1065 int id = rs.nElementCreate(dt.mID, dk.mID, norm, size);
1066 return new Element(id, rs, dt, dk, norm, size);
Jason Sams718cd1f2009-12-23 14:35:29 -08001067 }
Jason Sams36e612a2009-07-31 16:26:13 -07001068
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001069 /** @deprecated renderscript is deprecated in J
Stephen Hinesf257e512011-06-14 14:54:29 -07001070 * Check if the current Element is compatible with another Element.
1071 * Primitive Elements are compatible if they share the same underlying
1072 * size and type (i.e. U8 is compatible with A_8). User-defined Elements
1073 * must be equal in order to be compatible. This requires strict name
1074 * equivalence for all sub-Elements (in addition to structural equivalence).
1075 *
1076 * @param e The Element to check compatibility with.
1077 *
1078 * @return boolean true if the Elements are compatible, otherwise false.
1079 */
1080 public boolean isCompatible(Element e) {
1081 // Try strict BaseObj equality to start with.
1082 if (this.equals(e)) {
1083 return true;
1084 }
1085
1086 // Ignore mKind because it is allowed to be different (user vs. pixel).
1087 // We also ignore mNormalized because it can be different. The mType
Stephen Hines20948112012-02-14 19:42:42 -08001088 // field must not be NONE since we require name equivalence for
1089 // all user-created Elements.
Stephen Hinesf257e512011-06-14 14:54:29 -07001090 return ((mSize == e.mSize) &&
Stephen Hines20948112012-02-14 19:42:42 -08001091 (mType != DataType.NONE) &&
Stephen Hinesf257e512011-06-14 14:54:29 -07001092 (mType == e.mType) &&
1093 (mVectorSize == e.mVectorSize));
1094 }
1095
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001096 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001097 * Builder class for producing complex elements with matching field and name
1098 * pairs. The builder starts empty. The order in which elements are added
1099 * is retained for the layout in memory.
1100 *
1101 */
Jason Sams36e612a2009-07-31 16:26:13 -07001102 public static class Builder {
1103 RenderScript mRS;
Jason Sams718cd1f2009-12-23 14:35:29 -08001104 Element[] mElements;
1105 String[] mElementNames;
Jason Sams70d4e502010-09-02 17:35:23 -07001106 int[] mArraySizes;
Jason Sams718cd1f2009-12-23 14:35:29 -08001107 int mCount;
Alex Sakhartchouke60149d2011-11-15 15:15:21 -08001108 int mSkipPadding;
Jason Sams22534172009-08-04 16:58:20 -07001109
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001110 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001111 * Create a builder object.
1112 *
1113 * @param rs
1114 */
Jason Sams22534172009-08-04 16:58:20 -07001115 public Builder(RenderScript rs) {
Jason Sams36e612a2009-07-31 16:26:13 -07001116 mRS = rs;
Jason Sams718cd1f2009-12-23 14:35:29 -08001117 mCount = 0;
1118 mElements = new Element[8];
1119 mElementNames = new String[8];
Jason Sams70d4e502010-09-02 17:35:23 -07001120 mArraySizes = new int[8];
Jason Sams36e612a2009-07-31 16:26:13 -07001121 }
1122
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001123 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001124 * Add an array of elements to this element.
1125 *
1126 * @param element
1127 * @param name
1128 * @param arraySize
1129 */
Jason Samsbf6ef8d72010-12-06 15:59:59 -08001130 public Builder add(Element element, String name, int arraySize) {
Jason Sams70d4e502010-09-02 17:35:23 -07001131 if (arraySize < 1) {
Jason Samsc1d62102010-11-04 14:32:19 -07001132 throw new RSIllegalArgumentException("Array size cannot be less than 1.");
Jason Sams70d4e502010-09-02 17:35:23 -07001133 }
Alex Sakhartchouke60149d2011-11-15 15:15:21 -08001134
1135 // Skip padding fields after a vector 3 type.
1136 if (mSkipPadding != 0) {
1137 if (name.startsWith("#padding_")) {
1138 mSkipPadding = 0;
1139 return this;
1140 }
1141 }
1142
1143 if (element.mVectorSize == 3) {
1144 mSkipPadding = 1;
1145 } else {
1146 mSkipPadding = 0;
1147 }
1148
Jason Sams718cd1f2009-12-23 14:35:29 -08001149 if(mCount == mElements.length) {
1150 Element[] e = new Element[mCount + 8];
1151 String[] s = new String[mCount + 8];
Jason Sams70d4e502010-09-02 17:35:23 -07001152 int[] as = new int[mCount + 8];
Jason Sams718cd1f2009-12-23 14:35:29 -08001153 System.arraycopy(mElements, 0, e, 0, mCount);
1154 System.arraycopy(mElementNames, 0, s, 0, mCount);
Jason Sams70d4e502010-09-02 17:35:23 -07001155 System.arraycopy(mArraySizes, 0, as, 0, mCount);
Jason Sams718cd1f2009-12-23 14:35:29 -08001156 mElements = e;
1157 mElementNames = s;
Jason Sams70d4e502010-09-02 17:35:23 -07001158 mArraySizes = as;
Jason Sams36e612a2009-07-31 16:26:13 -07001159 }
Jason Sams718cd1f2009-12-23 14:35:29 -08001160 mElements[mCount] = element;
1161 mElementNames[mCount] = name;
Jason Sams70d4e502010-09-02 17:35:23 -07001162 mArraySizes[mCount] = arraySize;
Jason Sams718cd1f2009-12-23 14:35:29 -08001163 mCount++;
Jason Samsbf6ef8d72010-12-06 15:59:59 -08001164 return this;
Jason Sams07ae4062009-08-27 20:23:34 -07001165 }
1166
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001167 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001168 * Add a single element to this Element.
1169 *
1170 * @param element
1171 * @param name
1172 */
Jason Samsbf6ef8d72010-12-06 15:59:59 -08001173 public Builder add(Element element, String name) {
1174 return add(element, name, 1);
Jason Sams70d4e502010-09-02 17:35:23 -07001175 }
1176
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001177 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001178 * Create the element from this builder.
1179 *
1180 *
1181 * @return Element
1182 */
Jason Sams22534172009-08-04 16:58:20 -07001183 public Element create() {
Jason Sams771bebb2009-12-07 12:40:12 -08001184 mRS.validate();
Jason Sams718cd1f2009-12-23 14:35:29 -08001185 Element[] ein = new Element[mCount];
1186 String[] sin = new String[mCount];
Jason Sams70d4e502010-09-02 17:35:23 -07001187 int[] asin = new int[mCount];
Jason Sams718cd1f2009-12-23 14:35:29 -08001188 java.lang.System.arraycopy(mElements, 0, ein, 0, mCount);
1189 java.lang.System.arraycopy(mElementNames, 0, sin, 0, mCount);
Jason Sams70d4e502010-09-02 17:35:23 -07001190 java.lang.System.arraycopy(mArraySizes, 0, asin, 0, mCount);
Alex Sakhartchouk0de94442010-08-11 14:41:28 -07001191
1192 int[] ids = new int[ein.length];
1193 for (int ct = 0; ct < ein.length; ct++ ) {
Jason Samse07694b2012-04-03 15:36:36 -07001194 ids[ct] = ein[ct].getID(mRS);
Alex Sakhartchouk0de94442010-08-11 14:41:28 -07001195 }
Jason Sams70d4e502010-09-02 17:35:23 -07001196 int id = mRS.nElementCreate2(ids, sin, asin);
1197 return new Element(id, mRS, ein, sin, asin);
Jason Sams36e612a2009-07-31 16:26:13 -07001198 }
1199 }
Jason Sams36e612a2009-07-31 16:26:13 -07001200}
1201