Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 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 | ////////////////////////////////////////////////////// |
| 28 | // |
| 29 | |
| 30 | typedef void * RsAdapter1D; |
| 31 | typedef void * RsAdapter2D; |
| 32 | typedef void * RsAllocation; |
| 33 | typedef void * RsContext; |
| 34 | typedef void * RsDevice; |
| 35 | typedef void * RsElement; |
| 36 | typedef void * RsSampler; |
| 37 | typedef void * RsScript; |
| 38 | typedef void * RsScriptBasicTemp; |
| 39 | typedef void * RsTriangleMesh; |
| 40 | typedef void * RsType; |
| 41 | |
| 42 | typedef void * RsProgramVertex; |
| 43 | typedef void * RsProgramFragment; |
| 44 | typedef void * RsProgramFragmentStore; |
| 45 | |
| 46 | RsDevice rsDeviceCreate(); |
| 47 | void rsDeviceDestroy(RsDevice); |
| 48 | |
| 49 | RsContext rsContextCreate(RsDevice, void *, uint32_t version); |
| 50 | void rsContextDestroy(RsContext); |
| 51 | |
| 52 | enum RsDataType { |
| 53 | RS_TYPE_FLOAT, |
| 54 | RS_TYPE_UNSIGNED, |
| 55 | RS_TYPE_SIGNED |
| 56 | }; |
| 57 | |
| 58 | enum RsDataKind { |
| 59 | RS_KIND_USER, |
| 60 | RS_KIND_RED, |
| 61 | RS_KIND_GREEN, |
| 62 | RS_KIND_BLUE, |
| 63 | RS_KIND_ALPHA, |
| 64 | RS_KIND_LUMINANCE, |
| 65 | RS_KIND_INTENSITY, |
| 66 | RS_KIND_X, |
| 67 | RS_KIND_Y, |
| 68 | RS_KIND_Z, |
| 69 | RS_KIND_W, |
| 70 | RS_KIND_S, |
| 71 | RS_KIND_T, |
| 72 | RS_KIND_Q, |
| 73 | RS_KIND_R, |
| 74 | RS_KIND_NX, |
| 75 | RS_KIND_NY, |
| 76 | RS_KIND_NZ, |
| 77 | RS_KIND_INDEX |
| 78 | }; |
| 79 | |
| 80 | enum RsElementPredefined { |
| 81 | RS_ELEMENT_USER_U8, |
| 82 | RS_ELEMENT_USER_I8, |
| 83 | RS_ELEMENT_USER_U16, |
| 84 | RS_ELEMENT_USER_I16, |
| 85 | RS_ELEMENT_USER_U32, |
| 86 | RS_ELEMENT_USER_I32, |
| 87 | RS_ELEMENT_USER_FLOAT, |
| 88 | |
Jason Sams | ffe9f48 | 2009-06-01 17:45:53 -0700 | [diff] [blame] | 89 | RS_ELEMENT_A_8, // 7 |
| 90 | RS_ELEMENT_RGB_565, // 8 |
| 91 | RS_ELEMENT_RGBA_5551, // 9 |
| 92 | RS_ELEMENT_RGBA_4444, // 10 |
| 93 | RS_ELEMENT_RGB_888, // 11 |
| 94 | RS_ELEMENT_RGBA_8888, // 12 |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 95 | |
Jason Sams | ffe9f48 | 2009-06-01 17:45:53 -0700 | [diff] [blame] | 96 | RS_ELEMENT_INDEX_16, //13 |
Jason Sams | d19f10d | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 97 | RS_ELEMENT_INDEX_32, |
| 98 | RS_ELEMENT_XY_F32, |
| 99 | RS_ELEMENT_XYZ_F32, |
| 100 | RS_ELEMENT_ST_XY_F32, |
| 101 | RS_ELEMENT_ST_XYZ_F32, |
| 102 | RS_ELEMENT_NORM_XYZ_F32, |
| 103 | RS_ELEMENT_NORM_ST_XYZ_F32, |
| 104 | }; |
| 105 | |
| 106 | enum RsSamplerParam { |
| 107 | RS_SAMPLER_MIN_FILTER, |
| 108 | RS_SAMPLER_MAG_FILTER, |
| 109 | RS_SAMPLER_WRAP_S, |
| 110 | RS_SAMPLER_WRAP_T, |
| 111 | RS_SAMPLER_WRAP_R |
| 112 | }; |
| 113 | |
| 114 | enum RsSamplerValue { |
| 115 | RS_SAMPLER_NEAREST, |
| 116 | RS_SAMPLER_LINEAR, |
| 117 | RS_SAMPLER_LINEAR_MIP_LINEAR, |
| 118 | RS_SAMPLER_WRAP, |
| 119 | RS_SAMPLER_CLAMP |
| 120 | }; |
| 121 | |
| 122 | enum RsDimension { |
| 123 | RS_DIMENSION_X, |
| 124 | RS_DIMENSION_Y, |
| 125 | RS_DIMENSION_Z, |
| 126 | RS_DIMENSION_LOD, |
| 127 | RS_DIMENSION_FACE, |
| 128 | |
| 129 | RS_DIMENSION_ARRAY_0 = 100, |
| 130 | RS_DIMENSION_ARRAY_1, |
| 131 | RS_DIMENSION_ARRAY_2, |
| 132 | RS_DIMENSION_ARRAY_3, |
| 133 | RS_DIMENSION_MAX = RS_DIMENSION_ARRAY_3 |
| 134 | }; |
| 135 | |
| 136 | enum RsDepthFunc { |
| 137 | RS_DEPTH_FUNC_ALWAYS, |
| 138 | RS_DEPTH_FUNC_LESS, |
| 139 | RS_DEPTH_FUNC_LEQUAL, |
| 140 | RS_DEPTH_FUNC_GREATER, |
| 141 | RS_DEPTH_FUNC_GEQUAL, |
| 142 | RS_DEPTH_FUNC_EQUAL, |
| 143 | RS_DEPTH_FUNC_NOTEQUAL |
| 144 | }; |
| 145 | |
| 146 | enum RsBlendSrcFunc { |
| 147 | RS_BLEND_SRC_ZERO, |
| 148 | RS_BLEND_SRC_ONE, |
| 149 | RS_BLEND_SRC_DST_COLOR, |
| 150 | RS_BLEND_SRC_ONE_MINUS_DST_COLOR, |
| 151 | RS_BLEND_SRC_SRC_ALPHA, |
| 152 | RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA, |
| 153 | RS_BLEND_SRC_DST_ALPHA, |
| 154 | RS_BLEND_SRC_ONE_MINUS_DST_ALPHA, |
| 155 | RS_BLEND_SRC_SRC_ALPHA_SATURATE |
| 156 | }; |
| 157 | |
| 158 | enum RsBlendDstFunc { |
| 159 | RS_BLEND_DST_ZERO, |
| 160 | RS_BLEND_DST_ONE, |
| 161 | RS_BLEND_DST_SRC_COLOR, |
| 162 | RS_BLEND_DST_ONE_MINUS_SRC_COLOR, |
| 163 | RS_BLEND_DST_SRC_ALPHA, |
| 164 | RS_BLEND_DST_ONE_MINUS_SRC_ALPHA, |
| 165 | RS_BLEND_DST_DST_ALPHA, |
| 166 | RS_BLEND_DST_ONE_MINUS_DST_ALPHA |
| 167 | }; |
| 168 | |
| 169 | enum RsTexEnvMode { |
| 170 | RS_TEX_ENV_MODE_REPLACE, |
| 171 | RS_TEX_ENV_MODE_MODULATE, |
| 172 | RS_TEX_ENV_MODE_DECAL |
| 173 | }; |
| 174 | |
| 175 | |
| 176 | |
| 177 | #include "rsgApiFuncDecl.h" |
| 178 | |
| 179 | #ifdef __cplusplus |
| 180 | }; |
| 181 | #endif |
| 182 | |
| 183 | #endif // RENDER_SCRIPT_H |
| 184 | |
| 185 | |
| 186 | |