Home | History | Annotate | Download | only in rs
      1 /*
      2  * Copyright (C) 2007 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 
     17 #ifndef RENDER_SCRIPT_H
     18 #define RENDER_SCRIPT_H
     19 
     20 #include <stdint.h>
     21 #include <sys/types.h>
     22 
     23 #ifdef __cplusplus
     24 extern "C" {
     25 #endif
     26 
     27 #include "RenderScriptDefines.h"
     28 
     29 //
     30 // A3D loading and object update code.
     31 // Should only be called at object creation, not thread safe
     32 RsObjectBase rsaFileA3DGetEntryByIndex(RsContext, uint32_t idx, RsFile);
     33 RsFile rsaFileA3DCreateFromMemory(RsContext, const void *data, uint32_t len);
     34 RsFile rsaFileA3DCreateFromAsset(RsContext, void *asset);
     35 RsFile rsaFileA3DCreateFromFile(RsContext, const char *path);
     36 void rsaFileA3DGetNumIndexEntries(RsContext, int32_t *numEntries, RsFile);
     37 void rsaFileA3DGetIndexEntries(RsContext, RsFileIndexEntry *fileEntries,
     38                                uint32_t numEntries, RsFile);
     39 void rsaGetName(RsContext, void * obj, const char **name);
     40 // Mesh update functions
     41 void rsaMeshGetVertexBufferCount(RsContext, RsMesh, int32_t *vtxCount);
     42 void rsaMeshGetIndexCount(RsContext, RsMesh, int32_t *idxCount);
     43 void rsaMeshGetVertices(RsContext, RsMesh, RsAllocation *vtxData, uint32_t vtxDataCount);
     44 void rsaMeshGetIndices(RsContext, RsMesh, RsAllocation *va,
     45                        uint32_t *primType, uint32_t idxDataCount);
     46 // Allocation update
     47 const void* rsaAllocationGetType(RsContext con, RsAllocation va);
     48 // Type update
     49 void rsaTypeGetNativeData(RsContext, RsType, uint32_t *typeData, uint32_t typeDataSize);
     50 // Element update
     51 void rsaElementGetNativeData(RsContext, RsElement, uint32_t *elemData, uint32_t elemDataSize);
     52 void rsaElementGetSubElements(RsContext, RsElement, uint32_t *ids, const char **names,
     53                               uint32_t *arraySizes, uint32_t dataSize);
     54 
     55 RsDevice rsDeviceCreate();
     56 void rsDeviceDestroy(RsDevice dev);
     57 void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value);
     58 RsContext rsContextCreate(RsDevice dev, uint32_t version, uint32_t sdkVersion);
     59 RsContext rsContextCreateGL(RsDevice dev, uint32_t version, uint32_t sdkVersion,
     60                             RsSurfaceConfig sc, uint32_t dpi);
     61 
     62 #include "rsgApiFuncDecl.h"
     63 
     64 #ifdef __cplusplus
     65 };
     66 #endif
     67 
     68 #endif // RENDER_SCRIPT_H
     69 
     70 
     71 
     72