init commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_atomic.rsh: Atomic Update Functions
|
||||
*
|
||||
* To update values shared between multiple threads, use the functions below.
|
||||
* They ensure that the values are atomically updated, i.e. that the memory
|
||||
* reads, the updates, and the memory writes are done in the right order.
|
||||
*
|
||||
* These functions are slower than their non-atomic equivalents, so use
|
||||
* them only when synchronization is needed.
|
||||
*
|
||||
* Note that in RenderScript, your code is likely to be running in separate
|
||||
* threads even though you did not explicitely create them. The RenderScript
|
||||
* runtime will very often split the execution of one kernel across multiple
|
||||
* threads. Updating globals should be done with atomic functions. If possible,
|
||||
* modify your algorithm to avoid them altogether.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_ATOMIC_RSH
|
||||
#define RENDERSCRIPT_RS_ATOMIC_RSH
|
||||
|
||||
/*
|
||||
* rsAtomicAdd: Thread-safe addition
|
||||
*
|
||||
* Atomicly adds a value to the value at addr, i.e. *addr += value.
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Amount to add.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicAdd(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicAdd(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicAnd: Thread-safe bitwise and
|
||||
*
|
||||
* Atomicly performs a bitwise and of two values, storing the result back at addr,
|
||||
* i.e. *addr &= value.
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Value to and with.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicAnd(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicAnd(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicCas: Thread-safe compare and set
|
||||
*
|
||||
* If the value at addr matches compareValue then the newValue is written at addr,
|
||||
* i.e. if (*addr == compareValue) { *addr = newValue; }.
|
||||
*
|
||||
* You can check that the value was written by checking that the value returned
|
||||
* by rsAtomicCas() is compareValue.
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to compare and replace if the test passes.
|
||||
* compareValue: Value to test *addr against.
|
||||
* newValue: Value to write if the test passes.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicCas(volatile int32_t* addr, int32_t compareValue, int32_t newValue);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAtomicCas(volatile uint32_t* addr, uint32_t compareValue, uint32_t newValue);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicDec: Thread-safe decrement
|
||||
*
|
||||
* Atomicly subtracts one from the value at addr. This is equivalent to rsAtomicSub(addr, 1).
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to decrement.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicDec(volatile int32_t* addr);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicDec(volatile uint32_t* addr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicInc: Thread-safe increment
|
||||
*
|
||||
* Atomicly adds one to the value at addr. This is equivalent to rsAtomicAdd(addr, 1).
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to increment.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicInc(volatile int32_t* addr);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicInc(volatile uint32_t* addr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicMax: Thread-safe maximum
|
||||
*
|
||||
* Atomicly sets the value at addr to the maximum of *addr and value, i.e.
|
||||
* *addr = max(*addr, value).
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Comparison value.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAtomicMax(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicMax(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicMin: Thread-safe minimum
|
||||
*
|
||||
* Atomicly sets the value at addr to the minimum of *addr and value, i.e.
|
||||
* *addr = min(*addr, value).
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Comparison value.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAtomicMin(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicMin(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicOr: Thread-safe bitwise or
|
||||
*
|
||||
* Atomicly perform a bitwise or two values, storing the result at addr,
|
||||
* i.e. *addr |= value.
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Value to or with.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicOr(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicOr(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicSub: Thread-safe subtraction
|
||||
*
|
||||
* Atomicly subtracts a value from the value at addr, i.e. *addr -= value.
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Amount to subtract.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicSub(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicSub(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAtomicXor: Thread-safe bitwise exclusive or
|
||||
*
|
||||
* Atomicly performs a bitwise xor of two values, storing the result at addr,
|
||||
* i.e. *addr ^= value.
|
||||
*
|
||||
* Parameters:
|
||||
* addr: Address of the value to modify.
|
||||
* value: Value to xor with.
|
||||
*
|
||||
* Returns: Value of *addr prior to the operation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicXor(volatile int32_t* addr, int32_t value);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 20))
|
||||
extern int32_t __attribute__((overloadable))
|
||||
rsAtomicXor(volatile uint32_t* addr, uint32_t value);
|
||||
#endif
|
||||
|
||||
#endif // RENDERSCRIPT_RS_ATOMIC_RSH
|
||||
1623
apk_3234/build-tools/android-13/renderscript/include/rs_convert.rsh
Normal file
1623
apk_3234/build-tools/android-13/renderscript/include/rs_convert.rsh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_core.rsh: Overview
|
||||
*
|
||||
* RenderScript is a high-performance runtime that provides 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 compute header files are automatically
|
||||
* included for you.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_CORE_RSH
|
||||
#define RENDERSCRIPT_RS_CORE_RSH
|
||||
|
||||
#define RS_KERNEL __attribute__((kernel))
|
||||
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "rs_value_types.rsh"
|
||||
#include "rs_object_types.rsh"
|
||||
|
||||
#include "rs_allocation_create.rsh"
|
||||
#include "rs_allocation_data.rsh"
|
||||
#include "rs_atomic.rsh"
|
||||
#include "rs_convert.rsh"
|
||||
#include "rs_debug.rsh"
|
||||
#include "rs_for_each.rsh"
|
||||
#include "rs_io.rsh"
|
||||
#include "rs_math.rsh"
|
||||
#include "rs_matrix.rsh"
|
||||
#include "rs_object_info.rsh"
|
||||
#include "rs_quaternion.rsh"
|
||||
#include "rs_time.rsh"
|
||||
#include "rs_vector_math.rsh"
|
||||
|
||||
#endif // RENDERSCRIPT_RS_CORE_RSH
|
||||
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_debug.rsh: Debugging Functions
|
||||
*
|
||||
* The functions below are intended to be used during application developement.
|
||||
* They should not be used in shipping applications.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_DEBUG_RSH
|
||||
#define RENDERSCRIPT_RS_DEBUG_RSH
|
||||
|
||||
#define RS_DEBUG(a) rsDebug(#a, a)
|
||||
#define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__)
|
||||
|
||||
/*
|
||||
* rsDebug: Log a message and values
|
||||
*
|
||||
* This function prints a message to the standard log, followed by the provided values.
|
||||
*
|
||||
* This function is intended for debugging only and should not be used in shipping
|
||||
* applications.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, double a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, int a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uint a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, long a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ulong a);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, int2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, int3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, int4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uint2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uint3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uint4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, long2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, long3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, long4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ulong2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ulong3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ulong4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, double2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, double3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, double4 a);
|
||||
#endif
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float2 a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float3 a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float4 a);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, half a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, half2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, half3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, half4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, char a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, char2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, char3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, char4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uchar a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uchar2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uchar3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, uchar4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, short a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, short2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, short3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, short4 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ushort a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ushort2 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ushort3 a);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, ushort4 a);
|
||||
#endif
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float a, float b);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float a, float b, float c);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, float a, float b, float c, float d);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, long long a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, unsigned long long a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, const void* a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, const rs_matrix4x4* a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, const rs_matrix3x3* a);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsDebug(const char* message, const rs_matrix2x2* a);
|
||||
|
||||
#endif // RENDERSCRIPT_RS_DEBUG_RSH
|
||||
@@ -0,0 +1,434 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_for_each.rsh: Kernel Invocation Functions and Types
|
||||
*
|
||||
* The rsForEach() function can be used to invoke the root kernel of a script.
|
||||
*
|
||||
* The other functions are used to get the characteristics of the invocation of
|
||||
* an executing kernel, like dimensions and current indices. These functions take
|
||||
* a rs_kernel_context as argument.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_FOR_EACH_RSH
|
||||
#define RENDERSCRIPT_RS_FOR_EACH_RSH
|
||||
|
||||
/*
|
||||
* rs_for_each_strategy_t: Suggested cell processing order
|
||||
*
|
||||
* This type is used to suggest how the invoked kernel should iterate over the cells of the
|
||||
* allocations. This is a hint only. Implementations may not follow the suggestion.
|
||||
*
|
||||
* This specification can help the caching behavior of the running kernel, e.g. the cache
|
||||
* locality when the processing is distributed over multiple cores.
|
||||
*/
|
||||
typedef enum rs_for_each_strategy {
|
||||
RS_FOR_EACH_STRATEGY_SERIAL = 0, // Prefer contiguous memory regions.
|
||||
RS_FOR_EACH_STRATEGY_DONT_CARE = 1, // No preferences.
|
||||
RS_FOR_EACH_STRATEGY_DST_LINEAR = 2, // Prefer DST.
|
||||
RS_FOR_EACH_STRATEGY_TILE_SMALL = 3, // Prefer processing small rectangular regions.
|
||||
RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4, // Prefer processing medium rectangular regions.
|
||||
RS_FOR_EACH_STRATEGY_TILE_LARGE = 5 // Prefer processing large rectangular regions.
|
||||
} rs_for_each_strategy_t;
|
||||
|
||||
/*
|
||||
* rs_kernel_context: Handle to a kernel invocation context
|
||||
*
|
||||
* The kernel context contains common characteristics of the allocations being iterated
|
||||
* over, like dimensions. It also contains rarely used indices of the currently processed
|
||||
* cell, like the Array0 index or the current level of detail.
|
||||
*
|
||||
* You can access the kernel context by adding a special parameter named "context" of type
|
||||
* rs_kernel_context to your kernel function. See rsGetDimX() and rsGetArray0() for examples.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
typedef const struct rs_kernel_context_t * rs_kernel_context;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_script_call_t: Cell iteration information
|
||||
*
|
||||
* This structure is used to provide iteration information to a rsForEach call.
|
||||
* It is currently used to restrict processing to a subset of cells. In future
|
||||
* versions, it will also be used to provide hint on how to best iterate over
|
||||
* the cells.
|
||||
*
|
||||
* The Start fields are inclusive and the End fields are exclusive. E.g. to iterate
|
||||
* over cells 4, 5, 6, and 7 in the X dimension, set xStart to 4 and xEnd to 8.
|
||||
*/
|
||||
typedef struct rs_script_call {
|
||||
rs_for_each_strategy_t strategy; // Currently ignored. In the future, will be suggested cell iteration strategy.
|
||||
uint32_t xStart; // Starting index in the X dimension.
|
||||
uint32_t xEnd; // Ending index (exclusive) in the X dimension.
|
||||
uint32_t yStart; // Starting index in the Y dimension.
|
||||
uint32_t yEnd; // Ending index (exclusive) in the Y dimension.
|
||||
uint32_t zStart; // Starting index in the Z dimension.
|
||||
uint32_t zEnd; // Ending index (exclusive) in the Z dimension.
|
||||
uint32_t arrayStart; // Starting index in the Array0 dimension.
|
||||
uint32_t arrayEnd; // Ending index (exclusive) in the Array0 dimension.
|
||||
uint32_t array1Start; // Starting index in the Array1 dimension.
|
||||
uint32_t array1End; // Ending index (exclusive) in the Array1 dimension.
|
||||
uint32_t array2Start; // Starting index in the Array2 dimension.
|
||||
uint32_t array2End; // Ending index (exclusive) in the Array2 dimension.
|
||||
uint32_t array3Start; // Starting index in the Array3 dimension.
|
||||
uint32_t array3End; // Ending index (exclusive) in the Array3 dimension.
|
||||
} rs_script_call_t;
|
||||
|
||||
/*
|
||||
* rs_kernel: Handle to a kernel function
|
||||
*
|
||||
* An opaque type for a function that is defined with the kernel attribute. A value
|
||||
* of this type can be used in a rsForEach call to launch a kernel.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
typedef void* rs_kernel;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsForEach: Launches a kernel
|
||||
*
|
||||
* Runs the kernel over zero or more input allocations. They are passed after the
|
||||
* rs_kernel argument. If the specified kernel returns a value, an output allocation
|
||||
* must be specified as the last argument. All input allocations,
|
||||
* and the output allocation if it exists, must have the same dimensions.
|
||||
*
|
||||
* This is a synchronous function. A call to this function only returns after all
|
||||
* the work has completed for all cells of the input allocations. If the kernel
|
||||
* function returns any value, the call waits until all results have been written
|
||||
* to the output allocation.
|
||||
*
|
||||
* Up to API level 23, the kernel is implicitly specified as the kernel named
|
||||
* "root" in the specified script, and only a single input allocation can be used.
|
||||
* Starting in API level 24, an arbitrary kernel function can be used,
|
||||
* as specified by the kernel argument. The script argument is removed.
|
||||
* The kernel must be defined in the current script. In addition, more than one
|
||||
* input can be used.
|
||||
*
|
||||
* E.g.
|
||||
* float __attribute__((kernel)) square(float a) {
|
||||
* return a * a;
|
||||
* }
|
||||
*
|
||||
* void compute(rs_allocation ain, rs_allocation aout) {
|
||||
* rsForEach(square, ain, aout);
|
||||
* }
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* script: Script to call.
|
||||
* input: Allocation to source data from.
|
||||
* output: Allocation to write date into.
|
||||
* usrData: User defined data to pass to the script. May be NULL.
|
||||
* sc: Extra control information used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL.
|
||||
* usrDataLen: Size of the userData structure. This will be used to perform a shallow copy of the data if necessary.
|
||||
* kernel: Function designator to a function that is defined with the kernel attribute.
|
||||
* ...: Input and output allocations
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern void __attribute__((overloadable))
|
||||
rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
|
||||
const rs_script_call_t* sc);
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern void __attribute__((overloadable))
|
||||
rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
|
||||
extern void __attribute__((overloadable))
|
||||
rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
|
||||
size_t usrDataLen, const rs_script_call_t* sc);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 20))
|
||||
extern void __attribute__((overloadable))
|
||||
rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData,
|
||||
size_t usrDataLen);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (RS_VERSION <= 23))
|
||||
extern void __attribute__((overloadable))
|
||||
rsForEach(rs_script script, rs_allocation input, rs_allocation output);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void
|
||||
rsForEach(rs_kernel kernel, ...);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsForEachWithOptions: Launches a kernel with options
|
||||
*
|
||||
* Launches kernel in a way similar to rsForEach. However, instead of processing
|
||||
* all cells in the input, this function only processes cells in the subspace of
|
||||
* the index space specified in options. With the index space explicitly specified
|
||||
* by options, no input or output allocation is required for a kernel launch using
|
||||
* this API. If allocations are passed in, they must match the number of arguments
|
||||
* and return value expected by the kernel function. The output allocation is
|
||||
* present if and only if the kernel has a non-void return value.
|
||||
*
|
||||
* E.g.,
|
||||
* rs_script_call_t opts = {0};
|
||||
* opts.xStart = 0;
|
||||
* opts.xEnd = dimX;
|
||||
* opts.yStart = 0;
|
||||
* opts.yEnd = dimY / 2;
|
||||
* rsForEachWithOptions(foo, &opts, out, out);
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* kernel: Function designator to a function that is defined with the kernel attribute.
|
||||
* options: Launch options
|
||||
* ...: Input and output allocations
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void
|
||||
rsForEachWithOptions(rs_kernel kernel, rs_script_call_t* options, ...);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetArray0: Index in the Array0 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the index in the Array0 dimension of the cell being processed, as specified
|
||||
* by the supplied kernel context.
|
||||
*
|
||||
* The kernel context contains common characteristics of the allocations being iterated
|
||||
* over and rarely used indices, like the Array0 index.
|
||||
*
|
||||
* You can access the kernel context by adding a special parameter named "context" of
|
||||
* type rs_kernel_context to your kernel function. E.g.
|
||||
* short RS_KERNEL myKernel(short value, uint32_t x, rs_kernel_context context) {
|
||||
* // The current index in the common x, y, z dimensions are accessed by
|
||||
* // adding these variables as arguments. For the more rarely used indices
|
||||
* // to the other dimensions, extract them from the kernel context:
|
||||
* uint32_t index_a0 = rsGetArray0(context);
|
||||
* //...
|
||||
* }
|
||||
*
|
||||
* This function returns 0 if the Array0 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetArray0(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetArray1: Index in the Array1 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the index in the Array1 dimension of the cell being processed, as specified
|
||||
* by the supplied kernel context. See rsGetArray0() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Array1 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetArray1(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetArray2: Index in the Array2 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the index in the Array2 dimension of the cell being processed,
|
||||
* as specified by the supplied kernel context. See rsGetArray0() for an explanation
|
||||
* of the context.
|
||||
*
|
||||
* Returns 0 if the Array2 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetArray2(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetArray3: Index in the Array3 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the index in the Array3 dimension of the cell being processed, as specified
|
||||
* by the supplied kernel context. See rsGetArray0() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Array3 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetArray3(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimArray0: Size of the Array0 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the Array0 dimension for the specified kernel context.
|
||||
* See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Array0 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimArray0(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimArray1: Size of the Array1 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the Array1 dimension for the specified kernel context.
|
||||
* See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Array1 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimArray1(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimArray2: Size of the Array2 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the Array2 dimension for the specified kernel context.
|
||||
* See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Array2 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimArray2(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimArray3: Size of the Array3 dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the Array3 dimension for the specified kernel context.
|
||||
* See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Array3 dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimArray3(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimHasFaces: Presence of more than one face for the specified kernel context
|
||||
*
|
||||
* If the kernel is iterating over a cubemap, this function returns true if there's more
|
||||
* than one face present. In all other cases, it returns false. See rsGetDimX() for an
|
||||
* explanation of the context.
|
||||
*
|
||||
* rsAllocationGetDimFaces() is similar but returns 0 or 1 instead of a bool.
|
||||
*
|
||||
* Returns: Returns true if more than one face is present, false otherwise.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern bool __attribute__((overloadable))
|
||||
rsGetDimHasFaces(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimLod: Number of levels of detail for the specified kernel context
|
||||
*
|
||||
* Returns the number of levels of detail for the specified kernel context. This is useful
|
||||
* for mipmaps. See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if Level of Detail is not used.
|
||||
*
|
||||
* rsAllocationGetDimLOD() is similar but returns 0 or 1 instead the actual
|
||||
* number of levels.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimLod(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimX: Size of the X dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the X dimension for the specified kernel context.
|
||||
*
|
||||
* The kernel context contains common characteristics of the allocations being iterated
|
||||
* over and rarely used indices, like the Array0 index.
|
||||
*
|
||||
* You can access it by adding a special parameter named "context" of
|
||||
* type rs_kernel_context to your kernel function. E.g.
|
||||
* int4 RS_KERNEL myKernel(int4 value, rs_kernel_context context) {
|
||||
* uint32_t size = rsGetDimX(context); //...
|
||||
*
|
||||
* To get the dimension of specific allocation, use rsAllocationGetDimX().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimX(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimY: Size of the Y dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the X dimension for the specified kernel context.
|
||||
* See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Y dimension is not present.
|
||||
*
|
||||
* To get the dimension of specific allocation, use rsAllocationGetDimY().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimY(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetDimZ: Size of the Z dimension for the specified kernel context
|
||||
*
|
||||
* Returns the size of the Z dimension for the specified kernel context.
|
||||
* See rsGetDimX() for an explanation of the context.
|
||||
*
|
||||
* Returns 0 if the Z dimension is not present.
|
||||
*
|
||||
* To get the dimension of specific allocation, use rsAllocationGetDimZ().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetDimZ(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetFace: Coordinate of the Face for the specified kernel context
|
||||
*
|
||||
* Returns the face on which the cell being processed is found, as specified by the
|
||||
* supplied kernel context. See rsGetArray0() for an explanation of the context.
|
||||
*
|
||||
* Returns RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X if the face dimension is not
|
||||
* present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern rs_allocation_cubemap_face __attribute__((overloadable))
|
||||
rsGetFace(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetLod: Index in the Levels of Detail dimension for the specified kernel context
|
||||
*
|
||||
* Returns the index in the Levels of Detail dimension of the cell being processed,
|
||||
* as specified by the supplied kernel context. See rsGetArray0() for an explanation of
|
||||
* the context.
|
||||
*
|
||||
* Returns 0 if the Levels of Detail dimension is not present.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsGetLod(rs_kernel_context context);
|
||||
#endif
|
||||
|
||||
#endif // RENDERSCRIPT_RS_FOR_EACH_RSH
|
||||
1522
apk_3234/build-tools/android-13/renderscript/include/rs_graphics.rsh
Normal file
1522
apk_3234/build-tools/android-13/renderscript/include/rs_graphics.rsh
Normal file
File diff suppressed because it is too large
Load Diff
107
apk_3234/build-tools/android-13/renderscript/include/rs_io.rsh
Normal file
107
apk_3234/build-tools/android-13/renderscript/include/rs_io.rsh
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_io.rsh: Input/Output Functions
|
||||
*
|
||||
* These functions are used to:
|
||||
* - Send information to the Java client, and
|
||||
* - Send the processed allocation or receive the next allocation to process.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_IO_RSH
|
||||
#define RENDERSCRIPT_RS_IO_RSH
|
||||
|
||||
/*
|
||||
* rsAllocationIoReceive: Receive new content from the queue
|
||||
*
|
||||
* Receive a new set of contents from the queue.
|
||||
*
|
||||
* This function should not be called from inside a kernel, or from any function
|
||||
* that may be called directly or indirectly from a kernel. Doing so would cause a
|
||||
* runtime error.
|
||||
*
|
||||
* Parameters:
|
||||
* a: Allocation to work on.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern void __attribute__((overloadable))
|
||||
rsAllocationIoReceive(rs_allocation a);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsAllocationIoSend: Send new content to the queue
|
||||
*
|
||||
* Send the contents of the Allocation to the queue.
|
||||
*
|
||||
* This function should not be called from inside a kernel, or from any function
|
||||
* that may be called directly or indirectly from a kernel. Doing so would cause a
|
||||
* runtime error.
|
||||
*
|
||||
* Parameters:
|
||||
* a: Allocation to work on.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern void __attribute__((overloadable))
|
||||
rsAllocationIoSend(rs_allocation a);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsSendToClient: Send a message to the client, non-blocking
|
||||
*
|
||||
* Sends a message back to the client. This call does not block.
|
||||
* It returns true if the message was sent and false if the
|
||||
* message queue is full.
|
||||
*
|
||||
* A message ID is required. The data payload is optional.
|
||||
*
|
||||
* See RenderScript.RSMessageHandler.
|
||||
*
|
||||
* Parameters:
|
||||
* data: Application specific data.
|
||||
* len: Length of the data, in bytes.
|
||||
*/
|
||||
extern bool __attribute__((overloadable))
|
||||
rsSendToClient(int cmdID);
|
||||
|
||||
extern bool __attribute__((overloadable))
|
||||
rsSendToClient(int cmdID, const void* data, uint len);
|
||||
|
||||
/*
|
||||
* rsSendToClientBlocking: Send a message to the client, blocking
|
||||
*
|
||||
* Sends a message back to the client. This function will block
|
||||
* until there is room on the message queue for this message.
|
||||
* This function may return before the message was delivered and
|
||||
* processed by the client.
|
||||
*
|
||||
* A message ID is required. The data payload is optional.
|
||||
*
|
||||
* See RenderScript.RSMessageHandler.
|
||||
*
|
||||
* Parameters:
|
||||
* data: Application specific data.
|
||||
* len: Length of the data, in bytes.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsSendToClientBlocking(int cmdID);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsSendToClientBlocking(int cmdID, const void* data, uint len);
|
||||
|
||||
#endif // RENDERSCRIPT_RS_IO_RSH
|
||||
6550
apk_3234/build-tools/android-13/renderscript/include/rs_math.rsh
Normal file
6550
apk_3234/build-tools/android-13/renderscript/include/rs_math.rsh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,612 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_matrix.rsh: Matrix Functions
|
||||
*
|
||||
* These functions let you manipulate square matrices of rank 2x2, 3x3, and 4x4.
|
||||
* They are particularly useful for graphical transformations and are compatible
|
||||
* with OpenGL.
|
||||
*
|
||||
* We use a zero-based index for rows and columns. E.g. the last element of a
|
||||
* rs_matrix4x4 is found at (3, 3).
|
||||
*
|
||||
* RenderScript uses column-major matrices and column-based vectors. Transforming
|
||||
* a vector is done by postmultiplying the vector, e.g. (matrix * vector),
|
||||
* as provided by rsMatrixMultiply().
|
||||
*
|
||||
* To create a transformation matrix that performs two transformations at once,
|
||||
* multiply the two source matrices, with the first transformation as the right
|
||||
* argument. E.g. to create a transformation matrix that applies the
|
||||
* transformation s1 followed by s2, call rsMatrixLoadMultiply(&combined, &s2, &s1).
|
||||
* This derives from s2 * (s1 * v), which is (s2 * s1) * v.
|
||||
*
|
||||
* We have two style of functions to create transformation matrices:
|
||||
* rsMatrixLoadTransformation and rsMatrixTransformation. The former
|
||||
* style simply stores the transformation matrix in the first argument. The latter
|
||||
* modifies a pre-existing transformation matrix so that the new transformation
|
||||
* happens first. E.g. if you call rsMatrixTranslate() on a matrix that already
|
||||
* does a scaling, the resulting matrix when applied to a vector will first do the
|
||||
* translation then the scaling.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_MATRIX_RSH
|
||||
#define RENDERSCRIPT_RS_MATRIX_RSH
|
||||
|
||||
#include "rs_vector_math.rsh"
|
||||
|
||||
/*
|
||||
* rsExtractFrustumPlanes: Compute frustum planes
|
||||
*
|
||||
* Computes 6 frustum planes from the view projection matrix
|
||||
*
|
||||
* Parameters:
|
||||
* viewProj: Matrix to extract planes from.
|
||||
* left: Left plane.
|
||||
* right: Right plane.
|
||||
* top: Top plane.
|
||||
* bottom: Bottom plane.
|
||||
* near: Near plane.
|
||||
* far: Far plane.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsExtractFrustumPlanes(const rs_matrix4x4* viewProj, float4* left, float4* right, float4* top,
|
||||
float4* bottom, float4* near, float4* far) {
|
||||
// x y z w = a b c d in the plane equation
|
||||
left->x = viewProj->m[3] + viewProj->m[0];
|
||||
left->y = viewProj->m[7] + viewProj->m[4];
|
||||
left->z = viewProj->m[11] + viewProj->m[8];
|
||||
left->w = viewProj->m[15] + viewProj->m[12];
|
||||
|
||||
right->x = viewProj->m[3] - viewProj->m[0];
|
||||
right->y = viewProj->m[7] - viewProj->m[4];
|
||||
right->z = viewProj->m[11] - viewProj->m[8];
|
||||
right->w = viewProj->m[15] - viewProj->m[12];
|
||||
|
||||
top->x = viewProj->m[3] - viewProj->m[1];
|
||||
top->y = viewProj->m[7] - viewProj->m[5];
|
||||
top->z = viewProj->m[11] - viewProj->m[9];
|
||||
top->w = viewProj->m[15] - viewProj->m[13];
|
||||
|
||||
bottom->x = viewProj->m[3] + viewProj->m[1];
|
||||
bottom->y = viewProj->m[7] + viewProj->m[5];
|
||||
bottom->z = viewProj->m[11] + viewProj->m[9];
|
||||
bottom->w = viewProj->m[15] + viewProj->m[13];
|
||||
|
||||
near->x = viewProj->m[3] + viewProj->m[2];
|
||||
near->y = viewProj->m[7] + viewProj->m[6];
|
||||
near->z = viewProj->m[11] + viewProj->m[10];
|
||||
near->w = viewProj->m[15] + viewProj->m[14];
|
||||
|
||||
far->x = viewProj->m[3] - viewProj->m[2];
|
||||
far->y = viewProj->m[7] - viewProj->m[6];
|
||||
far->z = viewProj->m[11] - viewProj->m[10];
|
||||
far->w = viewProj->m[15] - viewProj->m[14];
|
||||
|
||||
float len = length(left->xyz);
|
||||
*left /= len;
|
||||
len = length(right->xyz);
|
||||
*right /= len;
|
||||
len = length(top->xyz);
|
||||
*top /= len;
|
||||
len = length(bottom->xyz);
|
||||
*bottom /= len;
|
||||
len = length(near->xyz);
|
||||
*near /= len;
|
||||
len = length(far->xyz);
|
||||
*far /= len;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsExtractFrustumPlanes(const rs_matrix4x4* viewProj, float4* left, float4* righ, float4* top,
|
||||
float4* bottom, float4* near, float4* far);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsIsSphereInFrustum: Checks if a sphere is within the frustum planes
|
||||
*
|
||||
* Returns true if the sphere is within the 6 frustum planes.
|
||||
*
|
||||
* Parameters:
|
||||
* sphere: float4 representing the sphere.
|
||||
* left: Left plane.
|
||||
* right: Right plane.
|
||||
* top: Top plane.
|
||||
* bottom: Bottom plane.
|
||||
* near: Near plane.
|
||||
* far: Far plane.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline bool __attribute__((always_inline, overloadable))
|
||||
rsIsSphereInFrustum(float4* sphere, float4* left, float4* right, float4* top, float4* bottom,
|
||||
float4* near, float4* far) {
|
||||
float distToCenter = dot(left->xyz, sphere->xyz) + left->w;
|
||||
if (distToCenter < -sphere->w) {
|
||||
return false;
|
||||
}
|
||||
distToCenter = dot(right->xyz, sphere->xyz) + right->w;
|
||||
if (distToCenter < -sphere->w) {
|
||||
return false;
|
||||
}
|
||||
distToCenter = dot(top->xyz, sphere->xyz) + top->w;
|
||||
if (distToCenter < -sphere->w) {
|
||||
return false;
|
||||
}
|
||||
distToCenter = dot(bottom->xyz, sphere->xyz) + bottom->w;
|
||||
if (distToCenter < -sphere->w) {
|
||||
return false;
|
||||
}
|
||||
distToCenter = dot(near->xyz, sphere->xyz) + near->w;
|
||||
if (distToCenter < -sphere->w) {
|
||||
return false;
|
||||
}
|
||||
distToCenter = dot(far->xyz, sphere->xyz) + far->w;
|
||||
if (distToCenter < -sphere->w) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern bool __attribute__((overloadable))
|
||||
rsIsSphereInFrustum(float4* sphere, float4* left, float4* right, float4* top, float4* bottom,
|
||||
float4* near, float4* far);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsMatrixGet: Get one element
|
||||
*
|
||||
* Returns one element of a matrix.
|
||||
*
|
||||
* Warning: The order of the column and row parameters may be unexpected.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to extract the element from.
|
||||
* col: Zero-based column of the element to be extracted.
|
||||
* row: Zero-based row of the element to extracted.
|
||||
*/
|
||||
extern float __attribute__((overloadable))
|
||||
rsMatrixGet(const rs_matrix4x4* m, uint32_t col, uint32_t row);
|
||||
|
||||
extern float __attribute__((overloadable))
|
||||
rsMatrixGet(const rs_matrix3x3* m, uint32_t col, uint32_t row);
|
||||
|
||||
extern float __attribute__((overloadable))
|
||||
rsMatrixGet(const rs_matrix2x2* m, uint32_t col, uint32_t row);
|
||||
|
||||
/*
|
||||
* rsMatrixInverse: Inverts a matrix in place
|
||||
*
|
||||
* Returns true if the matrix was successfully inverted.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to invert.
|
||||
*/
|
||||
extern bool __attribute__((overloadable))
|
||||
rsMatrixInverse(rs_matrix4x4* m);
|
||||
|
||||
/*
|
||||
* rsMatrixInverseTranspose: Inverts and transpose a matrix in place
|
||||
*
|
||||
* The matrix is first inverted then transposed. Returns true if the matrix was
|
||||
* successfully inverted.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to modify.
|
||||
*/
|
||||
extern bool __attribute__((overloadable))
|
||||
rsMatrixInverseTranspose(rs_matrix4x4* m);
|
||||
|
||||
/*
|
||||
* rsMatrixLoad: Load or copy a matrix
|
||||
*
|
||||
* Set the elements of a matrix from an array of floats or from another matrix.
|
||||
*
|
||||
* If loading from an array, the floats should be in row-major order, i.e. the element a
|
||||
* row 0, column 0 should be first, followed by the element at
|
||||
* row 0, column 1, etc.
|
||||
*
|
||||
* If loading from a matrix and the source is smaller than the destination, the rest
|
||||
* of the destination is filled with elements of the identity matrix. E.g.
|
||||
* loading a rs_matrix2x2 into a rs_matrix4x4 will give:
|
||||
*
|
||||
* m00 m01 0.0 0.0
|
||||
* m10 m11 0.0 0.0
|
||||
* 0.0 0.0 1.0 0.0
|
||||
* 0.0 0.0 0.0 1.0
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* destination: Matrix to set.
|
||||
* array: Array of values to set the matrix to. These arrays should be 4, 9, or 16 floats long, depending on the matrix size.
|
||||
* source: Source matrix.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix4x4* destination, const float* array);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix3x3* destination, const float* array);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix2x2* destination, const float* array);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix4x4* destination, const rs_matrix4x4* source);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix3x3* destination, const rs_matrix3x3* source);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix2x2* destination, const rs_matrix2x2* source);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix4x4* destination, const rs_matrix3x3* source);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoad(rs_matrix4x4* destination, const rs_matrix2x2* source);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadFrustum: Load a frustum projection matrix
|
||||
*
|
||||
* Constructs a frustum projection matrix, transforming the box identified by
|
||||
* the six clipping planes left, right, bottom, top, near, far.
|
||||
*
|
||||
* To apply this projection to a vector, multiply the vector by the created
|
||||
* matrix using rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadFrustum(rs_matrix4x4* m, float left, float right, float bottom, float top,
|
||||
float near, float far);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadIdentity: Load identity matrix
|
||||
*
|
||||
* Set the elements of a matrix to the identity matrix.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadIdentity(rs_matrix4x4* m);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadIdentity(rs_matrix3x3* m);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadIdentity(rs_matrix2x2* m);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadMultiply: Multiply two matrices
|
||||
*
|
||||
* Sets m to the matrix product of lhs * rhs.
|
||||
*
|
||||
* To combine two 4x4 transformaton matrices, multiply the second transformation matrix
|
||||
* by the first transformation matrix. E.g. to create a transformation matrix that applies
|
||||
* the transformation s1 followed by s2, call rsMatrixLoadMultiply(&combined, &s2, &s1).
|
||||
*
|
||||
* Warning: Prior to version 21, storing the result back into right matrix is not supported and
|
||||
* will result in undefined behavior. Use rsMatrixMulitply instead. E.g. instead of doing
|
||||
* rsMatrixLoadMultiply (&m2r, &m2r, &m2l), use rsMatrixMultiply (&m2r, &m2l).
|
||||
* rsMatrixLoadMultiply (&m2l, &m2r, &m2l) works as expected.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
* lhs: Left matrix of the product.
|
||||
* rhs: Right matrix of the product.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadMultiply(rs_matrix4x4* m, const rs_matrix4x4* lhs, const rs_matrix4x4* rhs);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadMultiply(rs_matrix3x3* m, const rs_matrix3x3* lhs, const rs_matrix3x3* rhs);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadMultiply(rs_matrix2x2* m, const rs_matrix2x2* lhs, const rs_matrix2x2* rhs);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadOrtho: Load an orthographic projection matrix
|
||||
*
|
||||
* Constructs an orthographic projection matrix, transforming the box identified by the
|
||||
* six clipping planes left, right, bottom, top, near, far into a unit cube
|
||||
* with a corner at (-1, -1, -1) and the opposite at (1, 1, 1).
|
||||
*
|
||||
* To apply this projection to a vector, multiply the vector by the created matrix
|
||||
* using rsMatrixMultiply().
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Orthographic_projection .
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadOrtho(rs_matrix4x4* m, float left, float right, float bottom, float top, float near,
|
||||
float far);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadPerspective: Load a perspective projection matrix
|
||||
*
|
||||
* Constructs a perspective projection matrix, assuming a symmetrical field of view.
|
||||
*
|
||||
* To apply this projection to a vector, multiply the vector by the created matrix
|
||||
* using rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
* fovy: Field of view, in degrees along the Y axis.
|
||||
* aspect: Ratio of x / y.
|
||||
* near: Near clipping plane.
|
||||
* far: Far clipping plane.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadRotate: Load a rotation matrix
|
||||
*
|
||||
* This function creates a rotation matrix. The axis of rotation is the (x, y, z) vector.
|
||||
*
|
||||
* To rotate a vector, multiply the vector by the created matrix using rsMatrixMultiply().
|
||||
*
|
||||
* See http://en.wikipedia.org/wiki/Rotation_matrix .
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
* rot: How much rotation to do, in degrees.
|
||||
* x: X component of the vector that is the axis of rotation.
|
||||
* y: Y component of the vector that is the axis of rotation.
|
||||
* z: Z component of the vector that is the axis of rotation.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadRotate(rs_matrix4x4* m, float rot, float x, float y, float z);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadScale: Load a scaling matrix
|
||||
*
|
||||
* This function creates a scaling matrix, where each component of a vector is multiplied
|
||||
* by a number. This number can be negative.
|
||||
*
|
||||
* To scale a vector, multiply the vector by the created matrix using rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
* x: Multiple to scale the x components by.
|
||||
* y: Multiple to scale the y components by.
|
||||
* z: Multiple to scale the z components by.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadScale(rs_matrix4x4* m, float x, float y, float z);
|
||||
|
||||
/*
|
||||
* rsMatrixLoadTranslate: Load a translation matrix
|
||||
*
|
||||
* This function creates a translation matrix, where a number is added to each element of
|
||||
* a vector.
|
||||
*
|
||||
* To translate a vector, multiply the vector by the created matrix using
|
||||
* rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to set.
|
||||
* x: Number to add to each x component.
|
||||
* y: Number to add to each y component.
|
||||
* z: Number to add to each z component.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixLoadTranslate(rs_matrix4x4* m, float x, float y, float z);
|
||||
|
||||
/*
|
||||
* rsMatrixMultiply: Multiply a matrix by a vector or another matrix
|
||||
*
|
||||
* For the matrix by matrix variant, sets m to the matrix product m * rhs.
|
||||
*
|
||||
* When combining two 4x4 transformation matrices using this function, the resulting
|
||||
* matrix will correspond to performing the rhs transformation first followed by
|
||||
* the original m transformation.
|
||||
*
|
||||
* For the matrix by vector variant, returns the post-multiplication of the vector
|
||||
* by the matrix, ie. m * in.
|
||||
*
|
||||
* When multiplying a float3 to a rs_matrix4x4, the vector is expanded with (1).
|
||||
*
|
||||
* When multiplying a float2 to a rs_matrix4x4, the vector is expanded with (0, 1).
|
||||
*
|
||||
* When multiplying a float2 to a rs_matrix3x3, the vector is expanded with (0).
|
||||
*
|
||||
* Starting with API 14, this function takes a const matrix as the first argument.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Left matrix of the product and the matrix to be set.
|
||||
* rhs: Right matrix of the product.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix4x4* m, const rs_matrix4x4* rhs);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix3x3* m, const rs_matrix3x3* rhs);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix2x2* m, const rs_matrix2x2* rhs);
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern float4 __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix4x4* m, float4 in);
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern float4 __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix4x4* m, float3 in);
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern float4 __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix4x4* m, float2 in);
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern float3 __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix3x3* m, float3 in);
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern float3 __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix3x3* m, float2 in);
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 13)
|
||||
extern float2 __attribute__((overloadable))
|
||||
rsMatrixMultiply(rs_matrix2x2* m, float2 in);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern float4 __attribute__((overloadable))
|
||||
rsMatrixMultiply(const rs_matrix4x4* m, float4 in);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern float4 __attribute__((overloadable))
|
||||
rsMatrixMultiply(const rs_matrix4x4* m, float3 in);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern float4 __attribute__((overloadable))
|
||||
rsMatrixMultiply(const rs_matrix4x4* m, float2 in);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern float3 __attribute__((overloadable))
|
||||
rsMatrixMultiply(const rs_matrix3x3* m, float3 in);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern float3 __attribute__((overloadable))
|
||||
rsMatrixMultiply(const rs_matrix3x3* m, float2 in);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
extern float2 __attribute__((overloadable))
|
||||
rsMatrixMultiply(const rs_matrix2x2* m, float2 in);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsMatrixRotate: Apply a rotation to a transformation matrix
|
||||
*
|
||||
* Multiply the matrix m with a rotation matrix.
|
||||
*
|
||||
* This function modifies a transformation matrix to first do a rotation. The axis of
|
||||
* rotation is the (x, y, z) vector.
|
||||
*
|
||||
* To apply this combined transformation to a vector, multiply the vector by the created
|
||||
* matrix using rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to modify.
|
||||
* rot: How much rotation to do, in degrees.
|
||||
* x: X component of the vector that is the axis of rotation.
|
||||
* y: Y component of the vector that is the axis of rotation.
|
||||
* z: Z component of the vector that is the axis of rotation.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixRotate(rs_matrix4x4* m, float rot, float x, float y, float z);
|
||||
|
||||
/*
|
||||
* rsMatrixScale: Apply a scaling to a transformation matrix
|
||||
*
|
||||
* Multiply the matrix m with a scaling matrix.
|
||||
*
|
||||
* This function modifies a transformation matrix to first do a scaling. When scaling,
|
||||
* each component of a vector is multiplied by a number. This number can be negative.
|
||||
*
|
||||
* To apply this combined transformation to a vector, multiply the vector by the created
|
||||
* matrix using rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to modify.
|
||||
* x: Multiple to scale the x components by.
|
||||
* y: Multiple to scale the y components by.
|
||||
* z: Multiple to scale the z components by.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixScale(rs_matrix4x4* m, float x, float y, float z);
|
||||
|
||||
/*
|
||||
* rsMatrixSet: Set one element
|
||||
*
|
||||
* Set an element of a matrix.
|
||||
*
|
||||
* Warning: The order of the column and row parameters may be unexpected.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix that will be modified.
|
||||
* col: Zero-based column of the element to be set.
|
||||
* row: Zero-based row of the element to be set.
|
||||
* v: Value to set.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixSet(rs_matrix4x4* m, uint32_t col, uint32_t row, float v);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixSet(rs_matrix3x3* m, uint32_t col, uint32_t row, float v);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixSet(rs_matrix2x2* m, uint32_t col, uint32_t row, float v);
|
||||
|
||||
/*
|
||||
* rsMatrixTranslate: Apply a translation to a transformation matrix
|
||||
*
|
||||
* Multiply the matrix m with a translation matrix.
|
||||
*
|
||||
* This function modifies a transformation matrix to first do a translation. When
|
||||
* translating, a number is added to each component of a vector.
|
||||
*
|
||||
* To apply this combined transformation to a vector, multiply the vector by the
|
||||
* created matrix using rsMatrixMultiply().
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to modify.
|
||||
* x: Number to add to each x component.
|
||||
* y: Number to add to each y component.
|
||||
* z: Number to add to each z component.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixTranslate(rs_matrix4x4* m, float x, float y, float z);
|
||||
|
||||
/*
|
||||
* rsMatrixTranspose: Transpose a matrix place
|
||||
*
|
||||
* Transpose the matrix m in place.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Matrix to transpose.
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixTranspose(rs_matrix4x4* m);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixTranspose(rs_matrix3x3* m);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsMatrixTranspose(rs_matrix2x2* m);
|
||||
|
||||
#endif // RENDERSCRIPT_RS_MATRIX_RSH
|
||||
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_object_info.rsh: Object Characteristics Functions
|
||||
*
|
||||
* The functions below can be used to query the characteristics of an Allocation, Element,
|
||||
* or Sampler object. These objects are created from Java. You can't create them from a
|
||||
* script.
|
||||
*
|
||||
* Allocations:
|
||||
*
|
||||
* Allocations are the primary method used to pass data to and from RenderScript kernels.
|
||||
*
|
||||
* They are a structured collection of cells that can be used to store bitmaps, textures,
|
||||
* arbitrary data points, etc.
|
||||
*
|
||||
* This collection of cells may have many dimensions (X, Y, Z, Array0, Array1, Array2, Array3),
|
||||
* faces (for cubemaps), and level of details (for mipmapping).
|
||||
*
|
||||
* See the android.renderscript.Allocation for details on to create Allocations.
|
||||
*
|
||||
* Elements:
|
||||
*
|
||||
* The term "element" is used a bit ambiguously in RenderScript, as both type information
|
||||
* for the cells of an Allocation and the instantiation of that type. For example:
|
||||
* - rs_element is a handle to a type specification, and
|
||||
* - In functions like rsGetElementAt(), "element" means the instantiation of the type,
|
||||
* i.e. a cell of an Allocation.
|
||||
*
|
||||
* The functions below let you query the characteristics of the type specificiation.
|
||||
*
|
||||
* An Element can specify a simple data types as found in C, e.g. an integer, float, or
|
||||
* boolean. It can also specify a handle to a RenderScript object. See rs_data_type for
|
||||
* a list of basic types.
|
||||
*
|
||||
* Elements can specify fixed size vector (of size 2, 3, or 4) versions of the basic types.
|
||||
* Elements can be grouped together into complex Elements, creating the equivalent of
|
||||
* C structure definitions.
|
||||
*
|
||||
* Elements can also have a kind, which is semantic information used to interpret pixel
|
||||
* data. See rs_data_kind.
|
||||
*
|
||||
* When creating Allocations of common elements, you can simply use one of the many predefined
|
||||
* Elements like F32_2.
|
||||
*
|
||||
* To create complex Elements, use the Element.Builder Java class.
|
||||
*
|
||||
* Samplers:
|
||||
*
|
||||
* Samplers objects define how Allocations can be read as structure within a kernel.
|
||||
* See android.renderscript.S.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_OBJECT_INFO_RSH
|
||||
#define RENDERSCRIPT_RS_OBJECT_INFO_RSH
|
||||
|
||||
/*
|
||||
* rsAllocationGetDimFaces: Presence of more than one face
|
||||
*
|
||||
* If the Allocation is a cubemap, this function returns 1 if there's more than one face
|
||||
* present. In all other cases, it returns 0.
|
||||
*
|
||||
* Use rsGetDimHasFaces() to get the dimension of a currently running kernel.
|
||||
*
|
||||
* Returns: Returns 1 if more than one face is present, 0 otherwise.
|
||||
*/
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAllocationGetDimFaces(rs_allocation a);
|
||||
|
||||
/*
|
||||
* rsAllocationGetDimLOD: Presence of levels of detail
|
||||
*
|
||||
* Query an Allocation for the presence of more than one Level Of Detail. This is useful
|
||||
* for mipmaps.
|
||||
*
|
||||
* Use rsGetDimLod() to get the dimension of a currently running kernel.
|
||||
*
|
||||
* Returns: Returns 1 if more than one LOD is present, 0 otherwise.
|
||||
*/
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAllocationGetDimLOD(rs_allocation a);
|
||||
|
||||
/*
|
||||
* rsAllocationGetDimX: Size of the X dimension
|
||||
*
|
||||
* Returns the size of the X dimension of the Allocation.
|
||||
*
|
||||
* Use rsGetDimX() to get the dimension of a currently running kernel.
|
||||
*
|
||||
* Returns: X dimension of the Allocation.
|
||||
*/
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAllocationGetDimX(rs_allocation a);
|
||||
|
||||
/*
|
||||
* rsAllocationGetDimY: Size of the Y dimension
|
||||
*
|
||||
* Returns the size of the Y dimension of the Allocation. If the Allocation has less
|
||||
* than two dimensions, returns 0.
|
||||
*
|
||||
* Use rsGetDimY() to get the dimension of a currently running kernel.
|
||||
*
|
||||
* Returns: Y dimension of the Allocation.
|
||||
*/
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAllocationGetDimY(rs_allocation a);
|
||||
|
||||
/*
|
||||
* rsAllocationGetDimZ: Size of the Z dimension
|
||||
*
|
||||
* Returns the size of the Z dimension of the Allocation. If the Allocation has less
|
||||
* than three dimensions, returns 0.
|
||||
*
|
||||
* Use rsGetDimZ() to get the dimension of a currently running kernel.
|
||||
*
|
||||
* Returns: Z dimension of the Allocation.
|
||||
*/
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsAllocationGetDimZ(rs_allocation a);
|
||||
|
||||
/*
|
||||
* rsAllocationGetElement: Get the object that describes the cell of an Allocation
|
||||
*
|
||||
* Get the Element object describing the type, kind, and other characteristics of a cell
|
||||
* of an Allocation. See the rsElement* functions below.
|
||||
*
|
||||
* Parameters:
|
||||
* a: Allocation to get data from.
|
||||
*
|
||||
* Returns: Element describing Allocation layout.
|
||||
*/
|
||||
extern rs_element __attribute__((overloadable))
|
||||
rsAllocationGetElement(rs_allocation a);
|
||||
|
||||
/*
|
||||
* rsClearObject: Release an object
|
||||
*
|
||||
* Tells the run time that this handle will no longer be used to access the the related
|
||||
* object. If this was the last handle to that object, resource recovery may happen.
|
||||
*
|
||||
* After calling this function, *dst will be set to an empty handle. See rsIsObject().
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsClearObject(rs_element* dst);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsClearObject(rs_type* dst);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsClearObject(rs_allocation* dst);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsClearObject(rs_sampler* dst);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsClearObject(rs_script* dst);
|
||||
|
||||
/*
|
||||
* rsIsObject: Check for an empty handle
|
||||
*
|
||||
* Returns true if the handle contains a non-null reference.
|
||||
*
|
||||
* This function does not validate that the internal pointer used in the handle
|
||||
* points to an actual valid object; it only checks for null.
|
||||
*
|
||||
* This function can be used to check the Element returned by rsElementGetSubElement()
|
||||
* or see if rsClearObject() has been called on a handle.
|
||||
*/
|
||||
extern bool __attribute__((overloadable))
|
||||
rsIsObject(rs_element v);
|
||||
|
||||
extern bool __attribute__((overloadable))
|
||||
rsIsObject(rs_type v);
|
||||
|
||||
extern bool __attribute__((overloadable))
|
||||
rsIsObject(rs_allocation v);
|
||||
|
||||
extern bool __attribute__((overloadable))
|
||||
rsIsObject(rs_sampler v);
|
||||
|
||||
extern bool __attribute__((overloadable))
|
||||
rsIsObject(rs_script v);
|
||||
|
||||
/*
|
||||
* rsElementGetBytesSize: Size of an Element
|
||||
*
|
||||
* Returns the size in bytes that an instantiation of this Element will occupy.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetBytesSize(rs_element e);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetDataKind: Kind of an Element
|
||||
*
|
||||
* Returns the Element's data kind. This is used to interpret pixel data.
|
||||
*
|
||||
* See rs_data_kind.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_data_kind __attribute__((overloadable))
|
||||
rsElementGetDataKind(rs_element e);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetDataType: Data type of an Element
|
||||
*
|
||||
* Returns the Element's base data type. This can be a type similar to C/C++ (e.g.
|
||||
* RS_TYPE_UNSIGNED_8), a handle (e.g. RS_TYPE_ALLOCATION and RS_TYPE_ELEMENT), or a
|
||||
* more complex numerical type (e.g. RS_TYPE_UNSIGNED_5_6_5 and RS_TYPE_MATRIX_4X4).
|
||||
* See rs_data_type.
|
||||
*
|
||||
* If the Element describes a vector, this function returns the data type of one of its items.
|
||||
* Use rsElementGetVectorSize to get the size of the vector.
|
||||
*
|
||||
* If the Element describes a structure, RS_TYPE_NONE is returned. Use the rsElementGetSub*
|
||||
* functions to explore this complex Element.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_data_type __attribute__((overloadable))
|
||||
rsElementGetDataType(rs_element e);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetSubElement: Sub-element of a complex Element
|
||||
*
|
||||
* For Elements that represents a structure, this function returns the sub-element at the
|
||||
* specified index.
|
||||
*
|
||||
* If the Element is not a structure or the index is greater or equal to the number of
|
||||
* sub-elements, an invalid handle is returned.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to query.
|
||||
* index: Index of the sub-element to return.
|
||||
*
|
||||
* Returns: Sub-element at the given index.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_element __attribute__((overloadable))
|
||||
rsElementGetSubElement(rs_element e, uint32_t index);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetSubElementArraySize: Array size of a sub-element of a complex Element
|
||||
*
|
||||
* For complex Elements, sub-elements can be statically sized arrays. This function
|
||||
* returns the array size of the sub-element at the index. This sub-element repetition
|
||||
* is different than fixed size vectors.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to query.
|
||||
* index: Index of the sub-element.
|
||||
*
|
||||
* Returns: Array size of the sub-element.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetSubElementArraySize(rs_element e, uint32_t index);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetSubElementCount: Number of sub-elements
|
||||
*
|
||||
* Elements can be simple, such as an int or a float, or a structure with multiple
|
||||
* sub-elements. This function returns zero for simple Elements and the number of
|
||||
* sub-elements for complex Elements.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to get data from.
|
||||
*
|
||||
* Returns: Number of sub-elements.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetSubElementCount(rs_element e);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetSubElementName: Name of a sub-element
|
||||
*
|
||||
* For complex Elements, this function returns the name of the sub-element at the
|
||||
* specified index.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to get data from.
|
||||
* index: Index of the sub-element.
|
||||
* name: Address of the array to store the name into.
|
||||
* nameLength: Length of the provided name array.
|
||||
*
|
||||
* Returns: Number of characters copied, excluding the null terminator.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetSubElementName(rs_element e, uint32_t index, char* name, uint32_t nameLength);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetSubElementNameLength: Length of the name of a sub-element
|
||||
*
|
||||
* For complex Elements, this function returns the length of the name of the sub-element
|
||||
* at the specified index.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to get data from.
|
||||
* index: Index of the sub-element.
|
||||
*
|
||||
* Returns: Length of the sub-element name including the null terminator.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetSubElementNameLength(rs_element e, uint32_t index);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetSubElementOffsetBytes: Offset of the instantiated sub-element
|
||||
*
|
||||
* This function returns the relative position of the instantiation of the specified
|
||||
* sub-element within the instantiation of the Element.
|
||||
*
|
||||
* For example, if the Element describes a 32 bit float followed by a 32 bit integer,
|
||||
* the offset return for the first will be 0 and the second 4.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to get data from.
|
||||
* index: Index of the sub-element.
|
||||
*
|
||||
* Returns: Offset in bytes.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsElementGetVectorSize: Vector size of the Element
|
||||
*
|
||||
* Returns the Element's vector size. If the Element does not represent a vector,
|
||||
* 1 is returned.
|
||||
*
|
||||
* Parameters:
|
||||
* e: Element to get data from.
|
||||
*
|
||||
* Returns: Length of the element vector.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern uint32_t __attribute__((overloadable))
|
||||
rsElementGetVectorSize(rs_element e);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsGetAllocation: Return the Allocation for a given pointer
|
||||
*
|
||||
* DEPRECATED. Do not use.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
extern rs_allocation __attribute__((overloadable
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 22))
|
||||
, deprecated("This function is deprecated and will be removed from the SDK in a future release.")
|
||||
#endif
|
||||
))
|
||||
rsGetAllocation(const void* p);
|
||||
|
||||
/*
|
||||
* rsSamplerGetAnisotropy: Anisotropy of the Sampler
|
||||
*
|
||||
* Get the Sampler's anisotropy.
|
||||
*
|
||||
* See android.renderscript.S.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern float __attribute__((overloadable))
|
||||
rsSamplerGetAnisotropy(rs_sampler s);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsSamplerGetMagnification: Sampler magnification value
|
||||
*
|
||||
* Get the Sampler's magnification value.
|
||||
*
|
||||
* See android.renderscript.S.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_sampler_value __attribute__((overloadable))
|
||||
rsSamplerGetMagnification(rs_sampler s);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsSamplerGetMinification: Sampler minification value
|
||||
*
|
||||
* Get the Sampler's minification value.
|
||||
*
|
||||
* See android.renderscript.S.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_sampler_value __attribute__((overloadable))
|
||||
rsSamplerGetMinification(rs_sampler s);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsSamplerGetWrapS: Sampler wrap S value
|
||||
*
|
||||
* Get the Sampler's wrap S value.
|
||||
*
|
||||
* See android.renderscript.S.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_sampler_value __attribute__((overloadable))
|
||||
rsSamplerGetWrapS(rs_sampler s);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsSamplerGetWrapT: Sampler wrap T value
|
||||
*
|
||||
* Get the sampler's wrap T value.
|
||||
*
|
||||
* See android.renderscript.S.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
extern rs_sampler_value __attribute__((overloadable))
|
||||
rsSamplerGetWrapT(rs_sampler s);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsSetObject: For internal use.
|
||||
*
|
||||
*/
|
||||
extern void __attribute__((overloadable))
|
||||
rsSetObject(rs_element* dst, rs_element src);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsSetObject(rs_type* dst, rs_type src);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsSetObject(rs_allocation* dst, rs_allocation src);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsSetObject(rs_sampler* dst, rs_sampler src);
|
||||
|
||||
extern void __attribute__((overloadable))
|
||||
rsSetObject(rs_script* dst, rs_script src);
|
||||
|
||||
#endif // RENDERSCRIPT_RS_OBJECT_INFO_RSH
|
||||
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_object_types.rsh: Object Types
|
||||
*
|
||||
* The types below are used to manipulate RenderScript objects like allocations, samplers,
|
||||
* elements, and scripts. Most of these object are created using the Java RenderScript APIs.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_OBJECT_TYPES_RSH
|
||||
#define RENDERSCRIPT_RS_OBJECT_TYPES_RSH
|
||||
|
||||
#define NULL ((void *)0)
|
||||
|
||||
// Opaque handle to a RenderScript object. Do not use this directly.
|
||||
#ifndef __LP64__
|
||||
#define _RS_OBJECT_DECL \
|
||||
{\
|
||||
const int* const p;\
|
||||
} __attribute__((packed, aligned(4)))
|
||||
#else
|
||||
#define _RS_OBJECT_DECL \
|
||||
{\
|
||||
const long* const p;\
|
||||
const long* const unused1;\
|
||||
const long* const unused2;\
|
||||
const long* const unused3;\
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_element: Handle to an element
|
||||
*
|
||||
* An opaque handle to a RenderScript element.
|
||||
*
|
||||
* See android.renderscript.Element.
|
||||
*/
|
||||
typedef struct rs_element _RS_OBJECT_DECL rs_element;
|
||||
|
||||
/*
|
||||
* rs_type: Handle to a Type
|
||||
*
|
||||
* An opaque handle to a RenderScript type.
|
||||
*
|
||||
* See android.renderscript.Type.
|
||||
*/
|
||||
typedef struct rs_type _RS_OBJECT_DECL rs_type;
|
||||
|
||||
/*
|
||||
* rs_allocation: Handle to an allocation
|
||||
*
|
||||
* An opaque handle to a RenderScript allocation.
|
||||
*
|
||||
* See android.renderscript.Allocation.
|
||||
*/
|
||||
typedef struct rs_allocation _RS_OBJECT_DECL rs_allocation;
|
||||
|
||||
/*
|
||||
* rs_sampler: Handle to a Sampler
|
||||
*
|
||||
* An opaque handle to a RenderScript sampler object.
|
||||
*
|
||||
* See android.renderscript.Sampler.
|
||||
*/
|
||||
typedef struct rs_sampler _RS_OBJECT_DECL rs_sampler;
|
||||
|
||||
/*
|
||||
* rs_script: Handle to a Script
|
||||
*
|
||||
* An opaque handle to a RenderScript script object.
|
||||
*
|
||||
* See android.renderscript.ScriptC.
|
||||
*/
|
||||
typedef struct rs_script _RS_OBJECT_DECL rs_script;
|
||||
|
||||
/*
|
||||
* rs_allocation_cubemap_face: Enum for selecting cube map faces
|
||||
*
|
||||
* An enum used to specify one the six faces of a cubemap.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
typedef enum {
|
||||
RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
|
||||
RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
|
||||
RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
|
||||
RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
|
||||
RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
|
||||
RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
|
||||
} rs_allocation_cubemap_face;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_allocation_usage_type: Bitfield to specify how an allocation is used
|
||||
*
|
||||
* These values are ORed together to specify which usages or memory spaces are
|
||||
* relevant to an allocation or an operation on an allocation.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 14))
|
||||
typedef enum {
|
||||
RS_ALLOCATION_USAGE_SCRIPT = 0x0001, // Allocation is bound to and accessed by scripts.
|
||||
RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, // Allocation is used as a texture source.
|
||||
RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, // Deprecated.
|
||||
RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, // Deprecated.
|
||||
RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010, // Deprecated.
|
||||
RS_ALLOCATION_USAGE_IO_INPUT = 0x0020, // Allocation is used as a Surface consumer.
|
||||
RS_ALLOCATION_USAGE_IO_OUTPUT = 0x0040, // Allocation is used as a Surface producer.
|
||||
RS_ALLOCATION_USAGE_SHARED = 0x0080 // Allocation's backing store is shared with another object (usually a Bitmap). Copying to or from the original source Bitmap will cause a synchronization rather than a full copy.
|
||||
} rs_allocation_usage_type;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_data_type: Element basic data type
|
||||
*
|
||||
* rs_data_type is used to encode the type information of a basic element.
|
||||
*
|
||||
* RS_TYPE_UNSIGNED_5_6_5, RS_TYPE_UNSIGNED_5_5_5_1, RS_TYPE_UNSIGNED_4_4_4_4 are for packed
|
||||
* graphical data formats and represent vectors with per vector member sizes which are treated
|
||||
* as a single unit for packing and alignment purposes.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
typedef enum {
|
||||
RS_TYPE_NONE = 0, // Element is a complex type, i.e. a struct.
|
||||
RS_TYPE_FLOAT_16 = 1, // A 16 bit floating point value.
|
||||
RS_TYPE_FLOAT_32 = 2, // A 32 bit floating point value.
|
||||
RS_TYPE_FLOAT_64 = 3, // A 64 bit floating point value.
|
||||
RS_TYPE_SIGNED_8 = 4, // An 8 bit signed integer.
|
||||
RS_TYPE_SIGNED_16 = 5, // A 16 bit signed integer.
|
||||
RS_TYPE_SIGNED_32 = 6, // A 32 bit signed integer.
|
||||
RS_TYPE_SIGNED_64 = 7, // A 64 bit signed integer.
|
||||
RS_TYPE_UNSIGNED_8 = 8, // An 8 bit unsigned integer.
|
||||
RS_TYPE_UNSIGNED_16 = 9, // A 16 bit unsigned integer.
|
||||
RS_TYPE_UNSIGNED_32 = 10, // A 32 bit unsigned integer.
|
||||
RS_TYPE_UNSIGNED_64 = 11, // A 64 bit unsigned integer.
|
||||
RS_TYPE_BOOLEAN = 12, // 0 or 1 (false or true) stored in an 8 bit container.
|
||||
RS_TYPE_UNSIGNED_5_6_5 = 13, // A 16 bit unsigned integer packing graphical data in 5, 6, and 5 bit sections.
|
||||
RS_TYPE_UNSIGNED_5_5_5_1 = 14, // A 16 bit unsigned integer packing graphical data in 5, 5, 5, and 1 bit sections.
|
||||
RS_TYPE_UNSIGNED_4_4_4_4 = 15, // A 16 bit unsigned integer packing graphical data in 4, 4, 4, and 4 bit sections.
|
||||
RS_TYPE_MATRIX_4X4 = 16, // A 4x4 matrix of 32 bit floats, aligned on a 32 bit boundary.
|
||||
RS_TYPE_MATRIX_3X3 = 17, // A 3x3 matrix of 32 bit floats, aligned on a 32 bit boundary.
|
||||
RS_TYPE_MATRIX_2X2 = 18, // A 2x2 matrix of 32 bit floats, aligned on a 32 bit boundary.
|
||||
RS_TYPE_ELEMENT = 1000, // A handle to an Element.
|
||||
RS_TYPE_TYPE = 1001, // A handle to a Type.
|
||||
RS_TYPE_ALLOCATION = 1002, // A handle to an Allocation.
|
||||
RS_TYPE_SAMPLER = 1003, // A handle to a Sampler.
|
||||
RS_TYPE_SCRIPT = 1004, // A handle to a Script.
|
||||
RS_TYPE_MESH = 1005, // Deprecated.
|
||||
RS_TYPE_PROGRAM_FRAGMENT = 1006, // Deprecated.
|
||||
RS_TYPE_PROGRAM_VERTEX = 1007, // Deprecated.
|
||||
RS_TYPE_PROGRAM_RASTER = 1008, // Deprecated.
|
||||
RS_TYPE_PROGRAM_STORE = 1009, // Deprecated.
|
||||
RS_TYPE_FONT = 1010, // Deprecated.
|
||||
RS_TYPE_INVALID = 10000
|
||||
} rs_data_type;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_data_kind: Element data kind
|
||||
*
|
||||
* This enumeration is primarly useful for graphical data. It provides additional information to
|
||||
* help interpret the rs_data_type.
|
||||
*
|
||||
* RS_KIND_USER indicates no special interpretation is expected.
|
||||
*
|
||||
* The RS_KIND_PIXEL_* values are used in conjunction with the standard data types for representing
|
||||
* texture formats.
|
||||
*
|
||||
* See the Element.createPixel() method.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
typedef enum {
|
||||
RS_KIND_USER = 0, // No special interpretation.
|
||||
RS_KIND_PIXEL_L = 7, // Luminance.
|
||||
RS_KIND_PIXEL_A = 8, // Alpha.
|
||||
RS_KIND_PIXEL_LA = 9, // Luminance and Alpha.
|
||||
RS_KIND_PIXEL_RGB = 10, // Red, Green, Blue.
|
||||
RS_KIND_PIXEL_RGBA = 11, // Red, Green, Blue, and Alpha.
|
||||
RS_KIND_PIXEL_DEPTH = 12, // Depth for a depth texture.
|
||||
RS_KIND_PIXEL_YUV = 13, // Luminance and chrominance.
|
||||
RS_KIND_INVALID = 100
|
||||
} rs_data_kind;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_yuv_format: YUV format
|
||||
*
|
||||
* Android YUV formats that can be associated with a RenderScript Type.
|
||||
*
|
||||
* See android.graphics.ImageFormat for a description of each format.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
typedef enum {
|
||||
RS_YUV_NONE = 0,
|
||||
RS_YUV_YV12 = 0x32315659,
|
||||
RS_YUV_NV21 = 0x11,
|
||||
RS_YUV_420_888 = 0x23
|
||||
} rs_yuv_format;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_sampler_value: Sampler wrap T value
|
||||
*
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 16))
|
||||
typedef enum {
|
||||
RS_SAMPLER_NEAREST = 0,
|
||||
RS_SAMPLER_LINEAR = 1,
|
||||
RS_SAMPLER_LINEAR_MIP_LINEAR = 2,
|
||||
RS_SAMPLER_WRAP = 3,
|
||||
RS_SAMPLER_CLAMP = 4,
|
||||
RS_SAMPLER_LINEAR_MIP_NEAREST = 5,
|
||||
RS_SAMPLER_MIRRORED_REPEAT = 6,
|
||||
RS_SAMPLER_INVALID = 100
|
||||
} rs_sampler_value;
|
||||
#endif
|
||||
|
||||
#endif // RENDERSCRIPT_RS_OBJECT_TYPES_RSH
|
||||
@@ -0,0 +1,374 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_quaternion.rsh: Quaternion Functions
|
||||
*
|
||||
* The following functions manipulate quaternions.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_QUATERNION_RSH
|
||||
#define RENDERSCRIPT_RS_QUATERNION_RSH
|
||||
|
||||
/*
|
||||
* rsQuaternionAdd: Add two quaternions
|
||||
*
|
||||
* Adds two quaternions, i.e. *q += *rhs;
|
||||
*
|
||||
* Parameters:
|
||||
* q: Destination quaternion to add to.
|
||||
* rhs: Quaternion to add.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs) {
|
||||
q->w += rhs->w;
|
||||
q->x += rhs->x;
|
||||
q->y += rhs->y;
|
||||
q->z += rhs->z;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionConjugate: Conjugate a quaternion
|
||||
*
|
||||
* Conjugates the quaternion.
|
||||
*
|
||||
* Parameters:
|
||||
* q: Quaternion to modify.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionConjugate(rs_quaternion* q) {
|
||||
q->x = -q->x;
|
||||
q->y = -q->y;
|
||||
q->z = -q->z;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionDot: Dot product of two quaternions
|
||||
*
|
||||
* Returns the dot product of two quaternions.
|
||||
*
|
||||
* Parameters:
|
||||
* q0: First quaternion.
|
||||
* q1: Second quaternion.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline float __attribute__((overloadable))
|
||||
rsQuaternionDot(const rs_quaternion* q0, const rs_quaternion* q1) {
|
||||
return q0->w*q1->w + q0->x*q1->x + q0->y*q1->y + q0->z*q1->z;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionGetMatrixUnit: Get a rotation matrix from a quaternion
|
||||
*
|
||||
* Computes a rotation matrix from the normalized quaternion.
|
||||
*
|
||||
* Parameters:
|
||||
* m: Resulting matrix.
|
||||
* q: Normalized quaternion.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q) {
|
||||
float xx = q->x * q->x;
|
||||
float xy = q->x * q->y;
|
||||
float xz = q->x * q->z;
|
||||
float xw = q->x * q->w;
|
||||
float yy = q->y * q->y;
|
||||
float yz = q->y * q->z;
|
||||
float yw = q->y * q->w;
|
||||
float zz = q->z * q->z;
|
||||
float zw = q->z * q->w;
|
||||
|
||||
m->m[0] = 1.0f - 2.0f * ( yy + zz );
|
||||
m->m[4] = 2.0f * ( xy - zw );
|
||||
m->m[8] = 2.0f * ( xz + yw );
|
||||
m->m[1] = 2.0f * ( xy + zw );
|
||||
m->m[5] = 1.0f - 2.0f * ( xx + zz );
|
||||
m->m[9] = 2.0f * ( yz - xw );
|
||||
m->m[2] = 2.0f * ( xz - yw );
|
||||
m->m[6] = 2.0f * ( yz + xw );
|
||||
m->m[10] = 1.0f - 2.0f * ( xx + yy );
|
||||
m->m[3] = m->m[7] = m->m[11] = m->m[12] = m->m[13] = m->m[14] = 0.0f;
|
||||
m->m[15] = 1.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionLoadRotateUnit: Quaternion that represents a rotation about an arbitrary unit vector
|
||||
*
|
||||
* Loads a quaternion that represents a rotation about an arbitrary unit vector.
|
||||
*
|
||||
* Parameters:
|
||||
* q: Destination quaternion.
|
||||
* rot: Angle to rotate by, in radians.
|
||||
* x: X component of the vector.
|
||||
* y: Y component of the vector.
|
||||
* z: Z component of the vector.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z) {
|
||||
rot *= (float)(M_PI / 180.0f) * 0.5f;
|
||||
float c = cos(rot);
|
||||
float s = sin(rot);
|
||||
|
||||
q->w = c;
|
||||
q->x = x * s;
|
||||
q->y = y * s;
|
||||
q->z = z * s;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionSet: Create a quaternion
|
||||
*
|
||||
* Creates a quaternion from its four components or from another quaternion.
|
||||
*
|
||||
* Parameters:
|
||||
* q: Destination quaternion.
|
||||
* w: W component.
|
||||
* x: X component.
|
||||
* y: Y component.
|
||||
* z: Z component.
|
||||
* rhs: Source quaternion.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z) {
|
||||
q->w = w;
|
||||
q->x = x;
|
||||
q->y = y;
|
||||
q->z = z;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs) {
|
||||
q->w = rhs->w;
|
||||
q->x = rhs->x;
|
||||
q->y = rhs->y;
|
||||
q->z = rhs->z;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionLoadRotate: Create a rotation quaternion
|
||||
*
|
||||
* Loads a quaternion that represents a rotation about an arbitrary vector
|
||||
* (doesn't have to be unit)
|
||||
*
|
||||
* Parameters:
|
||||
* q: Destination quaternion.
|
||||
* rot: Angle to rotate by.
|
||||
* x: X component of a vector.
|
||||
* y: Y component of a vector.
|
||||
* z: Z component of a vector.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z) {
|
||||
const float len = x*x + y*y + z*z;
|
||||
if (len != 1) {
|
||||
const float recipLen = 1.f / sqrt(len);
|
||||
x *= recipLen;
|
||||
y *= recipLen;
|
||||
z *= recipLen;
|
||||
}
|
||||
rsQuaternionLoadRotateUnit(q, rot, x, y, z);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionNormalize: Normalize a quaternion
|
||||
*
|
||||
* Normalizes the quaternion.
|
||||
*
|
||||
* Parameters:
|
||||
* q: Quaternion to normalize.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionNormalize(rs_quaternion* q) {
|
||||
const float len = rsQuaternionDot(q, q);
|
||||
if (len != 1) {
|
||||
const float recipLen = 1.f / sqrt(len);
|
||||
q->w *= recipLen;
|
||||
q->x *= recipLen;
|
||||
q->y *= recipLen;
|
||||
q->z *= recipLen;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionMultiply: Multiply a quaternion by a scalar or another quaternion
|
||||
*
|
||||
* Multiplies a quaternion by a scalar or by another quaternion, e.g
|
||||
* *q = *q * scalar; or *q = *q * *rhs;.
|
||||
*
|
||||
* Parameters:
|
||||
* q: Destination quaternion.
|
||||
* scalar: Scalar to multiply the quaternion by.
|
||||
* rhs: Quaternion to multiply the destination quaternion by.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionMultiply(rs_quaternion* q, float scalar) {
|
||||
q->w *= scalar;
|
||||
q->x *= scalar;
|
||||
q->y *= scalar;
|
||||
q->z *= scalar;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs) {
|
||||
rs_quaternion qtmp;
|
||||
rsQuaternionSet(&qtmp, q);
|
||||
|
||||
q->w = qtmp.w*rhs->w - qtmp.x*rhs->x - qtmp.y*rhs->y - qtmp.z*rhs->z;
|
||||
q->x = qtmp.w*rhs->x + qtmp.x*rhs->w + qtmp.y*rhs->z - qtmp.z*rhs->y;
|
||||
q->y = qtmp.w*rhs->y + qtmp.y*rhs->w + qtmp.z*rhs->x - qtmp.x*rhs->z;
|
||||
q->z = qtmp.w*rhs->z + qtmp.z*rhs->w + qtmp.x*rhs->y - qtmp.y*rhs->x;
|
||||
rsQuaternionNormalize(q);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rsQuaternionSlerp: Spherical linear interpolation between two quaternions
|
||||
*
|
||||
* Performs spherical linear interpolation between two quaternions.
|
||||
*
|
||||
* Parameters:
|
||||
* q: Result quaternion from the interpolation.
|
||||
* q0: First input quaternion.
|
||||
* q1: Second input quaternion.
|
||||
* t: How much to interpolate by.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 23)
|
||||
static inline void __attribute__((overloadable))
|
||||
rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t) {
|
||||
if (t <= 0.0f) {
|
||||
rsQuaternionSet(q, q0);
|
||||
return;
|
||||
}
|
||||
if (t >= 1.0f) {
|
||||
rsQuaternionSet(q, q1);
|
||||
return;
|
||||
}
|
||||
|
||||
rs_quaternion tempq0, tempq1;
|
||||
rsQuaternionSet(&tempq0, q0);
|
||||
rsQuaternionSet(&tempq1, q1);
|
||||
|
||||
float angle = rsQuaternionDot(q0, q1);
|
||||
if (angle < 0) {
|
||||
rsQuaternionMultiply(&tempq0, -1.0f);
|
||||
angle *= -1.0f;
|
||||
}
|
||||
|
||||
float scale, invScale;
|
||||
if (angle + 1.0f > 0.05f) {
|
||||
if (1.0f - angle >= 0.05f) {
|
||||
float theta = acos(angle);
|
||||
float invSinTheta = 1.0f / sin(theta);
|
||||
scale = sin(theta * (1.0f - t)) * invSinTheta;
|
||||
invScale = sin(theta * t) * invSinTheta;
|
||||
} else {
|
||||
scale = 1.0f - t;
|
||||
invScale = t;
|
||||
}
|
||||
} else {
|
||||
rsQuaternionSet(&tempq1, tempq0.z, -tempq0.y, tempq0.x, -tempq0.w);
|
||||
scale = sin(M_PI * (0.5f - t));
|
||||
invScale = sin(M_PI * t);
|
||||
}
|
||||
|
||||
rsQuaternionSet(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale,
|
||||
tempq0.y*scale + tempq1.y*invScale, tempq0.z*scale + tempq1.z*invScale);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionConjugate(rs_quaternion* q);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern float __attribute__((overloadable))
|
||||
rsQuaternionDot(const rs_quaternion* q0, const rs_quaternion* q1);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionNormalize(rs_quaternion* q);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionMultiply(rs_quaternion* q, float scalar);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern void __attribute__((overloadable))
|
||||
rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t);
|
||||
#endif
|
||||
|
||||
#endif // RENDERSCRIPT_RS_QUATERNION_RSH
|
||||
126
apk_3234/build-tools/android-13/renderscript/include/rs_time.rsh
Normal file
126
apk_3234/build-tools/android-13/renderscript/include/rs_time.rsh
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_time.rsh: Time Functions and Types
|
||||
*
|
||||
* The functions below can be used to tell the current clock time and the current
|
||||
* system up time. It is not recommended to call these functions inside of a kernel.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_TIME_RSH
|
||||
#define RENDERSCRIPT_RS_TIME_RSH
|
||||
|
||||
/*
|
||||
* rs_time_t: Seconds since January 1, 1970
|
||||
*
|
||||
* Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on
|
||||
* January 1, 1970, Coordinated Universal Time (UTC)).
|
||||
*/
|
||||
#ifndef __LP64__
|
||||
typedef int rs_time_t;
|
||||
#endif
|
||||
|
||||
#ifdef __LP64__
|
||||
typedef long rs_time_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* rs_tm: Date and time structure
|
||||
*
|
||||
* Data structure for broken-down time components.
|
||||
*/
|
||||
typedef struct {
|
||||
int tm_sec; // Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds.
|
||||
int tm_min; // Minutes after the hour. This ranges from 0 to 59.
|
||||
int tm_hour; // Hours past midnight. This ranges from 0 to 23.
|
||||
int tm_mday; // Day of the month. This ranges from 1 to 31.
|
||||
int tm_mon; // Months since January. This ranges from 0 to 11.
|
||||
int tm_year; // Years since 1900.
|
||||
int tm_wday; // Days since Sunday. This ranges from 0 to 6.
|
||||
int tm_yday; // Days since January 1. This ranges from 0 to 365.
|
||||
int 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.
|
||||
} rs_tm;
|
||||
|
||||
/*
|
||||
* rsGetDt: Elapsed time since last call
|
||||
*
|
||||
* Returns the time in seconds since this function was last called in this script.
|
||||
*
|
||||
* Returns: Time in seconds.
|
||||
*/
|
||||
extern float __attribute__((overloadable))
|
||||
rsGetDt(void);
|
||||
|
||||
/*
|
||||
* rsLocaltime: Convert to local time
|
||||
*
|
||||
* Converts the time specified by timer into a rs_tm structure that provides year, month,
|
||||
* hour, etc. This value is stored at *local.
|
||||
*
|
||||
* This functions returns the same pointer that is passed as first argument. If the
|
||||
* local parameter is NULL, this function does nothing and returns NULL.
|
||||
*
|
||||
* Parameters:
|
||||
* local: Pointer to time structure where the local time will be stored.
|
||||
* timer: Input time as a number of seconds since January 1, 1970.
|
||||
*
|
||||
* Returns: Pointer to the output local time, i.e. the same value as the parameter local.
|
||||
*/
|
||||
extern rs_tm* __attribute__((overloadable))
|
||||
rsLocaltime(rs_tm* local, const rs_time_t* timer);
|
||||
|
||||
/*
|
||||
* rsTime: Seconds since January 1, 1970
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Parameters:
|
||||
* timer: Location to also store the returned calendar time.
|
||||
*
|
||||
* Returns: Seconds since the Epoch, -1 if there's an error.
|
||||
*/
|
||||
extern rs_time_t __attribute__((overloadable))
|
||||
rsTime(rs_time_t* timer);
|
||||
|
||||
/*
|
||||
* rsUptimeMillis: System uptime in milliseconds
|
||||
*
|
||||
* Returns the current system clock (uptime) in milliseconds.
|
||||
*
|
||||
* Returns: Uptime in milliseconds.
|
||||
*/
|
||||
extern int64_t __attribute__((overloadable))
|
||||
rsUptimeMillis(void);
|
||||
|
||||
/*
|
||||
* rsUptimeNanos: System uptime in nanoseconds
|
||||
*
|
||||
* Returns the current system clock (uptime) in nanoseconds.
|
||||
*
|
||||
* The granularity of the values return by this call may be much larger than a nanosecond.
|
||||
*
|
||||
* Returns: Uptime in nanoseconds.
|
||||
*/
|
||||
extern int64_t __attribute__((overloadable))
|
||||
rsUptimeNanos(void);
|
||||
|
||||
#endif // RENDERSCRIPT_RS_TIME_RSH
|
||||
@@ -0,0 +1,543 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_value_types.rsh: Numerical Types
|
||||
*
|
||||
* Scalars:
|
||||
*
|
||||
* RenderScript supports the following scalar numerical types:
|
||||
*
|
||||
* 8 bits 16 bits 32 bits 64 bits
|
||||
* Integer: char, int8_t short, int16_t int32_t long, long long, int64_t
|
||||
* Unsigned integer: uchar, uint8_t ushort, uint16_t uint, uint32_t ulong, uint64_t
|
||||
* Floating point: half float double
|
||||
*
|
||||
*
|
||||
* Vectors:
|
||||
*
|
||||
* RenderScript supports fixed size vectors of length 2, 3, and 4.
|
||||
* Vectors are declared using the common type name followed by a 2, 3, or 4.
|
||||
* E.g. float4, int3, double2, ulong4.
|
||||
*
|
||||
* To create vector literals, use the vector type followed by the values enclosed
|
||||
* between curly braces, e.g. (float3){1.0f, 2.0f, 3.0f}.
|
||||
*
|
||||
* Entries of a vector can be accessed using different naming styles.
|
||||
*
|
||||
* Single entries can be accessed by following the variable name with a dot and:
|
||||
* - The letters x, y, z, and w,
|
||||
* - The letters r, g, b, and a,
|
||||
* - The letter s or S, followed by a zero based index.
|
||||
*
|
||||
* For example, with int4 myVar; the following are equivalent:
|
||||
* myVar.x == myVar.r == myVar.s0 == myVar.S0
|
||||
* myVar.y == myVar.g == myVar.s1 == myVar.S1
|
||||
* myVar.z == myVar.b == myVar.s2 == myVar.S2
|
||||
* myVar.w == myVar.a == myVar.s3 == myVar.S3
|
||||
*
|
||||
* Multiple entries of a vector can be accessed at once by using an identifier that is
|
||||
* the concatenation of multiple letters or indices. The resulting vector has a size
|
||||
* equal to the number of entries named.
|
||||
*
|
||||
* With the example above, the middle two entries can be accessed using
|
||||
* myVar.yz, myVar.gb, myVar.s12, and myVar.S12.
|
||||
*
|
||||
* The entries don't have to be contiguous or in increasing order. Entries can even be
|
||||
* repeated, as long as we're not trying to assign to it. You also can't mix the naming
|
||||
* styles.
|
||||
*
|
||||
* Here are examples of what can or can't be done:
|
||||
* float4 v4;
|
||||
* float3 v3;
|
||||
* float2 v2;
|
||||
* v2 = v4.xx; // Valid
|
||||
* v3 = v4.zxw; // Valid
|
||||
* v3 = v4.bba; // Valid
|
||||
* v3 = v4.s032; // Valid
|
||||
* v3.s120 = v4.S233; // Valid
|
||||
* v4.yz = v3.rg; // Valid
|
||||
* v4.yzx = v3.rg; // Invalid: mismatched sizes
|
||||
* v4.yzz = v3; // Invalid: z appears twice in an assignment
|
||||
* v3 = v3.xas0; // Invalid: can't mix xyzw with rgba nor s0...
|
||||
* v3 = v4.s034; // Invalid: the digit can only be 0, 1, 2, or 3
|
||||
*
|
||||
*
|
||||
* Matrices and Quaternions:
|
||||
*
|
||||
* RenderScript supports fixed size square matrices of floats of size 2x2, 3x3, and 4x4.
|
||||
* The types are named rs_matrix2x2, rs_matrix3x3, and rs_matrix4x4. See
|
||||
* Matrix Functions for the list of operations.
|
||||
*
|
||||
* Quaternions are also supported via rs_quaternion. See Quaterion Functions for the list
|
||||
* of operations.
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_VALUE_TYPES_RSH
|
||||
#define RENDERSCRIPT_RS_VALUE_TYPES_RSH
|
||||
|
||||
/*
|
||||
* half: 16 bit floating point value
|
||||
*
|
||||
* A 16 bit floating point value.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
typedef __fp16 half;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* half2: Two 16 bit floats
|
||||
*
|
||||
* Vector version of the half float type. Provides two half fields packed
|
||||
* into a single 32 bit field with 32 bit alignment.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
typedef half __attribute__((ext_vector_type(2))) half2;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* half3: Three 16 bit floats
|
||||
*
|
||||
* Vector version of the half float type. Provides three half fields packed
|
||||
* into a single 64 bit field with 64 bit alignment.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
typedef half __attribute__((ext_vector_type(3))) half3;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* half4: Four 16 bit floats
|
||||
*
|
||||
* Vector version of the half float type. Provides four half fields packed
|
||||
* into a single 64 bit field with 64 bit alignment.
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 23))
|
||||
typedef half __attribute__((ext_vector_type(4))) half4;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* int8_t: 8 bit signed integer
|
||||
*
|
||||
* 8 bit signed integer type.
|
||||
*/
|
||||
typedef char int8_t;
|
||||
|
||||
/*
|
||||
* int16_t: 16 bit signed integer
|
||||
*
|
||||
* A 16 bit signed integer type.
|
||||
*/
|
||||
typedef short int16_t;
|
||||
|
||||
/*
|
||||
* int32_t: 32 bit signed integer
|
||||
*
|
||||
* A 32 bit signed integer type.
|
||||
*/
|
||||
typedef int int32_t;
|
||||
|
||||
/*
|
||||
* int64_t: 64 bit signed integer
|
||||
*
|
||||
* A 64 bit signed integer type.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 20)
|
||||
typedef long long int64_t;
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
typedef long int64_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* uint8_t: 8 bit unsigned integer
|
||||
*
|
||||
* 8 bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned char uint8_t;
|
||||
|
||||
/*
|
||||
* uint16_t: 16 bit unsigned integer
|
||||
*
|
||||
* A 16 bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned short uint16_t;
|
||||
|
||||
/*
|
||||
* uint32_t: 32 bit unsigned integer
|
||||
*
|
||||
* A 32 bit unsigned integer type.
|
||||
*/
|
||||
typedef unsigned int uint32_t;
|
||||
|
||||
/*
|
||||
* uint64_t: 64 bit unsigned integer
|
||||
*
|
||||
* A 64 bit unsigned integer type.
|
||||
*/
|
||||
#if !defined(RS_VERSION) || (RS_VERSION <= 20)
|
||||
typedef unsigned long long uint64_t;
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
typedef unsigned long uint64_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* uchar: 8 bit unsigned integer
|
||||
*
|
||||
* 8 bit unsigned integer type.
|
||||
*/
|
||||
typedef uint8_t uchar;
|
||||
|
||||
/*
|
||||
* ushort: 16 bit unsigned integer
|
||||
*
|
||||
* A 16 bit unsigned integer type.
|
||||
*/
|
||||
typedef uint16_t ushort;
|
||||
|
||||
/*
|
||||
* uint: 32 bit unsigned integer
|
||||
*
|
||||
* A 32 bit unsigned integer type.
|
||||
*/
|
||||
typedef uint32_t uint;
|
||||
|
||||
/*
|
||||
* ulong: 64 bit unsigned integer
|
||||
*
|
||||
* A 64 bit unsigned integer type.
|
||||
*/
|
||||
typedef uint64_t ulong;
|
||||
|
||||
/*
|
||||
* size_t: Unsigned size type
|
||||
*
|
||||
* Unsigned size type. The number of bits depend on the compilation flags.
|
||||
*/
|
||||
#ifdef __LP64__
|
||||
typedef uint64_t size_t;
|
||||
#endif
|
||||
|
||||
#ifndef __LP64__
|
||||
typedef uint32_t size_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ssize_t: Signed size type
|
||||
*
|
||||
* Signed size type. The number of bits depend on the compilation flags.
|
||||
*/
|
||||
#ifdef __LP64__
|
||||
typedef int64_t ssize_t;
|
||||
#endif
|
||||
|
||||
#ifndef __LP64__
|
||||
typedef int32_t ssize_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* float2: Two 32 bit floats
|
||||
*
|
||||
* A vector of two floats. These two floats are packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*
|
||||
* A vector of two floats. These two floats are packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef float __attribute__((ext_vector_type(2))) float2;
|
||||
|
||||
/*
|
||||
* float3: Three 32 bit floats
|
||||
*
|
||||
* A vector of three floats. These three floats are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef float __attribute__((ext_vector_type(3))) float3;
|
||||
|
||||
/*
|
||||
* float4: Four 32 bit floats
|
||||
*
|
||||
* A vector of four floats type. These four floats are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef float __attribute__((ext_vector_type(4))) float4;
|
||||
|
||||
/*
|
||||
* double2: Two 64 bit floats
|
||||
*
|
||||
* A vector of two doubles. These two double fields packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef double __attribute__((ext_vector_type(2))) double2;
|
||||
|
||||
/*
|
||||
* double3: Three 64 bit floats
|
||||
*
|
||||
* A vector of three doubles. These three double fields packed into a single 256 bit field
|
||||
* with a 256 bit alignment.
|
||||
*/
|
||||
typedef double __attribute__((ext_vector_type(3))) double3;
|
||||
|
||||
/*
|
||||
* double4: Four 64 bit floats
|
||||
*
|
||||
* A vector of four doubles. These four double fields packed into a single 256 bit field
|
||||
* with a 256 bit alignment.
|
||||
*/
|
||||
typedef double __attribute__((ext_vector_type(4))) double4;
|
||||
|
||||
/*
|
||||
* uchar2: Two 8 bit unsigned integers
|
||||
*
|
||||
* A vector of two uchars. These two uchar fields packed into a single 16 bit field
|
||||
* with a 16 bit alignment.
|
||||
*/
|
||||
typedef uchar __attribute__((ext_vector_type(2))) uchar2;
|
||||
|
||||
/*
|
||||
* uchar3: Three 8 bit unsigned integers
|
||||
*
|
||||
* A vector of three uchars. These three uchar fields packed into a single 32 bit field
|
||||
* with a 32 bit alignment.
|
||||
*/
|
||||
typedef uchar __attribute__((ext_vector_type(3))) uchar3;
|
||||
|
||||
/*
|
||||
* uchar4: Four 8 bit unsigned integers
|
||||
*
|
||||
* A vector of four uchars. These four uchar fields packed into a single 32 bit field
|
||||
* with a 32 bit alignment.
|
||||
*/
|
||||
typedef uchar __attribute__((ext_vector_type(4))) uchar4;
|
||||
|
||||
/*
|
||||
* ushort2: Two 16 bit unsigned integers
|
||||
*
|
||||
* A vector of two ushorts. These two ushort fields packed into a single 32 bit field
|
||||
* with a 32 bit alignment.
|
||||
*/
|
||||
typedef ushort __attribute__((ext_vector_type(2))) ushort2;
|
||||
|
||||
/*
|
||||
* ushort3: Three 16 bit unsigned integers
|
||||
*
|
||||
* A vector of three ushorts. These three ushort fields packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef ushort __attribute__((ext_vector_type(3))) ushort3;
|
||||
|
||||
/*
|
||||
* ushort4: Four 16 bit unsigned integers
|
||||
*
|
||||
* A vector of four ushorts. These four ushort fields packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef ushort __attribute__((ext_vector_type(4))) ushort4;
|
||||
|
||||
/*
|
||||
* uint2: Two 32 bit unsigned integers
|
||||
*
|
||||
* A vector of two uints. These two uints are packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef uint __attribute__((ext_vector_type(2))) uint2;
|
||||
|
||||
/*
|
||||
* uint3: Three 32 bit unsigned integers
|
||||
*
|
||||
* A vector of three uints. These three uints are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef uint __attribute__((ext_vector_type(3))) uint3;
|
||||
|
||||
/*
|
||||
* uint4: Four 32 bit unsigned integers
|
||||
*
|
||||
* A vector of four uints. These four uints are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef uint __attribute__((ext_vector_type(4))) uint4;
|
||||
|
||||
/*
|
||||
* ulong2: Two 64 bit unsigned integers
|
||||
*
|
||||
* A vector of two ulongs. These two ulongs are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef ulong __attribute__((ext_vector_type(2))) ulong2;
|
||||
|
||||
/*
|
||||
* ulong3: Three 64 bit unsigned integers
|
||||
*
|
||||
* A vector of three ulongs. These three ulong fields packed into a single 256 bit field
|
||||
* with a 256 bit alignment.
|
||||
*/
|
||||
typedef ulong __attribute__((ext_vector_type(3))) ulong3;
|
||||
|
||||
/*
|
||||
* ulong4: Four 64 bit unsigned integers
|
||||
*
|
||||
* A vector of four ulongs. These four ulong fields packed into a single 256 bit field
|
||||
* with a 256 bit alignment.
|
||||
*/
|
||||
typedef ulong __attribute__((ext_vector_type(4))) ulong4;
|
||||
|
||||
/*
|
||||
* char2: Two 8 bit signed integers
|
||||
*
|
||||
* A vector of two chars. These two chars are packed into a single 16 bit field
|
||||
* with a 16 bit alignment.
|
||||
*/
|
||||
typedef char __attribute__((ext_vector_type(2))) char2;
|
||||
|
||||
/*
|
||||
* char3: Three 8 bit signed integers
|
||||
*
|
||||
* A vector of three chars. These three chars are packed into a single 32 bit field
|
||||
* with a 32 bit alignment.
|
||||
*/
|
||||
typedef char __attribute__((ext_vector_type(3))) char3;
|
||||
|
||||
/*
|
||||
* char4: Four 8 bit signed integers
|
||||
*
|
||||
* A vector of four chars. These four chars are packed into a single 32 bit field
|
||||
* with a 32 bit alignment.
|
||||
*/
|
||||
typedef char __attribute__((ext_vector_type(4))) char4;
|
||||
|
||||
/*
|
||||
* short2: Two 16 bit signed integers
|
||||
*
|
||||
* A vector of two shorts. These two shorts are packed into a single 32 bit field
|
||||
* with a 32 bit alignment.
|
||||
*/
|
||||
typedef short __attribute__((ext_vector_type(2))) short2;
|
||||
|
||||
/*
|
||||
* short3: Three 16 bit signed integers
|
||||
*
|
||||
* A vector of three shorts. These three short fields packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef short __attribute__((ext_vector_type(3))) short3;
|
||||
|
||||
/*
|
||||
* short4: Four 16 bit signed integers
|
||||
*
|
||||
* A vector of four shorts. These four short fields packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef short __attribute__((ext_vector_type(4))) short4;
|
||||
|
||||
/*
|
||||
* int2: Two 32 bit signed integers
|
||||
*
|
||||
* A vector of two ints. These two ints are packed into a single 64 bit field
|
||||
* with a 64 bit alignment.
|
||||
*/
|
||||
typedef int __attribute__((ext_vector_type(2))) int2;
|
||||
|
||||
/*
|
||||
* int3: Three 32 bit signed integers
|
||||
*
|
||||
* A vector of three ints. These three ints are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef int __attribute__((ext_vector_type(3))) int3;
|
||||
|
||||
/*
|
||||
* int4: Four 32 bit signed integers
|
||||
*
|
||||
* A vector of four ints. These two fours are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef int __attribute__((ext_vector_type(4))) int4;
|
||||
|
||||
/*
|
||||
* long2: Two 64 bit signed integers
|
||||
*
|
||||
* A vector of two longs. These two longs are packed into a single 128 bit field
|
||||
* with a 128 bit alignment.
|
||||
*/
|
||||
typedef long __attribute__((ext_vector_type(2))) long2;
|
||||
|
||||
/*
|
||||
* long3: Three 64 bit signed integers
|
||||
*
|
||||
* A vector of three longs. These three longs are packed into a single 256 bit field
|
||||
* with a 256 bit alignment.
|
||||
*/
|
||||
typedef long __attribute__((ext_vector_type(3))) long3;
|
||||
|
||||
/*
|
||||
* long4: Four 64 bit signed integers
|
||||
*
|
||||
* A vector of four longs. These four longs are packed into a single 256 bit field
|
||||
* with a 256 bit alignment.
|
||||
*/
|
||||
typedef long __attribute__((ext_vector_type(4))) long4;
|
||||
|
||||
/*
|
||||
* rs_matrix2x2: 2x2 matrix of 32 bit floats
|
||||
*
|
||||
* A square 2x2 matrix of floats. The entries are stored in the array at the
|
||||
* location [row*2 + col].
|
||||
*
|
||||
* See Matrix Functions.
|
||||
*/
|
||||
typedef struct {
|
||||
float m[4];
|
||||
} rs_matrix2x2;
|
||||
|
||||
/*
|
||||
* rs_matrix3x3: 3x3 matrix of 32 bit floats
|
||||
*
|
||||
* A square 3x3 matrix of floats. The entries are stored in the array at the
|
||||
* location [row*3 + col].
|
||||
*
|
||||
* See Matrix Functions.
|
||||
*/
|
||||
typedef struct {
|
||||
float m[9];
|
||||
} rs_matrix3x3;
|
||||
|
||||
/*
|
||||
* rs_matrix4x4: 4x4 matrix of 32 bit floats
|
||||
*
|
||||
* A square 4x4 matrix of floats. The entries are stored in the array at the
|
||||
* location [row*4 + col].
|
||||
*
|
||||
* See Matrix Functions.
|
||||
*/
|
||||
typedef struct {
|
||||
float m[16];
|
||||
} rs_matrix4x4;
|
||||
|
||||
/*
|
||||
* rs_quaternion: Quaternion
|
||||
*
|
||||
* A square 4x4 matrix of floats that represents a quaternion.
|
||||
*
|
||||
* See Quaternion Functions.
|
||||
*/
|
||||
typedef float4 rs_quaternion;
|
||||
|
||||
#endif // RENDERSCRIPT_RS_VALUE_TYPES_RSH
|
||||
@@ -0,0 +1,453 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
||||
|
||||
/*
|
||||
* rs_vector_math.rsh: Vector Math Functions
|
||||
*
|
||||
* These functions interpret the input arguments as representation of vectors in
|
||||
* n-dimensional space.
|
||||
*
|
||||
* The precision of the mathematical operations on 32 bit floats is affected by the pragmas
|
||||
* rs_fp_relaxed and rs_fp_full. See Mathematical Constants and Functions for details.
|
||||
*
|
||||
* Different precision/speed tradeoffs can be achieved by using variants of the common math
|
||||
* functions. Functions with a name starting with
|
||||
* - native_: May have custom hardware implementations with weaker precision. Additionally,
|
||||
* subnormal values may be flushed to zero, rounding towards zero may be used, and NaN and
|
||||
* infinity input may not be handled correctly.
|
||||
* - fast_: May perform internal computations using 16 bit floats. Additionally, subnormal
|
||||
* values may be flushed to zero, and rounding towards zero may be used.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef RENDERSCRIPT_RS_VECTOR_MATH_RSH
|
||||
#define RENDERSCRIPT_RS_VECTOR_MATH_RSH
|
||||
|
||||
/*
|
||||
* cross: Cross product of two vectors
|
||||
*
|
||||
* Computes the cross product of two vectors.
|
||||
*/
|
||||
extern float3 __attribute__((const, overloadable))
|
||||
cross(float3 left_vector, float3 right_vector);
|
||||
|
||||
extern float4 __attribute__((const, overloadable))
|
||||
cross(float4 left_vector, float4 right_vector);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half3 __attribute__((const, overloadable))
|
||||
cross(half3 left_vector, half3 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half4 __attribute__((const, overloadable))
|
||||
cross(half4 left_vector, half4 right_vector);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* distance: Distance between two points
|
||||
*
|
||||
* Compute the distance between two points.
|
||||
*
|
||||
* See also fast_distance(), native_distance().
|
||||
*/
|
||||
extern float __attribute__((const, overloadable))
|
||||
distance(float left_vector, float right_vector);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
distance(float2 left_vector, float2 right_vector);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
distance(float3 left_vector, float3 right_vector);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
distance(float4 left_vector, float4 right_vector);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
distance(half left_vector, half right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
distance(half2 left_vector, half2 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
distance(half3 left_vector, half3 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
distance(half4 left_vector, half4 right_vector);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* dot: Dot product of two vectors
|
||||
*
|
||||
* Computes the dot product of two vectors.
|
||||
*/
|
||||
extern float __attribute__((const, overloadable))
|
||||
dot(float left_vector, float right_vector);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
dot(float2 left_vector, float2 right_vector);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
dot(float3 left_vector, float3 right_vector);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
dot(float4 left_vector, float4 right_vector);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
dot(half left_vector, half right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
dot(half2 left_vector, half2 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
dot(half3 left_vector, half3 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
dot(half4 left_vector, half4 right_vector);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* fast_distance: Approximate distance between two points
|
||||
*
|
||||
* Computes the approximate distance between two points.
|
||||
*
|
||||
* The precision is what would be expected from doing the computation using 16 bit floating
|
||||
* point values.
|
||||
*
|
||||
* See also distance(), native_distance().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_distance(float left_vector, float right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_distance(float2 left_vector, float2 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_distance(float3 left_vector, float3 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_distance(float4 left_vector, float4 right_vector);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* fast_length: Approximate length of a vector
|
||||
*
|
||||
* Computes the approximate length of a vector.
|
||||
*
|
||||
* The precision is what would be expected from doing the computation using 16 bit floating
|
||||
* point values.
|
||||
*
|
||||
* See also length(), native_length().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_length(float v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_length(float2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_length(float3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_length(float4 v);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* fast_normalize: Approximate normalized vector
|
||||
*
|
||||
* Approximately normalizes a vector.
|
||||
*
|
||||
* For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for
|
||||
* positive values.
|
||||
*
|
||||
* The precision is what would be expected from doing the computation using 16 bit floating
|
||||
* point values.
|
||||
*
|
||||
* See also normalize(), native_normalize().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float __attribute__((const, overloadable))
|
||||
fast_normalize(float v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float2 __attribute__((const, overloadable))
|
||||
fast_normalize(float2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float3 __attribute__((const, overloadable))
|
||||
fast_normalize(float3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 17))
|
||||
extern float4 __attribute__((const, overloadable))
|
||||
fast_normalize(float4 v);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* length: Length of a vector
|
||||
*
|
||||
* Computes the length of a vector.
|
||||
*
|
||||
* See also fast_length(), native_length().
|
||||
*/
|
||||
extern float __attribute__((const, overloadable))
|
||||
length(float v);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
length(float2 v);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
length(float3 v);
|
||||
|
||||
extern float __attribute__((const, overloadable))
|
||||
length(float4 v);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
length(half v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
length(half2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
length(half3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
length(half4 v);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* native_distance: Approximate distance between two points
|
||||
*
|
||||
* Computes the approximate distance between two points.
|
||||
*
|
||||
* See also distance(), fast_distance().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_distance(float left_vector, float right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_distance(float2 left_vector, float2 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_distance(float3 left_vector, float3 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_distance(float4 left_vector, float4 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_distance(half left_vector, half right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_distance(half2 left_vector, half2 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_distance(half3 left_vector, half3 right_vector);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_distance(half4 left_vector, half4 right_vector);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* native_length: Approximate length of a vector
|
||||
*
|
||||
* Compute the approximate length of a vector.
|
||||
*
|
||||
* See also length(), fast_length().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_length(float v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_length(float2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_length(float3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_length(float4 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_length(half v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_length(half2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_length(half3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_length(half4 v);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* native_normalize: Approximately normalize a vector
|
||||
*
|
||||
* Approximately normalizes a vector.
|
||||
*
|
||||
* See also normalize(), fast_normalize().
|
||||
*/
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float __attribute__((const, overloadable))
|
||||
native_normalize(float v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float2 __attribute__((const, overloadable))
|
||||
native_normalize(float2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float3 __attribute__((const, overloadable))
|
||||
native_normalize(float3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 21))
|
||||
extern float4 __attribute__((const, overloadable))
|
||||
native_normalize(float4 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
native_normalize(half v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half2 __attribute__((const, overloadable))
|
||||
native_normalize(half2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half3 __attribute__((const, overloadable))
|
||||
native_normalize(half3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half4 __attribute__((const, overloadable))
|
||||
native_normalize(half4 v);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* normalize: Normalize a vector
|
||||
*
|
||||
* Normalize a vector.
|
||||
*
|
||||
* For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for
|
||||
* positive values.
|
||||
*
|
||||
* See also fast_normalize(), native_normalize().
|
||||
*/
|
||||
extern float __attribute__((const, overloadable))
|
||||
normalize(float v);
|
||||
|
||||
extern float2 __attribute__((const, overloadable))
|
||||
normalize(float2 v);
|
||||
|
||||
extern float3 __attribute__((const, overloadable))
|
||||
normalize(float3 v);
|
||||
|
||||
extern float4 __attribute__((const, overloadable))
|
||||
normalize(float4 v);
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half __attribute__((const, overloadable))
|
||||
normalize(half v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half2 __attribute__((const, overloadable))
|
||||
normalize(half2 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half3 __attribute__((const, overloadable))
|
||||
normalize(half3 v);
|
||||
#endif
|
||||
|
||||
#if (defined(RS_VERSION) && (RS_VERSION >= 24))
|
||||
extern half4 __attribute__((const, overloadable))
|
||||
normalize(half4 v);
|
||||
#endif
|
||||
|
||||
#endif // RENDERSCRIPT_RS_VECTOR_MATH_RSH
|
||||
Reference in New Issue
Block a user