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