blob: d82cd69afc4f3535ca4287a1690e3694fffe2644 [file] [log] [blame]
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001/*
2 * Copyright (C) 2015 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// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
18
19/*
20 * rs_vector_math.rsh: TODO Add documentation
21 *
22 * TODO Add documentation
23 */
24#ifndef RENDERSCRIPT_RS_VECTOR_MATH_RSH
25#define RENDERSCRIPT_RS_VECTOR_MATH_RSH
26
27/*
28 * cross: Cross product of two vectors
29 *
30 * Computes the cross product of two vectors.
31 */
32extern float3 __attribute__((const, overloadable))
33 cross(float3 left_vector, float3 right_vector);
34
35extern float4 __attribute__((const, overloadable))
36 cross(float4 left_vector, float4 right_vector);
37
38/*
39 * distance: Distance between two points
40 *
41 * Compute the distance between two points.
42 *
43 * See also fast_distance(), native_distance().
44 */
45extern float __attribute__((const, overloadable))
46 distance(float left_vector, float right_vector);
47
48extern float __attribute__((const, overloadable))
49 distance(float2 left_vector, float2 right_vector);
50
51extern float __attribute__((const, overloadable))
52 distance(float3 left_vector, float3 right_vector);
53
54extern float __attribute__((const, overloadable))
55 distance(float4 left_vector, float4 right_vector);
56
57/*
58 * dot: Dot product of two vectors
59 *
60 * Computes the dot product of two vectors.
61 */
62extern float __attribute__((const, overloadable))
63 dot(float left_vector, float right_vector);
64
65extern float __attribute__((const, overloadable))
66 dot(float2 left_vector, float2 right_vector);
67
68extern float __attribute__((const, overloadable))
69 dot(float3 left_vector, float3 right_vector);
70
71extern float __attribute__((const, overloadable))
72 dot(float4 left_vector, float4 right_vector);
73
74/*
75 * fast_distance: Approximate distance between two points
76 *
77 * Computes the approximate distance between two points.
78 *
79 * The precision is what would be expected from doing the computation using 16 bit floating point values.
80 *
81 * See also distance(), native_distance().
82 */
83#if (defined(RS_VERSION) && (RS_VERSION >= 17))
84extern float __attribute__((const, overloadable))
85 fast_distance(float left_vector, float right_vector);
86#endif
87
88#if (defined(RS_VERSION) && (RS_VERSION >= 17))
89extern float __attribute__((const, overloadable))
90 fast_distance(float2 left_vector, float2 right_vector);
91#endif
92
93#if (defined(RS_VERSION) && (RS_VERSION >= 17))
94extern float __attribute__((const, overloadable))
95 fast_distance(float3 left_vector, float3 right_vector);
96#endif
97
98#if (defined(RS_VERSION) && (RS_VERSION >= 17))
99extern float __attribute__((const, overloadable))
100 fast_distance(float4 left_vector, float4 right_vector);
101#endif
102
103/*
104 * fast_length: Approximate length of a vector
105 *
106 * Computes the approximate length of a vector.
107 *
108 * The precision is what would be expected from doing the computation using 16 bit floating point values.
109 *
110 * See also length(), native_length().
111 */
112#if (defined(RS_VERSION) && (RS_VERSION >= 17))
113extern float __attribute__((const, overloadable))
114 fast_length(float v);
115#endif
116
117#if (defined(RS_VERSION) && (RS_VERSION >= 17))
118extern float __attribute__((const, overloadable))
119 fast_length(float2 v);
120#endif
121
122#if (defined(RS_VERSION) && (RS_VERSION >= 17))
123extern float __attribute__((const, overloadable))
124 fast_length(float3 v);
125#endif
126
127#if (defined(RS_VERSION) && (RS_VERSION >= 17))
128extern float __attribute__((const, overloadable))
129 fast_length(float4 v);
130#endif
131
132/*
133 * fast_normalize: Approximate normalized vector
134 *
135 * Approximately normalizes a vector.
136 *
137 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
138 *
139 * The precision is what would be expected from doing the computation using 16 bit floating point values.
140 *
141 * See also normalize(), native_normalize().
142 */
143#if (defined(RS_VERSION) && (RS_VERSION >= 17))
144extern float __attribute__((const, overloadable))
145 fast_normalize(float v);
146#endif
147
148#if (defined(RS_VERSION) && (RS_VERSION >= 17))
149extern float2 __attribute__((const, overloadable))
150 fast_normalize(float2 v);
151#endif
152
153#if (defined(RS_VERSION) && (RS_VERSION >= 17))
154extern float3 __attribute__((const, overloadable))
155 fast_normalize(float3 v);
156#endif
157
158#if (defined(RS_VERSION) && (RS_VERSION >= 17))
159extern float4 __attribute__((const, overloadable))
160 fast_normalize(float4 v);
161#endif
162
163/*
164 * length: Length of a vector
165 *
166 * Computes the length of a vector.
167 *
168 * See also fast_length(), native_length().
169 */
170extern float __attribute__((const, overloadable))
171 length(float v);
172
173extern float __attribute__((const, overloadable))
174 length(float2 v);
175
176extern float __attribute__((const, overloadable))
177 length(float3 v);
178
179extern float __attribute__((const, overloadable))
180 length(float4 v);
181
182/*
183 * native_distance: Approximate distance between two points
184 *
185 * Computes the approximate distance between two points.
186 *
187 * See also distance(), fast_distance().
188 */
189#if (defined(RS_VERSION) && (RS_VERSION >= 21))
190extern float __attribute__((const, overloadable))
191 native_distance(float left_vector, float right_vector);
192#endif
193
194#if (defined(RS_VERSION) && (RS_VERSION >= 21))
195extern float __attribute__((const, overloadable))
196 native_distance(float2 left_vector, float2 right_vector);
197#endif
198
199#if (defined(RS_VERSION) && (RS_VERSION >= 21))
200extern float __attribute__((const, overloadable))
201 native_distance(float3 left_vector, float3 right_vector);
202#endif
203
204#if (defined(RS_VERSION) && (RS_VERSION >= 21))
205extern float __attribute__((const, overloadable))
206 native_distance(float4 left_vector, float4 right_vector);
207#endif
208
209/*
210 * native_length: Approximate length of a vector
211 *
212 * Compute the approximate length of a vector.
213 *
214 * See also length(), fast_length().
215 */
216#if (defined(RS_VERSION) && (RS_VERSION >= 21))
217extern float __attribute__((const, overloadable))
218 native_length(float v);
219#endif
220
221#if (defined(RS_VERSION) && (RS_VERSION >= 21))
222extern float __attribute__((const, overloadable))
223 native_length(float2 v);
224#endif
225
226#if (defined(RS_VERSION) && (RS_VERSION >= 21))
227extern float __attribute__((const, overloadable))
228 native_length(float3 v);
229#endif
230
231#if (defined(RS_VERSION) && (RS_VERSION >= 21))
232extern float __attribute__((const, overloadable))
233 native_length(float4 v);
234#endif
235
236/*
237 * native_normalize: Approximately normalize a vector
238 *
239 * Approximately normalizes a vector.
240 *
241 * See also normalize(), fast_normalize().
242 */
243#if (defined(RS_VERSION) && (RS_VERSION >= 21))
244extern float __attribute__((const, overloadable))
245 native_normalize(float v);
246#endif
247
248#if (defined(RS_VERSION) && (RS_VERSION >= 21))
249extern float2 __attribute__((const, overloadable))
250 native_normalize(float2 v);
251#endif
252
253#if (defined(RS_VERSION) && (RS_VERSION >= 21))
254extern float3 __attribute__((const, overloadable))
255 native_normalize(float3 v);
256#endif
257
258#if (defined(RS_VERSION) && (RS_VERSION >= 21))
259extern float4 __attribute__((const, overloadable))
260 native_normalize(float4 v);
261#endif
262
263/*
264 * normalize: Normalize a vector
265 *
266 * Normalize a vector.
267 *
268 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
269 *
270 * See also fast_normalize(), native_normalize().
271 */
272extern float __attribute__((const, overloadable))
273 normalize(float v);
274
275extern float2 __attribute__((const, overloadable))
276 normalize(float2 v);
277
278extern float3 __attribute__((const, overloadable))
279 normalize(float3 v);
280
281extern float4 __attribute__((const, overloadable))
282 normalize(float4 v);
283
284#endif // RENDERSCRIPT_RS_VECTOR_MATH_RSH