Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 1 | /* |
| 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 Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 17 | /** @file rs_element.rsh |
| 18 | * \brief Element routines |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef __RS_ELEMENT_RSH__ |
| 24 | #define __RS_ELEMENT_RSH__ |
| 25 | |
Alex Sakhartchouk | 3c0c606 | 2012-03-22 16:59:38 -0700 | [diff] [blame] | 26 | #if (defined(RS_VERSION) && (RS_VERSION >= 16)) |
| 27 | |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 28 | /** |
| 29 | * @param e element to get data from |
| 30 | * @return number of sub-elements in this element |
| 31 | */ |
| 32 | extern 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 | */ |
| 40 | extern 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 | */ |
| 49 | extern 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 | */ |
| 60 | extern 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 | */ |
| 69 | extern 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 | */ |
| 78 | extern 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 | */ |
| 85 | extern 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 | */ |
| 92 | extern 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 | */ |
| 99 | extern 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 | */ |
| 107 | extern uint32_t __attribute__((overloadable)) |
| 108 | rsElementGetVectorSize(rs_element e); |
| 109 | |
Alex Sakhartchouk | 3c0c606 | 2012-03-22 16:59:38 -0700 | [diff] [blame] | 110 | #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) |
| 111 | |
Alex Sakhartchouk | 14607a6 | 2012-03-21 09:58:15 -0700 | [diff] [blame] | 112 | #endif // __RS_ELEMENT_RSH__ |
| 113 | |