Element Class

Definition

An Element represents one item within an android.renderscript.Allocation.

[Android.Runtime.Register("android/renderscript/Element", DoNotGenerateAcw=true)]
public class Element : Android.Renderscripts.BaseObj
[<Android.Runtime.Register("android/renderscript/Element", DoNotGenerateAcw=true)>]
type Element = class
    inherit BaseObj
Inheritance
Attributes

Remarks

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

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

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 android.renderscript.Element#RGBA_8888 or android.renderscript#Element.A_8.

<div class="special reference"> <h3>Developer Guides</h3>

For more information about creating an application that uses RenderScript, read the RenderScript developer guide.

</div>

This member is deprecated. Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives.

Java documentation for android.renderscript.Element.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Element(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

BytesSize
Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsComplex

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

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Name

setName assigns a name to an object.

(Inherited from BaseObj)
PeerReference (Inherited from Object)
SubElementCount

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.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

VectorSize

Returns the number of vector components.

Methods

A_8(RenderScript)
ALLOCATION(RenderScript)
BOOLEAN(RenderScript)

Utility function for returning an Element containing a single Boolean.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreatePixel(RenderScript, Element+DataType, Element+DataKind)

Create a new pixel Element type.

CreateVector(RenderScript, Element+DataType, Int32)

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

Destroy()

Frees any native resources associated with this object.

(Inherited from BaseObj)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
ELEMENT(RenderScript)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
F16_2(RenderScript)
F16_3(RenderScript)
F16_4(RenderScript)
F16(RenderScript)
F32_2(RenderScript)
F32_3(RenderScript)
F32_4(RenderScript)
F32(RenderScript)
F64_2(RenderScript)
F64_3(RenderScript)
F64_4(RenderScript)
F64(RenderScript)
FONT(RenderScript)
GetDataKind()
GetDataType()
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetSubElement(Int32)

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

GetSubElementArraySize(Int32)

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

GetSubElementName(Int32)

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

GetSubElementOffsetBytes(Int32)

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

I16_2(RenderScript)
I16_3(RenderScript)
I16_4(RenderScript)
I16(RenderScript)
I32_2(RenderScript)
I32_3(RenderScript)
I32_4(RenderScript)
I32(RenderScript)
I64_2(RenderScript)
I64_3(RenderScript)
I64_4(RenderScript)
I64(RenderScript)
I8_2(RenderScript)
I8_3(RenderScript)
I8_4(RenderScript)
I8(RenderScript)

Utility function for returning an Element containing a single SIGNED_8.

IsCompatible(Element)

Check if the current Element is compatible with another Element.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
MATRIX_2X2(RenderScript)
MATRIX_3X3(RenderScript)
MATRIX_4X4(RenderScript)
MATRIX4X4(RenderScript)
Obsolete.

This member is deprecated.

MESH(RenderScript)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
PROGRAM_FRAGMENT(RenderScript)
PROGRAM_RASTER(RenderScript)
PROGRAM_STORE(RenderScript)
PROGRAM_VERTEX(RenderScript)
RGB_565(RenderScript)
RGB_888(RenderScript)
RGBA_4444(RenderScript)
RGBA_5551(RenderScript)
RGBA_8888(RenderScript)
SAMPLER(RenderScript)
SCRIPT(RenderScript)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
TYPE(RenderScript)
U16_2(RenderScript)
U16_3(RenderScript)
U16_4(RenderScript)
U16(RenderScript)
U32_2(RenderScript)
U32_3(RenderScript)
U32_4(RenderScript)
U32(RenderScript)
U64_2(RenderScript)
U64_3(RenderScript)
U64_4(RenderScript)
U64(RenderScript)
U8_2(RenderScript)
U8_3(RenderScript)
U8_4(RenderScript)
U8(RenderScript)

Utility function for returning an Element containing a single UNSIGNED_8.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
YUV(RenderScript)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to