1*344a7f5eSAndroid Build Coastguard Worker/* 2*344a7f5eSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*344a7f5eSAndroid Build Coastguard Worker * 4*344a7f5eSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*344a7f5eSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*344a7f5eSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*344a7f5eSAndroid Build Coastguard Worker * 8*344a7f5eSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*344a7f5eSAndroid Build Coastguard Worker * 10*344a7f5eSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*344a7f5eSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*344a7f5eSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*344a7f5eSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*344a7f5eSAndroid Build Coastguard Worker * limitations under the License. 15*344a7f5eSAndroid Build Coastguard Worker */ 16*344a7f5eSAndroid Build Coastguard Worker 17*344a7f5eSAndroid Build Coastguard Worker// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh. 18*344a7f5eSAndroid Build Coastguard Worker 19*344a7f5eSAndroid Build Coastguard Worker/* 20*344a7f5eSAndroid Build Coastguard Worker * rs_object_info.rsh: Object Characteristics Functions 21*344a7f5eSAndroid Build Coastguard Worker * 22*344a7f5eSAndroid Build Coastguard Worker * The functions below can be used to query the characteristics of an Allocation, Element, 23*344a7f5eSAndroid Build Coastguard Worker * or Sampler object. These objects are created from Java. You can't create them from a 24*344a7f5eSAndroid Build Coastguard Worker * script. 25*344a7f5eSAndroid Build Coastguard Worker * 26*344a7f5eSAndroid Build Coastguard Worker * Allocations: 27*344a7f5eSAndroid Build Coastguard Worker * 28*344a7f5eSAndroid Build Coastguard Worker * Allocations are the primary method used to pass data to and from RenderScript kernels. 29*344a7f5eSAndroid Build Coastguard Worker * 30*344a7f5eSAndroid Build Coastguard Worker * They are a structured collection of cells that can be used to store bitmaps, textures, 31*344a7f5eSAndroid Build Coastguard Worker * arbitrary data points, etc. 32*344a7f5eSAndroid Build Coastguard Worker * 33*344a7f5eSAndroid Build Coastguard Worker * This collection of cells may have many dimensions (X, Y, Z, Array0, Array1, Array2, Array3), 34*344a7f5eSAndroid Build Coastguard Worker * faces (for cubemaps), and level of details (for mipmapping). 35*344a7f5eSAndroid Build Coastguard Worker * 36*344a7f5eSAndroid Build Coastguard Worker * See the android.renderscript.Allocation for details on to create Allocations. 37*344a7f5eSAndroid Build Coastguard Worker * 38*344a7f5eSAndroid Build Coastguard Worker * Elements: 39*344a7f5eSAndroid Build Coastguard Worker * 40*344a7f5eSAndroid Build Coastguard Worker * The term "element" is used a bit ambiguously in RenderScript, as both type information 41*344a7f5eSAndroid Build Coastguard Worker * for the cells of an Allocation and the instantiation of that type. For example: 42*344a7f5eSAndroid Build Coastguard Worker * - rs_element is a handle to a type specification, and 43*344a7f5eSAndroid Build Coastguard Worker * - In functions like rsGetElementAt(), "element" means the instantiation of the type, 44*344a7f5eSAndroid Build Coastguard Worker * i.e. a cell of an Allocation. 45*344a7f5eSAndroid Build Coastguard Worker * 46*344a7f5eSAndroid Build Coastguard Worker * The functions below let you query the characteristics of the type specificiation. 47*344a7f5eSAndroid Build Coastguard Worker * 48*344a7f5eSAndroid Build Coastguard Worker * An Element can specify a simple data types as found in C, e.g. an integer, float, or 49*344a7f5eSAndroid Build Coastguard Worker * boolean. It can also specify a handle to a RenderScript object. See rs_data_type for 50*344a7f5eSAndroid Build Coastguard Worker * a list of basic types. 51*344a7f5eSAndroid Build Coastguard Worker * 52*344a7f5eSAndroid Build Coastguard Worker * Elements can specify fixed size vector (of size 2, 3, or 4) versions of the basic types. 53*344a7f5eSAndroid Build Coastguard Worker * Elements can be grouped together into complex Elements, creating the equivalent of 54*344a7f5eSAndroid Build Coastguard Worker * C structure definitions. 55*344a7f5eSAndroid Build Coastguard Worker * 56*344a7f5eSAndroid Build Coastguard Worker * Elements can also have a kind, which is semantic information used to interpret pixel 57*344a7f5eSAndroid Build Coastguard Worker * data. See rs_data_kind. 58*344a7f5eSAndroid Build Coastguard Worker * 59*344a7f5eSAndroid Build Coastguard Worker * When creating Allocations of common elements, you can simply use one of the many predefined 60*344a7f5eSAndroid Build Coastguard Worker * Elements like F32_2. 61*344a7f5eSAndroid Build Coastguard Worker * 62*344a7f5eSAndroid Build Coastguard Worker * To create complex Elements, use the Element.Builder Java class. 63*344a7f5eSAndroid Build Coastguard Worker * 64*344a7f5eSAndroid Build Coastguard Worker * Samplers: 65*344a7f5eSAndroid Build Coastguard Worker * 66*344a7f5eSAndroid Build Coastguard Worker * Samplers objects define how Allocations can be read as structure within a kernel. 67*344a7f5eSAndroid Build Coastguard Worker * See android.renderscript.S. 68*344a7f5eSAndroid Build Coastguard Worker */ 69*344a7f5eSAndroid Build Coastguard Worker 70*344a7f5eSAndroid Build Coastguard Worker#ifndef RENDERSCRIPT_RS_OBJECT_INFO_RSH 71*344a7f5eSAndroid Build Coastguard Worker#define RENDERSCRIPT_RS_OBJECT_INFO_RSH 72*344a7f5eSAndroid Build Coastguard Worker 73*344a7f5eSAndroid Build Coastguard Worker/* 74*344a7f5eSAndroid Build Coastguard Worker * rsAllocationGetDimFaces: Presence of more than one face 75*344a7f5eSAndroid Build Coastguard Worker * 76*344a7f5eSAndroid Build Coastguard Worker * If the Allocation is a cubemap, this function returns 1 if there's more than one face 77*344a7f5eSAndroid Build Coastguard Worker * present. In all other cases, it returns 0. 78*344a7f5eSAndroid Build Coastguard Worker * 79*344a7f5eSAndroid Build Coastguard Worker * Use rsGetDimHasFaces() to get the dimension of a currently running kernel. 80*344a7f5eSAndroid Build Coastguard Worker * 81*344a7f5eSAndroid Build Coastguard Worker * Returns: Returns 1 if more than one face is present, 0 otherwise. 82*344a7f5eSAndroid Build Coastguard Worker */ 83*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 84*344a7f5eSAndroid Build Coastguard Worker rsAllocationGetDimFaces(rs_allocation a); 85*344a7f5eSAndroid Build Coastguard Worker 86*344a7f5eSAndroid Build Coastguard Worker/* 87*344a7f5eSAndroid Build Coastguard Worker * rsAllocationGetDimLOD: Presence of levels of detail 88*344a7f5eSAndroid Build Coastguard Worker * 89*344a7f5eSAndroid Build Coastguard Worker * Query an Allocation for the presence of more than one Level Of Detail. This is useful 90*344a7f5eSAndroid Build Coastguard Worker * for mipmaps. 91*344a7f5eSAndroid Build Coastguard Worker * 92*344a7f5eSAndroid Build Coastguard Worker * Use rsGetDimLod() to get the dimension of a currently running kernel. 93*344a7f5eSAndroid Build Coastguard Worker * 94*344a7f5eSAndroid Build Coastguard Worker * Returns: Returns 1 if more than one LOD is present, 0 otherwise. 95*344a7f5eSAndroid Build Coastguard Worker */ 96*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 97*344a7f5eSAndroid Build Coastguard Worker rsAllocationGetDimLOD(rs_allocation a); 98*344a7f5eSAndroid Build Coastguard Worker 99*344a7f5eSAndroid Build Coastguard Worker/* 100*344a7f5eSAndroid Build Coastguard Worker * rsAllocationGetDimX: Size of the X dimension 101*344a7f5eSAndroid Build Coastguard Worker * 102*344a7f5eSAndroid Build Coastguard Worker * Returns the size of the X dimension of the Allocation. 103*344a7f5eSAndroid Build Coastguard Worker * 104*344a7f5eSAndroid Build Coastguard Worker * Use rsGetDimX() to get the dimension of a currently running kernel. 105*344a7f5eSAndroid Build Coastguard Worker * 106*344a7f5eSAndroid Build Coastguard Worker * Returns: X dimension of the Allocation. 107*344a7f5eSAndroid Build Coastguard Worker */ 108*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 109*344a7f5eSAndroid Build Coastguard Worker rsAllocationGetDimX(rs_allocation a); 110*344a7f5eSAndroid Build Coastguard Worker 111*344a7f5eSAndroid Build Coastguard Worker/* 112*344a7f5eSAndroid Build Coastguard Worker * rsAllocationGetDimY: Size of the Y dimension 113*344a7f5eSAndroid Build Coastguard Worker * 114*344a7f5eSAndroid Build Coastguard Worker * Returns the size of the Y dimension of the Allocation. If the Allocation has less 115*344a7f5eSAndroid Build Coastguard Worker * than two dimensions, returns 0. 116*344a7f5eSAndroid Build Coastguard Worker * 117*344a7f5eSAndroid Build Coastguard Worker * Use rsGetDimY() to get the dimension of a currently running kernel. 118*344a7f5eSAndroid Build Coastguard Worker * 119*344a7f5eSAndroid Build Coastguard Worker * Returns: Y dimension of the Allocation. 120*344a7f5eSAndroid Build Coastguard Worker */ 121*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 122*344a7f5eSAndroid Build Coastguard Worker rsAllocationGetDimY(rs_allocation a); 123*344a7f5eSAndroid Build Coastguard Worker 124*344a7f5eSAndroid Build Coastguard Worker/* 125*344a7f5eSAndroid Build Coastguard Worker * rsAllocationGetDimZ: Size of the Z dimension 126*344a7f5eSAndroid Build Coastguard Worker * 127*344a7f5eSAndroid Build Coastguard Worker * Returns the size of the Z dimension of the Allocation. If the Allocation has less 128*344a7f5eSAndroid Build Coastguard Worker * than three dimensions, returns 0. 129*344a7f5eSAndroid Build Coastguard Worker * 130*344a7f5eSAndroid Build Coastguard Worker * Use rsGetDimZ() to get the dimension of a currently running kernel. 131*344a7f5eSAndroid Build Coastguard Worker * 132*344a7f5eSAndroid Build Coastguard Worker * Returns: Z dimension of the Allocation. 133*344a7f5eSAndroid Build Coastguard Worker */ 134*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 135*344a7f5eSAndroid Build Coastguard Worker rsAllocationGetDimZ(rs_allocation a); 136*344a7f5eSAndroid Build Coastguard Worker 137*344a7f5eSAndroid Build Coastguard Worker/* 138*344a7f5eSAndroid Build Coastguard Worker * rsAllocationGetElement: Get the object that describes the cell of an Allocation 139*344a7f5eSAndroid Build Coastguard Worker * 140*344a7f5eSAndroid Build Coastguard Worker * Get the Element object describing the type, kind, and other characteristics of a cell 141*344a7f5eSAndroid Build Coastguard Worker * of an Allocation. See the rsElement* functions below. 142*344a7f5eSAndroid Build Coastguard Worker * 143*344a7f5eSAndroid Build Coastguard Worker * Parameters: 144*344a7f5eSAndroid Build Coastguard Worker * a: Allocation to get data from. 145*344a7f5eSAndroid Build Coastguard Worker * 146*344a7f5eSAndroid Build Coastguard Worker * Returns: Element describing Allocation layout. 147*344a7f5eSAndroid Build Coastguard Worker */ 148*344a7f5eSAndroid Build Coastguard Workerextern rs_element __attribute__((overloadable)) 149*344a7f5eSAndroid Build Coastguard Worker rsAllocationGetElement(rs_allocation a); 150*344a7f5eSAndroid Build Coastguard Worker 151*344a7f5eSAndroid Build Coastguard Worker/* 152*344a7f5eSAndroid Build Coastguard Worker * rsClearObject: Release an object 153*344a7f5eSAndroid Build Coastguard Worker * 154*344a7f5eSAndroid Build Coastguard Worker * Tells the run time that this handle will no longer be used to access the the related 155*344a7f5eSAndroid Build Coastguard Worker * object. If this was the last handle to that object, resource recovery may happen. 156*344a7f5eSAndroid Build Coastguard Worker * 157*344a7f5eSAndroid Build Coastguard Worker * After calling this function, *dst will be set to an empty handle. See rsIsObject(). 158*344a7f5eSAndroid Build Coastguard Worker */ 159*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 160*344a7f5eSAndroid Build Coastguard Worker rsClearObject(rs_element* dst); 161*344a7f5eSAndroid Build Coastguard Worker 162*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 163*344a7f5eSAndroid Build Coastguard Worker rsClearObject(rs_type* dst); 164*344a7f5eSAndroid Build Coastguard Worker 165*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 166*344a7f5eSAndroid Build Coastguard Worker rsClearObject(rs_allocation* dst); 167*344a7f5eSAndroid Build Coastguard Worker 168*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 169*344a7f5eSAndroid Build Coastguard Worker rsClearObject(rs_sampler* dst); 170*344a7f5eSAndroid Build Coastguard Worker 171*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 172*344a7f5eSAndroid Build Coastguard Worker rsClearObject(rs_script* dst); 173*344a7f5eSAndroid Build Coastguard Worker 174*344a7f5eSAndroid Build Coastguard Worker/* 175*344a7f5eSAndroid Build Coastguard Worker * rsIsObject: Check for an empty handle 176*344a7f5eSAndroid Build Coastguard Worker * 177*344a7f5eSAndroid Build Coastguard Worker * Returns true if the handle contains a non-null reference. 178*344a7f5eSAndroid Build Coastguard Worker * 179*344a7f5eSAndroid Build Coastguard Worker * This function does not validate that the internal pointer used in the handle 180*344a7f5eSAndroid Build Coastguard Worker * points to an actual valid object; it only checks for null. 181*344a7f5eSAndroid Build Coastguard Worker * 182*344a7f5eSAndroid Build Coastguard Worker * This function can be used to check the Element returned by rsElementGetSubElement() 183*344a7f5eSAndroid Build Coastguard Worker * or see if rsClearObject() has been called on a handle. 184*344a7f5eSAndroid Build Coastguard Worker */ 185*344a7f5eSAndroid Build Coastguard Workerextern bool __attribute__((overloadable)) 186*344a7f5eSAndroid Build Coastguard Worker rsIsObject(rs_element v); 187*344a7f5eSAndroid Build Coastguard Worker 188*344a7f5eSAndroid Build Coastguard Workerextern bool __attribute__((overloadable)) 189*344a7f5eSAndroid Build Coastguard Worker rsIsObject(rs_type v); 190*344a7f5eSAndroid Build Coastguard Worker 191*344a7f5eSAndroid Build Coastguard Workerextern bool __attribute__((overloadable)) 192*344a7f5eSAndroid Build Coastguard Worker rsIsObject(rs_allocation v); 193*344a7f5eSAndroid Build Coastguard Worker 194*344a7f5eSAndroid Build Coastguard Workerextern bool __attribute__((overloadable)) 195*344a7f5eSAndroid Build Coastguard Worker rsIsObject(rs_sampler v); 196*344a7f5eSAndroid Build Coastguard Worker 197*344a7f5eSAndroid Build Coastguard Workerextern bool __attribute__((overloadable)) 198*344a7f5eSAndroid Build Coastguard Worker rsIsObject(rs_script v); 199*344a7f5eSAndroid Build Coastguard Worker 200*344a7f5eSAndroid Build Coastguard Worker/* 201*344a7f5eSAndroid Build Coastguard Worker * rsElementGetBytesSize: Size of an Element 202*344a7f5eSAndroid Build Coastguard Worker * 203*344a7f5eSAndroid Build Coastguard Worker * Returns the size in bytes that an instantiation of this Element will occupy. 204*344a7f5eSAndroid Build Coastguard Worker */ 205*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 206*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 207*344a7f5eSAndroid Build Coastguard Worker rsElementGetBytesSize(rs_element e); 208*344a7f5eSAndroid Build Coastguard Worker#endif 209*344a7f5eSAndroid Build Coastguard Worker 210*344a7f5eSAndroid Build Coastguard Worker/* 211*344a7f5eSAndroid Build Coastguard Worker * rsElementGetDataKind: Kind of an Element 212*344a7f5eSAndroid Build Coastguard Worker * 213*344a7f5eSAndroid Build Coastguard Worker * Returns the Element's data kind. This is used to interpret pixel data. 214*344a7f5eSAndroid Build Coastguard Worker * 215*344a7f5eSAndroid Build Coastguard Worker * See rs_data_kind. 216*344a7f5eSAndroid Build Coastguard Worker */ 217*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 218*344a7f5eSAndroid Build Coastguard Workerextern rs_data_kind __attribute__((overloadable)) 219*344a7f5eSAndroid Build Coastguard Worker rsElementGetDataKind(rs_element e); 220*344a7f5eSAndroid Build Coastguard Worker#endif 221*344a7f5eSAndroid Build Coastguard Worker 222*344a7f5eSAndroid Build Coastguard Worker/* 223*344a7f5eSAndroid Build Coastguard Worker * rsElementGetDataType: Data type of an Element 224*344a7f5eSAndroid Build Coastguard Worker * 225*344a7f5eSAndroid Build Coastguard Worker * Returns the Element's base data type. This can be a type similar to C/C++ (e.g. 226*344a7f5eSAndroid Build Coastguard Worker * RS_TYPE_UNSIGNED_8), a handle (e.g. RS_TYPE_ALLOCATION and RS_TYPE_ELEMENT), or a 227*344a7f5eSAndroid Build Coastguard Worker * more complex numerical type (e.g. RS_TYPE_UNSIGNED_5_6_5 and RS_TYPE_MATRIX_4X4). 228*344a7f5eSAndroid Build Coastguard Worker * See rs_data_type. 229*344a7f5eSAndroid Build Coastguard Worker * 230*344a7f5eSAndroid Build Coastguard Worker * If the Element describes a vector, this function returns the data type of one of its items. 231*344a7f5eSAndroid Build Coastguard Worker * Use rsElementGetVectorSize to get the size of the vector. 232*344a7f5eSAndroid Build Coastguard Worker * 233*344a7f5eSAndroid Build Coastguard Worker * If the Element describes a structure, RS_TYPE_NONE is returned. Use the rsElementGetSub* 234*344a7f5eSAndroid Build Coastguard Worker * functions to explore this complex Element. 235*344a7f5eSAndroid Build Coastguard Worker */ 236*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 237*344a7f5eSAndroid Build Coastguard Workerextern rs_data_type __attribute__((overloadable)) 238*344a7f5eSAndroid Build Coastguard Worker rsElementGetDataType(rs_element e); 239*344a7f5eSAndroid Build Coastguard Worker#endif 240*344a7f5eSAndroid Build Coastguard Worker 241*344a7f5eSAndroid Build Coastguard Worker/* 242*344a7f5eSAndroid Build Coastguard Worker * rsElementGetSubElement: Sub-element of a complex Element 243*344a7f5eSAndroid Build Coastguard Worker * 244*344a7f5eSAndroid Build Coastguard Worker * For Elements that represents a structure, this function returns the sub-element at the 245*344a7f5eSAndroid Build Coastguard Worker * specified index. 246*344a7f5eSAndroid Build Coastguard Worker * 247*344a7f5eSAndroid Build Coastguard Worker * If the Element is not a structure or the index is greater or equal to the number of 248*344a7f5eSAndroid Build Coastguard Worker * sub-elements, an invalid handle is returned. 249*344a7f5eSAndroid Build Coastguard Worker * 250*344a7f5eSAndroid Build Coastguard Worker * Parameters: 251*344a7f5eSAndroid Build Coastguard Worker * e: Element to query. 252*344a7f5eSAndroid Build Coastguard Worker * index: Index of the sub-element to return. 253*344a7f5eSAndroid Build Coastguard Worker * 254*344a7f5eSAndroid Build Coastguard Worker * Returns: Sub-element at the given index. 255*344a7f5eSAndroid Build Coastguard Worker */ 256*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 257*344a7f5eSAndroid Build Coastguard Workerextern rs_element __attribute__((overloadable)) 258*344a7f5eSAndroid Build Coastguard Worker rsElementGetSubElement(rs_element e, uint32_t index); 259*344a7f5eSAndroid Build Coastguard Worker#endif 260*344a7f5eSAndroid Build Coastguard Worker 261*344a7f5eSAndroid Build Coastguard Worker/* 262*344a7f5eSAndroid Build Coastguard Worker * rsElementGetSubElementArraySize: Array size of a sub-element of a complex Element 263*344a7f5eSAndroid Build Coastguard Worker * 264*344a7f5eSAndroid Build Coastguard Worker * For complex Elements, sub-elements can be statically sized arrays. This function 265*344a7f5eSAndroid Build Coastguard Worker * returns the array size of the sub-element at the index. This sub-element repetition 266*344a7f5eSAndroid Build Coastguard Worker * is different than fixed size vectors. 267*344a7f5eSAndroid Build Coastguard Worker * 268*344a7f5eSAndroid Build Coastguard Worker * Parameters: 269*344a7f5eSAndroid Build Coastguard Worker * e: Element to query. 270*344a7f5eSAndroid Build Coastguard Worker * index: Index of the sub-element. 271*344a7f5eSAndroid Build Coastguard Worker * 272*344a7f5eSAndroid Build Coastguard Worker * Returns: Array size of the sub-element. 273*344a7f5eSAndroid Build Coastguard Worker */ 274*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 275*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 276*344a7f5eSAndroid Build Coastguard Worker rsElementGetSubElementArraySize(rs_element e, uint32_t index); 277*344a7f5eSAndroid Build Coastguard Worker#endif 278*344a7f5eSAndroid Build Coastguard Worker 279*344a7f5eSAndroid Build Coastguard Worker/* 280*344a7f5eSAndroid Build Coastguard Worker * rsElementGetSubElementCount: Number of sub-elements 281*344a7f5eSAndroid Build Coastguard Worker * 282*344a7f5eSAndroid Build Coastguard Worker * Elements can be simple, such as an int or a float, or a structure with multiple 283*344a7f5eSAndroid Build Coastguard Worker * sub-elements. This function returns zero for simple Elements and the number of 284*344a7f5eSAndroid Build Coastguard Worker * sub-elements for complex Elements. 285*344a7f5eSAndroid Build Coastguard Worker * 286*344a7f5eSAndroid Build Coastguard Worker * Parameters: 287*344a7f5eSAndroid Build Coastguard Worker * e: Element to get data from. 288*344a7f5eSAndroid Build Coastguard Worker * 289*344a7f5eSAndroid Build Coastguard Worker * Returns: Number of sub-elements. 290*344a7f5eSAndroid Build Coastguard Worker */ 291*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 292*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 293*344a7f5eSAndroid Build Coastguard Worker rsElementGetSubElementCount(rs_element e); 294*344a7f5eSAndroid Build Coastguard Worker#endif 295*344a7f5eSAndroid Build Coastguard Worker 296*344a7f5eSAndroid Build Coastguard Worker/* 297*344a7f5eSAndroid Build Coastguard Worker * rsElementGetSubElementName: Name of a sub-element 298*344a7f5eSAndroid Build Coastguard Worker * 299*344a7f5eSAndroid Build Coastguard Worker * For complex Elements, this function returns the name of the sub-element at the 300*344a7f5eSAndroid Build Coastguard Worker * specified index. 301*344a7f5eSAndroid Build Coastguard Worker * 302*344a7f5eSAndroid Build Coastguard Worker * Parameters: 303*344a7f5eSAndroid Build Coastguard Worker * e: Element to get data from. 304*344a7f5eSAndroid Build Coastguard Worker * index: Index of the sub-element. 305*344a7f5eSAndroid Build Coastguard Worker * name: Address of the array to store the name into. 306*344a7f5eSAndroid Build Coastguard Worker * nameLength: Length of the provided name array. 307*344a7f5eSAndroid Build Coastguard Worker * 308*344a7f5eSAndroid Build Coastguard Worker * Returns: Number of characters copied, excluding the null terminator. 309*344a7f5eSAndroid Build Coastguard Worker */ 310*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 311*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 312*344a7f5eSAndroid Build Coastguard Worker rsElementGetSubElementName(rs_element e, uint32_t index, char* name, uint32_t nameLength); 313*344a7f5eSAndroid Build Coastguard Worker#endif 314*344a7f5eSAndroid Build Coastguard Worker 315*344a7f5eSAndroid Build Coastguard Worker/* 316*344a7f5eSAndroid Build Coastguard Worker * rsElementGetSubElementNameLength: Length of the name of a sub-element 317*344a7f5eSAndroid Build Coastguard Worker * 318*344a7f5eSAndroid Build Coastguard Worker * For complex Elements, this function returns the length of the name of the sub-element 319*344a7f5eSAndroid Build Coastguard Worker * at the specified index. 320*344a7f5eSAndroid Build Coastguard Worker * 321*344a7f5eSAndroid Build Coastguard Worker * Parameters: 322*344a7f5eSAndroid Build Coastguard Worker * e: Element to get data from. 323*344a7f5eSAndroid Build Coastguard Worker * index: Index of the sub-element. 324*344a7f5eSAndroid Build Coastguard Worker * 325*344a7f5eSAndroid Build Coastguard Worker * Returns: Length of the sub-element name including the null terminator. 326*344a7f5eSAndroid Build Coastguard Worker */ 327*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 328*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 329*344a7f5eSAndroid Build Coastguard Worker rsElementGetSubElementNameLength(rs_element e, uint32_t index); 330*344a7f5eSAndroid Build Coastguard Worker#endif 331*344a7f5eSAndroid Build Coastguard Worker 332*344a7f5eSAndroid Build Coastguard Worker/* 333*344a7f5eSAndroid Build Coastguard Worker * rsElementGetSubElementOffsetBytes: Offset of the instantiated sub-element 334*344a7f5eSAndroid Build Coastguard Worker * 335*344a7f5eSAndroid Build Coastguard Worker * This function returns the relative position of the instantiation of the specified 336*344a7f5eSAndroid Build Coastguard Worker * sub-element within the instantiation of the Element. 337*344a7f5eSAndroid Build Coastguard Worker * 338*344a7f5eSAndroid Build Coastguard Worker * For example, if the Element describes a 32 bit float followed by a 32 bit integer, 339*344a7f5eSAndroid Build Coastguard Worker * the offset return for the first will be 0 and the second 4. 340*344a7f5eSAndroid Build Coastguard Worker * 341*344a7f5eSAndroid Build Coastguard Worker * Parameters: 342*344a7f5eSAndroid Build Coastguard Worker * e: Element to get data from. 343*344a7f5eSAndroid Build Coastguard Worker * index: Index of the sub-element. 344*344a7f5eSAndroid Build Coastguard Worker * 345*344a7f5eSAndroid Build Coastguard Worker * Returns: Offset in bytes. 346*344a7f5eSAndroid Build Coastguard Worker */ 347*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 348*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 349*344a7f5eSAndroid Build Coastguard Worker rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index); 350*344a7f5eSAndroid Build Coastguard Worker#endif 351*344a7f5eSAndroid Build Coastguard Worker 352*344a7f5eSAndroid Build Coastguard Worker/* 353*344a7f5eSAndroid Build Coastguard Worker * rsElementGetVectorSize: Vector size of the Element 354*344a7f5eSAndroid Build Coastguard Worker * 355*344a7f5eSAndroid Build Coastguard Worker * Returns the Element's vector size. If the Element does not represent a vector, 356*344a7f5eSAndroid Build Coastguard Worker * 1 is returned. 357*344a7f5eSAndroid Build Coastguard Worker * 358*344a7f5eSAndroid Build Coastguard Worker * Parameters: 359*344a7f5eSAndroid Build Coastguard Worker * e: Element to get data from. 360*344a7f5eSAndroid Build Coastguard Worker * 361*344a7f5eSAndroid Build Coastguard Worker * Returns: Length of the element vector. 362*344a7f5eSAndroid Build Coastguard Worker */ 363*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 364*344a7f5eSAndroid Build Coastguard Workerextern uint32_t __attribute__((overloadable)) 365*344a7f5eSAndroid Build Coastguard Worker rsElementGetVectorSize(rs_element e); 366*344a7f5eSAndroid Build Coastguard Worker#endif 367*344a7f5eSAndroid Build Coastguard Worker 368*344a7f5eSAndroid Build Coastguard Worker/* 369*344a7f5eSAndroid Build Coastguard Worker * rsGetAllocation: Return the Allocation for a given pointer 370*344a7f5eSAndroid Build Coastguard Worker * 371*344a7f5eSAndroid Build Coastguard Worker * DEPRECATED. Do not use. 372*344a7f5eSAndroid Build Coastguard Worker * 373*344a7f5eSAndroid Build Coastguard Worker * Returns the Allocation for a given pointer. The pointer should point within a valid 374*344a7f5eSAndroid Build Coastguard Worker * allocation. The results are undefined if the pointer is not from a valid Allocation. 375*344a7f5eSAndroid Build Coastguard Worker */ 376*344a7f5eSAndroid Build Coastguard Workerextern rs_allocation __attribute__((overloadable 377*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 22)) 378*344a7f5eSAndroid Build Coastguard Worker, deprecated("This function is deprecated and will be removed from the SDK in a future release.") 379*344a7f5eSAndroid Build Coastguard Worker#endif 380*344a7f5eSAndroid Build Coastguard Worker)) 381*344a7f5eSAndroid Build Coastguard Worker rsGetAllocation(const void* p); 382*344a7f5eSAndroid Build Coastguard Worker 383*344a7f5eSAndroid Build Coastguard Worker/* 384*344a7f5eSAndroid Build Coastguard Worker * rsSamplerGetAnisotropy: Anisotropy of the Sampler 385*344a7f5eSAndroid Build Coastguard Worker * 386*344a7f5eSAndroid Build Coastguard Worker * Get the Sampler's anisotropy. 387*344a7f5eSAndroid Build Coastguard Worker * 388*344a7f5eSAndroid Build Coastguard Worker * See android.renderscript.S. 389*344a7f5eSAndroid Build Coastguard Worker */ 390*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 391*344a7f5eSAndroid Build Coastguard Workerextern float __attribute__((overloadable)) 392*344a7f5eSAndroid Build Coastguard Worker rsSamplerGetAnisotropy(rs_sampler s); 393*344a7f5eSAndroid Build Coastguard Worker#endif 394*344a7f5eSAndroid Build Coastguard Worker 395*344a7f5eSAndroid Build Coastguard Worker/* 396*344a7f5eSAndroid Build Coastguard Worker * rsSamplerGetMagnification: Sampler magnification value 397*344a7f5eSAndroid Build Coastguard Worker * 398*344a7f5eSAndroid Build Coastguard Worker * Get the Sampler's magnification value. 399*344a7f5eSAndroid Build Coastguard Worker * 400*344a7f5eSAndroid Build Coastguard Worker * See android.renderscript.S. 401*344a7f5eSAndroid Build Coastguard Worker */ 402*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 403*344a7f5eSAndroid Build Coastguard Workerextern rs_sampler_value __attribute__((overloadable)) 404*344a7f5eSAndroid Build Coastguard Worker rsSamplerGetMagnification(rs_sampler s); 405*344a7f5eSAndroid Build Coastguard Worker#endif 406*344a7f5eSAndroid Build Coastguard Worker 407*344a7f5eSAndroid Build Coastguard Worker/* 408*344a7f5eSAndroid Build Coastguard Worker * rsSamplerGetMinification: Sampler minification value 409*344a7f5eSAndroid Build Coastguard Worker * 410*344a7f5eSAndroid Build Coastguard Worker * Get the Sampler's minification value. 411*344a7f5eSAndroid Build Coastguard Worker * 412*344a7f5eSAndroid Build Coastguard Worker * See android.renderscript.S. 413*344a7f5eSAndroid Build Coastguard Worker */ 414*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 415*344a7f5eSAndroid Build Coastguard Workerextern rs_sampler_value __attribute__((overloadable)) 416*344a7f5eSAndroid Build Coastguard Worker rsSamplerGetMinification(rs_sampler s); 417*344a7f5eSAndroid Build Coastguard Worker#endif 418*344a7f5eSAndroid Build Coastguard Worker 419*344a7f5eSAndroid Build Coastguard Worker/* 420*344a7f5eSAndroid Build Coastguard Worker * rsSamplerGetWrapS: Sampler wrap S value 421*344a7f5eSAndroid Build Coastguard Worker * 422*344a7f5eSAndroid Build Coastguard Worker * Get the Sampler's wrap S value. 423*344a7f5eSAndroid Build Coastguard Worker * 424*344a7f5eSAndroid Build Coastguard Worker * See android.renderscript.S. 425*344a7f5eSAndroid Build Coastguard Worker */ 426*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 427*344a7f5eSAndroid Build Coastguard Workerextern rs_sampler_value __attribute__((overloadable)) 428*344a7f5eSAndroid Build Coastguard Worker rsSamplerGetWrapS(rs_sampler s); 429*344a7f5eSAndroid Build Coastguard Worker#endif 430*344a7f5eSAndroid Build Coastguard Worker 431*344a7f5eSAndroid Build Coastguard Worker/* 432*344a7f5eSAndroid Build Coastguard Worker * rsSamplerGetWrapT: Sampler wrap T value 433*344a7f5eSAndroid Build Coastguard Worker * 434*344a7f5eSAndroid Build Coastguard Worker * Get the sampler's wrap T value. 435*344a7f5eSAndroid Build Coastguard Worker * 436*344a7f5eSAndroid Build Coastguard Worker * See android.renderscript.S. 437*344a7f5eSAndroid Build Coastguard Worker */ 438*344a7f5eSAndroid Build Coastguard Worker#if (defined(RS_VERSION) && (RS_VERSION >= 16)) 439*344a7f5eSAndroid Build Coastguard Workerextern rs_sampler_value __attribute__((overloadable)) 440*344a7f5eSAndroid Build Coastguard Worker rsSamplerGetWrapT(rs_sampler s); 441*344a7f5eSAndroid Build Coastguard Worker#endif 442*344a7f5eSAndroid Build Coastguard Worker 443*344a7f5eSAndroid Build Coastguard Worker/* 444*344a7f5eSAndroid Build Coastguard Worker * rsSetObject: For internal use. 445*344a7f5eSAndroid Build Coastguard Worker * 446*344a7f5eSAndroid Build Coastguard Worker */ 447*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 448*344a7f5eSAndroid Build Coastguard Worker rsSetObject(rs_element* dst, rs_element src); 449*344a7f5eSAndroid Build Coastguard Worker 450*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 451*344a7f5eSAndroid Build Coastguard Worker rsSetObject(rs_type* dst, rs_type src); 452*344a7f5eSAndroid Build Coastguard Worker 453*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 454*344a7f5eSAndroid Build Coastguard Worker rsSetObject(rs_allocation* dst, rs_allocation src); 455*344a7f5eSAndroid Build Coastguard Worker 456*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 457*344a7f5eSAndroid Build Coastguard Worker rsSetObject(rs_sampler* dst, rs_sampler src); 458*344a7f5eSAndroid Build Coastguard Worker 459*344a7f5eSAndroid Build Coastguard Workerextern void __attribute__((overloadable)) 460*344a7f5eSAndroid Build Coastguard Worker rsSetObject(rs_script* dst, rs_script src); 461*344a7f5eSAndroid Build Coastguard Worker 462*344a7f5eSAndroid Build Coastguard Worker#endif // RENDERSCRIPT_RS_OBJECT_INFO_RSH 463