blob: 1a4cdb754ad4374f25f30644a0a484fbc9818e54 [file] [log] [blame]
Alex Sakhartchouk14607a62012-03-21 09:58:15 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070017/** @file rs_element.rsh
18 * \brief Element routines
19 *
20 *
21 */
22
23#ifndef __RS_ELEMENT_RSH__
24#define __RS_ELEMENT_RSH__
25
Alex Sakhartchouk3c0c6062012-03-22 16:59:38 -070026#if (defined(RS_VERSION) && (RS_VERSION >= 16))
27
Alex Sakhartchouk14607a62012-03-21 09:58:15 -070028/**
29 * @param e element to get data from
30 * @return number of sub-elements in this element
31 */
32extern uint32_t __attribute__((overloadable))
33 rsElementGetSubElementCount(rs_element e);
34
35/**
36 * @param e element to get data from
37 * @param index index of the sub-element to return
38 * @return sub-element in this element at given index
39 */
40extern rs_element __attribute__((overloadable))
41 rsElementGetSubElement(rs_element, uint32_t index);
42
43/**
44 * @param e element to get data from
45 * @param index index of the sub-element to return
46 * @return length of the sub-element name including the null
47 * terminator (size of buffer needed to write the name)
48 */
49extern uint32_t __attribute__((overloadable))
50 rsElementGetSubElementNameLength(rs_element e, uint32_t index);
51
52/**
53 * @param e element to get data from
54 * @param index index of the sub-element
55 * @param name array to store the name into
56 * @param nameLength length of the provided name array
57 * @return number of characters actually written, excluding the
58 * null terminator
59 */
60extern uint32_t __attribute__((overloadable))
61 rsElementGetSubElementName(rs_element e, uint32_t index, char *name, uint32_t nameLength);
62
63/**
64 * @param e element to get data from
65 * @param index index of the sub-element
66 * @return array size of sub-element in this element at given
67 * index
68 */
69extern uint32_t __attribute__((overloadable))
70 rsElementGetSubElementArraySize(rs_element e, uint32_t index);
71
72/**
73 * @param e element to get data from
74 * @param index index of the sub-element
75 * @return offset in bytes of sub-element in this element at
76 * given index
77 */
78extern uint32_t __attribute__((overloadable))
79 rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index);
80
81/**
82 * @param e element to get data from
83 * @return total size of the element in bytes
84 */
85extern uint32_t __attribute__((overloadable))
86 rsElementGetSizeBytes(rs_element e);
87
88/**
89 * @param e element to get data from
90 * @return element's data type
91 */
92extern rs_data_type __attribute__((overloadable))
93 rsElementGetDataType(rs_element e);
94
95/**
96 * @param e element to get data from
97 * @return element's data size
98 */
99extern rs_data_kind __attribute__((overloadable))
100 rsElementGetDataKind(rs_element e);
101
102/**
103 * @param e element to get data from
104 * @return length of the element vector (for float2, float3,
105 * etc.)
106 */
107extern uint32_t __attribute__((overloadable))
108 rsElementGetVectorSize(rs_element e);
109
Alex Sakhartchouk3c0c6062012-03-22 16:59:38 -0700110#endif // (defined(RS_VERSION) && (RS_VERSION >= 16))
111
Alex Sakhartchouk14607a62012-03-21 09:58:15 -0700112#endif // __RS_ELEMENT_RSH__
113