java.lang.Object | ||
↳ | android.renderscript.BaseObj | |
↳ | android.renderscript.Element |
The most basic data type. An element represents one cell of a memory allocation. Element is the basic data type of Renderscript. An element can be of two forms: Basic elements or Complex forms. Examples of basic elements are:
Complex elements contain a list of sub-elements and names that represents a structure of data. The fields can be accessed by name from a script or shader. The memory layout is defined and ordered. Data alignment is determined by the most basic primitive type. i.e. a float4 vector will be aligned to sizeof(float) and not sizeof(float4). The ordering of elements in memory will be the order in which they were added with each component aligned as necessary. No re-ordering will be done.
The primary source of elements are from scripts. A script that exports a bind point for a data structure generates a Renderscript element to represent the data exported by the script. The other common source of elements is from bitmap formats.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Element.Builder | Builder class for producing complex elements with matching field and name pairs. | ||||||||||
Element.DataKind | The special interpretation of the data if required. | ||||||||||
Element.DataType | DataType represents the basic type information for a basic element. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.renderscript.BaseObj
| |||||||||||
From class
java.lang.Object
|
Utility function for returning an Element containing a single Boolean.
rs | Context to which the element will belong. |
---|
Utility function for returning an Element containing a single SIGNED_8.
rs | Context to which the element will belong. |
---|
Utility function for returning an Element containing a single UNSIGNED_8.
rs | Context to which the element will belong. |
---|
Create a new pixel Element type. A matching DataType and DataKind must be provided. The DataType and DataKind must contain the same number of components. Vector size will be set to 1.
rs | The context associated with the new Element. |
---|---|
dt | The DataType for the new element. |
dk | The DataKind to specify the mapping of each component in the DataType. |
Create a custom vector element of the specified DataType and vector size. DataKind will be set to USER.
rs | The context associated with the new Element. |
---|---|
dt | The DataType for the new element. |
size | Vector size for the new Element. Range 2-4 inclusive supported. |
Check if the current Element is compatible with another Element. Primitive Elements are compatible if they share the same underlying size and type (i.e. U8 is compatible with A_8). User-defined Elements must be equal in order to be compatible. This requires strict name equivalence for all sub-Elements (in addition to structural equivalence).
e | The Element to check compatibility with. |
---|
Return if a element is too complex for use as a data source for a Mesh or a Program.