IT. Expert System.

Android Reference

Element


android.renderscript

Class Element



  • public class Element
    extends BaseObj

    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:

    • Single float value
    • 4 element float vector
    • single RGB-565 color
    • single unsigned int 16

    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.

    Developer Guides

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

    • Method Detail

      • getBytesSize

        public int getBytesSize()
        Returns:
        element size in bytes
      • getVectorSize

        public int getVectorSize()
        Returns the number of vector components. 2 for float2, 4 for float4, etc.
        Returns:
        element vector size
      • isComplex

        public boolean isComplex()
        Return if a element is too complex for use as a data source for a Mesh or a Program.
        Returns:
        boolean
      • getSubElementCount

        public int getSubElementCount()
        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. This function returns zero for simple elements or the number of sub-elements otherwise.
        Returns:
        number of sub-elements in this element
      • getSubElement

        public Element getSubElement(int index)
        For complex elements, this function will return the sub-element at index
        Parameters:
        index - index of the sub-element to return
        Returns:
        sub-element in this element at given index
      • getSubElementName

        public String getSubElementName(int index)
        For complex elements, this function will return the sub-element name at index
        Parameters:
        index - index of the sub-element
        Returns:
        sub-element in this element at given index
      • getSubElementArraySize

        public int getSubElementArraySize(int index)
        For complex elements, some sub-elements could be statically sized arrays. This function will return the array size for sub-element at index
        Parameters:
        index - index of the sub-element
        Returns:
        array size of sub-element in this element at given index
      • getSubElementOffsetBytes

        public int getSubElementOffsetBytes(int index)
        This function specifies the location of a sub-element within the element
        Parameters:
        index - index of the sub-element
        Returns:
        offset in bytes of sub-element in this element at given index
      • BOOLEAN

        public static Element BOOLEAN(RenderScript rs)
        Utility function for returning an Element containing a single Boolean.
        Parameters:
        rs - Context to which the element will belong.
        Returns:
        Element
      • U8

        public static Element U8(RenderScript rs)
        Utility function for returning an Element containing a single UNSIGNED_8.
        Parameters:
        rs - Context to which the element will belong.
        Returns:
        Element
      • I8

        public static Element I8(RenderScript rs)
        Utility function for returning an Element containing a single SIGNED_8.
        Parameters:
        rs - Context to which the element will belong.
        Returns:
        Element
      • createVector

        public static Element createVector(RenderScript rs,
                           Element.DataType dt,
                           int size)
        Create a custom vector element of the specified DataType and vector size. DataKind will be set to USER. Only primitive types (FLOAT_32, FLOAT_64, SIGNED_8, SIGNED_16, SIGNED_32, SIGNED_64, UNSIGNED_8, UNSIGNED_16, UNSIGNED_32, UNSIGNED_64, BOOLEAN) are supported.
        Parameters:
        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.
        Returns:
        Element
      • createPixel

        public static Element createPixel(RenderScript rs,
                          Element.DataType dt,
                          Element.DataKind dk)
        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.
        Parameters:
        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.
        Returns:
        Element
      • isCompatible

        public boolean isCompatible(Element e)
        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).
        Parameters:
        e - The Element to check compatibility with.
        Returns:
        boolean true if the Elements are compatible, otherwise false.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 817 / 96448799. Delta: 0.08318 с