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