Functions
/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_element.rsh File Reference

Functions

uint32_t rsElementGetSubElementCount (rs_element e)
rs_element rsElementGetSubElement (rs_element, uint32_t index)
uint32_t rsElementGetSubElementNameLength (rs_element e, uint32_t index)
uint32_t rsElementGetSubElementName (rs_element e, uint32_t index, char *name, uint32_t nameLength)
uint32_t rsElementGetSubElementArraySize (rs_element e, uint32_t index)
uint32_t rsElementGetSubElementOffsetBytes (rs_element e, uint32_t index)
uint32_t rsElementGetBytesSize (rs_element e)
rs_data_type rsElementGetDataType (rs_element e)
rs_data_kind rsElementGetDataKind (rs_element e)
uint32_t rsElementGetVectorSize (rs_element e)

Detailed Description

Element routines.

Definition in file rs_element.rsh.


Function Documentation

uint32_t rsElementGetBytesSize ( rs_element  e)

Returns the size of element in bytes

Parameters:
eelement to get data from
Returns:
total size of the element in bytes
rs_data_kind rsElementGetDataKind ( rs_element  e)

Returns the element's data kind

Parameters:
eelement to get data from
Returns:
element's data size
rs_data_type rsElementGetDataType ( rs_element  e)

Returns the element's data type

Parameters:
eelement to get data from
Returns:
element's data type
rs_element rsElementGetSubElement ( rs_element  ,
uint32_t  index 
)

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

Parameters:
eelement to get data from
indexindex of the sub-element to return
Returns:
sub-element in this element at given index
uint32_t rsElementGetSubElementArraySize ( rs_element  e,
uint32_t  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:
eelement to get data from
indexindex of the sub-element
Returns:
array size of sub-element in this element at given index
uint32_t rsElementGetSubElementCount ( rs_element  e)

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.

Parameters:
eelement to get data from
Returns:
number of sub-elements in this element
uint32_t rsElementGetSubElementName ( rs_element  e,
uint32_t  index,
char *  name,
uint32_t  nameLength 
)

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

Parameters:
eelement to get data from
indexindex of the sub-element
namearray to store the name into
nameLengthlength of the provided name array
Returns:
number of characters actually written, excluding the null terminator
uint32_t rsElementGetSubElementNameLength ( rs_element  e,
uint32_t  index 
)

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

Parameters:
eelement to get data from
indexindex of the sub-element to return
Returns:
length of the sub-element name including the null terminator (size of buffer needed to write the name)
uint32_t rsElementGetSubElementOffsetBytes ( rs_element  e,
uint32_t  index 
)

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

Parameters:
eelement to get data from
indexindex of the sub-element
Returns:
offset in bytes of sub-element in this element at given index
uint32_t rsElementGetVectorSize ( rs_element  e)

Returns the element's vector size

Parameters:
eelement to get data from
Returns:
length of the element vector (for float2, float3, etc.)