blob: babe57ec23f1ec54a7cfbb8687c70cbf3b07dc9a [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),
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700152 /** @hide
153 */
Stephen Hines3a291412012-04-11 17:27:29 -0700154 RS_FONT (1010, 4);
Jason Sams36e612a2009-07-31 16:26:13 -0700155
156 int mID;
Jason Sams718cd1f2009-12-23 14:35:29 -0800157 int mSize;
158 DataType(int id, int size) {
Jason Sams36e612a2009-07-31 16:26:13 -0700159 mID = id;
Jason Sams718cd1f2009-12-23 14:35:29 -0800160 mSize = size;
Jason Sams36e612a2009-07-31 16:26:13 -0700161 }
162 }
163
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700164 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800165 * The special interpretation of the data if required. This is primarly
166 * useful for graphical data. USER indicates no special interpretation is
167 * expected. PIXEL is used in conjunction with the standard data types for
168 * representing texture formats.
169 */
Jason Sams36e612a2009-07-31 16:26:13 -0700170 public enum DataKind {
171 USER (0),
Jason Sams718cd1f2009-12-23 14:35:29 -0800172
173 PIXEL_L (7),
174 PIXEL_A (8),
175 PIXEL_LA (9),
176 PIXEL_RGB (10),
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -0700177 PIXEL_RGBA (11),
178 PIXEL_DEPTH (12);
Jason Sams36e612a2009-07-31 16:26:13 -0700179
180 int mID;
181 DataKind(int id) {
182 mID = id;
183 }
184 }
185
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700186 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800187 * Return if a element is too complex for use as a data source for a Mesh or
188 * a Program.
189 *
190 * @return boolean
191 */
Jason Samsc1d62102010-11-04 14:32:19 -0700192 public boolean isComplex() {
193 if (mElements == null) {
194 return false;
195 }
196 for (int ct=0; ct < mElements.length; ct++) {
197 if (mElements[ct].mElements != null) {
198 return true;
199 }
200 }
201 return false;
202 }
203
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700204 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700205 * Elements could be simple, such as an int or a float, or a
206 * structure with multiple sub elements, such as a collection of
207 * floats, float2, float4. This function returns zero for simple
208 * elements or the number of sub-elements otherwise.
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700209 * @return number of sub-elements in this element
210 */
211 public int getSubElementCount() {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800212 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700213 return 0;
214 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800215 return mVisibleElementMap.length;
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700216 }
217
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700218 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700219 * For complex elements, this function will return the
220 * sub-element at index
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700221 * @param index index of the sub-element to return
222 * @return sub-element in this element at given index
223 */
224 public Element getSubElement(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800225 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700226 throw new RSIllegalArgumentException("Element contains no sub-elements");
227 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800228 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700229 throw new RSIllegalArgumentException("Illegal sub-element index");
230 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800231 return mElements[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700232 }
233
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700234 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700235 * For complex elements, this function will return the
236 * sub-element name at index
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700237 * @param index index of the sub-element
238 * @return sub-element in this element at given index
239 */
240 public String getSubElementName(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800241 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700242 throw new RSIllegalArgumentException("Element contains no sub-elements");
243 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800244 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700245 throw new RSIllegalArgumentException("Illegal sub-element index");
246 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800247 return mElementNames[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700248 }
249
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700250 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700251 * For complex elements, some sub-elements could be statically
252 * sized arrays. This function will return the array size for
253 * sub-element at index
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700254 * @param index index of the sub-element
255 * @return array size of sub-element in this element at given index
256 */
257 public int getSubElementArraySize(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800258 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700259 throw new RSIllegalArgumentException("Element contains no sub-elements");
260 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800261 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700262 throw new RSIllegalArgumentException("Illegal sub-element index");
263 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800264 return mArraySizes[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700265 }
266
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700267 /** @hide renderscript is deprecated in J
Alex Sakhartchouk918e8402012-04-11 14:04:23 -0700268 * This function specifies the location of a sub-element within
269 * the element
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700270 * @param index index of the sub-element
271 * @return offset in bytes of sub-element in this element at given index
272 */
273 public int getSubElementOffsetBytes(int index) {
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800274 if (mVisibleElementMap == null) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700275 throw new RSIllegalArgumentException("Element contains no sub-elements");
276 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800277 if (index < 0 || index >= mVisibleElementMap.length) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700278 throw new RSIllegalArgumentException("Illegal sub-element index");
279 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800280 return mOffsetInBytes[mVisibleElementMap[index]];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700281 }
282
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700283 /** @hide renderscript is deprecated in J
Alex Sakhartchoukf5d8ac72011-12-16 09:44:26 -0800284 * @return element data type
285 */
286 public DataType getDataType() {
287 return mType;
288 }
289
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700290 /** @hide renderscript is deprecated in J
Alex Sakhartchoukf5d8ac72011-12-16 09:44:26 -0800291 * @return element data kind
292 */
293 public DataKind getDataKind() {
294 return mKind;
295 }
296
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700297 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800298 * Utility function for returning an Element containing a single Boolean.
299 *
300 * @param rs Context to which the element will belong.
301 *
302 * @return Element
303 */
Jason Samsf110d4b2010-06-21 17:42:41 -0700304 public static Element BOOLEAN(RenderScript rs) {
305 if(rs.mElement_BOOLEAN == null) {
306 rs.mElement_BOOLEAN = createUser(rs, DataType.BOOLEAN);
307 }
308 return rs.mElement_BOOLEAN;
309 }
310
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700311 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800312 * Utility function for returning an Element containing a single UNSIGNED_8.
313 *
314 * @param rs Context to which the element will belong.
315 *
316 * @return Element
317 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700318 public static Element U8(RenderScript rs) {
319 if(rs.mElement_U8 == null) {
320 rs.mElement_U8 = createUser(rs, DataType.UNSIGNED_8);
Jason Sams718cd1f2009-12-23 14:35:29 -0800321 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700322 return rs.mElement_U8;
Jason Sams718cd1f2009-12-23 14:35:29 -0800323 }
324
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700325 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800326 * Utility function for returning an Element containing a single SIGNED_8.
327 *
328 * @param rs Context to which the element will belong.
329 *
330 * @return Element
331 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700332 public static Element I8(RenderScript rs) {
333 if(rs.mElement_I8 == null) {
334 rs.mElement_I8 = createUser(rs, DataType.SIGNED_8);
Jason Sams718cd1f2009-12-23 14:35:29 -0800335 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700336 return rs.mElement_I8;
Jason Sams718cd1f2009-12-23 14:35:29 -0800337 }
338
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700339 /** @deprecated renderscript is deprecated in J
340 */
Jason Samse29f3e72010-06-08 15:40:48 -0700341 public static Element U16(RenderScript rs) {
342 if(rs.mElement_U16 == null) {
343 rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16);
344 }
345 return rs.mElement_U16;
346 }
347
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700348 /** @deprecated renderscript is deprecated in J
349 */
Jason Samse29f3e72010-06-08 15:40:48 -0700350 public static Element I16(RenderScript rs) {
351 if(rs.mElement_I16 == null) {
352 rs.mElement_I16 = createUser(rs, DataType.SIGNED_16);
353 }
354 return rs.mElement_I16;
355 }
356
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700357 /** @deprecated renderscript is deprecated in J
358 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700359 public static Element U32(RenderScript rs) {
360 if(rs.mElement_U32 == null) {
361 rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32);
Jason Sams718cd1f2009-12-23 14:35:29 -0800362 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700363 return rs.mElement_U32;
Jason Sams718cd1f2009-12-23 14:35:29 -0800364 }
365
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700366 /** @deprecated renderscript is deprecated in J
367 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700368 public static Element I32(RenderScript rs) {
369 if(rs.mElement_I32 == null) {
370 rs.mElement_I32 = createUser(rs, DataType.SIGNED_32);
Jason Sams718cd1f2009-12-23 14:35:29 -0800371 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700372 return rs.mElement_I32;
Jason Sams718cd1f2009-12-23 14:35:29 -0800373 }
374
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700375 /** @deprecated renderscript is deprecated in J
376 */
Stephen Hines52d83632010-10-11 16:10:42 -0700377 public static Element U64(RenderScript rs) {
378 if(rs.mElement_U64 == null) {
379 rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64);
380 }
381 return rs.mElement_U64;
382 }
383
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700384 /** @deprecated renderscript is deprecated in J
385 */
Stephen Hinesef1dac22010-10-01 15:39:33 -0700386 public static Element I64(RenderScript rs) {
387 if(rs.mElement_I64 == null) {
388 rs.mElement_I64 = createUser(rs, DataType.SIGNED_64);
389 }
390 return rs.mElement_I64;
391 }
392
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700393 /** @deprecated renderscript is deprecated in J
394 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700395 public static Element F32(RenderScript rs) {
396 if(rs.mElement_F32 == null) {
397 rs.mElement_F32 = createUser(rs, DataType.FLOAT_32);
Jason Sams718cd1f2009-12-23 14:35:29 -0800398 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700399 return rs.mElement_F32;
Jason Sams718cd1f2009-12-23 14:35:29 -0800400 }
401
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700402 /** @deprecated renderscript is deprecated in J
403 */
Stephen Hines02f417052010-09-30 15:19:22 -0700404 public static Element F64(RenderScript rs) {
405 if(rs.mElement_F64 == null) {
406 rs.mElement_F64 = createUser(rs, DataType.FLOAT_64);
407 }
408 return rs.mElement_F64;
409 }
410
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700411 /** @deprecated renderscript is deprecated in J
412 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700413 public static Element ELEMENT(RenderScript rs) {
414 if(rs.mElement_ELEMENT == null) {
415 rs.mElement_ELEMENT = createUser(rs, DataType.RS_ELEMENT);
Jason Samsa70f4162010-03-26 15:33:42 -0700416 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700417 return rs.mElement_ELEMENT;
Jason Samsa70f4162010-03-26 15:33:42 -0700418 }
419
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700420 /** @deprecated renderscript is deprecated in J
421 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700422 public static Element TYPE(RenderScript rs) {
423 if(rs.mElement_TYPE == null) {
424 rs.mElement_TYPE = createUser(rs, DataType.RS_TYPE);
Jason Samsa70f4162010-03-26 15:33:42 -0700425 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700426 return rs.mElement_TYPE;
Jason Samsa70f4162010-03-26 15:33:42 -0700427 }
428
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700429 /** @deprecated renderscript is deprecated in J
430 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700431 public static Element ALLOCATION(RenderScript rs) {
432 if(rs.mElement_ALLOCATION == null) {
433 rs.mElement_ALLOCATION = createUser(rs, DataType.RS_ALLOCATION);
Jason Samsa70f4162010-03-26 15:33:42 -0700434 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700435 return rs.mElement_ALLOCATION;
Jason Samsa70f4162010-03-26 15:33:42 -0700436 }
437
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700438 /** @deprecated renderscript is deprecated in J
439 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700440 public static Element SAMPLER(RenderScript rs) {
441 if(rs.mElement_SAMPLER == null) {
442 rs.mElement_SAMPLER = createUser(rs, DataType.RS_SAMPLER);
Jason Samsa70f4162010-03-26 15:33:42 -0700443 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700444 return rs.mElement_SAMPLER;
Jason Samsa70f4162010-03-26 15:33:42 -0700445 }
446
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700447 /** @deprecated renderscript is deprecated in J
448 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700449 public static Element SCRIPT(RenderScript rs) {
450 if(rs.mElement_SCRIPT == null) {
451 rs.mElement_SCRIPT = createUser(rs, DataType.RS_SCRIPT);
Jason Samsa70f4162010-03-26 15:33:42 -0700452 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700453 return rs.mElement_SCRIPT;
Jason Samsa70f4162010-03-26 15:33:42 -0700454 }
455
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700456 /** @deprecated renderscript is deprecated in J
457 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700458 public static Element MESH(RenderScript rs) {
459 if(rs.mElement_MESH == null) {
460 rs.mElement_MESH = createUser(rs, DataType.RS_MESH);
Jason Samsa70f4162010-03-26 15:33:42 -0700461 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700462 return rs.mElement_MESH;
Jason Samsa70f4162010-03-26 15:33:42 -0700463 }
464
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700465 /** @deprecated renderscript is deprecated in J
466 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700467 public static Element PROGRAM_FRAGMENT(RenderScript rs) {
468 if(rs.mElement_PROGRAM_FRAGMENT == null) {
469 rs.mElement_PROGRAM_FRAGMENT = createUser(rs, DataType.RS_PROGRAM_FRAGMENT);
Jason Samsa70f4162010-03-26 15:33:42 -0700470 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700471 return rs.mElement_PROGRAM_FRAGMENT;
Jason Samsa70f4162010-03-26 15:33:42 -0700472 }
473
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700474 /** @deprecated renderscript is deprecated in J
475 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700476 public static Element PROGRAM_VERTEX(RenderScript rs) {
477 if(rs.mElement_PROGRAM_VERTEX == null) {
478 rs.mElement_PROGRAM_VERTEX = createUser(rs, DataType.RS_PROGRAM_VERTEX);
Jason Samsa70f4162010-03-26 15:33:42 -0700479 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700480 return rs.mElement_PROGRAM_VERTEX;
Jason Samsa70f4162010-03-26 15:33:42 -0700481 }
482
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700483 /** @deprecated renderscript is deprecated in J
484 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700485 public static Element PROGRAM_RASTER(RenderScript rs) {
486 if(rs.mElement_PROGRAM_RASTER == null) {
487 rs.mElement_PROGRAM_RASTER = createUser(rs, DataType.RS_PROGRAM_RASTER);
Jason Samsa70f4162010-03-26 15:33:42 -0700488 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700489 return rs.mElement_PROGRAM_RASTER;
Jason Samsa70f4162010-03-26 15:33:42 -0700490 }
491
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700492 /** @deprecated renderscript is deprecated in J
493 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700494 public static Element PROGRAM_STORE(RenderScript rs) {
495 if(rs.mElement_PROGRAM_STORE == null) {
496 rs.mElement_PROGRAM_STORE = createUser(rs, DataType.RS_PROGRAM_STORE);
Jason Samsa70f4162010-03-26 15:33:42 -0700497 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700498 return rs.mElement_PROGRAM_STORE;
Jason Samsa70f4162010-03-26 15:33:42 -0700499 }
500
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700501 /** @hide
502 */
Stephen Hines3a291412012-04-11 17:27:29 -0700503 public static Element FONT(RenderScript rs) {
504 if(rs.mElement_FONT == null) {
505 rs.mElement_FONT = createUser(rs, DataType.RS_FONT);
506 }
507 return rs.mElement_FONT;
508 }
509
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700510 /** @deprecated renderscript is deprecated in J
511 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800512 public static Element A_8(RenderScript rs) {
513 if(rs.mElement_A_8 == null) {
514 rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A);
515 }
516 return rs.mElement_A_8;
517 }
518
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700519 /** @deprecated renderscript is deprecated in J
520 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800521 public static Element RGB_565(RenderScript rs) {
522 if(rs.mElement_RGB_565 == null) {
523 rs.mElement_RGB_565 = createPixel(rs, DataType.UNSIGNED_5_6_5, DataKind.PIXEL_RGB);
524 }
525 return rs.mElement_RGB_565;
526 }
527
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700528 /** @deprecated renderscript is deprecated in J
529 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800530 public static Element RGB_888(RenderScript rs) {
531 if(rs.mElement_RGB_888 == null) {
532 rs.mElement_RGB_888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGB);
533 }
534 return rs.mElement_RGB_888;
535 }
536
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700537 /** @deprecated renderscript is deprecated in J
538 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800539 public static Element RGBA_5551(RenderScript rs) {
540 if(rs.mElement_RGBA_5551 == null) {
541 rs.mElement_RGBA_5551 = createPixel(rs, DataType.UNSIGNED_5_5_5_1, DataKind.PIXEL_RGBA);
542 }
543 return rs.mElement_RGBA_5551;
544 }
545
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700546 /** @deprecated renderscript is deprecated in J
547 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800548 public static Element RGBA_4444(RenderScript rs) {
549 if(rs.mElement_RGBA_4444 == null) {
550 rs.mElement_RGBA_4444 = createPixel(rs, DataType.UNSIGNED_4_4_4_4, DataKind.PIXEL_RGBA);
551 }
552 return rs.mElement_RGBA_4444;
553 }
554
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700555 /** @deprecated renderscript is deprecated in J
556 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800557 public static Element RGBA_8888(RenderScript rs) {
558 if(rs.mElement_RGBA_8888 == null) {
559 rs.mElement_RGBA_8888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGBA);
560 }
561 return rs.mElement_RGBA_8888;
562 }
563
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700564 /** @deprecated renderscript is deprecated in J
565 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700566 public static Element F32_2(RenderScript rs) {
567 if(rs.mElement_FLOAT_2 == null) {
568 rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2);
Jason Sams718cd1f2009-12-23 14:35:29 -0800569 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700570 return rs.mElement_FLOAT_2;
Jason Sams718cd1f2009-12-23 14:35:29 -0800571 }
572
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700573 /** @deprecated renderscript is deprecated in J
574 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700575 public static Element F32_3(RenderScript rs) {
576 if(rs.mElement_FLOAT_3 == null) {
577 rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_32, 3);
Jason Sams718cd1f2009-12-23 14:35:29 -0800578 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700579 return rs.mElement_FLOAT_3;
Jason Sams718cd1f2009-12-23 14:35:29 -0800580 }
581
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700582 /** @deprecated renderscript is deprecated in J
583 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700584 public static Element F32_4(RenderScript rs) {
585 if(rs.mElement_FLOAT_4 == null) {
586 rs.mElement_FLOAT_4 = createVector(rs, DataType.FLOAT_32, 4);
Jason Sams718cd1f2009-12-23 14:35:29 -0800587 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700588 return rs.mElement_FLOAT_4;
Jason Sams718cd1f2009-12-23 14:35:29 -0800589 }
590
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700591 /** @deprecated renderscript is deprecated in J
592 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700593 public static Element F64_2(RenderScript rs) {
594 if(rs.mElement_DOUBLE_2 == null) {
595 rs.mElement_DOUBLE_2 = createVector(rs, DataType.FLOAT_64, 2);
596 }
597 return rs.mElement_DOUBLE_2;
598 }
599
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700600 /** @deprecated renderscript is deprecated in J
601 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700602 public static Element F64_3(RenderScript rs) {
603 if(rs.mElement_DOUBLE_3 == null) {
604 rs.mElement_DOUBLE_3 = createVector(rs, DataType.FLOAT_64, 3);
605 }
606 return rs.mElement_DOUBLE_3;
607 }
608
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700609 /** @deprecated renderscript is deprecated in J
610 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700611 public static Element F64_4(RenderScript rs) {
612 if(rs.mElement_DOUBLE_4 == null) {
613 rs.mElement_DOUBLE_4 = createVector(rs, DataType.FLOAT_64, 4);
614 }
615 return rs.mElement_DOUBLE_4;
616 }
617
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700618 /** @deprecated renderscript is deprecated in J
619 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700620 public static Element U8_2(RenderScript rs) {
621 if(rs.mElement_UCHAR_2 == null) {
622 rs.mElement_UCHAR_2 = createVector(rs, DataType.UNSIGNED_8, 2);
623 }
624 return rs.mElement_UCHAR_2;
625 }
626
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700627 /** @deprecated renderscript is deprecated in J
628 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700629 public static Element U8_3(RenderScript rs) {
630 if(rs.mElement_UCHAR_3 == null) {
631 rs.mElement_UCHAR_3 = createVector(rs, DataType.UNSIGNED_8, 3);
632 }
633 return rs.mElement_UCHAR_3;
634 }
635
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700636 /** @deprecated renderscript is deprecated in J
637 */
Jason Sams8cb39de2010-06-01 15:47:01 -0700638 public static Element U8_4(RenderScript rs) {
639 if(rs.mElement_UCHAR_4 == null) {
640 rs.mElement_UCHAR_4 = createVector(rs, DataType.UNSIGNED_8, 4);
Jason Sams718cd1f2009-12-23 14:35:29 -0800641 }
Jason Sams8cb39de2010-06-01 15:47:01 -0700642 return rs.mElement_UCHAR_4;
Jason Sams718cd1f2009-12-23 14:35:29 -0800643 }
644
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700645 /** @deprecated renderscript is deprecated in J
646 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700647 public static Element I8_2(RenderScript rs) {
648 if(rs.mElement_CHAR_2 == null) {
649 rs.mElement_CHAR_2 = createVector(rs, DataType.SIGNED_8, 2);
650 }
651 return rs.mElement_CHAR_2;
652 }
653
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700654 /** @deprecated renderscript is deprecated in J
655 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700656 public static Element I8_3(RenderScript rs) {
657 if(rs.mElement_CHAR_3 == null) {
658 rs.mElement_CHAR_3 = createVector(rs, DataType.SIGNED_8, 3);
659 }
660 return rs.mElement_CHAR_3;
661 }
662
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700663 /** @deprecated renderscript is deprecated in J
664 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700665 public static Element I8_4(RenderScript rs) {
666 if(rs.mElement_CHAR_4 == null) {
667 rs.mElement_CHAR_4 = createVector(rs, DataType.SIGNED_8, 4);
668 }
669 return rs.mElement_CHAR_4;
670 }
671
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700672 /** @deprecated renderscript is deprecated in J
673 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700674 public static Element U16_2(RenderScript rs) {
675 if(rs.mElement_USHORT_2 == null) {
676 rs.mElement_USHORT_2 = createVector(rs, DataType.UNSIGNED_16, 2);
677 }
678 return rs.mElement_USHORT_2;
679 }
680
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700681 /** @deprecated renderscript is deprecated in J
682 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700683 public static Element U16_3(RenderScript rs) {
684 if(rs.mElement_USHORT_3 == null) {
685 rs.mElement_USHORT_3 = createVector(rs, DataType.UNSIGNED_16, 3);
686 }
687 return rs.mElement_USHORT_3;
688 }
689
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700690 /** @deprecated renderscript is deprecated in J
691 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700692 public static Element U16_4(RenderScript rs) {
693 if(rs.mElement_USHORT_4 == null) {
694 rs.mElement_USHORT_4 = createVector(rs, DataType.UNSIGNED_16, 4);
695 }
696 return rs.mElement_USHORT_4;
697 }
698
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700699 /** @deprecated renderscript is deprecated in J
700 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700701 public static Element I16_2(RenderScript rs) {
702 if(rs.mElement_SHORT_2 == null) {
703 rs.mElement_SHORT_2 = createVector(rs, DataType.SIGNED_16, 2);
704 }
705 return rs.mElement_SHORT_2;
706 }
707
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700708 /** @deprecated renderscript is deprecated in J
709 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700710 public static Element I16_3(RenderScript rs) {
711 if(rs.mElement_SHORT_3 == null) {
712 rs.mElement_SHORT_3 = createVector(rs, DataType.SIGNED_16, 3);
713 }
714 return rs.mElement_SHORT_3;
715 }
716
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700717 /** @deprecated renderscript is deprecated in J
718 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700719 public static Element I16_4(RenderScript rs) {
720 if(rs.mElement_SHORT_4 == null) {
721 rs.mElement_SHORT_4 = createVector(rs, DataType.SIGNED_16, 4);
722 }
723 return rs.mElement_SHORT_4;
724 }
725
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700726 /** @deprecated renderscript is deprecated in J
727 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700728 public static Element U32_2(RenderScript rs) {
729 if(rs.mElement_UINT_2 == null) {
730 rs.mElement_UINT_2 = createVector(rs, DataType.UNSIGNED_32, 2);
731 }
732 return rs.mElement_UINT_2;
733 }
734
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700735 /** @deprecated renderscript is deprecated in J
736 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700737 public static Element U32_3(RenderScript rs) {
738 if(rs.mElement_UINT_3 == null) {
739 rs.mElement_UINT_3 = createVector(rs, DataType.UNSIGNED_32, 3);
740 }
741 return rs.mElement_UINT_3;
742 }
743
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700744 /** @deprecated renderscript is deprecated in J
745 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700746 public static Element U32_4(RenderScript rs) {
747 if(rs.mElement_UINT_4 == null) {
748 rs.mElement_UINT_4 = createVector(rs, DataType.UNSIGNED_32, 4);
749 }
750 return rs.mElement_UINT_4;
751 }
752
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700753 /** @deprecated renderscript is deprecated in J
754 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700755 public static Element I32_2(RenderScript rs) {
756 if(rs.mElement_INT_2 == null) {
757 rs.mElement_INT_2 = createVector(rs, DataType.SIGNED_32, 2);
758 }
759 return rs.mElement_INT_2;
760 }
761
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700762 /** @deprecated renderscript is deprecated in J
763 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700764 public static Element I32_3(RenderScript rs) {
765 if(rs.mElement_INT_3 == null) {
766 rs.mElement_INT_3 = createVector(rs, DataType.SIGNED_32, 3);
767 }
768 return rs.mElement_INT_3;
769 }
770
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700771 /** @deprecated renderscript is deprecated in J
772 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700773 public static Element I32_4(RenderScript rs) {
774 if(rs.mElement_INT_4 == null) {
775 rs.mElement_INT_4 = createVector(rs, DataType.SIGNED_32, 4);
776 }
777 return rs.mElement_INT_4;
778 }
779
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700780 /** @deprecated renderscript is deprecated in J
781 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700782 public static Element U64_2(RenderScript rs) {
783 if(rs.mElement_ULONG_2 == null) {
784 rs.mElement_ULONG_2 = createVector(rs, DataType.UNSIGNED_64, 2);
785 }
786 return rs.mElement_ULONG_2;
787 }
788
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700789 /** @deprecated renderscript is deprecated in J
790 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700791 public static Element U64_3(RenderScript rs) {
792 if(rs.mElement_ULONG_3 == null) {
793 rs.mElement_ULONG_3 = createVector(rs, DataType.UNSIGNED_64, 3);
794 }
795 return rs.mElement_ULONG_3;
796 }
797
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700798 /** @deprecated renderscript is deprecated in J
799 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700800 public static Element U64_4(RenderScript rs) {
801 if(rs.mElement_ULONG_4 == null) {
802 rs.mElement_ULONG_4 = createVector(rs, DataType.UNSIGNED_64, 4);
803 }
804 return rs.mElement_ULONG_4;
805 }
806
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700807 /** @deprecated renderscript is deprecated in J
808 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700809 public static Element I64_2(RenderScript rs) {
810 if(rs.mElement_LONG_2 == null) {
811 rs.mElement_LONG_2 = createVector(rs, DataType.SIGNED_64, 2);
812 }
813 return rs.mElement_LONG_2;
814 }
815
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700816 /** @deprecated renderscript is deprecated in J
817 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700818 public static Element I64_3(RenderScript rs) {
819 if(rs.mElement_LONG_3 == null) {
820 rs.mElement_LONG_3 = createVector(rs, DataType.SIGNED_64, 3);
821 }
822 return rs.mElement_LONG_3;
823 }
824
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700825 /** @deprecated renderscript is deprecated in J
826 */
Stephen Hines836c4a52011-06-01 14:38:10 -0700827 public static Element I64_4(RenderScript rs) {
828 if(rs.mElement_LONG_4 == null) {
829 rs.mElement_LONG_4 = createVector(rs, DataType.SIGNED_64, 4);
830 }
831 return rs.mElement_LONG_4;
832 }
833
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700834 /** @deprecated renderscript is deprecated in J
835 */
Jason Sams1d45c472010-08-25 14:31:48 -0700836 public static Element MATRIX_4X4(RenderScript rs) {
837 if(rs.mElement_MATRIX_4X4 == null) {
838 rs.mElement_MATRIX_4X4 = createUser(rs, DataType.MATRIX_4X4);
839 }
840 return rs.mElement_MATRIX_4X4;
841 }
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700842 /** @deprecated renderscript is deprecated in J
843 */
Jason Sams1d45c472010-08-25 14:31:48 -0700844 public static Element MATRIX4X4(RenderScript rs) {
845 return MATRIX_4X4(rs);
846 }
847
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700848 /** @deprecated renderscript is deprecated in J
849 */
Jason Sams1d45c472010-08-25 14:31:48 -0700850 public static Element MATRIX_3X3(RenderScript rs) {
851 if(rs.mElement_MATRIX_3X3 == null) {
852 rs.mElement_MATRIX_3X3 = createUser(rs, DataType.MATRIX_3X3);
853 }
Alex Sakhartchouk34769772011-02-28 16:01:28 -0800854 return rs.mElement_MATRIX_3X3;
Jason Sams1d45c472010-08-25 14:31:48 -0700855 }
856
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700857 /** @deprecated renderscript is deprecated in J
858 */
Jason Sams1d45c472010-08-25 14:31:48 -0700859 public static Element MATRIX_2X2(RenderScript rs) {
860 if(rs.mElement_MATRIX_2X2 == null) {
861 rs.mElement_MATRIX_2X2 = createUser(rs, DataType.MATRIX_2X2);
862 }
863 return rs.mElement_MATRIX_2X2;
864 }
Jason Sams718cd1f2009-12-23 14:35:29 -0800865
Jason Sams70d4e502010-09-02 17:35:23 -0700866 Element(int id, RenderScript rs, Element[] e, String[] n, int[] as) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700867 super(id, rs);
Jason Samsea84a7c2009-09-04 14:42:41 -0700868 mSize = 0;
Alex Sakhartchoukfd79e022011-12-22 14:30:55 -0800869 mVectorSize = 1;
Jason Sams718cd1f2009-12-23 14:35:29 -0800870 mElements = e;
871 mElementNames = n;
Jason Sams70d4e502010-09-02 17:35:23 -0700872 mArraySizes = as;
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800873 mType = DataType.NONE;
874 mKind = DataKind.USER;
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700875 mOffsetInBytes = new int[mElements.length];
Jason Sams718cd1f2009-12-23 14:35:29 -0800876 for (int ct = 0; ct < mElements.length; ct++ ) {
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700877 mOffsetInBytes[ct] = mSize;
Alex Sakhartchouk9e401bc2010-10-13 14:22:02 -0700878 mSize += mElements[ct].mSize * mArraySizes[ct];
Jason Sams718cd1f2009-12-23 14:35:29 -0800879 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800880 updateVisibleSubElements();
Jason Sams718cd1f2009-12-23 14:35:29 -0800881 }
882
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700883 Element(int id, RenderScript rs, DataType dt, DataKind dk, boolean norm, int size) {
884 super(id, rs);
Jason Sams252c0782011-01-11 17:42:52 -0800885 if ((dt != DataType.UNSIGNED_5_6_5) &&
886 (dt != DataType.UNSIGNED_4_4_4_4) &&
887 (dt != DataType.UNSIGNED_5_5_5_1)) {
Alex Sakhartchouke60149d2011-11-15 15:15:21 -0800888 if (size == 3) {
889 mSize = dt.mSize * 4;
890 } else {
891 mSize = dt.mSize * size;
892 }
Jason Sams252c0782011-01-11 17:42:52 -0800893 } else {
894 mSize = dt.mSize;
895 }
Jason Sams718cd1f2009-12-23 14:35:29 -0800896 mType = dt;
897 mKind = dk;
898 mNormalized = norm;
899 mVectorSize = size;
Jason Sams36e612a2009-07-31 16:26:13 -0700900 }
901
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700902 Element(int id, RenderScript rs) {
903 super(id, rs);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700904 }
905
906 @Override
907 void updateFromNative() {
Jason Sams06d69de2010-11-09 17:11:40 -0800908 super.updateFromNative();
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700909
910 // we will pack mType; mKind; mNormalized; mVectorSize; NumSubElements
911 int[] dataBuffer = new int[5];
Jason Samse07694b2012-04-03 15:36:36 -0700912 mRS.nElementGetNativeData(getID(mRS), dataBuffer);
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700913
914 mNormalized = dataBuffer[2] == 1 ? true : false;
915 mVectorSize = dataBuffer[3];
916 mSize = 0;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700917 for (DataType dt: DataType.values()) {
918 if(dt.mID == dataBuffer[0]){
919 mType = dt;
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700920 mSize = mType.mSize * mVectorSize;
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700921 }
922 }
923 for (DataKind dk: DataKind.values()) {
924 if(dk.mID == dataBuffer[1]){
925 mKind = dk;
926 }
927 }
928
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700929 int numSubElements = dataBuffer[4];
930 if(numSubElements > 0) {
931 mElements = new Element[numSubElements];
932 mElementNames = new String[numSubElements];
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700933 mArraySizes = new int[numSubElements];
934 mOffsetInBytes = new int[numSubElements];
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700935
936 int[] subElementIds = new int[numSubElements];
Jason Samse07694b2012-04-03 15:36:36 -0700937 mRS.nElementGetSubElements(getID(mRS), subElementIds, mElementNames, mArraySizes);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700938 for(int i = 0; i < numSubElements; i ++) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700939 mElements[i] = new Element(subElementIds[i], mRS);
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700940 mElements[i].updateFromNative();
Alex Sakhartchouk7d5f5e72011-10-18 11:08:31 -0700941 mOffsetInBytes[i] = mSize;
942 mSize += mElements[i].mSize * mArraySizes[i];
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700943 }
944 }
Alex Sakhartchouk3aac0ab2011-12-22 13:11:48 -0800945 updateVisibleSubElements();
Alex Sakhartchoukdfac8142010-07-15 11:33:03 -0700946 }
947
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700948 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800949 * Create a custom Element of the specified DataType. The DataKind will be
950 * set to USER and the vector size to 1 indicating non-vector.
951 *
952 * @param rs The context associated with the new Element.
953 * @param dt The DataType for the new element.
954 * @return Element
955 */
Jason Samsbf6ef8d72010-12-06 15:59:59 -0800956 static Element createUser(RenderScript rs, DataType dt) {
Alex Sakhartchouk0de94442010-08-11 14:41:28 -0700957 DataKind dk = DataKind.USER;
958 boolean norm = false;
959 int vecSize = 1;
960 int id = rs.nElementCreate(dt.mID, dk.mID, norm, vecSize);
961 return new Element(id, rs, dt, dk, norm, vecSize);
Jason Sams718cd1f2009-12-23 14:35:29 -0800962 }
963
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -0700964 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -0800965 * Create a custom vector element of the specified DataType and vector size.
Stephen Hines3beb60e2012-02-14 20:38:20 -0800966 * DataKind will be set to USER. Only primitive types (FLOAT_32, FLOAT_64,
967 * SIGNED_8, SIGNED_16, SIGNED_32, SIGNED_64, UNSIGNED_8, UNSIGNED_16,
968 * UNSIGNED_32, UNSIGNED_64, BOOLEAN) are supported.
Jason Samsa1b13ed2010-11-12 14:58:37 -0800969 *
970 * @param rs The context associated with the new Element.
Stephen Hines3beb60e2012-02-14 20:38:20 -0800971 * @param dt The DataType for the new Element.
Jason Samsa1b13ed2010-11-12 14:58:37 -0800972 * @param size Vector size for the new Element. Range 2-4 inclusive
973 * supported.
974 *
975 * @return Element
976 */
Jason Sams718cd1f2009-12-23 14:35:29 -0800977 public static Element createVector(RenderScript rs, DataType dt, int size) {
Jason Sams718cd1f2009-12-23 14:35:29 -0800978 if (size < 2 || size > 4) {
Jason Samsbf6ef8d72010-12-06 15:59:59 -0800979 throw new RSIllegalArgumentException("Vector size out of range 2-4.");
Jason Samsea84a7c2009-09-04 14:42:41 -0700980 }
Stephen Hines3beb60e2012-02-14 20:38:20 -0800981
982 switch (dt) {
983 // Support only primitive integer/float/boolean types as vectors.
984 case FLOAT_32:
985 case FLOAT_64:
986 case SIGNED_8:
987 case SIGNED_16:
988 case SIGNED_32:
989 case SIGNED_64:
990 case UNSIGNED_8:
991 case UNSIGNED_16:
992 case UNSIGNED_32:
993 case UNSIGNED_64:
994 case BOOLEAN: {
995 DataKind dk = DataKind.USER;
996 boolean norm = false;
997 int id = rs.nElementCreate(dt.mID, dk.mID, norm, size);
998 return new Element(id, rs, dt, dk, norm, size);
999 }
1000
1001 default: {
1002 throw new RSIllegalArgumentException("Cannot create vector of " +
1003 "non-primitive type.");
1004 }
1005 }
Jason Samsea84a7c2009-09-04 14:42:41 -07001006 }
1007
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001008 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001009 * Create a new pixel Element type. A matching DataType and DataKind must
1010 * be provided. The DataType and DataKind must contain the same number of
1011 * components. Vector size will be set to 1.
1012 *
1013 * @param rs The context associated with the new Element.
1014 * @param dt The DataType for the new element.
1015 * @param dk The DataKind to specify the mapping of each component in the
1016 * DataType.
1017 *
1018 * @return Element
1019 */
Jason Sams718cd1f2009-12-23 14:35:29 -08001020 public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) {
Jason Sams718cd1f2009-12-23 14:35:29 -08001021 if (!(dk == DataKind.PIXEL_L ||
1022 dk == DataKind.PIXEL_A ||
1023 dk == DataKind.PIXEL_LA ||
1024 dk == DataKind.PIXEL_RGB ||
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001025 dk == DataKind.PIXEL_RGBA ||
1026 dk == DataKind.PIXEL_DEPTH)) {
Jason Samsc1d62102010-11-04 14:32:19 -07001027 throw new RSIllegalArgumentException("Unsupported DataKind");
Jason Sams718cd1f2009-12-23 14:35:29 -08001028 }
1029 if (!(dt == DataType.UNSIGNED_8 ||
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001030 dt == DataType.UNSIGNED_16 ||
Jason Sams718cd1f2009-12-23 14:35:29 -08001031 dt == DataType.UNSIGNED_5_6_5 ||
1032 dt == DataType.UNSIGNED_4_4_4_4 ||
1033 dt == DataType.UNSIGNED_5_5_5_1)) {
Jason Samsc1d62102010-11-04 14:32:19 -07001034 throw new RSIllegalArgumentException("Unsupported DataType");
Jason Sams718cd1f2009-12-23 14:35:29 -08001035 }
1036 if (dt == DataType.UNSIGNED_5_6_5 && dk != DataKind.PIXEL_RGB) {
Jason Samsc1d62102010-11-04 14:32:19 -07001037 throw new RSIllegalArgumentException("Bad kind and type combo");
Jason Sams718cd1f2009-12-23 14:35:29 -08001038 }
1039 if (dt == DataType.UNSIGNED_5_5_5_1 && dk != DataKind.PIXEL_RGBA) {
Jason Samsc1d62102010-11-04 14:32:19 -07001040 throw new RSIllegalArgumentException("Bad kind and type combo");
Jason Sams718cd1f2009-12-23 14:35:29 -08001041 }
1042 if (dt == DataType.UNSIGNED_4_4_4_4 && dk != DataKind.PIXEL_RGBA) {
Jason Samsc1d62102010-11-04 14:32:19 -07001043 throw new RSIllegalArgumentException("Bad kind and type combo");
Jason Sams718cd1f2009-12-23 14:35:29 -08001044 }
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001045 if (dt == DataType.UNSIGNED_16 &&
1046 dk != DataKind.PIXEL_DEPTH) {
1047 throw new RSIllegalArgumentException("Bad kind and type combo");
1048 }
Jason Sams718cd1f2009-12-23 14:35:29 -08001049
1050 int size = 1;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001051 switch (dk) {
1052 case PIXEL_LA:
Jason Sams718cd1f2009-12-23 14:35:29 -08001053 size = 2;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001054 break;
1055 case PIXEL_RGB:
Jason Sams718cd1f2009-12-23 14:35:29 -08001056 size = 3;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001057 break;
1058 case PIXEL_RGBA:
Jason Sams718cd1f2009-12-23 14:35:29 -08001059 size = 4;
Alex Sakhartchouk8e90f2b2011-04-01 14:19:01 -07001060 break;
1061 case PIXEL_DEPTH:
1062 size = 2;
1063 break;
Jason Sams718cd1f2009-12-23 14:35:29 -08001064 }
1065
Alex Sakhartchouk0de94442010-08-11 14:41:28 -07001066 boolean norm = true;
1067 int id = rs.nElementCreate(dt.mID, dk.mID, norm, size);
1068 return new Element(id, rs, dt, dk, norm, size);
Jason Sams718cd1f2009-12-23 14:35:29 -08001069 }
Jason Sams36e612a2009-07-31 16:26:13 -07001070
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001071 /** @deprecated renderscript is deprecated in J
Stephen Hinesf257e512011-06-14 14:54:29 -07001072 * Check if the current Element is compatible with another Element.
1073 * Primitive Elements are compatible if they share the same underlying
1074 * size and type (i.e. U8 is compatible with A_8). User-defined Elements
1075 * must be equal in order to be compatible. This requires strict name
1076 * equivalence for all sub-Elements (in addition to structural equivalence).
1077 *
1078 * @param e The Element to check compatibility with.
1079 *
1080 * @return boolean true if the Elements are compatible, otherwise false.
1081 */
1082 public boolean isCompatible(Element e) {
1083 // Try strict BaseObj equality to start with.
1084 if (this.equals(e)) {
1085 return true;
1086 }
1087
1088 // Ignore mKind because it is allowed to be different (user vs. pixel).
1089 // We also ignore mNormalized because it can be different. The mType
Stephen Hines20948112012-02-14 19:42:42 -08001090 // field must not be NONE since we require name equivalence for
1091 // all user-created Elements.
Stephen Hinesf257e512011-06-14 14:54:29 -07001092 return ((mSize == e.mSize) &&
Stephen Hines20948112012-02-14 19:42:42 -08001093 (mType != DataType.NONE) &&
Stephen Hinesf257e512011-06-14 14:54:29 -07001094 (mType == e.mType) &&
1095 (mVectorSize == e.mVectorSize));
1096 }
1097
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001098 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001099 * Builder class for producing complex elements with matching field and name
1100 * pairs. The builder starts empty. The order in which elements are added
1101 * is retained for the layout in memory.
1102 *
1103 */
Jason Sams36e612a2009-07-31 16:26:13 -07001104 public static class Builder {
1105 RenderScript mRS;
Jason Sams718cd1f2009-12-23 14:35:29 -08001106 Element[] mElements;
1107 String[] mElementNames;
Jason Sams70d4e502010-09-02 17:35:23 -07001108 int[] mArraySizes;
Jason Sams718cd1f2009-12-23 14:35:29 -08001109 int mCount;
Alex Sakhartchouke60149d2011-11-15 15:15:21 -08001110 int mSkipPadding;
Jason Sams22534172009-08-04 16:58:20 -07001111
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001112 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001113 * Create a builder object.
1114 *
1115 * @param rs
1116 */
Jason Sams22534172009-08-04 16:58:20 -07001117 public Builder(RenderScript rs) {
Jason Sams36e612a2009-07-31 16:26:13 -07001118 mRS = rs;
Jason Sams718cd1f2009-12-23 14:35:29 -08001119 mCount = 0;
1120 mElements = new Element[8];
1121 mElementNames = new String[8];
Jason Sams70d4e502010-09-02 17:35:23 -07001122 mArraySizes = new int[8];
Jason Sams36e612a2009-07-31 16:26:13 -07001123 }
1124
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001125 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001126 * Add an array of elements to this element.
1127 *
1128 * @param element
1129 * @param name
1130 * @param arraySize
1131 */
Jason Samsbf6ef8d72010-12-06 15:59:59 -08001132 public Builder add(Element element, String name, int arraySize) {
Jason Sams70d4e502010-09-02 17:35:23 -07001133 if (arraySize < 1) {
Jason Samsc1d62102010-11-04 14:32:19 -07001134 throw new RSIllegalArgumentException("Array size cannot be less than 1.");
Jason Sams70d4e502010-09-02 17:35:23 -07001135 }
Alex Sakhartchouke60149d2011-11-15 15:15:21 -08001136
1137 // Skip padding fields after a vector 3 type.
1138 if (mSkipPadding != 0) {
1139 if (name.startsWith("#padding_")) {
1140 mSkipPadding = 0;
1141 return this;
1142 }
1143 }
1144
1145 if (element.mVectorSize == 3) {
1146 mSkipPadding = 1;
1147 } else {
1148 mSkipPadding = 0;
1149 }
1150
Jason Sams718cd1f2009-12-23 14:35:29 -08001151 if(mCount == mElements.length) {
1152 Element[] e = new Element[mCount + 8];
1153 String[] s = new String[mCount + 8];
Jason Sams70d4e502010-09-02 17:35:23 -07001154 int[] as = new int[mCount + 8];
Jason Sams718cd1f2009-12-23 14:35:29 -08001155 System.arraycopy(mElements, 0, e, 0, mCount);
1156 System.arraycopy(mElementNames, 0, s, 0, mCount);
Jason Sams70d4e502010-09-02 17:35:23 -07001157 System.arraycopy(mArraySizes, 0, as, 0, mCount);
Jason Sams718cd1f2009-12-23 14:35:29 -08001158 mElements = e;
1159 mElementNames = s;
Jason Sams70d4e502010-09-02 17:35:23 -07001160 mArraySizes = as;
Jason Sams36e612a2009-07-31 16:26:13 -07001161 }
Jason Sams718cd1f2009-12-23 14:35:29 -08001162 mElements[mCount] = element;
1163 mElementNames[mCount] = name;
Jason Sams70d4e502010-09-02 17:35:23 -07001164 mArraySizes[mCount] = arraySize;
Jason Sams718cd1f2009-12-23 14:35:29 -08001165 mCount++;
Jason Samsbf6ef8d72010-12-06 15:59:59 -08001166 return this;
Jason Sams07ae4062009-08-27 20:23:34 -07001167 }
1168
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001169 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001170 * Add a single element to this Element.
1171 *
1172 * @param element
1173 * @param name
1174 */
Jason Samsbf6ef8d72010-12-06 15:59:59 -08001175 public Builder add(Element element, String name) {
1176 return add(element, name, 1);
Jason Sams70d4e502010-09-02 17:35:23 -07001177 }
1178
Alex Sakhartchouka0c2eb22012-04-19 16:30:58 -07001179 /** @deprecated renderscript is deprecated in J
Jason Samsa1b13ed2010-11-12 14:58:37 -08001180 * Create the element from this builder.
1181 *
1182 *
1183 * @return Element
1184 */
Jason Sams22534172009-08-04 16:58:20 -07001185 public Element create() {
Jason Sams771bebb2009-12-07 12:40:12 -08001186 mRS.validate();
Jason Sams718cd1f2009-12-23 14:35:29 -08001187 Element[] ein = new Element[mCount];
1188 String[] sin = new String[mCount];
Jason Sams70d4e502010-09-02 17:35:23 -07001189 int[] asin = new int[mCount];
Jason Sams718cd1f2009-12-23 14:35:29 -08001190 java.lang.System.arraycopy(mElements, 0, ein, 0, mCount);
1191 java.lang.System.arraycopy(mElementNames, 0, sin, 0, mCount);
Jason Sams70d4e502010-09-02 17:35:23 -07001192 java.lang.System.arraycopy(mArraySizes, 0, asin, 0, mCount);
Alex Sakhartchouk0de94442010-08-11 14:41:28 -07001193
1194 int[] ids = new int[ein.length];
1195 for (int ct = 0; ct < ein.length; ct++ ) {
Jason Samse07694b2012-04-03 15:36:36 -07001196 ids[ct] = ein[ct].getID(mRS);
Alex Sakhartchouk0de94442010-08-11 14:41:28 -07001197 }
Jason Sams70d4e502010-09-02 17:35:23 -07001198 int id = mRS.nElementCreate2(ids, sin, asin);
1199 return new Element(id, mRS, ein, sin, asin);
Jason Sams36e612a2009-07-31 16:26:13 -07001200 }
1201 }
Jason Sams36e612a2009-07-31 16:26:13 -07001202}
1203