Added in API level 11
Deprecated in API level 31

Element


open class Element : BaseObj
kotlin.Any
   ↳ android.renderscript.BaseObj
   ↳ android.renderscript.Element

An Element represents one item within an android.renderscript.Allocation. An Element is roughly equivalent to a C type in a RenderScript kernel. Elements may be basic or complex. Some basic elements are

  • A single float value (equivalent to a float in a kernel)
  • A four-element float vector (equivalent to a float4 in a kernel)
  • An unsigned 32-bit integer (equivalent to an unsigned int in a kernel)
  • A single signed 8-bit integer (equivalent to a char in a kernel)

A complex element is roughly equivalent to a C struct and contains a number of basic or complex Elements. From Java code, a complex element contains a list of sub-elements and names that represents a particular data structure. Structs used in RS scripts are available to Java code by using the ScriptField_structname class that is reflected from a particular script.

Basic Elements are comprised of a android.renderscript.Element.DataType and a android.renderscript.Element.DataKind. The DataType encodes C type information of an Element, while the DataKind encodes how that Element should be interpreted by a android.renderscript.Sampler. Note that android.renderscript.Allocation objects with DataKind android.renderscript.Element.DataKind#USER cannot be used as input for a android.renderscript.Sampler. In general, android.renderscript.Allocation objects that are intended for use with a android.renderscript.Sampler should use bitmap-derived Elements such as RGBA_8888 or A_8.

Summary

Nested classes
open

Builder class for producing complex elements with matching field and name pairs.

The special interpretation of the data if required.

DataType represents the basic type information for a basic element.

Public methods
open static Element!

open static Element!

open static Element!

Utility function for returning an Element containing a single Boolean.

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

Utility function for returning an Element containing a single SIGNED_8.

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

Utility function for returning an Element containing a single UNSIGNED_8.

open static Element!

open static Element!

open static Element!

open static Element!

open static Element!

Create a new pixel Element type.

open static Element!

Create a custom vector element of the specified DataType and vector size.

open Int

open Element.DataKind!

open Element.DataType!

open Element!

For complex elements, this function will return the sub-element at index

open Int

For complex elements, some sub-elements could be statically sized arrays.

open Int

Elements could be simple, such as an int or a float, or a structure with multiple sub elements, such as a collection of floats, float2, float4.

open String!

For complex elements, this function will return the sub-element name at index

open Int

This function specifies the location of a sub-element within the element

open Int

Returns the number of vector components.

open Boolean

Check if the current Element is compatible with another Element.

open Boolean

Return if a element is too complex for use as a data source for a Mesh or a Program.

Inherited functions

Public methods

ALLOCATION

Added in API level 11
open static fun ALLOCATION(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

A_8

Added in API level 11
open static fun A_8(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

BOOLEAN

Added in API level 11
open static fun BOOLEAN(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

Utility function for returning an Element containing a single Boolean.

Parameters
rs RenderScript!: Context to which the element will belong.
Return
Element! Element

ELEMENT

Added in API level 11
open static fun ELEMENT(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F16

Added in API level 23
Deprecated in API level 31
open static fun F16(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F16_2

Added in API level 23
Deprecated in API level 31
open static fun F16_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F16_3

Added in API level 23
Deprecated in API level 31
open static fun F16_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F16_4

Added in API level 23
Deprecated in API level 31
open static fun F16_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F32

Added in API level 11
open static fun F32(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F32_2

Added in API level 11
open static fun F32_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F32_3

Added in API level 11
open static fun F32_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F32_4

Added in API level 11
open static fun F32_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F64

Added in API level 11
open static fun F64(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F64_2

Added in API level 14
Deprecated in API level 31
open static fun F64_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F64_3

Added in API level 14
Deprecated in API level 31
open static fun F64_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

F64_4

Added in API level 14
Deprecated in API level 31
open static fun F64_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

FONT

Added in API level 16
Deprecated in API level 31
open static fun FONT(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I16

Added in API level 11
open static fun I16(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I16_2

Added in API level 14
Deprecated in API level 31
open static fun I16_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I16_3

Added in API level 14
Deprecated in API level 31
open static fun I16_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I16_4

Added in API level 14
Deprecated in API level 31
open static fun I16_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I32

Added in API level 11
open static fun I32(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I32_2

Added in API level 14
Deprecated in API level 31
open static fun I32_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I32_3

Added in API level 14
Deprecated in API level 31
open static fun I32_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I32_4

Added in API level 14
Deprecated in API level 31
open static fun I32_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I64

Added in API level 11
open static fun I64(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I64_2

Added in API level 14
Deprecated in API level 31
open static fun I64_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I64_3

Added in API level 14
Deprecated in API level 31
open static fun I64_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I64_4

Added in API level 14
Deprecated in API level 31
open static fun I64_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I8

Added in API level 11
open static fun I8(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

Utility function for returning an Element containing a single SIGNED_8.

Parameters
rs RenderScript!: Context to which the element will belong.
Return
Element! Element

I8_2

Added in API level 14
Deprecated in API level 31
open static fun I8_2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I8_3

Added in API level 14
Deprecated in API level 31
open static fun I8_3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

I8_4

Added in API level 14
Deprecated in API level 31
open static fun I8_4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

MATRIX4X4

Added in API level 11
Deprecated in API level 16
open static fun MATRIX4X4(rs: RenderScript!): Element!

Deprecated: use MATRIX_4X4

MATRIX_2X2

Added in API level 11
open static fun MATRIX_2X2(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

MATRIX_3X3

Added in API level 11
open static fun MATRIX_3X3(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

MATRIX_4X4

Added in API level 11
open static fun MATRIX_4X4(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

MESH

Added in API level 11
open static fun MESH(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

PROGRAM_FRAGMENT

Added in API level 11
open static fun PROGRAM_FRAGMENT(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

PROGRAM_RASTER

Added in API level 11
open static fun PROGRAM_RASTER(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

PROGRAM_STORE

Added in API level 11
open static fun PROGRAM_STORE(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

PROGRAM_VERTEX

Added in API level 11
open static fun PROGRAM_VERTEX(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

RGBA_4444

Added in API level 11
open static fun RGBA_4444(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

RGBA_5551

Added in API level 11
open static fun RGBA_5551(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

RGBA_8888

Added in API level 11
open static fun RGBA_8888(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

RGB_565

Added in API level 11
open static fun RGB_565(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

RGB_888

Added in API level 11
open static fun RGB_888(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

SAMPLER

Added in API level 11
open static fun SAMPLER(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

SCRIPT

Added in API level 11
open static fun SCRIPT(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.

TYPE

Added in API level 11
open static fun TYPE(rs: RenderScript!): Element!

Deprecated: Deprecated in Java.