rs_vector_math.spec revision 386e87ecf4114084c10dd385edc1c2baebe80a04
1#
2# Copyright (C) 2014 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
17header:
18summary: TODO Add documentation
19description:
20 TODO Add documentation
21end:
22
23function: cross
24version: 9
25attrib: const
26w: 3, 4
27t: f32
28ret: #2#1
29arg: #2#1 left_vector
30arg: #2#1 right_vector
31summary: Cross product of two vectors
32description:
33 Computes the cross product of two vectors.
34test: vector
35end:
36
37function: distance
38version: 9
39attrib: const
40w: 1, 2, 3, 4
41t: f32
42ret: #2
43arg: #2#1 left_vector
44arg: #2#1 right_vector
45summary: Distance between two points
46description:
47 Compute the distance between two points.
48
49 See also @fast_distance(), @native_distance().
50test: vector
51end:
52
53function: dot
54version: 9
55attrib: const
56w: 1, 2, 3, 4
57t: f32
58ret: #2
59arg: #2#1 left_vector
60arg: #2#1 right_vector
61summary: Dot product of two vectors
62description:
63 Computes the dot product of two vectors.
64test: vector
65end:
66
67function: fast_distance
68version: 17
69attrib: const
70w: 1, 2, 3, 4
71t: f32
72ret: #2
73arg: #2#1 left_vector
74arg: #2#1 right_vector
75summary: Approximate distance between two points
76description:
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().
82test: vector
83end:
84
85function: fast_length
86version: 17
87attrib: const
88w: 1, 2, 3, 4
89t: f32
90ret: #2
91arg: #2#1 v
92summary: Approximate length of a vector
93description:
94 Computes the approximate length of a vector.
95
96 The precision is what would be expected from doing the computation using 16 bit floating point values.
97
98 See also @length(), @native_length().
99test: vector
100end:
101
102function: fast_normalize
103version: 17
104attrib: const
105w: 1, 2, 3, 4
106t: f32
107ret: #2#1
108arg: #2#1 v
109summary: Approximate normalized vector
110description:
111 Approximately normalizes a vector.
112
113 For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
114
115 The precision is what would be expected from doing the computation using 16 bit floating point values.
116
117 See also @normalize(), @native_normalize().
118test: vector
119end:
120
121function: length
122version: 9
123attrib: const
124w: 1, 2, 3, 4
125t: f32
126ret: #2
127arg: #2#1 v
128summary: Length of a vector
129description:
130 Computes the length of a vector.
131
132 See also @fast_length(), @native_length().
133test: vector
134end:
135
136function: native_distance
137version: 21
138attrib: const
139w: 1, 2, 3, 4
140t: f32
141ret: #2
142arg: #2#1 left_vector
143arg: #2#1 right_vector
144summary: Approximate distance between two points
145description:
146 Computes the approximate distance between two points.
147
148 See also @distance(), @fast_distance().
149test: vector
150end:
151
152function: native_length
153version: 21
154attrib: const
155w: 1, 2, 3, 4
156t: f32
157ret: #2
158arg: #2#1 v
159summary: Approximate length of a vector
160description:
161 Compute the approximate length of a vector.
162
163 See also @length(), @fast_length().
164test: vector
165end:
166
167function: native_normalize
168version: 21
169attrib: const
170w: 1, 2, 3, 4
171t: f32
172ret: #2#1
173arg: #2#1 v
174summary:  Approximately normalize a vector
175description:
176 Approximately normalizes a vector.
177
178 See also @normalize(), @fast_normalize().
179test: vector
180end:
181
182function: normalize
183version: 9
184attrib: const
185w: 1, 2, 3, 4
186t: f32
187ret: #2#1
188arg: #2#1 v
189summary: Normalize a vector
190description:
191 Normalize a vector.
192
193 For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
194
195 See also @fast_normalize(), @native_normalize().
196test: vector
197end:
198