Lines Matching refs:rs

94     public static Element USER_U8(RenderScript rs) {
95 if(rs.mElement_USER_U8 == null) {
96 rs.mElement_USER_U8 = createUser(rs, DataType.UNSIGNED_8);
98 return rs.mElement_USER_U8;
101 public static Element USER_I8(RenderScript rs) {
102 if(rs.mElement_USER_I8 == null) {
103 rs.mElement_USER_I8 = createUser(rs, DataType.SIGNED_8);
105 return rs.mElement_USER_I8;
108 public static Element USER_U32(RenderScript rs) {
109 if(rs.mElement_USER_U32 == null) {
110 rs.mElement_USER_U32 = createUser(rs, DataType.UNSIGNED_32);
112 return rs.mElement_USER_U32;
115 public static Element USER_I32(RenderScript rs) {
116 if(rs.mElement_USER_I32 == null) {
117 rs.mElement_USER_I32 = createUser(rs, DataType.SIGNED_32);
119 return rs.mElement_USER_I32;
122 public static Element USER_F32(RenderScript rs) {
123 if(rs.mElement_USER_F32 == null) {
124 rs.mElement_USER_F32 = createUser(rs, DataType.FLOAT_32);
126 return rs.mElement_USER_F32;
129 public static Element A_8(RenderScript rs) {
130 if(rs.mElement_A_8 == null) {
131 rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A);
133 return rs.mElement_A_8;
136 public static Element RGB_565(RenderScript rs) {
137 if(rs.mElement_RGB_565 == null) {
138 rs.mElement_RGB_565 = createPixel(rs, DataType.UNSIGNED_5_6_5, DataKind.PIXEL_RGB);
140 return rs.mElement_RGB_565;
143 public static Element RGB_888(RenderScript rs) {
144 if(rs.mElement_RGB_888 == null) {
145 rs.mElement_RGB_888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGB);
147 return rs.mElement_RGB_888;
150 public static Element RGBA_5551(RenderScript rs) {
151 if(rs.mElement_RGBA_5551 == null) {
152 rs.mElement_RGBA_5551 = createPixel(rs, DataType.UNSIGNED_5_5_5_1, DataKind.PIXEL_RGBA);
154 return rs.mElement_RGBA_5551;
157 public static Element RGBA_4444(RenderScript rs) {
158 if(rs.mElement_RGBA_4444 == null) {
159 rs.mElement_RGBA_4444 = createPixel(rs, DataType.UNSIGNED_4_4_4_4, DataKind.PIXEL_RGBA);
161 return rs.mElement_RGBA_4444;
164 public static Element RGBA_8888(RenderScript rs) {
165 if(rs.mElement_RGBA_8888 == null) {
166 rs.mElement_RGBA_8888 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_RGBA);
168 return rs.mElement_RGBA_8888;
171 public static Element INDEX_16(RenderScript rs) {
172 if(rs.mElement_INDEX_16 == null) {
173 rs.mElement_INDEX_16 = createIndex(rs);
175 return rs.mElement_INDEX_16;
178 public static Element ATTRIB_POSITION_2(RenderScript rs) {
179 if(rs.mElement_POSITION_2 == null) {
180 rs.mElement_POSITION_2 = createAttrib(rs, DataType.FLOAT_32, DataKind.POSITION, 2);
182 return rs.mElement_POSITION_2;
185 public static Element ATTRIB_POSITION_3(RenderScript rs) {
186 if(rs.mElement_POSITION_3 == null) {
187 rs.mElement_POSITION_3 = createAttrib(rs, DataType.FLOAT_32, DataKind.POSITION, 3);
189 return rs.mElement_POSITION_3;
192 public static Element ATTRIB_TEXTURE_2(RenderScript rs) {
193 if(rs.mElement_TEXTURE_2 == null) {
194 rs.mElement_TEXTURE_2 = createAttrib(rs, DataType.FLOAT_32, DataKind.TEXTURE, 2);
196 return rs.mElement_TEXTURE_2;
199 public static Element ATTRIB_NORMAL_3(RenderScript rs) {
200 if(rs.mElement_NORMAL_3 == null) {
201 rs.mElement_NORMAL_3 = createAttrib(rs, DataType.FLOAT_32, DataKind.NORMAL, 3);
203 return rs.mElement_NORMAL_3;
206 public static Element ATTRIB_COLOR_U8_4(RenderScript rs) {
207 if(rs.mElement_COLOR_U8_4 == null) {
208 rs.mElement_COLOR_U8_4 = createAttrib(rs, DataType.UNSIGNED_8, DataKind.COLOR, 4);
210 return rs.mElement_COLOR_U8_4;
213 public static Element ATTRIB_COLOR_F32_4(RenderScript rs) {
214 if(rs.mElement_COLOR_F32_4 == null) {
215 rs.mElement_COLOR_F32_4 = createAttrib(rs, DataType.FLOAT_32, DataKind.COLOR, 4);
217 return rs.mElement_COLOR_F32_4;
220 Element(RenderScript rs, Element[] e, String[] n) {
221 super(rs);
230 mID = rs.nElementCreate2(ids, mElementNames);
233 Element(RenderScript rs, DataType dt, DataKind dk, boolean norm, int size) {
234 super(rs);
240 mID = rs.nElementCreate(dt.mID, dk.mID, norm, size);
247 public static Element createFromClass(RenderScript rs, Class c) {
248 rs.validate();
250 Builder b = new Builder(rs);
255 b.add(createUser(rs, DataType.SIGNED_32), f.getName());
257 b.add(createUser(rs, DataType.SIGNED_16), f.getName());
259 b.add(createUser(rs, DataType.SIGNED_8), f.getName());
261 b.add(createUser(rs, DataType.FLOAT_32), f.getName());
271 public static Element createUser(RenderScript rs, DataType dt) {
272 return new Element(rs, dt, DataKind.USER, false, 1);
275 public static Element createVector(RenderScript rs, DataType dt, int size) {
279 return new Element(rs, dt, DataKind.USER, false, size);
282 public static Element createIndex(RenderScript rs) {
283 return new Element(rs, DataType.UNSIGNED_16, DataKind.INDEX, false, 1);
286 public static Element createAttrib(RenderScript rs, DataType dt, DataKind dk, int size) {
332 return new Element(rs, dt, dk, norm, size);
335 public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) {
370 return new Element(rs, dt, dk, true, size);
379 public Builder(RenderScript rs) {
380 mRS = rs;
410 static void initPredefined(RenderScript rs) {
411 int a8 = rs.nElementCreate(DataType.UNSIGNED_8.mID,
413 int rgba4444 = rs.nElementCreate(DataType.UNSIGNED_4_4_4_4.mID,
415 int rgba8888 = rs.nElementCreate(DataType.UNSIGNED_8.mID,
417 int rgb565 = rs.nElementCreate(DataType.UNSIGNED_5_6_5.mID,
419 rs.nInitElements(a8, rgba4444, rgba8888, rgb565);