diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs index 7f3894dd33a28..be0ca0e70caec 100644 --- a/docs/html/guide/guide_toc.cs +++ b/docs/html/guide/guide_toc.cs @@ -282,6 +282,10 @@ Compute +
| rs_allocation | Opaque handle to a Renderscript allocation |
| rs_element | Opaque handle to a Renderscript element |
| rs_font | Opaque handle to a Renderscript font object |
| rs_matrix2x2 | 2x2 float matrix |
| rs_matrix3x3 | 3x3 float matrix |
| rs_matrix4x4 | 4x4 float matrix |
| rs_mesh | Opaque handle to a Renderscript mesh object |
| rs_program_fragment | Opaque handle to a Renderscript ProgramFragment object |
| rs_program_raster | Opaque handle to a Renderscript ProgramRaster object |
| rs_program_store | Opaque handle to a Renderscript ProgramStore object |
| rs_program_vertex | Opaque handle to a Renderscript ProgramVertex object |
| rs_sampler | Opaque handle to a Renderscript sampler object |
| rs_script | Opaque handle to a Renderscript script object |
| rs_script_call | |
| rs_tm | |
| rs_type | Opaque handle to a Renderscript type |
Renderscript is a high-performance runtime that provides graphics rendering and compute operations at the native level. Renderscript code is compiled on devices at runtime to allow platform-independence as well. This reference documentation describes the Renderscript runtime APIs, which you can utilize to write Renderscript code in C99. The Renderscript header files are automatically included for you, except for the rs_graphics.rsh header. If you are doing graphics rendering, include the graphics header file like this:
+#include "rs_graphics.rsh"
To use Renderscript, you need to utilize the Renderscript runtime APIs documented here as well as the Android framework APIs for Renderscript. For documentation on the Android framework APIs, see the android.renderscript package reference. For more information on how to develop with Renderscript and how the runtime and Android framework APIs interact, see the Renderscript developer guide and the Renderscript samples.
++Functions | |
| rs_allocation | rsGetAllocation (const void *) |
| uint32_t | rsAllocationGetDimX (rs_allocation) |
| uint32_t | rsAllocationGetDimY (rs_allocation) |
| uint32_t | rsAllocationGetDimZ (rs_allocation) |
| uint32_t | rsAllocationGetDimLOD (rs_allocation) |
| uint32_t | rsAllocationGetDimFaces (rs_allocation) |
| const void * | rsGetElementAt (rs_allocation, uint32_t x) |
| const void * | rsGetElementAt (rs_allocation, uint32_t x, uint32_t y) |
| const void * | rsGetElementAt (rs_allocation, uint32_t x, uint32_t y, uint32_t z) |
Allocation routines.
+ +Definition in file rs_allocation.rsh.
+| uint32_t rsAllocationGetDimFaces | +( | +rs_allocation | +) | ++ |
Query an allocation for the presence of more than one face.
+| uint32_t rsAllocationGetDimLOD | +( | +rs_allocation | +) | ++ |
Query an allocation for the presence of more than one LOD.
+| uint32_t rsAllocationGetDimX | +( | +rs_allocation | +) | ++ |
Query the dimension of an allocation.
+| uint32_t rsAllocationGetDimY | +( | +rs_allocation | +) | ++ |
Query the dimension of an allocation.
+| uint32_t rsAllocationGetDimZ | +( | +rs_allocation | +) | ++ |
Query the dimension of an allocation.
+| rs_allocation rsGetAllocation | +( | +const void * | +) | ++ |
Returns the Allocation for a given pointer. The pointer should point within a valid allocation. The results are undefined if the pointer is not from a valid allocation.
+ +| const void* rsGetElementAt | +( | +rs_allocation | +, | +
| + | + | uint32_t | +x | +
| + | ) | ++ |
Extract a single element from an allocation.
+ +| const void* rsGetElementAt | +( | +rs_allocation | +, | +
| + | + | uint32_t | +x, | +
| + | + | uint32_t | +y | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| const void* rsGetElementAt | +( | +rs_allocation | +, | +
| + | + | uint32_t | +x, | +
| + | + | uint32_t | +y, | +
| + | + | uint32_t | +z | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_ALLOCATION_RSH__ +00024 #define __RS_ALLOCATION_RSH__ +00025 +00031 extern rs_allocation __attribute__((overloadable)) +00032 rsGetAllocation(const void *); +00033 +00039 extern uint32_t __attribute__((overloadable)) +00040 rsAllocationGetDimX(rs_allocation); +00041 +00047 extern uint32_t __attribute__((overloadable)) +00048 rsAllocationGetDimY(rs_allocation); +00049 +00055 extern uint32_t __attribute__((overloadable)) +00056 rsAllocationGetDimZ(rs_allocation); +00057 +00063 extern uint32_t __attribute__((overloadable)) +00064 rsAllocationGetDimLOD(rs_allocation); +00065 +00071 extern uint32_t __attribute__((overloadable)) +00072 rsAllocationGetDimFaces(rs_allocation); +00073 +00074 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) +00075 +00089 extern void __attribute__((overloadable)) +00090 rsAllocationCopy1DRange(rs_allocation dstAlloc, +00091 uint32_t dstOff, uint32_t dstMip, +00092 uint32_t count, +00093 rs_allocation srcAlloc, +00094 uint32_t srcOff, uint32_t srcMip); +00095 +00117 extern void __attribute__((overloadable)) +00118 rsAllocationCopy2DRange(rs_allocation dstAlloc, +00119 uint32_t dstXoff, uint32_t dstYoff, +00120 uint32_t dstMip, +00121 rs_allocation_cubemap_face dstFace, +00122 uint32_t width, uint32_t height, +00123 rs_allocation srcAlloc, +00124 uint32_t srcXoff, uint32_t srcYoff, +00125 uint32_t srcMip, +00126 rs_allocation_cubemap_face srcFace); +00127 +00128 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) +00129 +00133 extern const void * __attribute__((overloadable)) +00134 rsGetElementAt(rs_allocation, uint32_t x); +00138 extern const void * __attribute__((overloadable)) +00139 rsGetElementAt(rs_allocation, uint32_t x, uint32_t y); +00143 extern const void * __attribute__((overloadable)) +00144 rsGetElementAt(rs_allocation, uint32_t x, uint32_t y, uint32_t z); +00145 +00146 #endif +00147 +
00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_ATOMIC_RSH__ +00024 #define __RS_ATOMIC_RSH__ +00025 +00026 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) +00027 +00036 extern int32_t __attribute__((overloadable)) +00037 rsAtomicInc(volatile int32_t* addr); +00046 extern uint32_t __attribute__((overloadable)) +00047 rsAtomicInc(volatile uint32_t* addr); +00048 +00056 extern int32_t __attribute__((overloadable)) +00057 rsAtomicDec(volatile int32_t* addr); +00065 extern uint32_t __attribute__((overloadable)) +00066 rsAtomicDec(volatile uint32_t* addr); +00067 +00076 extern int32_t __attribute__((overloadable)) +00077 rsAtomicAdd(volatile int32_t* addr, int32_t value); +00086 extern uint32_t __attribute__((overloadable)) +00087 rsAtomicAdd(volatile uint32_t* addr, uint32_t value); +00088 +00097 extern int32_t __attribute__((overloadable)) +00098 rsAtomicSub(volatile int32_t* addr, int32_t value); +00107 extern uint32_t __attribute__((overloadable)) +00108 rsAtomicSub(volatile uint32_t* addr, uint32_t value); +00109 +00118 extern int32_t __attribute__((overloadable)) +00119 rsAtomicAnd(volatile int32_t* addr, int32_t value); +00128 extern uint32_t __attribute__((overloadable)) +00129 rsAtomicAnd(volatile uint32_t* addr, uint32_t value); +00130 +00139 extern int32_t __attribute__((overloadable)) +00140 rsAtomicOr(volatile int32_t* addr, int32_t value); +00149 extern uint32_t __attribute__((overloadable)) +00150 rsAtomicOr(volatile uint32_t* addr, uint32_t value); +00151 +00160 extern uint32_t __attribute__((overloadable)) +00161 rsAtomicXor(volatile uint32_t* addr, uint32_t value); +00170 extern int32_t __attribute__((overloadable)) +00171 rsAtomicXor(volatile int32_t* addr, int32_t value); +00172 +00182 extern uint32_t __attribute__((overloadable)) +00183 rsAtomicMin(volatile uint32_t* addr, uint32_t value); +00193 extern int32_t __attribute__((overloadable)) +00194 rsAtomicMin(volatile int32_t* addr, int32_t value); +00195 +00205 extern uint32_t __attribute__((overloadable)) +00206 rsAtomicMax(volatile uint32_t* addr, uint32_t value); +00216 extern int32_t __attribute__((overloadable)) +00217 rsAtomicMax(volatile int32_t* addr, int32_t value); +00218 +00230 extern int32_t __attribute__((overloadable)) +00231 rsAtomicCas(volatile int32_t* addr, int32_t compareValue, int32_t newValue); +00232 +00244 extern uint32_t __attribute__((overloadable)) +00245 rsAtomicCas(volatile uint32_t* addr, int32_t compareValue, int32_t newValue); +00246 +00247 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) +00248 +00249 #endif +00250 +
+Functions | |
| float | acos (float) |
| float | acosh (float) |
| _RS_RUNTIME float | acospi (float v) |
| float | asin (float) |
| float | asinh (float) |
| _RS_RUNTIME float | asinpi (float v) |
| float | atan (float) |
| float | atan2 (float y, float x) |
| float | atanh (float) |
| _RS_RUNTIME float | atanpi (float v) |
| _RS_RUNTIME float | atan2pi (float y, float x) |
| float | cbrt (float) |
| float | ceil (float) |
| float | copysign (float x, float y) |
| float | cos (float) |
| float | cosh (float) |
| _RS_RUNTIME float | cospi (float v) |
| float | erfc (float) |
| float | erf (float) |
| float | exp (float) |
| float | exp2 (float) |
| float | pow (float x, float y) |
| _RS_RUNTIME float | exp10 (float v) |
| float | expm1 (float) |
| float | fabs (float) |
| float | fdim (float, float) |
| float | floor (float) |
| float | fma (float a, float b, float c) |
| float | fmax (float x, float y) |
| float | fmin (float x, float y) |
| float | fmod (float x, float y) |
| _RS_RUNTIME float | fract (float v, float *iptr) |
| float | frexp (float v, int *iptr) |
| float | hypot (float x, float y) |
| int | ilogb (float) |
| float | ldexp (float x, int y) |
| float | lgamma (float) |
| float | lgamma (float x, int *y) |
| float | log (float) |
| float | log10 (float) |
| _RS_RUNTIME float | log2 (float v) |
| float | log1p (float v) |
| float | logb (float) |
| float | mad (float a, float b, float c) |
| float | modf (float x, float *iret) |
| float | nextafter (float x, float y) |
| _RS_RUNTIME float | pown (float v, int p) |
| _RS_RUNTIME float | powr (float v, float p) |
| float | remainder (float x, float y) |
| float | rint (float) |
| _RS_RUNTIME float | rootn (float v, int n) |
| float | round (float) |
| float | sqrt (float) |
| _RS_RUNTIME float | rsqrt (float v) |
| float | sin (float v) |
| _RS_RUNTIME float | sincos (float v, float *cosptr) |
| float | sinh (float) |
| _RS_RUNTIME float | sinpi (float v) |
| float | tan (float v) |
| float | tanh (float) |
| _RS_RUNTIME float | tanpi (float v) |
| float | tgamma (float) |
| float | trunc (float) |
| _RS_RUNTIME float | clamp (float amount, float low, float high) |
| _RS_RUNTIME float | degrees (float radians) |
| _RS_RUNTIME float | mix (float start, float stop, float amount) |
| _RS_RUNTIME float | radians (float degrees) |
| _RS_RUNTIME float | step (float edge, float v) |
| _RS_RUNTIME float | sign (float v) |
| _RS_RUNTIME float3 | cross (float3 lhs, float3 rhs) |
| _RS_RUNTIME float | dot (float lhs, float rhs) |
| _RS_RUNTIME float | length (float v) |
| _RS_RUNTIME float | distance (float lhs, float rhs) |
| _RS_RUNTIME float | normalize (float v) |
Basic math functions.
+ +Definition in file rs_cl.rsh.
+| float acos | +( | +float | +) | ++ |
Return the inverse cosine.
+Supports float, float2, float3, float4
+ +| float acosh | +( | +float | +) | ++ |
Return the inverse hyperbolic cosine.
+Supports float, float2, float3, float4
+ +| _RS_RUNTIME float acospi | +( | +float | +v | ) | ++ |
Return the inverse cosine divided by PI.
+Supports float, float2, float3, float4
+ +| float asin | +( | +float | +) | ++ |
Return the inverse sine.
+Supports float, float2, float3, float4
+ +| float asinh | +( | +float | +) | ++ |
Return the inverse hyperbolic sine.
+Supports float, float2, float3, float4
+ +| _RS_RUNTIME float asinpi | +( | +float | +v | ) | ++ |
Return the inverse sine divided by PI.
+Supports float, float2, float3, float4
+ +| float atan | +( | +float | +) | ++ |
Return the inverse tangent.
+Supports float, float2, float3, float4
+ +| float atan2 | +( | +float | +y, | +
| + | + | float | +x | +
| + | ) | ++ |
Return the inverse tangent of y / x.
+Supports float, float2, float3, float4. Both arguments must be of the same type.
+| y | |
| x |
| _RS_RUNTIME float atan2pi | +( | +float | +y, | +
| + | + | float | +x | +
| + | ) | ++ |
Return the inverse tangent of y / x, divided by PI.
+Supports float, float2, float3, float4. Both arguments must be of the same type.
+| y | |
| x |
| float atanh | +( | +float | +) | ++ |
Return the inverse hyperbolic tangent.
+Supports float, float2, float3, float4
+ +| _RS_RUNTIME float atanpi | +( | +float | +v | ) | ++ |
Return the inverse tangent divided by PI.
+Supports float, float2, float3, float4
+ +| float cbrt | +( | +float | +) | ++ |
Return the cube root.
+Supports float, float2, float3, float4.
+ +| float ceil | +( | +float | +) | ++ |
Return the smallest integer not less than a value.
+Supports float, float2, float3, float4.
+ +| _RS_RUNTIME float4 clamp | +( | +float | +amount, | +
| + | + | float | +low, | +
| + | + | float | +high | +
| + | ) | ++ |
Return the minimum of two values.
+Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int, float. Return the maximum of two values.
+Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int, float. Clamp a value to a specified high and low bound.
+| amount | value to be clamped. Supports 1,2,3,4 components |
| low | Lower bound, must be scalar or matching vector. |
| high | High bound, must match type of low |
| float copysign | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Copy the sign bit from y to x.
+Supports float, float2, float3, float4. Both arguments must be of the same type.
+| x | |
| y |
| float cos | +( | +float | +) | ++ |
Return the cosine.
+Supports float, float2, float3, float4.
+ +| float cosh | +( | +float | +) | ++ |
Return the hypebolic cosine.
+Supports float, float2, float3, float4.
+ +| _RS_RUNTIME float cospi | +( | +float | +v | ) | ++ |
Return the cosine of the value * PI.
+Supports float, float2, float3, float4.
+ +Compute the cross product of two vectors.
+Supports 3,4 components
+ +| _RS_RUNTIME float degrees | +( | +float | +radians | ) | ++ |
Convert from radians to degrees.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float distance | +( | +float | +lhs, | +
| + | + | float | +rhs | +
| + | ) | ++ |
Compute the distance between two points.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float dot | +( | +float | +lhs, | +
| + | + | float | +rhs | +
| + | ) | ++ |
Compute the dot product of two vectors.
+Supports 1,2,3,4 components
+ +| float erf | +( | +float | +) | ++ |
Return the error function.
+Supports float, float2, float3, float4.
+ +| float erfc | +( | +float | +) | ++ |
Return the complementary error function.
+Supports float, float2, float3, float4.
+ +| float exp | +( | +float | +) | ++ |
Return e ^ value.
+Supports float, float2, float3, float4.
+ +| _RS_RUNTIME float exp10 | +( | +float | +v | ) | ++ |
Return 10 ^ value.
+Supports float, float2, float3, float4.
+ +| float exp2 | +( | +float | +) | ++ |
Return 2 ^ value.
+Supports float, float2, float3, float4.
+ +| float expm1 | +( | +float | +) | ++ |
Return (e ^ value) - 1.
+Supports float, float2, float3, float4.
+ +| float fabs | +( | +float | +) | ++ |
Return the absolute value of a value.
+Supports float, float2, float3, float4.
+ +| float fdim | +( | +float | +, | +
| + | + | float | ++ |
| + | ) | ++ |
Return the positive difference between two values.
+Supports float, float2, float3, float4. Both arguments must be of the same type.
+ +| float floor | +( | +float | +) | ++ |
Return the smallest integer not greater than a value.
+Supports float, float2, float3, float4.
+ +| float fma | +( | +float | +a, | +
| + | + | float | +b, | +
| + | + | float | +c | +
| + | ) | ++ |
Return a*b + c.
+Supports float, float2, float3, float4.
+ +| float fmax | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return (x < y ? y : x)
+Supports float, float2, float3, float4.
+| x,: | may be float, float2, float3, float4 |
| y,: | may be float or vector. If vector must match type of x. |
| float fmin | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return (x > y ? y : x)
+| x,: | may be float, float2, float3, float4 |
| y,: | may be float or vector. If vector must match type of x. |
| float fmod | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return the remainder from x / y
+Supports float, float2, float3, float4.
+ +| _RS_RUNTIME float fract | +( | +float | +v, | +
| + | + | float * | +iptr | +
| + | ) | ++ |
Return fractional part of v
+| iptr | iptr[0] will be set to the floor of the input value. Supports float, float2, float3, float4. |
| float frexp | +( | +float | +v, | +
| + | + | int * | +iptr | +
| + | ) | ++ |
Return the mantissa and place the exponent into iptr[0]
+| v | Supports float, float2, float3, float4. |
| iptr | Must have the same vector size as v. |
| float hypot | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return sqrt(x*x + y*y)
+Supports float, float2, float3, float4.
+ +| int ilogb | +( | +float | +) | ++ |
Return the integer exponent of a value
+Supports 1,2,3,4 components
+ +| float ldexp | +( | +float | +x, | +
| + | + | int | +y | +
| + | ) | ++ |
Return (x * 2^y)
+| x | Supports 1,2,3,4 components |
| y | Supports single component or matching vector. |
| _RS_RUNTIME float length | +( | +float | +v | ) | ++ |
Compute the length of a vector.
+Supports 1,2,3,4 components
+ +| float lgamma | +( | +float | +) | ++ |
Return the log gamma
+Supports 1,2,3,4 components
+ +| float lgamma | +( | +float | +x, | +
| + | + | int * | +y | +
| + | ) | ++ |
Return the log gamma and sign
+| x | Supports 1,2,3,4 components |
| y | Supports matching vector. |
| float log | +( | +float | +) | ++ |
Return the natural logarithm
+Supports 1,2,3,4 components
+ +| float log10 | +( | +float | +) | ++ |
Return the base 10 logarithm
+Supports 1,2,3,4 components
+ +| float log1p | +( | +float | +v | ) | ++ |
Return the natural logarithm of (v + 1.0f)
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float log2 | +( | +float | +v | ) | ++ |
Return the base 2 logarithm
+Supports 1,2,3,4 components
+ +| float logb | +( | +float | +) | ++ |
Compute the exponent of the value.
+Supports 1,2,3,4 components
+ +| float mad | +( | +float | +a, | +
| + | + | float | +b, | +
| + | + | float | +c | +
| + | ) | ++ |
Compute (a * b) + c
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float4 mix | +( | +float | +start, | +
| + | + | float | +stop, | +
| + | + | float | +amount | +
| + | ) | ++ |
return start + ((stop - start) * amount);
+Supports 1,2,3,4 components
+ +| float modf | +( | +float | +x, | +
| + | + | float * | +iret | +
| + | ) | ++ |
Return the integral and fractional components of a number Supports 1,2,3,4 components
+| x | Source value |
| iret | iret[0] will be set to the integral portion of the number. |
| float nextafter | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return the next floating point number from x towards y.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float4 normalize | +( | +float | +v | ) | ++ |
Normalize a vector.
+Supports 1,2,3,4 components
+ +| float pow | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return x ^ y.
+Supports float, float2, float3, float4. Both arguments must be of the same type.
+ +| _RS_RUNTIME float pown | +( | +float | +v, | +
| + | + | int | +p | +
| + | ) | ++ |
Return (v ^ p).
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float powr | +( | +float | +v, | +
| + | + | float | +p | +
| + | ) | ++ |
Return (v ^ p).
+| v | must be greater than 0. |
Supports 1,2,3,4 components
+ +| _RS_RUNTIME float radians | +( | +float | +degrees | ) | ++ |
Convert from degrees to radians.
+Supports 1,2,3,4 components
+ +| float remainder | +( | +float | +x, | +
| + | + | float | +y | +
| + | ) | ++ |
Return round x/y to the nearest integer then compute the remander.
+Supports 1,2,3,4 components
+ +| float rint | +( | +float | +) | ++ |
Round to the nearest integral value.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float rootn | +( | +float | +v, | +
| + | + | int | +n | +
| + | ) | ++ |
Compute the Nth root of a value.
+Supports 1,2,3,4 components
+ +| float round | +( | +float | +) | ++ |
Round to the nearest integral value. Half values are rounded away from zero.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float rsqrt | +( | +float | +v | ) | ++ |
Return (1 / sqrt(value)).
+| v | The incoming value in radians Supports 1,2,3,4 components |
| _RS_RUNTIME float sign | +( | +float | +v | ) | ++ |
if (v < 0) return -1.f; else if (v > 0) return 1.f; else return 0.f;
+Supports 1,2,3,4 components
+ +| float sin | +( | +float | +v | ) | ++ |
Return the sine of a value specified in radians.
+| v | The incoming value in radians Supports 1,2,3,4 components |
| _RS_RUNTIME float sincos | +( | +float | +v, | +
| + | + | float * | +cosptr | +
| + | ) | ++ |
Return the sine and cosine of a value.
+| v | The incoming value in radians |
| *cosptr | cosptr[0] will be set to the cosine value. |
Supports 1,2,3,4 components
+ +| float sinh | +( | +float | +) | ++ |
Return the hyperbolic sine of a value specified in radians.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float sinpi | +( | +float | +v | ) | ++ |
Return the sin(v * PI).
+Supports 1,2,3,4 components
+ +| float sqrt | +( | +float | +) | ++ |
Return the square root of a value.
+Supports 1,2,3,4 components
+ +| _RS_RUNTIME float4 step | +( | +float | +edge, | +
| + | + | float | +v | +
| + | ) | ++ |
if (v < edge) return 0.f; else return 1.f;
+Supports 1,2,3,4 components
+ +| float tan | +( | +float | +v | ) | ++ |
Return the tangent of a value.
+Supports 1,2,3,4 components
+| v | The incoming value in radians |
| float tanh | +( | +float | +) | ++ |
Return the hyperbolic tangent of a value.
+Supports 1,2,3,4 components
+| v | The incoming value in radians |
| _RS_RUNTIME float tanpi | +( | +float | +v | ) | ++ |
Return tan(v * PI)
+Supports 1,2,3,4 components
+ +| float tgamma | +( | +float | +) | ++ |
Compute the gamma function of a value.
+Supports 1,2,3,4 components
+ +| float trunc | +( | +float | +) | ++ |
Round to integral using truncation.
+Supports 1,2,3,4 components
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_CL_RSH__ +00024 #define __RS_CL_RSH__ +00025 +00026 // Conversions +00027 #define CVT_FUNC_2(typeout, typein) \ +00028 _RS_RUNTIME typeout##2 __attribute__((overloadable)) \ +00029 convert_##typeout##2(typein##2 v); \ +00030 _RS_RUNTIME typeout##3 __attribute__((overloadable)) \ +00031 convert_##typeout##3(typein##3 v); \ +00032 _RS_RUNTIME typeout##4 __attribute__((overloadable)) \ +00033 convert_##typeout##4(typein##4 v); +00034 +00035 +00036 #define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \ +00037 CVT_FUNC_2(type, char) \ +00038 CVT_FUNC_2(type, ushort) \ +00039 CVT_FUNC_2(type, short) \ +00040 CVT_FUNC_2(type, uint) \ +00041 CVT_FUNC_2(type, int) \ +00042 CVT_FUNC_2(type, float) +00043 +00044 CVT_FUNC(char) +00045 CVT_FUNC(uchar) +00046 CVT_FUNC(short) +00047 CVT_FUNC(ushort) +00048 CVT_FUNC(int) +00049 CVT_FUNC(uint) +00050 CVT_FUNC(float) +00051 +00052 // Float ops, 6.11.2 +00053 +00054 #define FN_FUNC_FN(fnc) \ +00055 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v); \ +00056 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v); \ +00057 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v); +00058 +00059 #define IN_FUNC_FN(fnc) \ +00060 _RS_RUNTIME int2 __attribute__((overloadable)) fnc(float2 v); \ +00061 _RS_RUNTIME int3 __attribute__((overloadable)) fnc(float3 v); \ +00062 _RS_RUNTIME int4 __attribute__((overloadable)) fnc(float4 v); +00063 +00064 #define FN_FUNC_FN_FN(fnc) \ +00065 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2); \ +00066 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2); \ +00067 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2); +00068 +00069 #define FN_FUNC_FN_F(fnc) \ +00070 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, float v2); \ +00071 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, float v2); \ +00072 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, float v2); +00073 +00074 #define FN_FUNC_FN_IN(fnc) \ +00075 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2); \ +00076 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2); \ +00077 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2); \ +00078 +00079 #define FN_FUNC_FN_I(fnc) \ +00080 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int v2); \ +00081 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int v2); \ +00082 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int v2); +00083 +00084 #define FN_FUNC_FN_PFN(fnc) \ +00085 _RS_RUNTIME float2 __attribute__((overloadable)) \ +00086 fnc(float2 v1, float2 *v2); \ +00087 _RS_RUNTIME float3 __attribute__((overloadable)) \ +00088 fnc(float3 v1, float3 *v2); \ +00089 _RS_RUNTIME float4 __attribute__((overloadable)) \ +00090 fnc(float4 v1, float4 *v2); +00091 +00092 #define FN_FUNC_FN_PIN(fnc) \ +00093 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2); \ +00094 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2); \ +00095 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2); +00096 +00097 #define FN_FUNC_FN_FN_FN(fnc) \ +00098 _RS_RUNTIME float2 __attribute__((overloadable)) \ +00099 fnc(float2 v1, float2 v2, float2 v3); \ +00100 _RS_RUNTIME float3 __attribute__((overloadable)) \ +00101 fnc(float3 v1, float3 v2, float3 v3); \ +00102 _RS_RUNTIME float4 __attribute__((overloadable)) \ +00103 fnc(float4 v1, float4 v2, float4 v3); +00104 +00105 #define FN_FUNC_FN_FN_PIN(fnc) \ +00106 _RS_RUNTIME float2 __attribute__((overloadable)) \ +00107 fnc(float2 v1, float2 v2, int2 *v3); \ +00108 _RS_RUNTIME float3 __attribute__((overloadable)) \ +00109 fnc(float3 v1, float3 v2, int3 *v3); \ +00110 _RS_RUNTIME float4 __attribute__((overloadable)) \ +00111 fnc(float4 v1, float4 v2, int4 *v3); +00112 +00113 +00119 extern float __attribute__((overloadable)) acos(float); +00120 FN_FUNC_FN(acos) +00121 +00127 extern float __attribute__((overloadable)) acosh(float); +00128 FN_FUNC_FN(acosh) +00129 +00135 _RS_RUNTIME float __attribute__((overloadable)) acospi(float v); +00136 FN_FUNC_FN(acospi) +00137 +00143 extern float __attribute__((overloadable)) asin(float); +00144 FN_FUNC_FN(asin) +00145 +00151 extern float __attribute__((overloadable)) asinh(float); +00152 FN_FUNC_FN(asinh) +00153 +00154 +00160 _RS_RUNTIME float __attribute__((overloadable)) asinpi(float v); +00161 FN_FUNC_FN(asinpi) +00162 +00168 extern float __attribute__((overloadable)) atan(float); +00169 FN_FUNC_FN(atan) +00170 +00180 extern float __attribute__((overloadable)) atan2(float y, float x); +00181 FN_FUNC_FN_FN(atan2) +00182 +00188 extern float __attribute__((overloadable)) atanh(float); +00189 FN_FUNC_FN(atanh) +00190 +00196 _RS_RUNTIME float __attribute__((overloadable)) atanpi(float v); +00197 FN_FUNC_FN(atanpi) +00198 +00208 _RS_RUNTIME float __attribute__((overloadable)) atan2pi(float y, float x); +00209 FN_FUNC_FN_FN(atan2pi) +00210 +00211 +00217 extern float __attribute__((overloadable)) cbrt(float); +00218 FN_FUNC_FN(cbrt) +00219 +00225 extern float __attribute__((overloadable)) ceil(float); +00226 FN_FUNC_FN(ceil) +00227 +00237 extern float __attribute__((overloadable)) copysign(float x, float y); +00238 FN_FUNC_FN_FN(copysign) +00239 +00245 extern float __attribute__((overloadable)) cos(float); +00246 FN_FUNC_FN(cos) +00247 +00253 extern float __attribute__((overloadable)) cosh(float); +00254 FN_FUNC_FN(cosh) +00255 +00261 _RS_RUNTIME float __attribute__((overloadable)) cospi(float v); +00262 FN_FUNC_FN(cospi) +00263 +00269 extern float __attribute__((overloadable)) erfc(float); +00270 FN_FUNC_FN(erfc) +00271 +00277 extern float __attribute__((overloadable)) erf(float); +00278 FN_FUNC_FN(erf) +00279 +00285 extern float __attribute__((overloadable)) exp(float); +00286 FN_FUNC_FN(exp) +00287 +00293 extern float __attribute__((overloadable)) exp2(float); +00294 FN_FUNC_FN(exp2) +00295 +00302 extern float __attribute__((overloadable)) pow(float x, float y); +00303 FN_FUNC_FN_FN(pow) +00304 +00310 _RS_RUNTIME float __attribute__((overloadable)) exp10(float v); +00311 FN_FUNC_FN(exp10) +00312 +00318 extern float __attribute__((overloadable)) expm1(float); +00319 FN_FUNC_FN(expm1) +00320 +00326 extern float __attribute__((overloadable)) fabs(float); +00327 FN_FUNC_FN(fabs) +00328 +00335 extern float __attribute__((overloadable)) fdim(float, float); +00336 FN_FUNC_FN_FN(fdim) +00337 +00343 extern float __attribute__((overloadable)) floor(float); +00344 FN_FUNC_FN(floor) +00345 +00351 extern float __attribute__((overloadable)) fma(float a, float b, float c); +00352 FN_FUNC_FN_FN_FN(fma) +00353 +00361 extern float __attribute__((overloadable)) fmax(float x, float y); +00362 FN_FUNC_FN_FN(fmax); +00363 FN_FUNC_FN_F(fmax); +00364 +00371 extern float __attribute__((overloadable)) fmin(float x, float y); +00372 FN_FUNC_FN_FN(fmin); +00373 FN_FUNC_FN_F(fmin); +00374 +00380 extern float __attribute__((overloadable)) fmod(float x, float y); +00381 FN_FUNC_FN_FN(fmod) +00382 +00383 +00390 _RS_RUNTIME float __attribute__((overloadable)) fract(float v, float *iptr); +00391 FN_FUNC_FN_PFN(fract) +00392 +00399 extern float __attribute__((overloadable)) frexp(float v, int *iptr); +00400 FN_FUNC_FN_PIN(frexp) +00401 +00407 extern float __attribute__((overloadable)) hypot(float x, float y); +00408 FN_FUNC_FN_FN(hypot) +00409 +00415 extern int __attribute__((overloadable)) ilogb(float); +00416 IN_FUNC_FN(ilogb) +00417 +00424 extern float __attribute__((overloadable)) ldexp(float x, int y); +00425 FN_FUNC_FN_IN(ldexp) +00426 FN_FUNC_FN_I(ldexp) +00427 +00433 extern float __attribute__((overloadable)) lgamma(float); +00434 FN_FUNC_FN(lgamma) +00435 +00442 extern float __attribute__((overloadable)) lgamma(float x, int* y); +00443 FN_FUNC_FN_PIN(lgamma) +00444 +00450 extern float __attribute__((overloadable)) log(float); +00451 FN_FUNC_FN(log) +00452 +00458 extern float __attribute__((overloadable)) log10(float); +00459 FN_FUNC_FN(log10) +00460 +00466 _RS_RUNTIME float __attribute__((overloadable)) log2(float v); +00467 FN_FUNC_FN(log2) +00468 +00474 extern float __attribute__((overloadable)) log1p(float v); +00475 FN_FUNC_FN(log1p) +00476 +00482 extern float __attribute__((overloadable)) logb(float); +00483 FN_FUNC_FN(logb) +00484 +00490 extern float __attribute__((overloadable)) mad(float a, float b, float c); +00491 FN_FUNC_FN_FN_FN(mad) +00492 +00501 extern float __attribute__((overloadable)) modf(float x, float *iret); +00502 FN_FUNC_FN_PFN(modf); +00503 +00504 //extern float __attribute__((overloadable)) nan(uint); +00505 +00511 extern float __attribute__((overloadable)) nextafter(float x, float y); +00512 FN_FUNC_FN_FN(nextafter) +00513 +00519 _RS_RUNTIME float __attribute__((overloadable)) pown(float v, int p); +00520 FN_FUNC_FN_IN(pown) +00521 +00528 _RS_RUNTIME float __attribute__((overloadable)) powr(float v, float p); +00529 FN_FUNC_FN_FN(powr) +00530 +00536 extern float __attribute__((overloadable)) remainder(float x, float y); +00537 FN_FUNC_FN_FN(remainder) +00538 +00539 // document once we know the precision of bionic +00540 extern float __attribute__((overloadable)) remquo(float, float, int *); +00541 FN_FUNC_FN_FN_PIN(remquo) +00542 +00548 extern float __attribute__((overloadable)) rint(float); +00549 FN_FUNC_FN(rint) +00550 +00556 _RS_RUNTIME float __attribute__((overloadable)) rootn(float v, int n); +00557 FN_FUNC_FN_IN(rootn) +00558 +00564 extern float __attribute__((overloadable)) round(float); +00565 FN_FUNC_FN(round) +00566 +00572 extern float __attribute__((overloadable)) sqrt(float); +00573 FN_FUNC_FN(sqrt) +00574 +00581 _RS_RUNTIME float __attribute__((overloadable)) rsqrt(float v); +00582 FN_FUNC_FN(rsqrt) +00583 +00590 extern float __attribute__((overloadable)) sin(float v); +00591 FN_FUNC_FN(sin) +00592 +00602 _RS_RUNTIME float __attribute__((overloadable)) sincos(float v, float *cosptr); +00603 FN_FUNC_FN_PFN(sincos); +00604 +00610 extern float __attribute__((overloadable)) sinh(float); +00611 FN_FUNC_FN(sinh) +00612 +00618 _RS_RUNTIME float __attribute__((overloadable)) sinpi(float v); +00619 FN_FUNC_FN(sinpi) +00620 +00627 extern float __attribute__((overloadable)) tan(float v); +00628 FN_FUNC_FN(tan) +00629 +00636 extern float __attribute__((overloadable)) tanh(float); +00637 FN_FUNC_FN(tanh) +00638 +00644 _RS_RUNTIME float __attribute__((overloadable)) tanpi(float v); +00645 FN_FUNC_FN(tanpi) +00646 +00652 extern float __attribute__((overloadable)) tgamma(float); +00653 FN_FUNC_FN(tgamma) +00654 +00660 extern float __attribute__((overloadable)) trunc(float); +00661 FN_FUNC_FN(trunc) +00662 +00663 +00664 #define XN_FUNC_YN(typeout, fnc, typein) \ +00665 extern typeout __attribute__((overloadable)) fnc(typein); \ +00666 _RS_RUNTIME typeout##2 __attribute__((overloadable)) fnc(typein##2 v); \ +00667 _RS_RUNTIME typeout##3 __attribute__((overloadable)) fnc(typein##3 v); \ +00668 _RS_RUNTIME typeout##4 __attribute__((overloadable)) fnc(typein##4 v); +00669 +00670 #define UIN_FUNC_IN(fnc) \ +00671 XN_FUNC_YN(uchar, fnc, char) \ +00672 XN_FUNC_YN(ushort, fnc, short) \ +00673 XN_FUNC_YN(uint, fnc, int) +00674 +00675 #define IN_FUNC_IN(fnc) \ +00676 XN_FUNC_YN(uchar, fnc, uchar) \ +00677 XN_FUNC_YN(char, fnc, char) \ +00678 XN_FUNC_YN(ushort, fnc, ushort) \ +00679 XN_FUNC_YN(short, fnc, short) \ +00680 XN_FUNC_YN(uint, fnc, uint) \ +00681 XN_FUNC_YN(int, fnc, int) +00682 +00683 +00684 #define XN_FUNC_XN_XN_BODY(type, fnc, body) \ +00685 _RS_RUNTIME type __attribute__((overloadable)) \ +00686 fnc(type v1, type v2); \ +00687 _RS_RUNTIME type##2 __attribute__((overloadable)) \ +00688 fnc(type##2 v1, type##2 v2); \ +00689 _RS_RUNTIME type##3 __attribute__((overloadable)) \ +00690 fnc(type##3 v1, type##3 v2); \ +00691 _RS_RUNTIME type##4 __attribute__((overloadable)) \ +00692 fnc(type##4 v1, type##4 v2); +00693 +00694 #define IN_FUNC_IN_IN_BODY(fnc, body) \ +00695 XN_FUNC_XN_XN_BODY(uchar, fnc, body) \ +00696 XN_FUNC_XN_XN_BODY(char, fnc, body) \ +00697 XN_FUNC_XN_XN_BODY(ushort, fnc, body) \ +00698 XN_FUNC_XN_XN_BODY(short, fnc, body) \ +00699 XN_FUNC_XN_XN_BODY(uint, fnc, body) \ +00700 XN_FUNC_XN_XN_BODY(int, fnc, body) \ +00701 XN_FUNC_XN_XN_BODY(float, fnc, body) +00702 +00703 UIN_FUNC_IN(abs) +00704 IN_FUNC_IN(clz) +00705 +00711 IN_FUNC_IN_IN_BODY(min, (v1 < v2 ? v1 : v2)) +00712 FN_FUNC_FN_F(min) +00713 +00719 IN_FUNC_IN_IN_BODY(max, (v1 > v2 ? v1 : v2)) +00720 FN_FUNC_FN_F(max) +00721 +00729 _RS_RUNTIME float __attribute__((overloadable)) clamp(float amount, float low, float high); +00730 _RS_RUNTIME float2 __attribute__((overloadable)) clamp(float2 amount, float2 low, float2 high); +00731 _RS_RUNTIME float3 __attribute__((overloadable)) clamp(float3 amount, float3 low, float3 high); +00732 _RS_RUNTIME float4 __attribute__((overloadable)) clamp(float4 amount, float4 low, float4 high); +00733 _RS_RUNTIME float2 __attribute__((overloadable)) clamp(float2 amount, float low, float high); +00734 _RS_RUNTIME float3 __attribute__((overloadable)) clamp(float3 amount, float low, float high); +00735 _RS_RUNTIME float4 __attribute__((overloadable)) clamp(float4 amount, float low, float high); +00736 +00742 _RS_RUNTIME float __attribute__((overloadable)) degrees(float radians); +00743 FN_FUNC_FN(degrees) +00744 +00750 _RS_RUNTIME float __attribute__((overloadable)) mix(float start, float stop, float amount); +00751 _RS_RUNTIME float2 __attribute__((overloadable)) mix(float2 start, float2 stop, float2 amount); +00752 _RS_RUNTIME float3 __attribute__((overloadable)) mix(float3 start, float3 stop, float3 amount); +00753 _RS_RUNTIME float4 __attribute__((overloadable)) mix(float4 start, float4 stop, float4 amount); +00754 _RS_RUNTIME float2 __attribute__((overloadable)) mix(float2 start, float2 stop, float amount); +00755 _RS_RUNTIME float3 __attribute__((overloadable)) mix(float3 start, float3 stop, float amount); +00756 _RS_RUNTIME float4 __attribute__((overloadable)) mix(float4 start, float4 stop, float amount); +00757 +00763 _RS_RUNTIME float __attribute__((overloadable)) radians(float degrees); +00764 FN_FUNC_FN(radians) +00765 +00774 _RS_RUNTIME float __attribute__((overloadable)) step(float edge, float v); +00775 _RS_RUNTIME float2 __attribute__((overloadable)) step(float2 edge, float2 v); +00776 _RS_RUNTIME float3 __attribute__((overloadable)) step(float3 edge, float3 v); +00777 _RS_RUNTIME float4 __attribute__((overloadable)) step(float4 edge, float4 v); +00778 _RS_RUNTIME float2 __attribute__((overloadable)) step(float2 edge, float v); +00779 _RS_RUNTIME float3 __attribute__((overloadable)) step(float3 edge, float v); +00780 _RS_RUNTIME float4 __attribute__((overloadable)) step(float4 edge, float v); +00781 +00782 // not implemented +00783 extern float __attribute__((overloadable)) smoothstep(float, float, float); +00784 extern float2 __attribute__((overloadable)) smoothstep(float2, float2, float2); +00785 extern float3 __attribute__((overloadable)) smoothstep(float3, float3, float3); +00786 extern float4 __attribute__((overloadable)) smoothstep(float4, float4, float4); +00787 extern float2 __attribute__((overloadable)) smoothstep(float, float, float2); +00788 extern float3 __attribute__((overloadable)) smoothstep(float, float, float3); +00789 extern float4 __attribute__((overloadable)) smoothstep(float, float, float4); +00790 +00798 _RS_RUNTIME float __attribute__((overloadable)) sign(float v); +00799 FN_FUNC_FN(sign) +00800 +00806 _RS_RUNTIME float3 __attribute__((overloadable)) cross(float3 lhs, float3 rhs); +00807 _RS_RUNTIME float4 __attribute__((overloadable)) cross(float4 lhs, float4 rhs); +00808 +00814 _RS_RUNTIME float __attribute__((overloadable)) dot(float lhs, float rhs); +00815 _RS_RUNTIME float __attribute__((overloadable)) dot(float2 lhs, float2 rhs); +00816 _RS_RUNTIME float __attribute__((overloadable)) dot(float3 lhs, float3 rhs); +00817 _RS_RUNTIME float __attribute__((overloadable)) dot(float4 lhs, float4 rhs); +00818 +00824 _RS_RUNTIME float __attribute__((overloadable)) length(float v); +00825 _RS_RUNTIME float __attribute__((overloadable)) length(float2 v); +00826 _RS_RUNTIME float __attribute__((overloadable)) length(float3 v); +00827 _RS_RUNTIME float __attribute__((overloadable)) length(float4 v); +00828 +00834 _RS_RUNTIME float __attribute__((overloadable)) distance(float lhs, float rhs); +00835 _RS_RUNTIME float __attribute__((overloadable)) distance(float2 lhs, float2 rhs); +00836 _RS_RUNTIME float __attribute__((overloadable)) distance(float3 lhs, float3 rhs); +00837 _RS_RUNTIME float __attribute__((overloadable)) distance(float4 lhs, float4 rhs); +00838 +00844 _RS_RUNTIME float __attribute__((overloadable)) normalize(float v); +00845 _RS_RUNTIME float2 __attribute__((overloadable)) normalize(float2 v); +00846 _RS_RUNTIME float3 __attribute__((overloadable)) normalize(float3 v); +00847 _RS_RUNTIME float4 __attribute__((overloadable)) normalize(float4 v); +00848 +00849 #undef CVT_FUNC +00850 #undef CVT_FUNC_2 +00851 #undef FN_FUNC_FN +00852 #undef IN_FUNC_FN +00853 #undef FN_FUNC_FN_FN +00854 #undef FN_FUNC_FN_F +00855 #undef FN_FUNC_FN_IN +00856 #undef FN_FUNC_FN_I +00857 #undef FN_FUNC_FN_PFN +00858 #undef FN_FUNC_FN_PIN +00859 #undef FN_FUNC_FN_FN_FN +00860 #undef FN_FUNC_FN_FN_PIN +00861 #undef XN_FUNC_YN +00862 #undef UIN_FUNC_IN +00863 #undef IN_FUNC_IN +00864 #undef XN_FUNC_XN_XN_BODY +00865 #undef IN_FUNC_IN_IN_BODY +00866 +00867 #endif +
#include "rs_types.rsh"#include "rs_allocation.rsh"#include "rs_atomic.rsh"#include "rs_cl.rsh"#include "rs_debug.rsh"#include "rs_math.rsh"#include "rs_matrix.rsh"#include "rs_object.rsh"#include "rs_quaternion.rsh"#include "rs_time.rsh"+Data Structures | |
| struct | rs_script_call |
+Typedefs | |
| typedef struct rs_script_call | rs_script_call_t |
+Enumerations | |
| enum | rs_for_each_strategy |
+Functions | |
| bool | rsSendToClient (int cmdID) |
| bool | rsSendToClient (int cmdID, const void *data, uint len) |
| void | rsSendToClientBlocking (int cmdID) |
| void | rsSendToClientBlocking (int cmdID, const void *data, uint len) |
| void | rsForEach (rs_script script, rs_allocation input, rs_allocation output, const void *usrData, const rs_script_call_t *sc) |
| void | rsForEach (rs_script script, rs_allocation input, rs_allocation output, const void *usrData) |
todo-jsams
+ +Definition in file rs_core.rsh.
+| typedef struct rs_script_call rs_script_call_t | +
Structure to provide extra information to a rsForEach call. Primarly used to restrict the call to a subset of cells in the allocation.
+ +| enum rs_for_each_strategy | +
Launch order hint for rsForEach calls. This provides a hint to the system to determine in which order the root function of the target is called with each cell of the allocation.
+This is a hint and implementations may not obey the order.
+ +Definition at line 74 of file rs_core.rsh.
+ +| void rsForEach | +( | +rs_script | +script, | +
| + | + | rs_allocation | +input, | +
| + | + | rs_allocation | +output, | +
| + | + | const void * | +usrData, | +
| + | + | const rs_script_call_t * | +sc | +
| + | ) | ++ |
Make a script to script call to launch work. One of the input or output is required to be a valid object. The input and output must be of the same dimensions. API 10-13
+| script | The target script to call |
| input | The allocation to source data from |
| output | the allocation to write date into |
| usrData | The user definied params to pass to the root script. May be NULL. |
| sc | Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL. |
| void rsForEach | +( | +rs_script | +script, | +
| + | + | rs_allocation | +input, | +
| + | + | rs_allocation | +output, | +
| + | + | const void * | +usrData | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsSendToClient | +( | +int | +cmdID | ) | ++ |
Send a message back to the client. Will not block and returns true if the message was sendable and false if the fifo was full. A message ID is required. Data payload is optional.
+ +| bool rsSendToClient | +( | +int | +cmdID, | +
| + | + | const void * | +data, | +
| + | + | uint | +len | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSendToClientBlocking | +( | +int | +cmdID | ) | ++ |
Send a message back to the client, blocking until the message is queued. A message ID is required. Data payload is optional.
+ +| void rsSendToClientBlocking | +( | +int | +cmdID, | +
| + | + | const void * | +data, | +
| + | + | uint | +len | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00024 #ifndef __RS_CORE_RSH__ +00025 #define __RS_CORE_RSH__ +00026 +00027 #define _RS_RUNTIME extern +00028 +00029 #include "rs_types.rsh" +00030 #include "rs_allocation.rsh" +00031 #include "rs_atomic.rsh" +00032 #include "rs_cl.rsh" +00033 #include "rs_debug.rsh" +00034 #include "rs_math.rsh" +00035 #include "rs_matrix.rsh" +00036 #include "rs_object.rsh" +00037 #include "rs_quaternion.rsh" +00038 #include "rs_time.rsh" +00039 +00040 +00041 +00047 extern bool __attribute__((overloadable)) +00048 rsSendToClient(int cmdID); +00052 extern bool __attribute__((overloadable)) +00053 rsSendToClient(int cmdID, const void *data, uint len); +00058 extern void __attribute__((overloadable)) +00059 rsSendToClientBlocking(int cmdID); +00063 extern void __attribute__((overloadable)) +00064 rsSendToClientBlocking(int cmdID, const void *data, uint len); +00065 +00066 +00074 enum rs_for_each_strategy { +00075 RS_FOR_EACH_STRATEGY_SERIAL, +00076 RS_FOR_EACH_STRATEGY_DONT_CARE, +00077 RS_FOR_EACH_STRATEGY_DST_LINEAR, +00078 RS_FOR_EACH_STRATEGY_TILE_SMALL, +00079 RS_FOR_EACH_STRATEGY_TILE_MEDIUM, +00080 RS_FOR_EACH_STRATEGY_TILE_LARGE +00081 }; +00082 +00083 +00088 typedef struct rs_script_call { +00089 enum rs_for_each_strategy strategy; +00090 uint32_t xStart; +00091 uint32_t xEnd; +00092 uint32_t yStart; +00093 uint32_t yEnd; +00094 uint32_t zStart; +00095 uint32_t zEnd; +00096 uint32_t arrayStart; +00097 uint32_t arrayEnd; +00098 } rs_script_call_t; +00099 +00116 #if !defined(RS_VERSION) || (RS_VERSION < 14) +00117 extern void __attribute__((overloadable)) +00118 rsForEach(rs_script script, rs_allocation input, +00119 rs_allocation output, const void * usrData, +00120 const rs_script_call_t *sc); +00124 extern void __attribute__((overloadable)) +00125 rsForEach(rs_script script, rs_allocation input, +00126 rs_allocation output, const void * usrData); +00127 #else +00128 +00147 extern void __attribute__((overloadable)) +00148 rsForEach(rs_script script, rs_allocation input, rs_allocation output, +00149 const void * usrData, size_t usrDataLen, const rs_script_call_t *); +00153 extern void __attribute__((overloadable)) +00154 rsForEach(rs_script script, rs_allocation input, rs_allocation output, +00155 const void * usrData, size_t usrDataLen); +00159 extern void __attribute__((overloadable)) +00160 rsForEach(rs_script script, rs_allocation input, rs_allocation output); +00161 #endif +00162 +00163 +00164 +00165 #undef _RS_RUNTIME +00166 +00167 #endif +
+Functions | |
| void | rsDebug (const char *, float) |
| void | rsDebug (const char *, float, float) |
| void | rsDebug (const char *, float, float, float) |
| void | rsDebug (const char *, float, float, float, float) |
| void | rsDebug (const char *, double) |
| void | rsDebug (const char *, const rs_matrix4x4 *) |
| void | rsDebug (const char *, const rs_matrix3x3 *) |
| void | rsDebug (const char *, const rs_matrix2x2 *) |
| void | rsDebug (const char *, int) |
| void | rsDebug (const char *, uint) |
| void | rsDebug (const char *, long) |
| void | rsDebug (const char *, unsigned long) |
| void | rsDebug (const char *, const void *) |
Utility debugging routines.
+Routines intended to be used during application developement. These should not be used in shipping applications. All print a string and value pair to the standard log.
+ +Definition in file rs_debug.rsh.
+| _RS_RUNTIME void rsDebug | +( | +const char * | +, | +
| + | + | float | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | float | +, | +
| + | + | float | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | float | +, | +
| + | + | float | +, | +
| + | + | float | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | float | +, | +
| + | + | float | +, | +
| + | + | float | +, | +
| + | + | float | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | double | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | const rs_matrix4x4 * | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | const rs_matrix3x3 * | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | const rs_matrix2x2 * | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | int | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | uint | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | long | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | unsigned | +long | +
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +| void rsDebug | +( | +const char * | +, | +
| + | + | const void * | ++ |
| + | ) | ++ |
Debug function. Prints a string and value to the log.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00026 #ifndef __RS_DEBUG_RSH__ +00027 #define __RS_DEBUG_RSH__ +00028 +00029 +00030 +00034 extern void __attribute__((overloadable)) +00035 rsDebug(const char *, float); +00039 extern void __attribute__((overloadable)) +00040 rsDebug(const char *, float, float); +00044 extern void __attribute__((overloadable)) +00045 rsDebug(const char *, float, float, float); +00049 extern void __attribute__((overloadable)) +00050 rsDebug(const char *, float, float, float, float); +00054 extern void __attribute__((overloadable)) +00055 rsDebug(const char *, double); +00059 extern void __attribute__((overloadable)) +00060 rsDebug(const char *, const rs_matrix4x4 *); +00064 extern void __attribute__((overloadable)) +00065 rsDebug(const char *, const rs_matrix3x3 *); +00069 extern void __attribute__((overloadable)) +00070 rsDebug(const char *, const rs_matrix2x2 *); +00074 extern void __attribute__((overloadable)) +00075 rsDebug(const char *, int); +00079 extern void __attribute__((overloadable)) +00080 rsDebug(const char *, uint); +00084 extern void __attribute__((overloadable)) +00085 rsDebug(const char *, long); +00089 extern void __attribute__((overloadable)) +00090 rsDebug(const char *, unsigned long); +00094 extern void __attribute__((overloadable)) +00095 rsDebug(const char *, long long); +00099 extern void __attribute__((overloadable)) +00100 rsDebug(const char *, unsigned long long); +00104 extern void __attribute__((overloadable)) +00105 rsDebug(const char *, const void *); +00106 #define RS_DEBUG(a) rsDebug(#a, a) +00107 #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) +00108 +00109 +00113 _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float2 v); +00117 _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float3 v); +00121 _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float4 v); +00122 +00123 #endif +
+Functions | |
| void | rsgBindProgramFragment (rs_program_fragment pf) |
| void | rsgBindProgramStore (rs_program_store ps) |
| void | rsgBindProgramVertex (rs_program_vertex pv) |
| void | rsgBindProgramRaster (rs_program_raster pr) |
| void | rsgBindSampler (rs_program_fragment, uint slot, rs_sampler) |
| void | rsgBindTexture (rs_program_fragment, uint slot, rs_allocation) |
| void | rsgProgramVertexLoadProjectionMatrix (const rs_matrix4x4 *proj) |
| void | rsgProgramVertexLoadModelMatrix (const rs_matrix4x4 *model) |
| void | rsgProgramVertexLoadTextureMatrix (const rs_matrix4x4 *tex) |
| void | rsgProgramVertexGetProjectionMatrix (rs_matrix4x4 *proj) |
| void | rsgProgramFragmentConstantColor (rs_program_fragment pf, float r, float g, float b, float a) |
| uint | rsgGetWidth (void) |
| uint | rsgGetHeight (void) |
| void | rsgAllocationSyncAll (rs_allocation alloc) |
| void | rsgDrawRect (float x1, float y1, float x2, float y2, float z) |
| void | rsgDrawQuad (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) |
| void | rsgDrawQuadTexCoords (float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4) |
| void | rsgDrawSpriteScreenspace (float x, float y, float z, float w, float h) |
| void | rsgDrawMesh (rs_mesh ism) |
| void | rsgDrawMesh (rs_mesh ism, uint primitiveIndex) |
| void | rsgDrawMesh (rs_mesh ism, uint primitiveIndex, uint start, uint len) |
| void | rsgClearColor (float r, float g, float b, float a) |
| void | rsgClearDepth (float value) |
| void | rsgDrawText (const char *, int x, int y) |
| void | rsgDrawText (rs_allocation, int x, int y) |
| void | rsgBindFont (rs_font font) |
| void | rsgFontColor (float r, float g, float b, float a) |
| void | rsgMeasureText (const char *, int *left, int *right, int *top, int *bottom) |
| void | rsgMeasureText (rs_allocation, int *left, int *right, int *top, int *bottom) |
| void | rsgMeshComputeBoundingBox (rs_mesh mesh, float *minX, float *minY, float *minZ, float *maxX, float *maxY, float *maxZ) |
| static __inline__ void | rsgMeshComputeBoundingBox (rs_mesh mesh, float3 *bBoxMin, float3 *bBoxMax) |
Renderscript graphics API.
+A set of graphics functions used by Renderscript.
+ +Definition in file rs_graphics.rsh.
+| void rsgAllocationSyncAll | +( | +rs_allocation | +alloc | ) | ++ |
Sync the contents of an allocation from its SCRIPT memory space to its HW memory spaces.
+| alloc |
| void rsgBindFont | +( | +rs_font | +font | ) | ++ |
Binds the font object to be used for all subsequent font rendering calls
+| font | object to bind |
| void rsgBindProgramFragment | +( | +rs_program_fragment | +pf | ) | ++ |
Bind a new ProgramFragment to the rendering context.
+| pf |
| void rsgBindProgramRaster | +( | +rs_program_raster | +pr | ) | ++ |
Bind a new ProgramRaster to the rendering context.
+| pr |
| void rsgBindProgramStore | +( | +rs_program_store | +ps | ) | ++ |
Bind a new ProgramStore to the rendering context.
+| ps |
| void rsgBindProgramVertex | +( | +rs_program_vertex | +pv | ) | ++ |
Bind a new ProgramVertex to the rendering context.
+| pv |
| void rsgBindSampler | +( | +rs_program_fragment | +, | +
| + | + | uint | +slot, | +
| + | + | rs_sampler | ++ |
| + | ) | ++ |
Bind a new Sampler object to a ProgramFragment. The sampler will operate on the texture bound at the matching slot.
+| slot |
| void rsgBindTexture | +( | +rs_program_fragment | +, | +
| + | + | uint | +slot, | +
| + | + | rs_allocation | ++ |
| + | ) | ++ |
Bind a new Allocation object to a ProgramFragment. The Allocation must be a valid texture for the Program. The sampling of the texture will be controled by the Sampler bound at the matching slot.
+| slot |
| void rsgClearColor | +( | +float | +r, | +
| + | + | float | +g, | +
| + | + | float | +b, | +
| + | + | float | +a | +
| + | ) | ++ |
Clears the rendering surface to the specified color.
+| r | |
| g | |
| b | |
| a |
| void rsgClearDepth | +( | +float | +value | ) | ++ |
Clears the depth suface to the specified value.
+ +| void rsgDrawMesh | +( | +rs_mesh | +ism | ) | ++ |
Draw a mesh using the current context state. The whole mesh is rendered.
+| ism |
Draw part of a mesh using the current context state.
+| ism | mesh object to render |
| primitiveIndex | for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. |
| void rsgDrawMesh | +( | +rs_mesh | +ism, | +
| + | + | uint | +primitiveIndex, | +
| + | + | uint | +start, | +
| + | + | uint | +len | +
| + | ) | ++ |
Draw specified index range of part of a mesh using the current context state.
+| ism | mesh object to render |
| primitiveIndex | for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. |
| start | starting index in the range |
| len | number of indices to draw |
| void rsgDrawQuad | +( | +float | +x1, | +
| + | + | float | +y1, | +
| + | + | float | +z1, | +
| + | + | float | +x2, | +
| + | + | float | +y2, | +
| + | + | float | +z2, | +
| + | + | float | +x3, | +
| + | + | float | +y3, | +
| + | + | float | +z3, | +
| + | + | float | +x4, | +
| + | + | float | +y4, | +
| + | + | float | +z4 | +
| + | ) | ++ |
Low performance utility function for drawing a simple quad. Not intended for drawing large quantities of geometry.
+| x1 | |
| y1 | |
| z1 | |
| x2 | |
| y2 | |
| z2 | |
| x3 | |
| y3 | |
| z3 | |
| x4 | |
| y4 | |
| z4 |
| void rsgDrawQuadTexCoords | +( | +float | +x1, | +
| + | + | float | +y1, | +
| + | + | float | +z1, | +
| + | + | float | +u1, | +
| + | + | float | +v1, | +
| + | + | float | +x2, | +
| + | + | float | +y2, | +
| + | + | float | +z2, | +
| + | + | float | +u2, | +
| + | + | float | +v2, | +
| + | + | float | +x3, | +
| + | + | float | +y3, | +
| + | + | float | +z3, | +
| + | + | float | +u3, | +
| + | + | float | +v3, | +
| + | + | float | +x4, | +
| + | + | float | +y4, | +
| + | + | float | +z4, | +
| + | + | float | +u4, | +
| + | + | float | +v4 | +
| + | ) | ++ |
Low performance utility function for drawing a textured quad. Not intended for drawing large quantities of geometry.
+| x1 | |
| y1 | |
| z1 | |
| u1 | |
| v1 | |
| x2 | |
| y2 | |
| z2 | |
| u2 | |
| v2 | |
| x3 | |
| y3 | |
| z3 | |
| u3 | |
| v3 | |
| x4 | |
| y4 | |
| z4 | |
| u4 | |
| v4 |
| void rsgDrawRect | +( | +float | +x1, | +
| + | + | float | +y1, | +
| + | + | float | +x2, | +
| + | + | float | +y2, | +
| + | + | float | +z | +
| + | ) | ++ |
Low performance utility function for drawing a simple rectangle. Not intended for drawing large quantities of geometry.
+| x1 | |
| y1 | |
| x2 | |
| y2 | |
| z |
| void rsgDrawSpriteScreenspace | +( | +float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z, | +
| + | + | float | +w, | +
| + | + | float | +h | +
| + | ) | ++ |
Low performance function for drawing rectangles in screenspace. This function uses the default passthough ProgramVertex. Any bound ProgramVertex is ignored. This function has considerable overhead and should not be used for drawing in shipping applications.
+| x | |
| y | |
| z | |
| w | |
| h |
| void rsgDrawText | +( | +const char * | +, | +
| + | + | int | +x, | +
| + | + | int | +y | +
| + | ) | ++ |
Draws text given a string and location
+ +| void rsgDrawText | +( | +rs_allocation | +, | +
| + | + | int | +x, | +
| + | + | int | +y | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsgFontColor | +( | +float | +r, | +
| + | + | float | +g, | +
| + | + | float | +b, | +
| + | + | float | +a | +
| + | ) | ++ |
Sets the font color for all subsequent rendering calls
+| r | red component |
| g | green component |
| b | blue component |
| a | alpha component |
| uint rsgGetHeight | +( | +void | +) | ++ |
Get the height of the current rendering surface.
+| uint rsgGetWidth | +( | +void | +) | ++ |
Get the width of the current rendering surface.
+| void rsgMeasureText | +( | +const char * | +, | +
| + | + | int * | +left, | +
| + | + | int * | +right, | +
| + | + | int * | +top, | +
| + | + | int * | +bottom | +
| + | ) | ++ |
Returns the bounding box of the text relative to (0, 0) Any of left, right, top, bottom could be NULL
+ +| void rsgMeasureText | +( | +rs_allocation | +, | +
| + | + | int * | +left, | +
| + | + | int * | +right, | +
| + | + | int * | +top, | +
| + | + | int * | +bottom | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsgMeshComputeBoundingBox | +( | +rs_mesh | +mesh, | +
| + | + | float * | +minX, | +
| + | + | float * | +minY, | +
| + | + | float * | +minZ, | +
| + | + | float * | +maxX, | +
| + | + | float * | +maxY, | +
| + | + | float * | +maxZ | +
| + | ) | ++ |
Computes an axis aligned bounding box of a mesh object
+ +| static __inline__ void rsgMeshComputeBoundingBox | +( | +rs_mesh | +mesh, | +
| + | + | float3 * | +bBoxMin, | +
| + | + | float3 * | +bBoxMax | +
| + | ) | + [static] |
+
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +Definition at line 380 of file rs_graphics.rsh.
+ +| void rsgProgramFragmentConstantColor | +( | +rs_program_fragment | +pf, | +
| + | + | float | +r, | +
| + | + | float | +g, | +
| + | + | float | +b, | +
| + | + | float | +a | +
| + | ) | ++ |
Set the constant color for a fixed function emulation program.
+| pf | |
| r | |
| g | |
| b | |
| a |
| void rsgProgramVertexGetProjectionMatrix | +( | +rs_matrix4x4 * | +proj | ) | ++ |
Get the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
+| proj | matrix to store the current projection matrix into |
| void rsgProgramVertexLoadModelMatrix | +( | +const rs_matrix4x4 * | +model | ) | ++ |
Load the model matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
+| model | model matrix |
| void rsgProgramVertexLoadProjectionMatrix | +( | +const rs_matrix4x4 * | +proj | ) | ++ |
Load the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
+| proj | projection matrix |
| void rsgProgramVertexLoadTextureMatrix | +( | +const rs_matrix4x4 * | +tex | ) | ++ |
Load the texture matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
+| tex | texture matrix |
00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_GRAPHICS_RSH__ +00024 #define __RS_GRAPHICS_RSH__ +00025 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) +00026 +00031 extern void __attribute__((overloadable)) +00032 rsgBindColorTarget(rs_allocation colorTarget, uint slot); +00033 +00038 extern void __attribute__((overloadable)) +00039 rsgClearColorTarget(uint slot); +00040 +00045 extern void __attribute__((overloadable)) +00046 rsgBindDepthTarget(rs_allocation depthTarget); +00047 +00051 extern void __attribute__((overloadable)) +00052 rsgClearDepthTarget(void); +00053 +00058 extern void __attribute__((overloadable)) +00059 rsgClearAllRenderTargets(void); +00060 +00064 extern uint __attribute__((overloadable)) +00065 rsgFinish(void); +00066 +00067 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) +00068 +00074 extern void __attribute__((overloadable)) +00075 rsgBindProgramFragment(rs_program_fragment pf); +00076 +00082 extern void __attribute__((overloadable)) +00083 rsgBindProgramStore(rs_program_store ps); +00084 +00090 extern void __attribute__((overloadable)) +00091 rsgBindProgramVertex(rs_program_vertex pv); +00092 +00098 extern void __attribute__((overloadable)) +00099 rsgBindProgramRaster(rs_program_raster pr); +00100 +00107 extern void __attribute__((overloadable)) +00108 rsgBindSampler(rs_program_fragment, uint slot, rs_sampler); +00109 +00118 extern void __attribute__((overloadable)) +00119 rsgBindTexture(rs_program_fragment, uint slot, rs_allocation); +00120 +00127 extern void __attribute__((overloadable)) +00128 rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4 *proj); +00135 extern void __attribute__((overloadable)) +00136 rsgProgramVertexLoadModelMatrix(const rs_matrix4x4 *model); +00143 extern void __attribute__((overloadable)) +00144 rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4 *tex); +00151 extern void __attribute__((overloadable)) +00152 rsgProgramVertexGetProjectionMatrix(rs_matrix4x4 *proj); +00153 +00163 extern void __attribute__((overloadable)) +00164 rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a); +00165 +00171 extern uint __attribute__((overloadable)) +00172 rsgGetWidth(void); +00173 +00179 extern uint __attribute__((overloadable)) +00180 rsgGetHeight(void); +00181 +00182 +00189 extern void __attribute__((overloadable)) +00190 rsgAllocationSyncAll(rs_allocation alloc); +00191 +00192 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) +00193 +00201 extern void __attribute__((overloadable)) +00202 rsgAllocationSyncAll(rs_allocation alloc, +00203 rs_allocation_usage_type source); +00204 +00205 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) +00206 +00217 extern void __attribute__((overloadable)) +00218 rsgDrawRect(float x1, float y1, float x2, float y2, float z); +00219 +00237 extern void __attribute__((overloadable)) +00238 rsgDrawQuad(float x1, float y1, float z1, +00239 float x2, float y2, float z2, +00240 float x3, float y3, float z3, +00241 float x4, float y4, float z4); +00242 +00243 +00269 extern void __attribute__((overloadable)) +00270 rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, +00271 float x2, float y2, float z2, float u2, float v2, +00272 float x3, float y3, float z3, float u3, float v3, +00273 float x4, float y4, float z4, float u4, float v4); +00274 +00275 +00288 extern void __attribute__((overloadable)) +00289 rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); +00290 +00297 extern void __attribute__((overloadable)) +00298 rsgDrawMesh(rs_mesh ism); +00305 extern void __attribute__((overloadable)) +00306 rsgDrawMesh(rs_mesh ism, uint primitiveIndex); +00315 extern void __attribute__((overloadable)) +00316 rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len); +00317 +00326 extern void __attribute__((overloadable)) +00327 rsgClearColor(float r, float g, float b, float a); +00328 +00332 extern void __attribute__((overloadable)) +00333 rsgClearDepth(float value); +00337 extern void __attribute__((overloadable)) +00338 rsgDrawText(const char *, int x, int y); +00342 extern void __attribute__((overloadable)) +00343 rsgDrawText(rs_allocation, int x, int y); +00348 extern void __attribute__((overloadable)) +00349 rsgBindFont(rs_font font); +00357 extern void __attribute__((overloadable)) +00358 rsgFontColor(float r, float g, float b, float a); +00363 extern void __attribute__((overloadable)) +00364 rsgMeasureText(const char *, int *left, int *right, int *top, int *bottom); +00368 extern void __attribute__((overloadable)) +00369 rsgMeasureText(rs_allocation, int *left, int *right, int *top, int *bottom); +00373 extern void __attribute__((overloadable)) +00374 rsgMeshComputeBoundingBox(rs_mesh mesh, float *minX, float *minY, float *minZ, +00375 float *maxX, float *maxY, float *maxZ); +00379 __inline__ static void __attribute__((overloadable, always_inline)) +00380 rsgMeshComputeBoundingBox(rs_mesh mesh, float3 *bBoxMin, float3 *bBoxMax) { +00381 float x1, y1, z1, x2, y2, z2; +00382 rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2); +00383 bBoxMin->x = x1; +00384 bBoxMin->y = y1; +00385 bBoxMin->z = z1; +00386 bBoxMax->x = x2; +00387 bBoxMax->y = y2; +00388 bBoxMax->z = z2; +00389 } +00390 +00391 #endif +00392 +
+Functions | |
| int | rsRand (int max_value) |
| int | rsRand (int min_value, int max_value) |
| float | rsRand (float max_value) |
| float | rsRand (float min_value, float max_value) |
| float | rsFrac (float) |
| _RS_RUNTIME uint | rsClamp (uint amount, uint low, uint high) |
| _RS_RUNTIME int | rsClamp (int amount, int low, int high) |
| _RS_RUNTIME ushort | rsClamp (ushort amount, ushort low, ushort high) |
| _RS_RUNTIME short | rsClamp (short amount, short low, short high) |
| _RS_RUNTIME uchar | rsClamp (uchar amount, uchar low, uchar high) |
| _RS_RUNTIME char | rsClamp (char amount, char low, char high) |
| static __inline__ void | rsExtractFrustumPlanes (const rs_matrix4x4 *viewProj, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far) |
| static __inline__ bool | rsIsSphereInFrustum (float4 *sphere, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far) |
| _RS_RUNTIME uchar4 | rsPackColorTo8888 (float r, float g, float b) |
| _RS_RUNTIME uchar4 | rsPackColorTo8888 (float r, float g, float b, float a) |
| _RS_RUNTIME uchar4 | rsPackColorTo8888 (float3 color) |
| _RS_RUNTIME float4 | rsUnpackColor8888 (uchar4 c) |
todo-jsams
+ +Definition in file rs_math.rsh.
+| _RS_RUNTIME uint rsClamp | +( | +uint | +amount, | +
| + | + | uint | +low, | +
| + | + | uint | +high | +
| + | ) | ++ |
Clamp the value amount between low and high.
+| amount | The value to clamp |
| low | |
| high |
| _RS_RUNTIME int rsClamp | +( | +int | +amount, | +
| + | + | int | +low, | +
| + | + | int | +high | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME ushort rsClamp | +( | +ushort | +amount, | +
| + | + | ushort | +low, | +
| + | + | ushort | +high | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME short rsClamp | +( | +short | +amount, | +
| + | + | short | +low, | +
| + | + | short | +high | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME uchar rsClamp | +( | +uchar | +amount, | +
| + | + | uchar | +low, | +
| + | + | uchar | +high | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME char rsClamp | +( | +char | +amount, | +
| + | + | char | +low, | +
| + | + | char | +high | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| static __inline__ void rsExtractFrustumPlanes | +( | +const rs_matrix4x4 * | +viewProj, | +
| + | + | float4 * | +left, | +
| + | + | float4 * | +right, | +
| + | + | float4 * | +top, | +
| + | + | float4 * | +bottom, | +
| + | + | float4 * | +near, | +
| + | + | float4 * | +far | +
| + | ) | + [static] |
+
Computes 6 frustum planes from the view projection matrix
+| viewProj | matrix to extract planes from |
| left | plane |
| right | plane |
| top | plane |
| bottom | plane |
| near | plane |
| far | plane |
Definition at line 102 of file rs_math.rsh.
+ +| float rsFrac | +( | +float | +) | ++ |
Returns the fractional part of a float
+ +| static __inline__ bool rsIsSphereInFrustum | +( | +float4 * | +sphere, | +
| + | + | float4 * | +left, | +
| + | + | float4 * | +right, | +
| + | + | float4 * | +top, | +
| + | + | float4 * | +bottom, | +
| + | + | float4 * | +near, | +
| + | + | float4 * | +far | +
| + | ) | + [static] |
+
Checks if a sphere is withing the 6 frustum planes
+| sphere | float4 representing the sphere |
| left | plane |
| right | plane |
| top | plane |
| bottom | plane |
| near | plane |
| far | plane |
Definition at line 162 of file rs_math.rsh.
+ +| _RS_RUNTIME uchar4 rsPackColorTo8888 | +( | +float | +r, | +
| + | + | float | +g, | +
| + | + | float | +b | +
| + | ) | ++ |
Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).
+| r | |
| g | |
| b |
| _RS_RUNTIME uchar4 rsPackColorTo8888 | +( | +float | +r, | +
| + | + | float | +g, | +
| + | + | float | +b, | +
| + | + | float | +a | +
| + | ) | ++ |
Pack floating point (0-1) RGBA values into a uchar4.
+| r | |
| g | |
| b | |
| a |
Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).
+| color |
Pack floating point (0-1) RGBA values into a uchar4.
+| color |
| int rsRand | +( | +int | +max_value | ) | ++ |
Return a random value between 0 (or min_value) and max_malue.
+ +| int rsRand | +( | +int | +min_value, | +
| + | + | int | +max_value | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| float rsRand | +( | +float | +max_value | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| float rsRand | +( | +float | +min_value, | +
| + | + | float | +max_value | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00024 #ifndef __RS_MATH_RSH__ +00025 #define __RS_MATH_RSH__ +00026 +00027 +00031 extern int __attribute__((overloadable)) +00032 rsRand(int max_value); +00036 extern int __attribute__((overloadable)) +00037 rsRand(int min_value, int max_value); +00041 extern float __attribute__((overloadable)) +00042 rsRand(float max_value); +00046 extern float __attribute__((overloadable)) +00047 rsRand(float min_value, float max_value); +00048 +00052 extern float __attribute__((overloadable)) +00053 rsFrac(float); +00054 +00055 +00057 // int ops +00059 +00067 _RS_RUNTIME uint __attribute__((overloadable, always_inline)) rsClamp(uint amount, uint low, uint high); +00068 +00072 _RS_RUNTIME int __attribute__((overloadable, always_inline)) rsClamp(int amount, int low, int high); +00076 _RS_RUNTIME ushort __attribute__((overloadable, always_inline)) rsClamp(ushort amount, ushort low, ushort high); +00080 _RS_RUNTIME short __attribute__((overloadable, always_inline)) rsClamp(short amount, short low, short high); +00084 _RS_RUNTIME uchar __attribute__((overloadable, always_inline)) rsClamp(uchar amount, uchar low, uchar high); +00088 _RS_RUNTIME char __attribute__((overloadable, always_inline)) rsClamp(char amount, char low, char high); +00089 +00090 +00101 __inline__ static void __attribute__((overloadable, always_inline)) +00102 rsExtractFrustumPlanes(const rs_matrix4x4 *viewProj, +00103 float4 *left, float4 *right, +00104 float4 *top, float4 *bottom, +00105 float4 *near, float4 *far) { +00106 // x y z w = a b c d in the plane equation +00107 left->x = viewProj->m[3] + viewProj->m[0]; +00108 left->y = viewProj->m[7] + viewProj->m[4]; +00109 left->z = viewProj->m[11] + viewProj->m[8]; +00110 left->w = viewProj->m[15] + viewProj->m[12]; +00111 +00112 right->x = viewProj->m[3] - viewProj->m[0]; +00113 right->y = viewProj->m[7] - viewProj->m[4]; +00114 right->z = viewProj->m[11] - viewProj->m[8]; +00115 right->w = viewProj->m[15] - viewProj->m[12]; +00116 +00117 top->x = viewProj->m[3] - viewProj->m[1]; +00118 top->y = viewProj->m[7] - viewProj->m[5]; +00119 top->z = viewProj->m[11] - viewProj->m[9]; +00120 top->w = viewProj->m[15] - viewProj->m[13]; +00121 +00122 bottom->x = viewProj->m[3] + viewProj->m[1]; +00123 bottom->y = viewProj->m[7] + viewProj->m[5]; +00124 bottom->z = viewProj->m[11] + viewProj->m[9]; +00125 bottom->w = viewProj->m[15] + viewProj->m[13]; +00126 +00127 near->x = viewProj->m[3] + viewProj->m[2]; +00128 near->y = viewProj->m[7] + viewProj->m[6]; +00129 near->z = viewProj->m[11] + viewProj->m[10]; +00130 near->w = viewProj->m[15] + viewProj->m[14]; +00131 +00132 far->x = viewProj->m[3] - viewProj->m[2]; +00133 far->y = viewProj->m[7] - viewProj->m[6]; +00134 far->z = viewProj->m[11] - viewProj->m[10]; +00135 far->w = viewProj->m[15] - viewProj->m[14]; +00136 +00137 float len = length(left->xyz); +00138 *left /= len; +00139 len = length(right->xyz); +00140 *right /= len; +00141 len = length(top->xyz); +00142 *top /= len; +00143 len = length(bottom->xyz); +00144 *bottom /= len; +00145 len = length(near->xyz); +00146 *near /= len; +00147 len = length(far->xyz); +00148 *far /= len; +00149 } +00150 +00161 __inline__ static bool __attribute__((overloadable, always_inline)) +00162 rsIsSphereInFrustum(float4 *sphere, +00163 float4 *left, float4 *right, +00164 float4 *top, float4 *bottom, +00165 float4 *near, float4 *far) { +00166 +00167 float distToCenter = dot(left->xyz, sphere->xyz) + left->w; +00168 if (distToCenter < -sphere->w) { +00169 return false; +00170 } +00171 distToCenter = dot(right->xyz, sphere->xyz) + right->w; +00172 if (distToCenter < -sphere->w) { +00173 return false; +00174 } +00175 distToCenter = dot(top->xyz, sphere->xyz) + top->w; +00176 if (distToCenter < -sphere->w) { +00177 return false; +00178 } +00179 distToCenter = dot(bottom->xyz, sphere->xyz) + bottom->w; +00180 if (distToCenter < -sphere->w) { +00181 return false; +00182 } +00183 distToCenter = dot(near->xyz, sphere->xyz) + near->w; +00184 if (distToCenter < -sphere->w) { +00185 return false; +00186 } +00187 distToCenter = dot(far->xyz, sphere->xyz) + far->w; +00188 if (distToCenter < -sphere->w) { +00189 return false; +00190 } +00191 return true; +00192 } +00193 +00194 +00205 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b); +00206 +00217 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b, float a); +00218 +00227 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float3 color); +00228 +00236 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float4 color); +00237 +00245 _RS_RUNTIME float4 rsUnpackColor8888(uchar4 c); +00246 +00247 +00248 #endif +
Matrix routines.
+ +Definition in file rs_matrix.rsh.
+| _RS_RUNTIME float rsMatrixGet | +( | +const rs_matrix4x4 * | +m, | +
| + | + | uint32_t | +row, | +
| + | + | uint32_t | +col | +
| + | ) | ++ |
Get one element of a matrix.
+| m | The matrix to read from |
| row | |
| col |
| _RS_RUNTIME float rsMatrixGet | +( | +const rs_matrix3x3 * | +m, | +
| + | + | uint32_t | +row, | +
| + | + | uint32_t | +col | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME float rsMatrixGet | +( | +const rs_matrix2x2 * | +m, | +
| + | + | uint32_t | +row, | +
| + | + | uint32_t | +col | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsMatrixInverse | +( | +rs_matrix4x4 * | +m | ) | ++ |
Returns true if the matrix was successfully inversed
+| m |
| bool rsMatrixInverseTranspose | +( | +rs_matrix4x4 * | +m | ) | ++ |
Returns true if the matrix was successfully inversed and transposed.
+| m |
| void rsMatrixLoad | +( | +rs_matrix4x4 * | +m, | +
| + | + | const float * | +v | +
| + | ) | ++ |
Set the elements of a matrix from an array of floats.
+| m |
| void rsMatrixLoad | +( | +rs_matrix3x3 * | +m, | +
| + | + | const float * | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoad | +( | +rs_matrix2x2 * | +m, | +
| + | + | const float * | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoad | +( | +rs_matrix4x4 * | +m, | +
| + | + | const rs_matrix4x4 * | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoad | +( | +rs_matrix4x4 * | +m, | +
| + | + | const rs_matrix3x3 * | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoad | +( | +rs_matrix4x4 * | +m, | +
| + | + | const rs_matrix2x2 * | +v | +
| + | ) | ++ |
Set the elements of a matrix from another matrix.
+| m |
| void rsMatrixLoad | +( | +rs_matrix3x3 * | +m, | +
| + | + | const rs_matrix3x3 * | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoad | +( | +rs_matrix2x2 * | +m, | +
| + | + | const rs_matrix2x2 * | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoadFrustum | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +left, | +
| + | + | float | +right, | +
| + | + | float | +bottom, | +
| + | + | float | +top, | +
| + | + | float | +near, | +
| + | + | float | +far | +
| + | ) | ++ |
Load an Frustum projection matrix constructed from the 6 planes
+| m | |
| left | |
| right | |
| bottom | |
| top | |
| near | |
| far |
| void rsMatrixLoadIdentity | +( | +rs_matrix4x4 * | +m | ) | ++ |
Set the elements of a matrix to the identity matrix.
+| m |
| void rsMatrixLoadIdentity | +( | +rs_matrix3x3 * | +m | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoadIdentity | +( | +rs_matrix2x2 * | +m | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoadMultiply | +( | +rs_matrix4x4 * | +m, | +
| + | + | const rs_matrix4x4 * | +lhs, | +
| + | + | const rs_matrix4x4 * | +rhs | +
| + | ) | ++ |
Multiply two matrix (lhs, rhs) and place the result in m.
+| m | |
| lhs | |
| rhs |
| void rsMatrixLoadMultiply | +( | +rs_matrix3x3 * | +m, | +
| + | + | const rs_matrix3x3 * | +lhs, | +
| + | + | const rs_matrix3x3 * | +rhs | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoadMultiply | +( | +rs_matrix2x2 * | +m, | +
| + | + | const rs_matrix2x2 * | +lhs, | +
| + | + | const rs_matrix2x2 * | +rhs | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixLoadOrtho | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +left, | +
| + | + | float | +right, | +
| + | + | float | +bottom, | +
| + | + | float | +top, | +
| + | + | float | +near, | +
| + | + | float | +far | +
| + | ) | ++ |
Load an Ortho projection matrix constructed from the 6 planes
+| m | |
| left | |
| right | |
| bottom | |
| top | |
| near | |
| far |
| void rsMatrixLoadPerspective | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +fovy, | +
| + | + | float | +aspect, | +
| + | + | float | +near, | +
| + | + | float | +far | +
| + | ) | ++ |
Load an perspective projection matrix constructed from the 6 planes
+| m | |
| fovy | Field of view, in degrees along the Y axis. |
| aspect | Ratio of x / y. |
| near | |
| far |
| void rsMatrixLoadRotate | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +rot, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | ++ |
Load a rotation matrix.
+| m | |
| rot | |
| x | |
| y | |
| z |
| void rsMatrixLoadScale | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | ++ |
Load a scale matrix.
+| m | |
| x | |
| y | |
| z |
| void rsMatrixLoadTranslate | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | ++ |
Load a translation matrix.
+| m | |
| x | |
| y | |
| z |
| void rsMatrixMultiply | +( | +rs_matrix4x4 * | +m, | +
| + | + | const rs_matrix4x4 * | +rhs | +
| + | ) | ++ |
Multiply the matrix m by rhs and place the result back into m.
+| m | (lhs) |
| rhs |
| void rsMatrixMultiply | +( | +rs_matrix3x3 * | +m, | +
| + | + | const rs_matrix3x3 * | +rhs | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixMultiply | +( | +rs_matrix2x2 * | +m, | +
| + | + | const rs_matrix2x2 * | +rhs | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME float4 rsMatrixMultiply | +( | +rs_matrix4x4 * | +m, | +
| + | + | float4 | +in | +
| + | ) | ++ |
Multiply a vector by a matrix and return the result vector. API version 10-13
+This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME float3 rsMatrixMultiply | +( | +rs_matrix3x3 * | +m, | +
| + | + | float3 | +in | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME float2 rsMatrixMultiply | +( | +rs_matrix2x2 * | +m, | +
| + | + | float2 | +in | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixRotate | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +rot, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | ++ |
Multiple matrix m with a rotation matrix
+| m | |
| rot | |
| x | |
| y | |
| z |
| void rsMatrixScale | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | ++ |
Multiple matrix m with a scale matrix
+| m | |
| x | |
| y | |
| z |
| _RS_RUNTIME void rsMatrixSet | +( | +rs_matrix4x4 * | +m, | +
| + | + | uint32_t | +row, | +
| + | + | uint32_t | +col, | +
| + | + | float | +v | +
| + | ) | ++ |
Set one element of a matrix.
+| m | The matrix to be set |
| row | |
| col | |
| v |
| _RS_RUNTIME void rsMatrixSet | +( | +rs_matrix3x3 * | +m, | +
| + | + | uint32_t | +row, | +
| + | + | uint32_t | +col, | +
| + | + | float | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| _RS_RUNTIME void rsMatrixSet | +( | +rs_matrix2x2 * | +m, | +
| + | + | uint32_t | +row, | +
| + | + | uint32_t | +col, | +
| + | + | float | +v | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixTranslate | +( | +rs_matrix4x4 * | +m, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | ++ |
Multiple matrix m with a translation matrix
+| m | |
| x | |
| y | |
| z |
| void rsMatrixTranspose | +( | +rs_matrix4x4 * | +m | ) | ++ |
Transpose the matrix m.
+| m |
| void rsMatrixTranspose | +( | +rs_matrix3x3 * | +m | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsMatrixTranspose | +( | +rs_matrix2x2 * | +m | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_MATRIX_RSH__ +00024 #define __RS_MATRIX_RSH__ +00025 +00036 _RS_RUNTIME void __attribute__((overloadable)) +00037 rsMatrixSet(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v); +00041 _RS_RUNTIME void __attribute__((overloadable)) +00042 rsMatrixSet(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v); +00046 _RS_RUNTIME void __attribute__((overloadable)) +00047 rsMatrixSet(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v); +00048 +00058 _RS_RUNTIME float __attribute__((overloadable)) +00059 rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col); +00063 _RS_RUNTIME float __attribute__((overloadable)) +00064 rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col); +00068 _RS_RUNTIME float __attribute__((overloadable)) +00069 rsMatrixGet(const rs_matrix2x2 *m, uint32_t row, uint32_t col); +00070 +00076 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix4x4 *m); +00080 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix3x3 *m); +00084 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix2x2 *m); +00085 +00091 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const float *v); +00095 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const float *v); +00099 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const float *v); +00103 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v); +00107 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v); +00108 +00114 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v); +00118 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const rs_matrix3x3 *v); +00122 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const rs_matrix2x2 *v); +00123 +00133 extern void __attribute__((overloadable)) +00134 rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); +00135 +00144 extern void __attribute__((overloadable)) +00145 rsMatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z); +00146 +00155 extern void __attribute__((overloadable)) +00156 rsMatrixLoadTranslate(rs_matrix4x4 *m, float x, float y, float z); +00157 +00165 extern void __attribute__((overloadable)) +00166 rsMatrixLoadMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs); +00170 extern void __attribute__((overloadable)) +00171 rsMatrixLoadMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *lhs, const rs_matrix3x3 *rhs); +00175 extern void __attribute__((overloadable)) +00176 rsMatrixLoadMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs); +00177 +00184 extern void __attribute__((overloadable)) +00185 rsMatrixMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *rhs); +00189 extern void __attribute__((overloadable)) +00190 rsMatrixMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *rhs); +00194 extern void __attribute__((overloadable)) +00195 rsMatrixMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *rhs); +00196 +00206 extern void __attribute__((overloadable)) +00207 rsMatrixRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); +00208 +00217 extern void __attribute__((overloadable)) +00218 rsMatrixScale(rs_matrix4x4 *m, float x, float y, float z); +00219 +00228 extern void __attribute__((overloadable)) +00229 rsMatrixTranslate(rs_matrix4x4 *m, float x, float y, float z); +00230 +00242 extern void __attribute__((overloadable)) +00243 rsMatrixLoadOrtho(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far); +00244 +00256 extern void __attribute__((overloadable)) +00257 rsMatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far); +00258 +00268 extern void __attribute__((overloadable)) +00269 rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far); +00270 +00271 #if !defined(RS_VERSION) || (RS_VERSION < 14) +00272 +00276 _RS_RUNTIME float4 __attribute__((overloadable)) +00277 rsMatrixMultiply(rs_matrix4x4 *m, float4 in); +00278 +00282 _RS_RUNTIME float4 __attribute__((overloadable)) +00283 rsMatrixMultiply(rs_matrix4x4 *m, float3 in); +00284 +00288 _RS_RUNTIME float4 __attribute__((overloadable)) +00289 rsMatrixMultiply(rs_matrix4x4 *m, float2 in); +00290 +00294 _RS_RUNTIME float3 __attribute__((overloadable)) +00295 rsMatrixMultiply(rs_matrix3x3 *m, float3 in); +00296 +00300 _RS_RUNTIME float3 __attribute__((overloadable)) +00301 rsMatrixMultiply(rs_matrix3x3 *m, float2 in); +00302 +00306 _RS_RUNTIME float2 __attribute__((overloadable)) +00307 rsMatrixMultiply(rs_matrix2x2 *m, float2 in); +00308 #else +00309 +00313 _RS_RUNTIME float4 __attribute__((overloadable)) +00314 rsMatrixMultiply(const rs_matrix4x4 *m, float4 in); +00315 +00319 _RS_RUNTIME float4 __attribute__((overloadable)) +00320 rsMatrixMultiply(const rs_matrix4x4 *m, float3 in); +00321 +00325 _RS_RUNTIME float4 __attribute__((overloadable)) +00326 rsMatrixMultiply(const rs_matrix4x4 *m, float2 in); +00327 +00331 _RS_RUNTIME float3 __attribute__((overloadable)) +00332 rsMatrixMultiply(const rs_matrix3x3 *m, float3 in); +00333 +00337 _RS_RUNTIME float3 __attribute__((overloadable)) +00338 rsMatrixMultiply(const rs_matrix3x3 *m, float2 in); +00339 +00343 _RS_RUNTIME float2 __attribute__((overloadable)) +00344 rsMatrixMultiply(const rs_matrix2x2 *m, float2 in); +00345 #endif +00346 +00347 +00353 extern bool __attribute__((overloadable)) rsMatrixInverse(rs_matrix4x4 *m); +00354 +00360 extern bool __attribute__((overloadable)) rsMatrixInverseTranspose(rs_matrix4x4 *m); +00361 +00367 extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix4x4 *m); +00371 extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix3x3 *m); +00375 extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix2x2 *m); +00376 +00377 +00378 #endif +
Object routines.
+ +Definition in file rs_object.rsh.
+| void rsClearObject | +( | +rs_element * | +dst | ) | ++ |
Sets the object to NULL.
+| void rsClearObject | +( | +rs_type * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_allocation * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_sampler * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_script * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_mesh * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_program_fragment * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_program_vertex * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_program_raster * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_program_store * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsClearObject | +( | +rs_font * | +dst | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_element | +) | ++ |
Tests if the object is valid. Returns true if the object is valid, false if it is NULL.
+| bool rsIsObject | +( | +rs_type | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_allocation | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_sampler | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_script | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_mesh | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_program_fragment | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_program_vertex | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_program_raster | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_program_store | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| bool rsIsObject | +( | +rs_font | +) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_element * | +dst, | +
| + | + | rs_element | +src | +
| + | ) | ++ |
Copy reference to the specified object.
+| dst | |
| src |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_allocation * | +dst, | +
| + | + | rs_allocation | +src | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_sampler * | +dst, | +
| + | + | rs_sampler | +src | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_program_fragment * | +dst, | +
| + | + | rs_program_fragment | +src | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_program_vertex * | +dst, | +
| + | + | rs_program_vertex | +src | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_program_raster * | +dst, | +
| + | + | rs_program_raster | +src | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +| void rsSetObject | +( | +rs_program_store * | +dst, | +
| + | + | rs_program_store | +src | +
| + | ) | ++ |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_OBJECT_RSH__ +00024 #define __RS_OBJECT_RSH__ +00025 +00026 +00033 extern void __attribute__((overloadable)) +00034 rsSetObject(rs_element *dst, rs_element src); +00038 extern void __attribute__((overloadable)) +00039 rsSetObject(rs_type *dst, rs_type src); +00043 extern void __attribute__((overloadable)) +00044 rsSetObject(rs_allocation *dst, rs_allocation src); +00048 extern void __attribute__((overloadable)) +00049 rsSetObject(rs_sampler *dst, rs_sampler src); +00053 extern void __attribute__((overloadable)) +00054 rsSetObject(rs_script *dst, rs_script src); +00058 extern void __attribute__((overloadable)) +00059 rsSetObject(rs_mesh *dst, rs_mesh src); +00063 extern void __attribute__((overloadable)) +00064 rsSetObject(rs_program_fragment *dst, rs_program_fragment src); +00068 extern void __attribute__((overloadable)) +00069 rsSetObject(rs_program_vertex *dst, rs_program_vertex src); +00073 extern void __attribute__((overloadable)) +00074 rsSetObject(rs_program_raster *dst, rs_program_raster src); +00078 extern void __attribute__((overloadable)) +00079 rsSetObject(rs_program_store *dst, rs_program_store src); +00083 extern void __attribute__((overloadable)) +00084 rsSetObject(rs_font *dst, rs_font src); +00085 +00091 extern void __attribute__((overloadable)) +00092 rsClearObject(rs_element *dst); +00096 extern void __attribute__((overloadable)) +00097 rsClearObject(rs_type *dst); +00101 extern void __attribute__((overloadable)) +00102 rsClearObject(rs_allocation *dst); +00106 extern void __attribute__((overloadable)) +00107 rsClearObject(rs_sampler *dst); +00111 extern void __attribute__((overloadable)) +00112 rsClearObject(rs_script *dst); +00116 extern void __attribute__((overloadable)) +00117 rsClearObject(rs_mesh *dst); +00121 extern void __attribute__((overloadable)) +00122 rsClearObject(rs_program_fragment *dst); +00126 extern void __attribute__((overloadable)) +00127 rsClearObject(rs_program_vertex *dst); +00131 extern void __attribute__((overloadable)) +00132 rsClearObject(rs_program_raster *dst); +00136 extern void __attribute__((overloadable)) +00137 rsClearObject(rs_program_store *dst); +00141 extern void __attribute__((overloadable)) +00142 rsClearObject(rs_font *dst); +00143 +00144 +00145 +00152 extern bool __attribute__((overloadable)) +00153 rsIsObject(rs_element); +00157 extern bool __attribute__((overloadable)) +00158 rsIsObject(rs_type); +00162 extern bool __attribute__((overloadable)) +00163 rsIsObject(rs_allocation); +00167 extern bool __attribute__((overloadable)) +00168 rsIsObject(rs_sampler); +00172 extern bool __attribute__((overloadable)) +00173 rsIsObject(rs_script); +00177 extern bool __attribute__((overloadable)) +00178 rsIsObject(rs_mesh); +00182 extern bool __attribute__((overloadable)) +00183 rsIsObject(rs_program_fragment); +00187 extern bool __attribute__((overloadable)) +00188 rsIsObject(rs_program_vertex); +00192 extern bool __attribute__((overloadable)) +00193 rsIsObject(rs_program_raster); +00197 extern bool __attribute__((overloadable)) +00198 rsIsObject(rs_program_store); +00202 extern bool __attribute__((overloadable)) +00203 rsIsObject(rs_font); +00204 +00205 #endif +
+Functions | |
| static void | rsQuaternionSet (rs_quaternion *q, float w, float x, float y, float z) |
| static void | rsQuaternionSet (rs_quaternion *q, const rs_quaternion *rhs) |
| static void | rsQuaternionMultiply (rs_quaternion *q, float s) |
| static void | rsQuaternionAdd (rs_quaternion *q, const rs_quaternion *rhs) |
| static void | rsQuaternionLoadRotateUnit (rs_quaternion *q, float rot, float x, float y, float z) |
| static void | rsQuaternionLoadRotate (rs_quaternion *q, float rot, float x, float y, float z) |
| static void | rsQuaternionConjugate (rs_quaternion *q) |
| static float | rsQuaternionDot (const rs_quaternion *q0, const rs_quaternion *q1) |
| static void | rsQuaternionNormalize (rs_quaternion *q) |
| static void | rsQuaternionMultiply (rs_quaternion *q, const rs_quaternion *rhs) |
| static void | rsQuaternionSlerp (rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t) |
| static void | rsQuaternionGetMatrixUnit (rs_matrix4x4 *m, const rs_quaternion *q) |
Quaternion routines.
+ +Definition in file rs_quaternion.rsh.
+| static void rsQuaternionAdd | +( | +rs_quaternion * | +q, | +
| + | + | const rs_quaternion * | +rhs | +
| + | ) | + [static] |
+
Add two quaternions
+| q | destination quaternion to add to |
| rsh | right hand side quaternion to add |
Definition at line 74 of file rs_quaternion.rsh.
+ +| static void rsQuaternionConjugate | +( | +rs_quaternion * | +q | ) | + [static] |
+
Conjugates the quaternion
+| q | quaternion to conjugate |
Definition at line 127 of file rs_quaternion.rsh.
+ +| static float rsQuaternionDot | +( | +const rs_quaternion * | +q0, | +
| + | + | const rs_quaternion * | +q1 | +
| + | ) | + [static] |
+
Dot product of two quaternions
+| q0 | first quaternion |
| q1 | second quaternion |
Definition at line 140 of file rs_quaternion.rsh.
+ +| static void rsQuaternionGetMatrixUnit | +( | +rs_matrix4x4 * | +m, | +
| + | + | const rs_quaternion * | +q | +
| + | ) | + [static] |
+
Computes rotation matrix from the normalized quaternion
+| m | resulting matrix |
| p | normalized quaternion |
Definition at line 228 of file rs_quaternion.rsh.
+ +| static void rsQuaternionLoadRotate | +( | +rs_quaternion * | +q, | +
| + | + | float | +rot, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | + [static] |
+
Loads a quaternion that represents a rotation about an arbitrary vector (doesn't have to be unit)
+| q | quaternion to set |
| rot | angle to rotate by |
| x | component of a vector |
| y | component of a vector |
| x | component of a vector |
Definition at line 111 of file rs_quaternion.rsh.
+ +| static void rsQuaternionLoadRotateUnit | +( | +rs_quaternion * | +q, | +
| + | + | float | +rot, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | + [static] |
+
Loads a quaternion that represents a rotation about an arbitrary unit vector
+| q | quaternion to set |
| rot | angle to rotate by |
| x | component of a vector |
| y | component of a vector |
| x | component of a vector |
Definition at line 90 of file rs_quaternion.rsh.
+ +| static void rsQuaternionMultiply | +( | +rs_quaternion * | +q, | +
| + | + | float | +s | +
| + | ) | + [static] |
+
Multiply quaternion by a scalar
+| q | quaternion to multiply |
| s | scalar |
Definition at line 61 of file rs_quaternion.rsh.
+ +| static void rsQuaternionMultiply | +( | +rs_quaternion * | +q, | +
| + | + | const rs_quaternion * | +rhs | +
| + | ) | + [static] |
+
Multiply quaternion by another quaternion
+| q | destination quaternion |
| rhs | right hand side quaternion to multiply by |
Definition at line 163 of file rs_quaternion.rsh.
+ +| static void rsQuaternionNormalize | +( | +rs_quaternion * | +q | ) | + [static] |
+
Normalizes the quaternion
+| q | quaternion to normalize |
Definition at line 149 of file rs_quaternion.rsh.
+ +| static void rsQuaternionSet | +( | +rs_quaternion * | +q, | +
| + | + | float | +w, | +
| + | + | float | +x, | +
| + | + | float | +y, | +
| + | + | float | +z | +
| + | ) | + [static] |
+
Set the quaternion components
+| w | component |
| x | component |
| y | component |
| z | component |
Definition at line 35 of file rs_quaternion.rsh.
+ +| static void rsQuaternionSet | +( | +rs_quaternion * | +q, | +
| + | + | const rs_quaternion * | +rhs | +
| + | ) | + [static] |
+
Set the quaternion from another quaternion
+| q | destination quaternion |
| rhs | source quaternion |
Definition at line 48 of file rs_quaternion.rsh.
+ +| static void rsQuaternionSlerp | +( | +rs_quaternion * | +q, | +
| + | + | const rs_quaternion * | +q0, | +
| + | + | const rs_quaternion * | +q1, | +
| + | + | float | +t | +
| + | ) | + [static] |
+
Performs spherical linear interpolation between two quaternions
+| q | result quaternion from interpolation |
| q0 | first param |
| q1 | second param |
| t | how much to interpolate by |
Definition at line 182 of file rs_quaternion.rsh.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00023 #ifndef __RS_QUATERNION_RSH__ +00024 #define __RS_QUATERNION_RSH__ +00025 +00026 +00034 static void __attribute__((overloadable)) +00035 rsQuaternionSet(rs_quaternion *q, float w, float x, float y, float z) { +00036 q->w = w; +00037 q->x = x; +00038 q->y = y; +00039 q->z = z; +00040 } +00041 +00047 static void __attribute__((overloadable)) +00048 rsQuaternionSet(rs_quaternion *q, const rs_quaternion *rhs) { +00049 q->w = rhs->w; +00050 q->x = rhs->x; +00051 q->y = rhs->y; +00052 q->z = rhs->z; +00053 } +00054 +00060 static void __attribute__((overloadable)) +00061 rsQuaternionMultiply(rs_quaternion *q, float s) { +00062 q->w *= s; +00063 q->x *= s; +00064 q->y *= s; +00065 q->z *= s; +00066 } +00067 +00073 static void +00074 rsQuaternionAdd(rs_quaternion *q, const rs_quaternion *rhs) { +00075 q->w *= rhs->w; +00076 q->x *= rhs->x; +00077 q->y *= rhs->y; +00078 q->z *= rhs->z; +00079 } +00080 +00089 static void +00090 rsQuaternionLoadRotateUnit(rs_quaternion *q, float rot, float x, float y, float z) { +00091 rot *= (float)(M_PI / 180.0f) * 0.5f; +00092 float c = cos(rot); +00093 float s = sin(rot); +00094 +00095 q->w = c; +00096 q->x = x * s; +00097 q->y = y * s; +00098 q->z = z * s; +00099 } +00100 +00110 static void +00111 rsQuaternionLoadRotate(rs_quaternion *q, float rot, float x, float y, float z) { +00112 const float len = x*x + y*y + z*z; +00113 if (len != 1) { +00114 const float recipLen = 1.f / sqrt(len); +00115 x *= recipLen; +00116 y *= recipLen; +00117 z *= recipLen; +00118 } +00119 rsQuaternionLoadRotateUnit(q, rot, x, y, z); +00120 } +00121 +00126 static void +00127 rsQuaternionConjugate(rs_quaternion *q) { +00128 q->x = -q->x; +00129 q->y = -q->y; +00130 q->z = -q->z; +00131 } +00132 +00139 static float +00140 rsQuaternionDot(const rs_quaternion *q0, const rs_quaternion *q1) { +00141 return q0->w*q1->w + q0->x*q1->x + q0->y*q1->y + q0->z*q1->z; +00142 } +00143 +00148 static void +00149 rsQuaternionNormalize(rs_quaternion *q) { +00150 const float len = rsQuaternionDot(q, q); +00151 if (len != 1) { +00152 const float recipLen = 1.f / sqrt(len); +00153 rsQuaternionMultiply(q, recipLen); +00154 } +00155 } +00156 +00162 static void __attribute__((overloadable)) +00163 rsQuaternionMultiply(rs_quaternion *q, const rs_quaternion *rhs) { +00164 rs_quaternion qtmp; +00165 rsQuaternionSet(&qtmp, q); +00166 +00167 q->w = qtmp.w*rhs->w - qtmp.x*rhs->x - qtmp.y*rhs->y - qtmp.z*rhs->z; +00168 q->x = qtmp.w*rhs->x + qtmp.x*rhs->w + qtmp.y*rhs->z - qtmp.z*rhs->y; +00169 q->y = qtmp.w*rhs->y + qtmp.y*rhs->w + qtmp.z*rhs->x - qtmp.x*rhs->z; +00170 q->z = qtmp.w*rhs->z + qtmp.z*rhs->w + qtmp.x*rhs->y - qtmp.y*rhs->x; +00171 rsQuaternionNormalize(q); +00172 } +00173 +00181 static void +00182 rsQuaternionSlerp(rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t) { +00183 if (t <= 0.0f) { +00184 rsQuaternionSet(q, q0); +00185 return; +00186 } +00187 if (t >= 1.0f) { +00188 rsQuaternionSet(q, q1); +00189 return; +00190 } +00191 +00192 rs_quaternion tempq0, tempq1; +00193 rsQuaternionSet(&tempq0, q0); +00194 rsQuaternionSet(&tempq1, q1); +00195 +00196 float angle = rsQuaternionDot(q0, q1); +00197 if (angle < 0) { +00198 rsQuaternionMultiply(&tempq0, -1.0f); +00199 angle *= -1.0f; +00200 } +00201 +00202 float scale, invScale; +00203 if (angle + 1.0f > 0.05f) { +00204 if (1.0f - angle >= 0.05f) { +00205 float theta = acos(angle); +00206 float invSinTheta = 1.0f / sin(theta); +00207 scale = sin(theta * (1.0f - t)) * invSinTheta; +00208 invScale = sin(theta * t) * invSinTheta; +00209 } else { +00210 scale = 1.0f - t; +00211 invScale = t; +00212 } +00213 } else { +00214 rsQuaternionSet(&tempq1, tempq0.z, -tempq0.y, tempq0.x, -tempq0.w); +00215 scale = sin(M_PI * (0.5f - t)); +00216 invScale = sin(M_PI * t); +00217 } +00218 +00219 rsQuaternionSet(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale, +00220 tempq0.y*scale + tempq1.y*invScale, tempq0.z*scale + tempq1.z*invScale); +00221 } +00222 +00228 static void rsQuaternionGetMatrixUnit(rs_matrix4x4 *m, const rs_quaternion *q) { +00229 float xx = q->x * q->x; +00230 float xy = q->x * q->y; +00231 float xz = q->x * q->z; +00232 float xw = q->x * q->w; +00233 float yy = q->y * q->y; +00234 float yz = q->y * q->z; +00235 float yw = q->y * q->w; +00236 float zz = q->z * q->z; +00237 float zw = q->z * q->w; +00238 +00239 m->m[0] = 1.0f - 2.0f * ( yy + zz ); +00240 m->m[4] = 2.0f * ( xy - zw ); +00241 m->m[8] = 2.0f * ( xz + yw ); +00242 m->m[1] = 2.0f * ( xy + zw ); +00243 m->m[5] = 1.0f - 2.0f * ( xx + zz ); +00244 m->m[9] = 2.0f * ( yz - xw ); +00245 m->m[2] = 2.0f * ( xz - yw ); +00246 m->m[6] = 2.0f * ( yz + xw ); +00247 m->m[10] = 1.0f - 2.0f * ( xx + yy ); +00248 m->m[3] = m->m[7] = m->m[11] = m->m[12] = m->m[13] = m->m[14] = 0.0f; +00249 m->m[15] = 1.0f; +00250 } +00251 +00252 #endif +00253 +
+Data Structures | |
| struct | rs_tm |
+Typedefs | |
| typedef int | rs_time_t |
+Functions | |
| rs_time_t | rsTime (rs_time_t *timer) |
| rs_tm * | rsLocaltime (rs_tm *local, const rs_time_t *timer) |
| int64_t | rsUptimeMillis (void) |
| int64_t | rsUptimeNanos (void) |
| float | rsGetDt (void) |
Renderscript time routines.
+This file contains Renderscript functions relating to time and date manipulation.
+ +Definition in file rs_time.rsh.
+| typedef int rs_time_t | +
Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)).
+ +Definition at line 31 of file rs_time.rsh.
+ +| float rsGetDt | +( | +void | +) | ++ |
Returns the time in seconds since this function was last called in this script.
+| rs_tm* rsLocaltime | +( | +rs_tm * | +local, | +
| + | + | const rs_time_t * | +timer | +
| + | ) | ++ |
Converts the time specified by timer into broken-down time and stores it in local. This function also returns a pointer to local. If local is NULL, this function does nothing and returns NULL.
| local | Broken-down time. |
| timer | Input time as calendar time. |
local). Returns the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970). If timer is non-NULL, the result is also stored in the memory pointed to by this variable. If an error occurs, a value of -1 is returned.
| timer | Location to also store the returned calendar time. |
| int64_t rsUptimeMillis | +( | +void | +) | ++ |
Returns the current system clock (uptime) in milliseconds.
+| int64_t rsUptimeNanos | +( | +void | +) | ++ |
Returns the current system clock (uptime) in nanoseconds.
+00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00024 #ifndef __RS_TIME_RSH__ +00025 #define __RS_TIME_RSH__ +00026 +00031 typedef int rs_time_t; +00032 +00049 typedef struct { +00050 int tm_sec; +00051 int tm_min; +00052 int tm_hour; +00053 int tm_mday; +00054 int tm_mon; +00055 int tm_year; +00056 int tm_wday; +00057 int tm_yday; +00058 int tm_isdst; +00059 } rs_tm; +00060 +00070 extern rs_time_t __attribute__((overloadable)) +00071 rsTime(rs_time_t *timer); +00072 +00083 extern rs_tm * __attribute__((overloadable)) +00084 rsLocaltime(rs_tm *local, const rs_time_t *timer); +00085 +00091 extern int64_t __attribute__((overloadable)) +00092 rsUptimeMillis(void); +00093 +00099 extern int64_t __attribute__((overloadable)) +00100 rsUptimeNanos(void); +00101 +00108 extern float __attribute__((overloadable)) +00109 rsGetDt(void); +00110 +00111 #endif +
#include "stdbool.h"+Data Structures | |
| struct | rs_element |
| Opaque handle to a Renderscript element. More... | |
| struct | rs_type |
| Opaque handle to a Renderscript type. More... | |
| struct | rs_allocation |
| Opaque handle to a Renderscript allocation. More... | |
| struct | rs_sampler |
| Opaque handle to a Renderscript sampler object. More... | |
| struct | rs_script |
| Opaque handle to a Renderscript script object. More... | |
| struct | rs_mesh |
| Opaque handle to a Renderscript mesh object. More... | |
| struct | rs_program_fragment |
| Opaque handle to a Renderscript ProgramFragment object. More... | |
| struct | rs_program_vertex |
| Opaque handle to a Renderscript ProgramVertex object. More... | |
| struct | rs_program_raster |
| Opaque handle to a Renderscript ProgramRaster object. More... | |
| struct | rs_program_store |
| Opaque handle to a Renderscript ProgramStore object. More... | |
| struct | rs_font |
| Opaque handle to a Renderscript font object. More... | |
| struct | rs_matrix4x4 |
| 4x4 float matrix More... | |
| struct | rs_matrix3x3 |
| 3x3 float matrix More... | |
| struct | rs_matrix2x2 |
| 2x2 float matrix More... | |
+Typedefs | |
| typedef char | int8_t |
| typedef short | int16_t |
| typedef int | int32_t |
| typedef long long | int64_t |
| typedef unsigned char | uint8_t |
| typedef unsigned short | uint16_t |
| typedef unsigned int | uint32_t |
| typedef unsigned long long | uint64_t |
| typedef uint8_t | uchar |
| typedef uint16_t | ushort |
| typedef uint32_t | uint |
| typedef uint64_t | ulong |
| typedef uint32_t | size_t |
| typedef int32_t | ssize_t |
| typedef float | float2 |
| typedef float | float3 |
| typedef float | float4 |
| typedef double | double2 |
| typedef double | double3 |
| typedef double | double4 |
| typedef uchar | uchar2 |
| typedef uchar | uchar3 |
| typedef uchar | uchar4 |
| typedef ushort | ushort2 |
| typedef ushort | ushort3 |
| typedef ushort | ushort4 |
| typedef uint | uint2 |
| typedef uint | uint3 |
| typedef uint | uint4 |
| typedef ulong | ulong2 |
| typedef ulong | ulong3 |
| typedef ulong | ulong4 |
| typedef char | char2 |
| typedef char | char3 |
| typedef char | char4 |
| typedef short | short2 |
| typedef short | short3 |
| typedef short | short4 |
| typedef int | int2 |
| typedef int | int3 |
| typedef int | int4 |
| typedef long | long2 |
| typedef long | long3 |
| typedef long | long4 |
| typedef float4 | rs_quaternion |
Define the standard Renderscript types
+Integers 8 bit: char, int8_t 16 bit: short, int16_t 32 bit: int, in32_t 64 bit: long, long long, int64_t
+Unsigned Integers 8 bit: uchar, uint8_t 16 bit: ushort, uint16_t 32 bit: uint, uint32_t 64 bit: ulong, uint64_t
+Floating point 32 bit: float 64 bit: double
+Vectors of length 2, 3, and 4 are supported for all the types above.
+ +Definition in file rs_types.rsh.
+| typedef char char2 | +
Vector version of the basic char type. Provides two char fields packed into a single 16 bit field with 16 bit alignment.
+ +Definition at line 273 of file rs_types.rsh.
+ +| typedef char char3 | +
Vector version of the basic char type. Provides three char fields packed into a single 32 bit field with 32 bit alignment.
+ +Definition at line 278 of file rs_types.rsh.
+ +| typedef char char4 | +
Vector version of the basic char type. Provides four char fields packed into a single 32 bit field with 32 bit alignment.
+ +Definition at line 283 of file rs_types.rsh.
+ +| typedef double double2 | +
Vector version of the basic double type. Provides two double fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 193 of file rs_types.rsh.
+ +| typedef double double3 | +
Vector version of the basic double type. Provides three double fields packed into a single 256 bit field with 256 bit alignment.
+ +Definition at line 198 of file rs_types.rsh.
+ +| typedef double double4 | +
Vector version of the basic double type. Provides four double fields packed into a single 256 bit field with 256 bit alignment.
+ +Definition at line 203 of file rs_types.rsh.
+ +| typedef float float2 | +
Vector version of the basic float type. Provides two float fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 176 of file rs_types.rsh.
+ +| typedef float float3 | +
Vector version of the basic float type. Provides three float fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 181 of file rs_types.rsh.
+ +| typedef float float4 | +
Vector version of the basic float type. Provides four float fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 187 of file rs_types.rsh.
+ +| typedef short int16_t | +
16 bit integer type
+ +Definition at line 54 of file rs_types.rsh.
+ +| typedef int int2 | +
Vector version of the basic int type. Provides two int fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 305 of file rs_types.rsh.
+ +| typedef int int3 | +
Vector version of the basic int type. Provides three int fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 310 of file rs_types.rsh.
+ +| typedef int int32_t | +
32 bit integer type
+ +Definition at line 58 of file rs_types.rsh.
+ +| typedef int int4 | +
Vector version of the basic int type. Provides two four fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 315 of file rs_types.rsh.
+ +| typedef long long int64_t | +
64 bit integer type
+ +Definition at line 62 of file rs_types.rsh.
+ +| typedef char int8_t | +
8 bit integer type
+ +Definition at line 50 of file rs_types.rsh.
+ +| typedef long long2 | +
Vector version of the basic long type. Provides two long fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 321 of file rs_types.rsh.
+ +| typedef long long3 | +
Vector version of the basic long type. Provides three long fields packed into a single 256 bit field with 256 bit alignment.
+ +Definition at line 326 of file rs_types.rsh.
+ +| typedef long long4 | +
Vector version of the basic long type. Provides four long fields packed into a single 256 bit field with 256 bit alignment.
+ +Definition at line 331 of file rs_types.rsh.
+ +| typedef float4 rs_quaternion | +
quaternion type for use with the quaternion functions
+ +Definition at line 364 of file rs_types.rsh.
+ +| typedef short short2 | +
Vector version of the basic short type. Provides two short fields packed into a single 32 bit field with 32 bit alignment.
+ +Definition at line 289 of file rs_types.rsh.
+ +| typedef short short3 | +
Vector version of the basic short type. Provides three short fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 294 of file rs_types.rsh.
+ +| typedef short short4 | +
Vector version of the basic short type. Provides four short fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 299 of file rs_types.rsh.
+ +Typedef for unsigned int
+ +Definition at line 98 of file rs_types.rsh.
+ +Typedef for int (use for 32-bit integers)
+ +Definition at line 102 of file rs_types.rsh.
+ +8 bit unsigned integer type
+ +Definition at line 82 of file rs_types.rsh.
+ +Vector version of the basic uchar type. Provides two uchar fields packed into a single 16 bit field with 16 bit alignment.
+ +Definition at line 209 of file rs_types.rsh.
+ +Vector version of the basic uchar type. Provides three uchar fields packed into a single 32 bit field with 32 bit alignment.
+ +Definition at line 214 of file rs_types.rsh.
+ +Vector version of the basic uchar type. Provides four uchar fields packed into a single 32 bit field with 32 bit alignment.
+ +Definition at line 219 of file rs_types.rsh.
+ +32 bit unsigned integer type
+ +Definition at line 90 of file rs_types.rsh.
+ +| typedef unsigned short uint16_t | +
16 bit unsigned integer type
+ +Definition at line 70 of file rs_types.rsh.
+ +Vector version of the basic uint type. Provides two uint fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 241 of file rs_types.rsh.
+ +Vector version of the basic uint type. Provides three uint fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 246 of file rs_types.rsh.
+ +| typedef unsigned int uint32_t | +
32 bit unsigned integer type
+ +Definition at line 74 of file rs_types.rsh.
+ +Vector version of the basic uint type. Provides four uint fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 251 of file rs_types.rsh.
+ +| typedef unsigned long long uint64_t | +
64 bit unsigned integer type
+ +Definition at line 78 of file rs_types.rsh.
+ +| typedef unsigned char uint8_t | +
8 bit unsigned integer type
+ +Definition at line 66 of file rs_types.rsh.
+ +Typedef for unsigned long (use for 64-bit unsigned integers)
+ +Definition at line 94 of file rs_types.rsh.
+ +Vector version of the basic ulong type. Provides two ulong fields packed into a single 128 bit field with 128 bit alignment.
+ +Definition at line 257 of file rs_types.rsh.
+ +Vector version of the basic ulong type. Provides three ulong fields packed into a single 256 bit field with 256 bit alignment.
+ +Definition at line 262 of file rs_types.rsh.
+ +Vector version of the basic ulong type. Provides four ulong fields packed into a single 256 bit field with 256 bit alignment.
+ +Definition at line 267 of file rs_types.rsh.
+ +16 bit unsigned integer type
+ +Definition at line 86 of file rs_types.rsh.
+ +Vector version of the basic ushort type. Provides two ushort fields packed into a single 32 bit field with 32 bit alignment.
+ +Definition at line 225 of file rs_types.rsh.
+ +Vector version of the basic ushort type. Provides three ushort fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 230 of file rs_types.rsh.
+ +Vector version of the basic ushort type. Provides four ushort fields packed into a single 64 bit field with 64 bit alignment.
+ +Definition at line 235 of file rs_types.rsh.
+ +00001 /* +00002 * Copyright (C) 2011 The Android Open Source Project +00003 * +00004 * Licensed under the Apache License, Version 2.0 (the "License"); +00005 * you may not use this file except in compliance with the License. +00006 * You may obtain a copy of the License at +00007 * +00008 * http://www.apache.org/licenses/LICENSE-2.0 +00009 * +00010 * Unless required by applicable law or agreed to in writing, software +00011 * distributed under the License is distributed on an "AS IS" BASIS, +00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +00013 * See the License for the specific language governing permissions and +00014 * limitations under the License. +00015 */ +00016 +00041 #ifndef __RS_TYPES_RSH__ +00042 #define __RS_TYPES_RSH__ +00043 +00044 #define M_PI 3.14159265358979323846264338327950288f /* pi */ +00045 +00046 #include "stdbool.h" +00050 typedef char int8_t; +00054 typedef short int16_t; +00058 typedef int int32_t; +00062 typedef long long int64_t; +00066 typedef unsigned char uint8_t; +00070 typedef unsigned short uint16_t; +00074 typedef unsigned int uint32_t; +00078 typedef unsigned long long uint64_t; +00082 typedef uint8_t uchar; +00086 typedef uint16_t ushort; +00090 typedef uint32_t uint; +00094 typedef uint64_t ulong; +00098 typedef uint32_t size_t; +00102 typedef int32_t ssize_t; +00103 +00109 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_element; +00115 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_type; +00121 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_allocation; +00127 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_sampler; +00133 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_script; +00139 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_mesh; +00145 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_fragment; +00151 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_vertex; +00157 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_raster; +00163 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_store; +00169 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_font; +00170 +00176 typedef float float2 __attribute__((ext_vector_type(2))); +00181 typedef float float3 __attribute__((ext_vector_type(3))); +00187 typedef float float4 __attribute__((ext_vector_type(4))); +00188 +00193 typedef double double2 __attribute__((ext_vector_type(2))); +00198 typedef double double3 __attribute__((ext_vector_type(3))); +00203 typedef double double4 __attribute__((ext_vector_type(4))); +00204 +00209 typedef uchar uchar2 __attribute__((ext_vector_type(2))); +00214 typedef uchar uchar3 __attribute__((ext_vector_type(3))); +00219 typedef uchar uchar4 __attribute__((ext_vector_type(4))); +00220 +00225 typedef ushort ushort2 __attribute__((ext_vector_type(2))); +00230 typedef ushort ushort3 __attribute__((ext_vector_type(3))); +00235 typedef ushort ushort4 __attribute__((ext_vector_type(4))); +00236 +00241 typedef uint uint2 __attribute__((ext_vector_type(2))); +00246 typedef uint uint3 __attribute__((ext_vector_type(3))); +00251 typedef uint uint4 __attribute__((ext_vector_type(4))); +00252 +00257 typedef ulong ulong2 __attribute__((ext_vector_type(2))); +00262 typedef ulong ulong3 __attribute__((ext_vector_type(3))); +00267 typedef ulong ulong4 __attribute__((ext_vector_type(4))); +00268 +00273 typedef char char2 __attribute__((ext_vector_type(2))); +00278 typedef char char3 __attribute__((ext_vector_type(3))); +00283 typedef char char4 __attribute__((ext_vector_type(4))); +00284 +00289 typedef short short2 __attribute__((ext_vector_type(2))); +00294 typedef short short3 __attribute__((ext_vector_type(3))); +00299 typedef short short4 __attribute__((ext_vector_type(4))); +00300 +00305 typedef int int2 __attribute__((ext_vector_type(2))); +00310 typedef int int3 __attribute__((ext_vector_type(3))); +00315 typedef int int4 __attribute__((ext_vector_type(4))); +00316 +00321 typedef long long2 __attribute__((ext_vector_type(2))); +00326 typedef long long3 __attribute__((ext_vector_type(3))); +00331 typedef long long4 __attribute__((ext_vector_type(4))); +00332 +00339 typedef struct { +00340 float m[16]; +00341 } rs_matrix4x4; +00348 typedef struct { +00349 float m[9]; +00350 } rs_matrix3x3; +00357 typedef struct { +00358 float m[4]; +00359 } rs_matrix2x2; +00360 +00364 typedef float4 rs_quaternion; +00365 +00366 #define RS_PACKED __attribute__((packed, aligned(4))) +00367 #define NULL ((const void *)0) +00368 +00369 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) +00370 +00374 typedef enum { +00375 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0, +00376 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1, +00377 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2, +00378 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3, +00379 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4, +00380 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5 +00381 } rs_allocation_cubemap_face; +00382 +00389 typedef enum { +00390 RS_ALLOCATION_USAGE_SCRIPT = 0x0001, +00391 RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, +00392 RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, +00393 RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, +00394 RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010 +00395 } rs_allocation_usage_type; +00396 +00397 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) +00398 +00399 #endif +
Opaque handle to a Renderscript allocation. + More...
+Opaque handle to a Renderscript allocation.
+See: android.renderscript.Allocation
+ +Definition at line 121 of file rs_types.rsh.
+Opaque handle to a Renderscript element. + More...
+Opaque handle to a Renderscript element.
+See: android.renderscript.Element
+ +Definition at line 109 of file rs_types.rsh.
+Opaque handle to a Renderscript font object. + More...
+Opaque handle to a Renderscript font object.
+See: android.renderscript.Font
+ +Definition at line 169 of file rs_types.rsh.
+2x2 float matrix + More...
+2x2 float matrix
+Native holder for RS matrix. Elements are stored in the array at the location [row*2 + col]
+ +Definition at line 357 of file rs_types.rsh.
+3x3 float matrix + More...
+3x3 float matrix
+Native holder for RS matrix. Elements are stored in the array at the location [row*3 + col]
+ +Definition at line 348 of file rs_types.rsh.
+4x4 float matrix + More...
+4x4 float matrix
+Native holder for RS matrix. Elements are stored in the array at the location [row*4 + col]
+ +Definition at line 339 of file rs_types.rsh.
+Opaque handle to a Renderscript mesh object. + More...
+Opaque handle to a Renderscript mesh object.
+See: android.renderscript.Mesh
+ +Definition at line 139 of file rs_types.rsh.
+Opaque handle to a Renderscript ProgramFragment object. + More...
+Opaque handle to a Renderscript ProgramFragment object.
+See: android.renderscript.ProgramFragment
+ +Definition at line 145 of file rs_types.rsh.
+Opaque handle to a Renderscript ProgramRaster object. + More...
+Opaque handle to a Renderscript ProgramRaster object.
+See: android.renderscript.ProgramRaster
+ +Definition at line 157 of file rs_types.rsh.
+Opaque handle to a Renderscript ProgramStore object. + More...
+Opaque handle to a Renderscript ProgramStore object.
+See: android.renderscript.ProgramStore
+ +Definition at line 163 of file rs_types.rsh.
+Opaque handle to a Renderscript ProgramVertex object. + More...
+Opaque handle to a Renderscript ProgramVertex object.
+See: android.renderscript.ProgramVertex
+ +Definition at line 151 of file rs_types.rsh.
+Opaque handle to a Renderscript sampler object. + More...
+Opaque handle to a Renderscript sampler object.
+See: android.renderscript.Sampler
+ +Definition at line 127 of file rs_types.rsh.
+Opaque handle to a Renderscript script object. + More...
+Opaque handle to a Renderscript script object.
+See: android.renderscript.ScriptC
+ +Definition at line 133 of file rs_types.rsh.
+Structure to provide extra information to a rsForEach call. Primarly used to restrict the call to a subset of cells in the allocation.
+ +Definition at line 88 of file rs_core.rsh.
++Data Fields | |
| +int | tm_sec |
| seconds | |
| +int | tm_min |
| minutes | |
| +int | tm_hour |
| hours | |
| +int | tm_mday |
| day of the month | |
| +int | tm_mon |
| month | |
| +int | tm_year |
| year | |
| +int | tm_wday |
| day of the week | |
| +int | tm_yday |
| day of the year | |
| +int | tm_isdst |
| daylight savings time | |
Data structure for broken-down time components.
+tm_sec - Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds. tm_min - Minutes after the hour. This ranges from 0 to 59. tm_hour - Hours past midnight. This ranges from 0 to 23. tm_mday - Day of the month. This ranges from 1 to 31. tm_mon - Months since January. This ranges from 0 to 11. tm_year - Years since 1900. tm_wday - Days since Sunday. This ranges from 0 to 6. tm_yday - Days since January 1. This ranges from 0 to 365. tm_isdst - Flag to indicate whether daylight saving time is in effect. The value is positive if it is in effect, zero if it is not, and negative if the information is not available.
+ +Definition at line 49 of file rs_time.rsh.
+Opaque handle to a Renderscript type. + More...
+Opaque handle to a Renderscript type.
+See: android.renderscript.Type
+ +Definition at line 115 of file rs_types.rsh.
+