summaryrefslogtreecommitdiff
path: root/23.0.3/include
diff options
context:
space:
mode:
Diffstat (limited to '23.0.3/include')
-rw-r--r--23.0.3/include/rs_allocation_data.rsh3357
-rw-r--r--23.0.3/include/rs_atomic.rsh257
-rw-r--r--23.0.3/include/rs_convert.rsh1308
-rw-r--r--23.0.3/include/rs_core.rsh60
-rw-r--r--23.0.3/include/rs_debug.rsh249
-rw-r--r--23.0.3/include/rs_for_each.rsh384
-rw-r--r--23.0.3/include/rs_graphics.rsh1522
-rw-r--r--23.0.3/include/rs_io.rsh99
-rw-r--r--23.0.3/include/rs_math.rsh4177
-rw-r--r--23.0.3/include/rs_matrix.rsh596
-rw-r--r--23.0.3/include/rs_object_info.rsh462
-rw-r--r--23.0.3/include/rs_object_types.rsh215
-rw-r--r--23.0.3/include/rs_quaternion.rsh290
-rw-r--r--23.0.3/include/rs_time.rsh126
-rw-r--r--23.0.3/include/rs_value_types.rsh543
-rw-r--r--23.0.3/include/rs_vector_math.rsh303
16 files changed, 13948 insertions, 0 deletions
diff --git a/23.0.3/include/rs_allocation_data.rsh b/23.0.3/include/rs_allocation_data.rsh
new file mode 100644
index 0000000..69e9baf
--- /dev/null
+++ b/23.0.3/include/rs_allocation_data.rsh
@@ -0,0 +1,3357 @@
+/*
+ * Copyright (C) 2015 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_allocation_data.rsh: Allocation Data Access Functions
+ *
+ * The functions below can be used to get and set the cells that comprise
+ * an allocation.
+ *
+ * - Individual cells are accessed using the rsGetElementAt* and
+ * rsSetElementAt functions.
+ * - Multiple cells can be copied using the rsAllocationCopy* and
+ * rsAllocationV* functions.
+ * - For getting values through a sampler, use rsSample.
+ *
+ * The rsGetElementAt and rsSetElement* functions are somewhat misnamed.
+ * They don't get or set elements, which are akin to data types; they get
+ * or set cells. Think of them as rsGetCellAt and and rsSetCellAt.
+ */
+
+#ifndef RENDERSCRIPT_RS_ALLOCATION_DATA_RSH
+#define RENDERSCRIPT_RS_ALLOCATION_DATA_RSH
+
+/*
+ * rsAllocationCopy1DRange: Copy consecutive cells between allocations
+ *
+ * Copies the specified number of cells from one allocation to another.
+ *
+ * The two allocations must be different. Using this function to copy whithin
+ * the same allocation yields undefined results.
+ *
+ * The function does not validate whether the offset plus count exceeds the size
+ * of either allocation. Be careful!
+ *
+ * This function should only be called between 1D allocations. Calling it
+ * on other allocations is undefined.
+ *
+ * Parameters:
+ * dstAlloc: Allocation to copy cells into.
+ * dstOff: Offset in the destination of the first cell to be copied into.
+ * dstMip: Mip level in the destination allocation. 0 if mip mapping is not used.
+ * count: Number of cells to be copied.
+ * srcAlloc: Source allocation.
+ * srcOff: Offset in the source of the first cell to be copied.
+ * srcMip: Mip level in the source allocation. 0 if mip mapping is not used.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+extern void __attribute__((overloadable))
+ rsAllocationCopy1DRange(rs_allocation dstAlloc, uint32_t dstOff, uint32_t dstMip, uint32_t count,
+ rs_allocation srcAlloc, uint32_t srcOff, uint32_t srcMip);
+#endif
+
+/*
+ * rsAllocationCopy2DRange: Copy a rectangular region of cells between allocations
+ *
+ * Copies a rectangular region of cells from one allocation to another.
+ * (width * heigth) cells are copied.
+ *
+ * The two allocations must be different. Using this function to copy whithin
+ * the same allocation yields undefined results.
+ *
+ * The function does not validate whether the the source or destination region
+ * exceeds the size of its respective allocation. Be careful!
+ *
+ * This function should only be called between 2D allocations. Calling it
+ * on other allocations is undefined.
+ *
+ * Parameters:
+ * dstAlloc: Allocation to copy cells into.
+ * dstXoff: X offset in the destination of the region to be set.
+ * dstYoff: Y offset in the destination of the region to be set.
+ * dstMip: Mip level in the destination allocation. 0 if mip mapping is not used.
+ * dstFace: Cubemap face of the destination allocation. Ignored for allocations that aren't cubemaps.
+ * width: Width of the incoming region to update.
+ * height: Height of the incoming region to update.
+ * srcAlloc: Source allocation.
+ * srcXoff: X offset in the source.
+ * srcYoff: Y offset in the source.
+ * srcMip: Mip level in the source allocation. 0 if mip mapping is not used.
+ * srcFace: Cubemap face of the source allocation. Ignored for allocations that aren't cubemaps.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+extern void __attribute__((overloadable))
+ rsAllocationCopy2DRange(rs_allocation dstAlloc, uint32_t dstXoff, uint32_t dstYoff,
+ uint32_t dstMip, rs_allocation_cubemap_face dstFace, uint32_t width,
+ uint32_t height, rs_allocation srcAlloc, uint32_t srcXoff,
+ uint32_t srcYoff, uint32_t srcMip, rs_allocation_cubemap_face srcFace);
+#endif
+
+/*
+ * rsAllocationVLoadX: Get a vector from an allocation of scalars
+ *
+ * This function returns a vector composed of successive cells of the allocation.
+ * It assumes that the allocation contains scalars.
+ *
+ * The "X" in the name indicates that successive values are extracted by
+ * increasing the X index. There are currently no functions to get successive
+ * values incrementing other dimensions. Use multiple calls to rsGetElementAt()
+ * instead.
+ *
+ * For example, when calling rsAllocationVLoadX_int4(a, 20, 30), an int4 composed
+ * of a[20, 30], a[21, 30], a[22, 30], and a[23, 30] is returned.
+ *
+ * When retrieving from a three dimensional allocations, use the x, y, z variant.
+ * Similarly, use the x, y variant for two dimensional allocations and x for the
+ * mono dimensional allocations.
+ *
+ * For efficiency, this function does not validate the inputs. Trying to wrap
+ * the X index, exceeding the size of the allocation, or using indices incompatible
+ * with the dimensionality of the allocation yields undefined results.
+ *
+ * See also rsAllocationVStoreX().
+ *
+ * Parameters:
+ * a: Allocation to get the data from.
+ * x: X offset in the allocation of the first cell to be copied from.
+ * y: Y offset in the allocation of the first cell to be copied from.
+ * z: Z offset in the allocation of the first cell to be copied from.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float2 __attribute__((overloadable))
+ rsAllocationVLoadX_float2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float3 __attribute__((overloadable))
+ rsAllocationVLoadX_float3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float4 __attribute__((overloadable))
+ rsAllocationVLoadX_float4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double2 __attribute__((overloadable))
+ rsAllocationVLoadX_double2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double3 __attribute__((overloadable))
+ rsAllocationVLoadX_double3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double4 __attribute__((overloadable))
+ rsAllocationVLoadX_double4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char2 __attribute__((overloadable))
+ rsAllocationVLoadX_char2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char3 __attribute__((overloadable))
+ rsAllocationVLoadX_char3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char4 __attribute__((overloadable))
+ rsAllocationVLoadX_char4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar2 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar3 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar4 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short2 __attribute__((overloadable))
+ rsAllocationVLoadX_short2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short3 __attribute__((overloadable))
+ rsAllocationVLoadX_short3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short4 __attribute__((overloadable))
+ rsAllocationVLoadX_short4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort2 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort3 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort4 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int2 __attribute__((overloadable))
+ rsAllocationVLoadX_int2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int3 __attribute__((overloadable))
+ rsAllocationVLoadX_int3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int4 __attribute__((overloadable))
+ rsAllocationVLoadX_int4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint2 __attribute__((overloadable))
+ rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint3 __attribute__((overloadable))
+ rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint4 __attribute__((overloadable))
+ rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long2 __attribute__((overloadable))
+ rsAllocationVLoadX_long2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long3 __attribute__((overloadable))
+ rsAllocationVLoadX_long3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long4 __attribute__((overloadable))
+ rsAllocationVLoadX_long4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong2 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong3 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong4 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float2 __attribute__((overloadable))
+ rsAllocationVLoadX_float2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float3 __attribute__((overloadable))
+ rsAllocationVLoadX_float3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float4 __attribute__((overloadable))
+ rsAllocationVLoadX_float4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double2 __attribute__((overloadable))
+ rsAllocationVLoadX_double2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double3 __attribute__((overloadable))
+ rsAllocationVLoadX_double3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double4 __attribute__((overloadable))
+ rsAllocationVLoadX_double4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char2 __attribute__((overloadable))
+ rsAllocationVLoadX_char2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char3 __attribute__((overloadable))
+ rsAllocationVLoadX_char3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char4 __attribute__((overloadable))
+ rsAllocationVLoadX_char4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar2 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar3 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar4 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short2 __attribute__((overloadable))
+ rsAllocationVLoadX_short2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short3 __attribute__((overloadable))
+ rsAllocationVLoadX_short3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short4 __attribute__((overloadable))
+ rsAllocationVLoadX_short4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort2 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort3 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort4 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int2 __attribute__((overloadable))
+ rsAllocationVLoadX_int2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int3 __attribute__((overloadable))
+ rsAllocationVLoadX_int3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int4 __attribute__((overloadable))
+ rsAllocationVLoadX_int4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint2 __attribute__((overloadable))
+ rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint3 __attribute__((overloadable))
+ rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint4 __attribute__((overloadable))
+ rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long2 __attribute__((overloadable))
+ rsAllocationVLoadX_long2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long3 __attribute__((overloadable))
+ rsAllocationVLoadX_long3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long4 __attribute__((overloadable))
+ rsAllocationVLoadX_long4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong2 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong3 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong4 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float2 __attribute__((overloadable))
+ rsAllocationVLoadX_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float3 __attribute__((overloadable))
+ rsAllocationVLoadX_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern float4 __attribute__((overloadable))
+ rsAllocationVLoadX_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double2 __attribute__((overloadable))
+ rsAllocationVLoadX_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double3 __attribute__((overloadable))
+ rsAllocationVLoadX_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern double4 __attribute__((overloadable))
+ rsAllocationVLoadX_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char2 __attribute__((overloadable))
+ rsAllocationVLoadX_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char3 __attribute__((overloadable))
+ rsAllocationVLoadX_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern char4 __attribute__((overloadable))
+ rsAllocationVLoadX_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar2 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar3 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uchar4 __attribute__((overloadable))
+ rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short2 __attribute__((overloadable))
+ rsAllocationVLoadX_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short3 __attribute__((overloadable))
+ rsAllocationVLoadX_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern short4 __attribute__((overloadable))
+ rsAllocationVLoadX_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort2 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort3 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ushort4 __attribute__((overloadable))
+ rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int2 __attribute__((overloadable))
+ rsAllocationVLoadX_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int3 __attribute__((overloadable))
+ rsAllocationVLoadX_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern int4 __attribute__((overloadable))
+ rsAllocationVLoadX_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint2 __attribute__((overloadable))
+ rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint3 __attribute__((overloadable))
+ rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern uint4 __attribute__((overloadable))
+ rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long2 __attribute__((overloadable))
+ rsAllocationVLoadX_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long3 __attribute__((overloadable))
+ rsAllocationVLoadX_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern long4 __attribute__((overloadable))
+ rsAllocationVLoadX_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong2 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong3 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern ulong4 __attribute__((overloadable))
+ rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+/*
+ * rsAllocationVStoreX: Store a vector into an allocation of scalars
+ *
+ * This function stores the entries of a vector into successive cells of an allocation.
+ * It assumes that the allocation contains scalars.
+ *
+ * The "X" in the name indicates that successive values are stored by increasing
+ * the X index. There are currently no functions to store successive values
+ * incrementing other dimensions. Use multiple calls to rsSetElementAt() instead.
+ *
+ * For example, when calling rsAllocationVStoreX_int3(a, v, 20, 30), v.x is stored
+ * at a[20, 30], v.y at a[21, 30], and v.z at a[22, 30].
+ *
+ * When storing into a three dimensional allocations, use the x, y, z variant.
+ * Similarly, use the x, y variant for two dimensional allocations and x for the
+ * mono dimensional allocations.
+ *
+ * For efficiency, this function does not validate the inputs. Trying to wrap the
+ * X index, exceeding the size of the allocation, or using indexes incompatible
+ * with the dimensionality of the allocation yiels undefined results.
+ *
+ * See also rsAllocationVLoadX().
+ *
+ * Parameters:
+ * a: Allocation to store the data into.
+ * val: Value to be stored.
+ * x: X offset in the allocation of the first cell to be copied into.
+ * y: Y offset in the allocation of the first cell to be copied into.
+ * z: Z offset in the allocation of the first cell to be copied into.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+extern void __attribute__((overloadable))
+ rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+/*
+ * rsGetElementAt: Return a cell from an allocation
+ *
+ * This function extracts a single cell from an allocation.
+ *
+ * When retrieving from a three dimensional allocations, use the x, y, z variant.
+ * Similarly, use the x, y variant for two dimensional allocations and x for the
+ * mono dimensional allocations.
+ *
+ * This function has two styles. One returns the address of the value using a void*,
+ * the other returns the actual value, e.g. rsGetElementAt() vs. rsGetElementAt_int4().
+ * For primitive types, always use the latter as it is more efficient.
+ */
+extern const void* __attribute__((overloadable))
+ rsGetElementAt(rs_allocation a, uint32_t x);
+
+extern const void* __attribute__((overloadable))
+ rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y);
+
+extern const void* __attribute__((overloadable))
+ rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float __attribute__((overloadable))
+ rsGetElementAt_float(rs_allocation a, uint32_t x) {
+ return ((float *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float2 __attribute__((overloadable))
+ rsGetElementAt_float2(rs_allocation a, uint32_t x) {
+ return ((float2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float3 __attribute__((overloadable))
+ rsGetElementAt_float3(rs_allocation a, uint32_t x) {
+ return ((float3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float4 __attribute__((overloadable))
+ rsGetElementAt_float4(rs_allocation a, uint32_t x) {
+ return ((float4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double __attribute__((overloadable))
+ rsGetElementAt_double(rs_allocation a, uint32_t x) {
+ return ((double *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double2 __attribute__((overloadable))
+ rsGetElementAt_double2(rs_allocation a, uint32_t x) {
+ return ((double2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double3 __attribute__((overloadable))
+ rsGetElementAt_double3(rs_allocation a, uint32_t x) {
+ return ((double3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double4 __attribute__((overloadable))
+ rsGetElementAt_double4(rs_allocation a, uint32_t x) {
+ return ((double4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char __attribute__((overloadable))
+ rsGetElementAt_char(rs_allocation a, uint32_t x) {
+ return ((char *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char2 __attribute__((overloadable))
+ rsGetElementAt_char2(rs_allocation a, uint32_t x) {
+ return ((char2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char3 __attribute__((overloadable))
+ rsGetElementAt_char3(rs_allocation a, uint32_t x) {
+ return ((char3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char4 __attribute__((overloadable))
+ rsGetElementAt_char4(rs_allocation a, uint32_t x) {
+ return ((char4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar __attribute__((overloadable))
+ rsGetElementAt_uchar(rs_allocation a, uint32_t x) {
+ return ((uchar *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar2 __attribute__((overloadable))
+ rsGetElementAt_uchar2(rs_allocation a, uint32_t x) {
+ return ((uchar2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar3 __attribute__((overloadable))
+ rsGetElementAt_uchar3(rs_allocation a, uint32_t x) {
+ return ((uchar3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar4 __attribute__((overloadable))
+ rsGetElementAt_uchar4(rs_allocation a, uint32_t x) {
+ return ((uchar4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short __attribute__((overloadable))
+ rsGetElementAt_short(rs_allocation a, uint32_t x) {
+ return ((short *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short2 __attribute__((overloadable))
+ rsGetElementAt_short2(rs_allocation a, uint32_t x) {
+ return ((short2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short3 __attribute__((overloadable))
+ rsGetElementAt_short3(rs_allocation a, uint32_t x) {
+ return ((short3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short4 __attribute__((overloadable))
+ rsGetElementAt_short4(rs_allocation a, uint32_t x) {
+ return ((short4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort __attribute__((overloadable))
+ rsGetElementAt_ushort(rs_allocation a, uint32_t x) {
+ return ((ushort *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort2 __attribute__((overloadable))
+ rsGetElementAt_ushort2(rs_allocation a, uint32_t x) {
+ return ((ushort2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort3 __attribute__((overloadable))
+ rsGetElementAt_ushort3(rs_allocation a, uint32_t x) {
+ return ((ushort3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort4 __attribute__((overloadable))
+ rsGetElementAt_ushort4(rs_allocation a, uint32_t x) {
+ return ((ushort4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int __attribute__((overloadable))
+ rsGetElementAt_int(rs_allocation a, uint32_t x) {
+ return ((int *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int2 __attribute__((overloadable))
+ rsGetElementAt_int2(rs_allocation a, uint32_t x) {
+ return ((int2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int3 __attribute__((overloadable))
+ rsGetElementAt_int3(rs_allocation a, uint32_t x) {
+ return ((int3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int4 __attribute__((overloadable))
+ rsGetElementAt_int4(rs_allocation a, uint32_t x) {
+ return ((int4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint __attribute__((overloadable))
+ rsGetElementAt_uint(rs_allocation a, uint32_t x) {
+ return ((uint *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint2 __attribute__((overloadable))
+ rsGetElementAt_uint2(rs_allocation a, uint32_t x) {
+ return ((uint2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint3 __attribute__((overloadable))
+ rsGetElementAt_uint3(rs_allocation a, uint32_t x) {
+ return ((uint3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint4 __attribute__((overloadable))
+ rsGetElementAt_uint4(rs_allocation a, uint32_t x) {
+ return ((uint4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long __attribute__((overloadable))
+ rsGetElementAt_long(rs_allocation a, uint32_t x) {
+ return ((long *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long2 __attribute__((overloadable))
+ rsGetElementAt_long2(rs_allocation a, uint32_t x) {
+ return ((long2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long3 __attribute__((overloadable))
+ rsGetElementAt_long3(rs_allocation a, uint32_t x) {
+ return ((long3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long4 __attribute__((overloadable))
+ rsGetElementAt_long4(rs_allocation a, uint32_t x) {
+ return ((long4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong __attribute__((overloadable))
+ rsGetElementAt_ulong(rs_allocation a, uint32_t x) {
+ return ((ulong *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong2 __attribute__((overloadable))
+ rsGetElementAt_ulong2(rs_allocation a, uint32_t x) {
+ return ((ulong2 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong3 __attribute__((overloadable))
+ rsGetElementAt_ulong3(rs_allocation a, uint32_t x) {
+ return ((ulong3 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong4 __attribute__((overloadable))
+ rsGetElementAt_ulong4(rs_allocation a, uint32_t x) {
+ return ((ulong4 *)rsGetElementAt(a, x))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float __attribute__((overloadable))
+ rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((float *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float2 __attribute__((overloadable))
+ rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((float2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float3 __attribute__((overloadable))
+ rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((float3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float4 __attribute__((overloadable))
+ rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((float4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double __attribute__((overloadable))
+ rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((double *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double2 __attribute__((overloadable))
+ rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((double2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double3 __attribute__((overloadable))
+ rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((double3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double4 __attribute__((overloadable))
+ rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((double4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char __attribute__((overloadable))
+ rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((char *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char2 __attribute__((overloadable))
+ rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((char2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char3 __attribute__((overloadable))
+ rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((char3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char4 __attribute__((overloadable))
+ rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((char4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar __attribute__((overloadable))
+ rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uchar *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar2 __attribute__((overloadable))
+ rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uchar2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar3 __attribute__((overloadable))
+ rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uchar3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar4 __attribute__((overloadable))
+ rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uchar4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short __attribute__((overloadable))
+ rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((short *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short2 __attribute__((overloadable))
+ rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((short2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short3 __attribute__((overloadable))
+ rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((short3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short4 __attribute__((overloadable))
+ rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((short4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort __attribute__((overloadable))
+ rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ushort *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort2 __attribute__((overloadable))
+ rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ushort2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort3 __attribute__((overloadable))
+ rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ushort3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort4 __attribute__((overloadable))
+ rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ushort4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int __attribute__((overloadable))
+ rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((int *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int2 __attribute__((overloadable))
+ rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((int2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int3 __attribute__((overloadable))
+ rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((int3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int4 __attribute__((overloadable))
+ rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((int4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint __attribute__((overloadable))
+ rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uint *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint2 __attribute__((overloadable))
+ rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uint2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint3 __attribute__((overloadable))
+ rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uint3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint4 __attribute__((overloadable))
+ rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((uint4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long __attribute__((overloadable))
+ rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((long *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long2 __attribute__((overloadable))
+ rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((long2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long3 __attribute__((overloadable))
+ rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((long3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long4 __attribute__((overloadable))
+ rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((long4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong __attribute__((overloadable))
+ rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ulong *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong2 __attribute__((overloadable))
+ rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ulong2 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong3 __attribute__((overloadable))
+ rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ulong3 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong4 __attribute__((overloadable))
+ rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y) {
+ return ((ulong4 *)rsGetElementAt(a, x, y))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float __attribute__((overloadable))
+ rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((float *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float2 __attribute__((overloadable))
+ rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((float2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float3 __attribute__((overloadable))
+ rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((float3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline float4 __attribute__((overloadable))
+ rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((float4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double __attribute__((overloadable))
+ rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((double *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double2 __attribute__((overloadable))
+ rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((double2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double3 __attribute__((overloadable))
+ rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((double3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline double4 __attribute__((overloadable))
+ rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((double4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char __attribute__((overloadable))
+ rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((char *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char2 __attribute__((overloadable))
+ rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((char2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char3 __attribute__((overloadable))
+ rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((char3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline char4 __attribute__((overloadable))
+ rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((char4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar __attribute__((overloadable))
+ rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uchar *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar2 __attribute__((overloadable))
+ rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uchar2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar3 __attribute__((overloadable))
+ rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uchar3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uchar4 __attribute__((overloadable))
+ rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uchar4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short __attribute__((overloadable))
+ rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((short *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short2 __attribute__((overloadable))
+ rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((short2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short3 __attribute__((overloadable))
+ rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((short3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline short4 __attribute__((overloadable))
+ rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((short4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort __attribute__((overloadable))
+ rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ushort *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort2 __attribute__((overloadable))
+ rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ushort2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort3 __attribute__((overloadable))
+ rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ushort3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ushort4 __attribute__((overloadable))
+ rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ushort4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int __attribute__((overloadable))
+ rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((int *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int2 __attribute__((overloadable))
+ rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((int2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int3 __attribute__((overloadable))
+ rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((int3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline int4 __attribute__((overloadable))
+ rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((int4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint __attribute__((overloadable))
+ rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uint *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint2 __attribute__((overloadable))
+ rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uint2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint3 __attribute__((overloadable))
+ rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uint3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline uint4 __attribute__((overloadable))
+ rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((uint4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long __attribute__((overloadable))
+ rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((long *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long2 __attribute__((overloadable))
+ rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((long2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long3 __attribute__((overloadable))
+ rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((long3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline long4 __attribute__((overloadable))
+ rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((long4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong __attribute__((overloadable))
+ rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ulong *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong2 __attribute__((overloadable))
+ rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ulong2 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong3 __attribute__((overloadable))
+ rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ulong3 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 17)
+static inline ulong4 __attribute__((overloadable))
+ rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
+ return ((ulong4 *)rsGetElementAt(a, x, y, z))[0];
+}
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((overloadable))
+ rsGetElementAt_float(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((overloadable))
+ rsGetElementAt_float2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((overloadable))
+ rsGetElementAt_float3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((overloadable))
+ rsGetElementAt_float4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double __attribute__((overloadable))
+ rsGetElementAt_double(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double2 __attribute__((overloadable))
+ rsGetElementAt_double2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double3 __attribute__((overloadable))
+ rsGetElementAt_double3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double4 __attribute__((overloadable))
+ rsGetElementAt_double4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char __attribute__((overloadable))
+ rsGetElementAt_char(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char2 __attribute__((overloadable))
+ rsGetElementAt_char2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char3 __attribute__((overloadable))
+ rsGetElementAt_char3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char4 __attribute__((overloadable))
+ rsGetElementAt_char4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar __attribute__((overloadable))
+ rsGetElementAt_uchar(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar2 __attribute__((overloadable))
+ rsGetElementAt_uchar2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar3 __attribute__((overloadable))
+ rsGetElementAt_uchar3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar4 __attribute__((overloadable))
+ rsGetElementAt_uchar4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short __attribute__((overloadable))
+ rsGetElementAt_short(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short2 __attribute__((overloadable))
+ rsGetElementAt_short2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short3 __attribute__((overloadable))
+ rsGetElementAt_short3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short4 __attribute__((overloadable))
+ rsGetElementAt_short4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort __attribute__((overloadable))
+ rsGetElementAt_ushort(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort2 __attribute__((overloadable))
+ rsGetElementAt_ushort2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort3 __attribute__((overloadable))
+ rsGetElementAt_ushort3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort4 __attribute__((overloadable))
+ rsGetElementAt_ushort4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int __attribute__((overloadable))
+ rsGetElementAt_int(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int2 __attribute__((overloadable))
+ rsGetElementAt_int2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int3 __attribute__((overloadable))
+ rsGetElementAt_int3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int4 __attribute__((overloadable))
+ rsGetElementAt_int4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint __attribute__((overloadable))
+ rsGetElementAt_uint(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint2 __attribute__((overloadable))
+ rsGetElementAt_uint2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint3 __attribute__((overloadable))
+ rsGetElementAt_uint3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint4 __attribute__((overloadable))
+ rsGetElementAt_uint4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long __attribute__((overloadable))
+ rsGetElementAt_long(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long2 __attribute__((overloadable))
+ rsGetElementAt_long2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long3 __attribute__((overloadable))
+ rsGetElementAt_long3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long4 __attribute__((overloadable))
+ rsGetElementAt_long4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong __attribute__((overloadable))
+ rsGetElementAt_ulong(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong2 __attribute__((overloadable))
+ rsGetElementAt_ulong2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong3 __attribute__((overloadable))
+ rsGetElementAt_ulong3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong4 __attribute__((overloadable))
+ rsGetElementAt_ulong4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((overloadable))
+ rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((overloadable))
+ rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((overloadable))
+ rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((overloadable))
+ rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double __attribute__((overloadable))
+ rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double2 __attribute__((overloadable))
+ rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double3 __attribute__((overloadable))
+ rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double4 __attribute__((overloadable))
+ rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char __attribute__((overloadable))
+ rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char2 __attribute__((overloadable))
+ rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char3 __attribute__((overloadable))
+ rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char4 __attribute__((overloadable))
+ rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar __attribute__((overloadable))
+ rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar2 __attribute__((overloadable))
+ rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar3 __attribute__((overloadable))
+ rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar4 __attribute__((overloadable))
+ rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short __attribute__((overloadable))
+ rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short2 __attribute__((overloadable))
+ rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short3 __attribute__((overloadable))
+ rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short4 __attribute__((overloadable))
+ rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort __attribute__((overloadable))
+ rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort2 __attribute__((overloadable))
+ rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort3 __attribute__((overloadable))
+ rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort4 __attribute__((overloadable))
+ rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int __attribute__((overloadable))
+ rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int2 __attribute__((overloadable))
+ rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int3 __attribute__((overloadable))
+ rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int4 __attribute__((overloadable))
+ rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint __attribute__((overloadable))
+ rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint2 __attribute__((overloadable))
+ rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint3 __attribute__((overloadable))
+ rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint4 __attribute__((overloadable))
+ rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long __attribute__((overloadable))
+ rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long2 __attribute__((overloadable))
+ rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long3 __attribute__((overloadable))
+ rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long4 __attribute__((overloadable))
+ rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong __attribute__((overloadable))
+ rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong2 __attribute__((overloadable))
+ rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong3 __attribute__((overloadable))
+ rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong4 __attribute__((overloadable))
+ rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((overloadable))
+ rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((overloadable))
+ rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((overloadable))
+ rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((overloadable))
+ rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double __attribute__((overloadable))
+ rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double2 __attribute__((overloadable))
+ rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double3 __attribute__((overloadable))
+ rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern double4 __attribute__((overloadable))
+ rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char __attribute__((overloadable))
+ rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char2 __attribute__((overloadable))
+ rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char3 __attribute__((overloadable))
+ rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern char4 __attribute__((overloadable))
+ rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar __attribute__((overloadable))
+ rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar2 __attribute__((overloadable))
+ rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar3 __attribute__((overloadable))
+ rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar4 __attribute__((overloadable))
+ rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short __attribute__((overloadable))
+ rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short2 __attribute__((overloadable))
+ rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short3 __attribute__((overloadable))
+ rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern short4 __attribute__((overloadable))
+ rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort __attribute__((overloadable))
+ rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort2 __attribute__((overloadable))
+ rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort3 __attribute__((overloadable))
+ rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ushort4 __attribute__((overloadable))
+ rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int __attribute__((overloadable))
+ rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int2 __attribute__((overloadable))
+ rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int3 __attribute__((overloadable))
+ rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern int4 __attribute__((overloadable))
+ rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint __attribute__((overloadable))
+ rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint2 __attribute__((overloadable))
+ rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint3 __attribute__((overloadable))
+ rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uint4 __attribute__((overloadable))
+ rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long __attribute__((overloadable))
+ rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long2 __attribute__((overloadable))
+ rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long3 __attribute__((overloadable))
+ rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern long4 __attribute__((overloadable))
+ rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong __attribute__((overloadable))
+ rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong2 __attribute__((overloadable))
+ rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong3 __attribute__((overloadable))
+ rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern ulong4 __attribute__((overloadable))
+ rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half __attribute__((overloadable))
+ rsGetElementAt_half(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half2 __attribute__((overloadable))
+ rsGetElementAt_half2(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half3 __attribute__((overloadable))
+ rsGetElementAt_half3(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half4 __attribute__((overloadable))
+ rsGetElementAt_half4(rs_allocation a, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half __attribute__((overloadable))
+ rsGetElementAt_half(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half2 __attribute__((overloadable))
+ rsGetElementAt_half2(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half3 __attribute__((overloadable))
+ rsGetElementAt_half3(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half4 __attribute__((overloadable))
+ rsGetElementAt_half4(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half __attribute__((overloadable))
+ rsGetElementAt_half(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half2 __attribute__((overloadable))
+ rsGetElementAt_half2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half3 __attribute__((overloadable))
+ rsGetElementAt_half3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern half4 __attribute__((overloadable))
+ rsGetElementAt_half4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+/*
+ * rsGetElementAtYuv_uchar_U: Get the U component of an allocation of YUVs
+ *
+ * Extracts the U component of a single YUV value from a 2D allocation of YUVs.
+ *
+ * Inside an allocation, Y, U, and V components may be stored if different planes
+ * and at different resolutions. The x, y coordinates provided here are in the
+ * dimensions of the Y plane.
+ *
+ * See rsGetElementAtYuv_uchar_Y().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar __attribute__((overloadable))
+ rsGetElementAtYuv_uchar_U(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+/*
+ * rsGetElementAtYuv_uchar_V: Get the V component of an allocation of YUVs
+ *
+ * Extracts the V component of a single YUV value from a 2D allocation of YUVs.
+ *
+ * Inside an allocation, Y, U, and V components may be stored if different planes
+ * and at different resolutions. The x, y coordinates provided here are in the
+ * dimensions of the Y plane.
+ *
+ * See rsGetElementAtYuv_uchar_Y().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar __attribute__((overloadable))
+ rsGetElementAtYuv_uchar_V(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+/*
+ * rsGetElementAtYuv_uchar_Y: Get the Y component of an allocation of YUVs
+ *
+ * Extracts the Y component of a single YUV value from a 2D allocation of YUVs.
+ *
+ * Inside an allocation, Y, U, and V components may be stored if different planes
+ * and at different resolutions. The x, y coordinates provided here are in the
+ * dimensions of the Y plane.
+ *
+ * See rsGetElementAtYuv_uchar_U() and rsGetElementAtYuv_uchar_V().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern uchar __attribute__((overloadable))
+ rsGetElementAtYuv_uchar_Y(rs_allocation a, uint32_t x, uint32_t y);
+#endif
+
+/*
+ * rsSample: Sample a value from a texture allocation
+ *
+ * Fetches a value from a texture allocation in a way described by the sampler.
+ *
+ * If your allocation is 1D, use the variant with float for location. For 2D,
+ * use the float2 variant.
+ *
+ * See android.renderscript.Sampler for more details.
+ *
+ * Parameters:
+ * a: Allocation to sample from.
+ * s: Sampler state.
+ * location: Location to sample from.
+ * lod: Mip level to sample from, for fractional values mip levels will be interpolated if RS_SAMPLER_LINEAR_MIP_LINEAR is used.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern float4 __attribute__((overloadable))
+ rsSample(rs_allocation a, rs_sampler s, float location);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern float4 __attribute__((overloadable))
+ rsSample(rs_allocation a, rs_sampler s, float location, float lod);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern float4 __attribute__((overloadable))
+ rsSample(rs_allocation a, rs_sampler s, float2 location);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+extern float4 __attribute__((overloadable))
+ rsSample(rs_allocation a, rs_sampler s, float2 location, float lod);
+#endif
+
+/*
+ * rsSetElementAt: Set a cell of an allocation
+ *
+ * This function stores a value into a single cell of an allocation.
+ *
+ * When storing into a three dimensional allocations, use the x, y, z variant.
+ * Similarly, use the x, y variant for two dimensional allocations and x for
+ * the mono dimensional allocations.
+ *
+ * This function has two styles. One passes the value to be stored using a void*,
+ * the other has the actual value as an argument, e.g. rsSetElementAt() vs.
+ * rsSetElementAt_int4(). For primitive types, always use the latter as it is
+ * more efficient.
+ *
+ * See also rsGetElementAt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt(rs_allocation a, void* ptr, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt(rs_allocation a, void* ptr, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float(rs_allocation a, float val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double(rs_allocation a, double val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char(rs_allocation a, char val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short(rs_allocation a, short val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int(rs_allocation a, int val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long(rs_allocation a, long val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float(rs_allocation a, float val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double(rs_allocation a, double val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char(rs_allocation a, char val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short(rs_allocation a, short val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int(rs_allocation a, int val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long(rs_allocation a, long val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float(rs_allocation a, float val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double(rs_allocation a, double val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char(rs_allocation a, char val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short(rs_allocation a, short val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int(rs_allocation a, int val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long(rs_allocation a, long val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern void __attribute__((overloadable))
+ rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half(rs_allocation a, half val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half(rs_allocation a, half val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x, uint32_t y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half(rs_allocation a, half val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 23))
+extern void __attribute__((overloadable))
+ rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x, uint32_t y, uint32_t z);
+#endif
+
+#endif // RENDERSCRIPT_RS_ALLOCATION_DATA_RSH
diff --git a/23.0.3/include/rs_atomic.rsh b/23.0.3/include/rs_atomic.rsh
new file mode 100644
index 0000000..0ab26ca
--- /dev/null
+++ b/23.0.3/include/rs_atomic.rsh
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2015 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
diff --git a/23.0.3/include/rs_convert.rsh b/23.0.3/include/rs_convert.rsh
new file mode 100644
index 0000000..66e47c6
--- /dev/null
+++ b/23.0.3/include/rs_convert.rsh
@@ -0,0 +1,1308 @@
+/*
+ * Copyright (C) 2015 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_convert.rsh: Conversion Functions
+ *
+ * The functions below convert from a numerical vector type to another, of from one color
+ * representation to another.
+ */
+
+#ifndef RENDERSCRIPT_RS_CONVERT_RSH
+#define RENDERSCRIPT_RS_CONVERT_RSH
+
+/*
+ * convert: Convert numerical vectors
+ *
+ * Converts a vector from one numerical type to another. The conversion are done entry per entry.
+ *
+ * E.g calling a = convert_short3(b); is equivalent to doing
+ * a.x = (short)b.x; a.y = (short)b.y; a.z = (short)b.z;.
+ *
+ * Converting floating point values to integer types truncates.
+ *
+ * Converting numbers too large to fit the destination type yields undefined results.
+ * For example, converting a float that contains 1.0e18 to a short is undefined.
+ * Use clamp() to avoid this.
+ */
+extern float2 __attribute__((const, overloadable))
+ convert_float2(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(float4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(char2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(char3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(char4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(uchar2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(uchar3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(uchar4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(short2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(short3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(short4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(ushort2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(ushort3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(ushort4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(int2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(int3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(int4 v);
+
+extern float2 __attribute__((const, overloadable))
+ convert_float2(uint2 v);
+
+extern float3 __attribute__((const, overloadable))
+ convert_float3(uint3 v);
+
+extern float4 __attribute__((const, overloadable))
+ convert_float4(uint4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(float2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(float3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(float4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(char2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(char3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(char4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(uchar2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(uchar3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(uchar4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(short2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(short3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(short4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(ushort2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(ushort3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(ushort4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(int2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(int3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(int4 v);
+
+extern char2 __attribute__((const, overloadable))
+ convert_char2(uint2 v);
+
+extern char3 __attribute__((const, overloadable))
+ convert_char3(uint3 v);
+
+extern char4 __attribute__((const, overloadable))
+ convert_char4(uint4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(float2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(float3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(float4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(char2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(char3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(char4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(uchar2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(uchar3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(uchar4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(short2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(short3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(short4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(ushort2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(ushort3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(ushort4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(int2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(int3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(int4 v);
+
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(uint2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(uint3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(uint4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(float2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(float3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(float4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(char2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(char3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(char4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(uchar2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(uchar3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(uchar4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(short2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(short3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(short4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(ushort2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(ushort3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(ushort4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(int2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(int3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(int4 v);
+
+extern short2 __attribute__((const, overloadable))
+ convert_short2(uint2 v);
+
+extern short3 __attribute__((const, overloadable))
+ convert_short3(uint3 v);
+
+extern short4 __attribute__((const, overloadable))
+ convert_short4(uint4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(float2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(float3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(float4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(char2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(char3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(char4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(uchar2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(uchar3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(uchar4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(short2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(short3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(short4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(ushort2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(ushort3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(ushort4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(int2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(int3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(int4 v);
+
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(uint2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(uint3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(uint4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(float2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(float3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(float4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(char2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(char3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(char4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(uchar2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(uchar3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(uchar4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(short2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(short3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(short4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(ushort2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(ushort3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(ushort4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(int2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(int3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(int4 v);
+
+extern int2 __attribute__((const, overloadable))
+ convert_int2(uint2 v);
+
+extern int3 __attribute__((const, overloadable))
+ convert_int3(uint3 v);
+
+extern int4 __attribute__((const, overloadable))
+ convert_int4(uint4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(float2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(float3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(float4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(char2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(char3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(char4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(uchar2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(uchar3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(uchar4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(short2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(short3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(short4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(ushort2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(ushort3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(ushort4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(int2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(int3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(int4 v);
+
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(uint2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(uint3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(uint4 v);
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ convert_float2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ convert_float3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ convert_float4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ convert_float2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ convert_float3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ convert_float4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ convert_float2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ convert_float3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ convert_float4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ convert_char2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ convert_char3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ convert_char4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ convert_char2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ convert_char3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ convert_char4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ convert_char2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ convert_char3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ convert_char4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ convert_uchar2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ convert_uchar3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ convert_uchar4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ convert_short2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ convert_short3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ convert_short4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ convert_short2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ convert_short3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ convert_short4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ convert_short2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ convert_short3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ convert_short4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ convert_ushort2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ convert_ushort3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ convert_ushort4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ convert_int2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ convert_int3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ convert_int4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ convert_int2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ convert_int3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ convert_int4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ convert_int2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ convert_int3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ convert_int4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(double2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(double3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(double4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(long2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(long3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(long4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ convert_uint2(ulong2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ convert_uint3(ulong3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ convert_uint4(ulong4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(char2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(char3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(char4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(uchar2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(uchar3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(uchar4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(short2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(short3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(short4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(ushort2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(ushort3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(ushort4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(int2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(int3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(int4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double2 __attribute__((const, overloadable))
+ convert_double2(uint2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double3 __attribute__((const, overloadable))
+ convert_double3(uint3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern double4 __attribute__((const, overloadable))
+ convert_double4(uint4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(char2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(char3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(char4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(uchar2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(uchar3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(uchar4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(short2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(short3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(short4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(ushort2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(ushort3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(ushort4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(int2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(int3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(int4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ convert_long2(uint2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ convert_long3(uint3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ convert_long4(uint4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(char2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(char3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(char4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(uchar2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(uchar3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(uchar4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(short2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(short3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(short4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(ushort2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(ushort3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(ushort4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(int2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(int3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(int4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ convert_ulong2(uint2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ convert_ulong3(uint3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ convert_ulong4(uint4 v);
+#endif
+
+/*
+ * rsPackColorTo8888: Create a uchar4 RGBA from floats
+ *
+ * Packs three or four floating point RGBA values into a uchar4.
+ *
+ * The input values are typically between 0.0 and 1.0 inclusive. For input values outside
+ * of this range, the resulting outputs will be clamped to be between 0 and 255. As this
+ * clamping may be done after the input is multiplied by 255.f and converted to an integer,
+ * input numbers greater than INT_MAX/255.f or less than INT_MIN/255.f can result in
+ * undefined behavior.
+ *
+ * If the alpha component is not specified, it is assumed to be 1.0, i.e. the result will
+ * have an alpha set to 255.
+ *
+ * Parameters:
+ * r: Red component.
+ * g: Green component.
+ * b: Blue component.
+ * a: Alpha component.
+ * color: Vector of 3 or 4 floats containing the R, G, B, and A values.
+ */
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float r, float g, float b);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float r, float g, float b, float a);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float3 color);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsPackColorTo8888(float4 color);
+
+/*
+ * rsUnpackColor8888: Create a float4 RGBA from uchar4
+ *
+ * Unpacks a uchar4 color to float4. The resulting floats will be between 0.0 and 1.0 inclusive.
+ */
+extern float4 __attribute__((const))
+ rsUnpackColor8888(uchar4 c);
+
+/*
+ * rsYuvToRGBA: Convert a YUV value to RGBA
+ *
+ * Converts a color from a YUV representation to RGBA.
+ *
+ * We currently don't provide a function to do the reverse conversion.
+ *
+ * Parameters:
+ * y: Luminance component.
+ * u: U chrominance component.
+ * v: V chrominance component.
+ */
+extern float4 __attribute__((const, overloadable))
+ rsYuvToRGBA_float4(uchar y, uchar u, uchar v);
+
+extern uchar4 __attribute__((const, overloadable))
+ rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v);
+
+#endif // RENDERSCRIPT_RS_CONVERT_RSH
diff --git a/23.0.3/include/rs_core.rsh b/23.0.3/include/rs_core.rsh
new file mode 100644
index 0000000..128c689
--- /dev/null
+++ b/23.0.3/include/rs_core.rsh
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2015 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_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
diff --git a/23.0.3/include/rs_debug.rsh b/23.0.3/include/rs_debug.rsh
new file mode 100644
index 0000000..f75a4cf
--- /dev/null
+++ b/23.0.3/include/rs_debug.rsh
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2015 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 >= 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
diff --git a/23.0.3/include/rs_for_each.rsh b/23.0.3/include/rs_for_each.rsh
new file mode 100644
index 0000000..9507c0c
--- /dev/null
+++ b/23.0.3/include/rs_for_each.rsh
@@ -0,0 +1,384 @@
+/*
+ * Copyright (C) 2015 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 indexes. 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 prefrences.
+ 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, and rarely used indexes, like the Array0 index or the current
+ * level of detail.
+ *
+ * A kernel may be executed in parallel over multiple threads. Each thread will have its
+ * own context.
+ *
+ * You can access the context by adding a special parameter named "context" and 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;
+
+/*
+ * rsForEach: Invoke the root kernel of a script
+ *
+ * Invoke the kernel named "root" of the specified script. Like other kernels, this root()
+ * function will be invoked repeatedly over the cells of the specificed allocation, filling
+ * the output allocation with the results.
+ *
+ * When rsForEach is called, the root script is launched immediately. rsForEach returns
+ * only when the script has completed and the output allocation is ready to use.
+ *
+ * The rs_script argument is typically initialized using a global variable set from Java.
+ *
+ * The kernel can be invoked with just an input allocation or just an output allocation.
+ * This can be done by defining an rs_allocation variable and not initializing it. E.g.
+ * rs_script gCustomScript;
+ * void specializedProcessing(rs_allocation in) {
+ * rs_allocation ignoredOut;
+ * rsForEach(gCustomScript, in, ignoredOut);
+ * }
+ *
+ * If both input and output allocations are specified, they must have the same dimensions.
+ *
+ * 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.
+ */
+#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))
+extern void __attribute__((overloadable))
+ rsForEach(rs_script script, rs_allocation input, rs_allocation output);
+#endif
+
+/*
+ * rsGetArray0: Index in the Array0 dimension for the specified context
+ *
+ * Returns the index in the Array0 dimension of the cell being processed, as specified
+ * by the supplied context.
+ *
+ * This context is created when a kernel is launched and updated at each iteration.
+ * It contains common characteristics of the allocations being iterated over and rarely
+ * used indexes, like the Array0 index.
+ *
+ * You can access the context by adding a special parameter named "context" and 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, w dimensions are accessed by
+ * // adding these variables as arguments. For the more rarely used indexes
+ * // to the other dimensions, extract them from the 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 context
+ *
+ * Returns the index in the Array1 dimension of the cell being processed, as specified
+ * by the supplied 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 context
+ *
+ * Returns the index in the Array2 dimension of the cell being processed,
+ * as specified by the supplied 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 context
+ *
+ * Returns the index in the Array3 dimension of the cell being processed, as specified
+ * by the supplied 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 context
+ *
+ * Returns the size of the Array0 dimension for the specified 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 context
+ *
+ * Returns the size of the Array1 dimension for the specified 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 context
+ *
+ * Returns the size of the Array2 dimension for the specified 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 context
+ *
+ * Returns the size of the Array3 dimension for the specified 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 context
+ *
+ * If the context refers to 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 context
+ *
+ * Returns the number of levels of detail for the specified 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 context
+ *
+ * Returns the size of the X dimension for the specified context.
+ *
+ * This context is created when a kernel is launched. It contains common
+ * characteristics of the allocations being iterated over by the kernel in
+ * a very efficient structure. It also contains rarely used indexes.
+ *
+ * You can access it by adding a special parameter named "context" and 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 context
+ *
+ * Returns the size of the X dimension for the specified 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 context
+ *
+ * Returns the size of the Z dimension for the specified 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 context
+ *
+ * Returns the face on which the cell being processed is found, as specified by the
+ * supplied 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 context
+ *
+ * Returns the index in the Levels of Detail dimension of the cell being processed,
+ * as specified by the supplied 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
diff --git a/23.0.3/include/rs_graphics.rsh b/23.0.3/include/rs_graphics.rsh
new file mode 100644
index 0000000..2a78018
--- /dev/null
+++ b/23.0.3/include/rs_graphics.rsh
@@ -0,0 +1,1522 @@
+/*
+ * Copyright (C) 2015 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_graphics.rsh: Graphics Functions and Types
+ *
+ * The graphics subsystem of RenderScript was removed at API level 23.
+ */
+
+#ifndef RENDERSCRIPT_RS_GRAPHICS_RSH
+#define RENDERSCRIPT_RS_GRAPHICS_RSH
+
+#ifdef __LP64__
+// TODO We need to fix some of the builds before enabling this error:
+// #error "RenderScript graphics is deprecated and not supported in 64bit mode."
+#endif
+
+// TODO we seem to assume order for the other headers too.
+#include "rs_object_types.rsh"
+
+/*
+ * rs_blend_src_func: Blend source function
+ *
+ * DEPRECATED. Do not use.
+ *
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+typedef enum __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) {
+ RS_BLEND_SRC_ZERO = 0,
+ RS_BLEND_SRC_ONE = 1,
+ RS_BLEND_SRC_DST_COLOR = 2,
+ RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3,
+ RS_BLEND_SRC_SRC_ALPHA = 4,
+ RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5,
+ RS_BLEND_SRC_DST_ALPHA = 6,
+ RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7,
+ RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8,
+ RS_BLEND_SRC_INVALID = 100
+} rs_blend_src_func;
+#endif
+#endif
+
+/*
+ * rs_blend_dst_func: Blend destination function
+ *
+ * DEPRECATED. Do not use.
+ *
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+typedef enum __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) {
+ RS_BLEND_DST_ZERO = 0,
+ RS_BLEND_DST_ONE = 1,
+ RS_BLEND_DST_SRC_COLOR = 2,
+ RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3,
+ RS_BLEND_DST_SRC_ALPHA = 4,
+ RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5,
+ RS_BLEND_DST_DST_ALPHA = 6,
+ RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7,
+ RS_BLEND_DST_INVALID = 100
+} rs_blend_dst_func;
+#endif
+#endif
+
+/*
+ * rs_cull_mode: Culling mode
+ *
+ * DEPRECATED. Do not use.
+ *
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+typedef enum __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) {
+ RS_CULL_BACK = 0,
+ RS_CULL_FRONT = 1,
+ RS_CULL_NONE = 2,
+ RS_CULL_INVALID = 100
+} rs_cull_mode;
+#endif
+#endif
+
+/*
+ * rs_depth_func: Depth function
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Specifies conditional drawing depending on the comparison of the incoming
+ * depth to that found in the depth buffer.
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+typedef enum __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) {
+ RS_DEPTH_FUNC_ALWAYS = 0, // Always drawn
+ RS_DEPTH_FUNC_LESS = 1, // Drawn if the incoming depth value is less than that in the depth buffer
+ RS_DEPTH_FUNC_LEQUAL = 2, // Drawn if the incoming depth value is less or equal to that in the depth buffer
+ RS_DEPTH_FUNC_GREATER = 3, // Drawn if the incoming depth value is greater than that in the depth buffer
+ RS_DEPTH_FUNC_GEQUAL = 4, // Drawn if the incoming depth value is greater or equal to that in the depth buffer
+ RS_DEPTH_FUNC_EQUAL = 5, // Drawn if the incoming depth value is equal to that in the depth buffer
+ RS_DEPTH_FUNC_NOTEQUAL = 6, // Drawn if the incoming depth value is not equal to that in the depth buffer
+ RS_DEPTH_FUNC_INVALID = 100 // Invalid depth function
+} rs_depth_func;
+#endif
+#endif
+
+/*
+ * rs_primitive: How to intepret mesh vertex data
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Describes the way mesh vertex data is interpreted when rendering
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+typedef enum __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) {
+ RS_PRIMITIVE_POINT = 0, // Vertex data will be rendered as a series of points
+ RS_PRIMITIVE_LINE = 1, // Vertex pairs will be rendered as lines
+ RS_PRIMITIVE_LINE_STRIP = 2, // Vertex data will be rendered as a connected line strip
+ RS_PRIMITIVE_TRIANGLE = 3, // Vertices will be rendered as individual triangles
+ RS_PRIMITIVE_TRIANGLE_STRIP = 4, // Vertices will be rendered as a connected triangle strip defined by the first three vertices with each additional triangle defined by a new vertex
+ RS_PRIMITIVE_TRIANGLE_FAN = 5, // Vertices will be rendered as a sequence of triangles that all share first vertex as the origin
+ RS_PRIMITIVE_INVALID = 100 // Invalid primitive
+} rs_primitive;
+#endif
+#endif
+
+/*
+ * rs_font: Handle to a Font
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Opaque handle to a RenderScript font object.
+ * See: android.renderscript.Font
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+typedef _RS_HANDLE __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) rs_font;
+#endif
+#endif
+
+/*
+ * rs_mesh: Handle to a Mesh
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Opaque handle to a RenderScript mesh object.
+ * See: android.renderscript.Mesh
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+typedef _RS_HANDLE __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) rs_mesh;
+#endif
+#endif
+
+/*
+ * rs_program_fragment: Handle to a ProgramFragment
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Opaque handle to a RenderScript ProgramFragment object.
+ * See: android.renderscript.ProgramFragment
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+typedef _RS_HANDLE __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) rs_program_fragment;
+#endif
+#endif
+
+/*
+ * rs_program_vertex: Handle to a ProgramVertex
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Opaque handle to a RenderScript ProgramVertex object.
+ * See: android.renderscript.ProgramVertex
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+typedef _RS_HANDLE __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) rs_program_vertex;
+#endif
+#endif
+
+/*
+ * rs_program_raster: Handle to a ProgramRaster
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Opaque handle to a RenderScript ProgramRaster object.
+ * See: android.renderscript.ProgramRaster
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+typedef _RS_HANDLE __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) rs_program_raster;
+#endif
+#endif
+
+/*
+ * rs_program_store: Handle to a ProgramStore
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Opaque handle to a RenderScript ProgramStore object.
+ * See: android.renderscript.ProgramStore
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+typedef _RS_HANDLE __attribute__((
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+deprecated
+#endif
+)) rs_program_store;
+#endif
+#endif
+
+/*
+ * 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().
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsClearObject(rs_mesh* dst);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_fragment* dst);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_vertex* dst);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_raster* dst);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsClearObject(rs_program_store* dst);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsClearObject(rs_font* dst);
+#endif
+#endif
+
+/*
+ * 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.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_mesh v);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_fragment v);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_vertex v);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_raster v);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_program_store v);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern bool __attribute__((overloadable))
+ rsIsObject(rs_font v);
+#endif
+#endif
+
+/*
+ * rsSetObject: For internal use.
+ *
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsSetObject(rs_mesh* dst, rs_mesh src);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_fragment* dst, rs_program_fragment src);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_vertex* dst, rs_program_vertex src);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_raster* dst, rs_program_raster src);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsSetObject(rs_program_store* dst, rs_program_store src);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
+extern void __attribute__((overloadable))
+ rsSetObject(rs_font* dst, rs_font src);
+#endif
+#endif
+
+/*
+ * rsgAllocationSyncAll: Sync the contents of an allocation
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Sync the contents of an allocation.
+ *
+ * If the source is specified, sync from memory space specified by source.
+ *
+ * If the source is not specified, sync from its SCRIPT memory space to its HW
+ * memory spaces.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgAllocationSyncAll(rs_allocation alloc);
+#endif
+#endif
+
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgAllocationSyncAll(rs_allocation alloc, rs_allocation_usage_type source);
+#endif
+#endif
+
+/*
+ * rsgBindColorTarget: Set the color target
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Set the color target used for all subsequent rendering calls
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindColorTarget(rs_allocation colorTarget, uint slot);
+#endif
+#endif
+
+/*
+ * rsgBindConstant: Bind a constant allocation
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new Allocation object to a ProgramFragment or ProgramVertex.
+ * The Allocation must be a valid constant input for the Program.
+ *
+ * Parameters:
+ * ps: program fragment object
+ * slot: index of the constant buffer on the program
+ * c: constants to bind
+ * pv: program vertex object
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindConstant(rs_program_fragment ps, uint slot, rs_allocation c);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindConstant(rs_program_vertex pv, uint slot, rs_allocation c);
+#endif
+#endif
+
+/*
+ * rsgBindDepthTarget: Set the depth target
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Set the depth target used for all subsequent rendering calls
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindDepthTarget(rs_allocation depthTarget);
+#endif
+#endif
+
+/*
+ * rsgBindFont: Bind a font object
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Binds the font object to be used for all subsequent font rendering calls
+ *
+ * Parameters:
+ * font: object to bind
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindFont(rs_font font);
+#endif
+#endif
+
+/*
+ * rsgBindProgramFragment: Bind a ProgramFragment
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new ProgramFragment to the rendering context.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindProgramFragment(rs_program_fragment pf);
+#endif
+#endif
+
+/*
+ * rsgBindProgramRaster: Bind a ProgramRaster
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new ProgramRaster to the rendering context.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindProgramRaster(rs_program_raster pr);
+#endif
+#endif
+
+/*
+ * rsgBindProgramStore: Bind a ProgramStore
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new ProgramStore to the rendering context.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindProgramStore(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgBindProgramVertex: Bind a ProgramVertex
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new ProgramVertex to the rendering context.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindProgramVertex(rs_program_vertex pv);
+#endif
+#endif
+
+/*
+ * rsgBindSampler: Bind a sampler
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new Sampler object to a ProgramFragment. The sampler will
+ * operate on the texture bound at the matching slot.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindSampler(rs_program_fragment fragment, uint slot, rs_sampler sampler);
+#endif
+#endif
+
+/*
+ * rsgBindTexture: Bind a texture allocation
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Bind a new Allocation object to a ProgramFragment. The
+ * Allocation must be a valid texture for the Program. The sampling
+ * of the texture will be controled by the Sampler bound at the
+ * matching slot.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgBindTexture(rs_program_fragment v, uint slot, rs_allocation alloc);
+#endif
+#endif
+
+/*
+ * rsgClearAllRenderTargets: Clear all color and depth targets
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Clear all color and depth targets and resume rendering into
+ * the framebuffer
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgClearAllRenderTargets(void);
+#endif
+#endif
+
+/*
+ * rsgClearColor: Clear the specified color from the surface
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Clears the rendering surface to the specified color.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgClearColor(float r, float g, float b, float a);
+#endif
+#endif
+
+/*
+ * rsgClearColorTarget: Clear the color target
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Clear the previously set color target
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgClearColorTarget(uint slot);
+#endif
+#endif
+
+/*
+ * rsgClearDepth: Clear the depth surface
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Clears the depth suface to the specified value.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgClearDepth(float value);
+#endif
+#endif
+
+/*
+ * rsgClearDepthTarget: Clear the depth target
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Clear the previously set depth target
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgClearDepthTarget(void);
+#endif
+#endif
+
+/*
+ * rsgDrawMesh: Draw a mesh
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Draw a mesh using the current context state.
+ *
+ * If primitiveIndex is specified, draw part of a mesh using the current context state.
+ *
+ * If start and len are also specified, draw specified index range of part of a mesh using the current context state.
+ *
+ * Otherwise the whole mesh is rendered.
+ *
+ * Parameters:
+ * ism: mesh object to render
+ * primitiveIndex: for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw.
+ * start: starting index in the range
+ * len: number of indices to draw
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawMesh(rs_mesh ism);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawMesh(rs_mesh ism, uint primitiveIndex);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len);
+#endif
+#endif
+
+/*
+ * rsgDrawQuad: Draw a quad
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Low performance utility function for drawing a simple quad. Not intended for
+ * drawing large quantities of geometry.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3,
+ float z3, float x4, float y4, float z4);
+#endif
+#endif
+
+/*
+ * rsgDrawQuadTexCoords: Draw a textured quad
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Low performance utility function for drawing a textured quad. Not intended
+ * for drawing large quantities of geometry.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2,
+ float z2, float u2, float v2, float x3, float y3, float z3, float u3,
+ float v3, float x4, float y4, float z4, float u4, float v4);
+#endif
+#endif
+
+/*
+ * rsgDrawRect: Draw a rectangle
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Low performance utility function for drawing a simple rectangle. Not
+ * intended for drawing large quantities of geometry.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawRect(float x1, float y1, float x2, float y2, float z);
+#endif
+#endif
+
+/*
+ * rsgDrawSpriteScreenspace: Draw rectangles in screenspace
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Low performance function for drawing rectangles in screenspace. This
+ * function uses the default passthough ProgramVertex. Any bound ProgramVertex
+ * is ignored. This function has considerable overhead and should not be used
+ * for drawing in shipping applications.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h);
+#endif
+#endif
+
+/*
+ * rsgDrawText: Draw a text string
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Draws text given a string and location
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawText(const char* text, int x, int y);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgDrawText(rs_allocation alloc, int x, int y);
+#endif
+#endif
+
+/*
+ * rsgFinish: End rendering commands
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Force RenderScript to finish all rendering commands
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern uint __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgFinish(void);
+#endif
+#endif
+
+/*
+ * rsgFontColor: Set the font color
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Sets the font color for all subsequent rendering calls
+ *
+ * Parameters:
+ * r: red component
+ * g: green component
+ * b: blue component
+ * a: alpha component
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgFontColor(float r, float g, float b, float a);
+#endif
+#endif
+
+/*
+ * rsgGetHeight: Get the surface height
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get the height of the current rendering surface.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern uint __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgGetHeight(void);
+#endif
+#endif
+
+/*
+ * rsgGetWidth: Get the surface width
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get the width of the current rendering surface.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern uint __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgGetWidth(void);
+#endif
+#endif
+
+/*
+ * rsgMeasureText: Get the bounding box for a text string
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Returns the bounding box of the text relative to (0, 0)
+ * Any of left, right, top, bottom could be NULL
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeasureText(const char* text, int* left, int* right, int* top, int* bottom);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeasureText(rs_allocation alloc, int* left, int* right, int* top, int* bottom);
+#endif
+#endif
+
+/*
+ * rsgMeshComputeBoundingBox: Compute a bounding box
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Computes an axis aligned bounding box of a mesh object
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshComputeBoundingBox(rs_mesh mesh, float* minX, float* minY, float* min, float* maxX,
+ float* maxY, float* maxZ);
+#endif
+#endif
+
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+static inline void __attribute__((always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshComputeBoundingBox(rs_mesh mesh, float3* bBoxMin, float3* bBoxMax) {
+ float x1, y1, z1, x2, y2, z2;
+ rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2);
+ bBoxMin->x = x1;
+ bBoxMin->y = y1;
+ bBoxMin->z = z1;
+ bBoxMax->x = x2;
+ bBoxMax->y = y2;
+ bBoxMax->z = z2;
+}
+#endif
+#endif
+
+/*
+ * rsgMeshGetIndexAllocation: Return an allocation containing index data
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Returns an allocation containing index data or a null
+ * allocation if only the primitive is specified
+ *
+ * Parameters:
+ * m: mesh to get data from
+ * index: index of the index allocation
+ *
+ * Returns: allocation containing index data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_allocation __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index);
+#endif
+#endif
+
+/*
+ * rsgMeshGetPrimitive: Return the primitive
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Returns the primitive describing how a part of the mesh is
+ * rendered
+ *
+ * Parameters:
+ * m: mesh to get data from
+ * index: index of the primitive
+ *
+ * Returns: primitive describing how the mesh is rendered
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_primitive __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
+#endif
+#endif
+
+/*
+ * rsgMeshGetPrimitiveCount: Return the number of index sets
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Meshes could have multiple index sets, this function returns
+ * the number.
+ *
+ * Parameters:
+ * m: mesh to get data from
+ *
+ * Returns: number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern uint32_t __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshGetPrimitiveCount(rs_mesh m);
+#endif
+#endif
+
+/*
+ * rsgMeshGetVertexAllocation: Return a vertex allocation
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Returns an allocation that is part of the mesh and contains
+ * vertex data, e.g. positions, normals, texcoords
+ *
+ * Parameters:
+ * m: mesh to get data from
+ * index: index of the vertex allocation
+ *
+ * Returns: allocation containing vertex data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_allocation __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index);
+#endif
+#endif
+
+/*
+ * rsgMeshGetVertexAllocationCount: Return the number of vertex allocations
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Returns the number of allocations in the mesh that contain
+ * vertex data
+ *
+ * Parameters:
+ * m: mesh to get data from
+ *
+ * Returns: number of allocations in the mesh that contain vertex data
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern uint32_t __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgMeshGetVertexAllocationCount(rs_mesh m);
+#endif
+#endif
+
+/*
+ * rsgProgramFragmentConstantColor: Set the constant color for a fixed function emulation program
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Set the constant color for a fixed function emulation program.
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a);
+#endif
+#endif
+
+/*
+ * rsgProgramVertexGetProjectionMatrix: Get the projection matrix for a fixed function vertex program
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get the projection matrix for a currently bound fixed function
+ * vertex program. Calling this function with a custom vertex shader
+ * would result in an error.
+ *
+ * Parameters:
+ * proj: matrix to store the current projection matrix into
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramVertexGetProjectionMatrix(rs_matrix4x4* proj);
+#endif
+#endif
+
+/*
+ * rsgProgramVertexLoadModelMatrix: Load the model matrix for a bound fixed function vertex program
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Load the model matrix for a currently bound fixed function
+ * vertex program. Calling this function with a custom vertex shader
+ * would result in an error.
+ *
+ * Parameters:
+ * model: model matrix
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramVertexLoadModelMatrix(const rs_matrix4x4* model);
+#endif
+#endif
+
+/*
+ * rsgProgramVertexLoadProjectionMatrix: Load the projection matrix for a bound fixed function vertex program
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Load the projection matrix for a currently bound fixed function
+ * vertex program. Calling this function with a custom vertex shader
+ * would result in an error.
+ *
+ * Parameters:
+ * proj: projection matrix
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4* proj);
+#endif
+#endif
+
+/*
+ * rsgProgramVertexLoadTextureMatrix: Load the texture matrix for a bound fixed function vertex program
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Load the texture matrix for a currently bound fixed function
+ * vertex program. Calling this function with a custom vertex shader
+ * would result in an error.
+ *
+ * Parameters:
+ * tex: texture matrix
+ */
+#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
+extern void __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4* tex);
+#endif
+#endif
+
+/*
+ * rsgProgramRasterGetCullMode: Get program raster cull mode
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program raster cull mode
+ *
+ * Parameters:
+ * pr: program raster to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_cull_mode __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramRasterGetCullMode(rs_program_raster pr);
+#endif
+#endif
+
+/*
+ * rsgProgramRasterIsPointSpriteEnabled: Get program raster point sprite state
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program raster point sprite state
+ *
+ * Parameters:
+ * pr: program raster to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreGetBlendDstFunc: Get program store blend destination function
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store blend destination function
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_blend_dst_func __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreGetBlendDstFunc(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreGetBlendSrcFunc: Get program store blend source function
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store blend source function
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_blend_src_func __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreGetBlendSrcFunc(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreGetDepthFunc: Get program store depth function
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store depth function
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern rs_depth_func __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreGetDepthFunc(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreIsColorMaskAlphaEnabled: Get program store alpha component color mask
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store alpha component color mask
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreIsColorMaskBlueEnabled: Get program store blur component color mask
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store blur component color mask
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreIsColorMaskGreenEnabled: Get program store green component color mask
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store green component color mask
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreIsColorMaskRedEnabled: Get program store red component color mask
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store red component color mask
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreIsDepthMaskEnabled: Get program store depth mask
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store depth mask
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps);
+#endif
+#endif
+
+/*
+ * rsgProgramStoreIsDitherEnabled: Get program store dither state
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Get program store dither state
+ *
+ * Parameters:
+ * ps: program store to query
+ */
+#ifndef __LP64__
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
+extern bool __attribute__((overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated
+#endif
+))
+ rsgProgramStoreIsDitherEnabled(rs_program_store ps);
+#endif
+#endif
+
+#endif // RENDERSCRIPT_RS_GRAPHICS_RSH
diff --git a/23.0.3/include/rs_io.rsh b/23.0.3/include/rs_io.rsh
new file mode 100644
index 0000000..d14af11
--- /dev/null
+++ b/23.0.3/include/rs_io.rsh
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2015 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.
+ *
+ * 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.
+ *
+ * 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
diff --git a/23.0.3/include/rs_math.rsh b/23.0.3/include/rs_math.rsh
new file mode 100644
index 0000000..9b39680
--- /dev/null
+++ b/23.0.3/include/rs_math.rsh
@@ -0,0 +1,4177 @@
+/*
+ * Copyright (C) 2015 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_math.rsh: Mathematical Constants and Functions
+ *
+ * The mathematical functions below can be applied to scalars and vectors. When applied
+ * to vectors, the returned value is a vector of the function applied to each entry of the input.
+ *
+ * For example:
+ * float3 a, b;
+ * // The following call sets
+ * // a.x to sin(b.x),
+ * // a.y to sin(b.y), and
+ * // a.z to sin(b.z).
+ * a = sin(b);
+ *
+ *
+ * See Vector Math Functions for functions like distance() and length() that interpret
+ * instead the input as a single vector 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. Under rs_fp_relaxed, subnormal values may be flushed to zero and
+ * rounding may be done towards zero. In comparison, rs_fp_full requires correct handling of
+ * subnormal values, i.e. smaller than 1.17549435e-38f. rs_fp_rull also requires round to nearest
+ * with ties to even.
+ *
+ * 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.
+ * - half_: 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_MATH_RSH
+#define RENDERSCRIPT_RS_MATH_RSH
+
+/*
+ * M_1_PI: 1 / pi, as a 32 bit float
+ *
+ * The inverse of pi, as a 32 bit float.
+ */
+#define M_1_PI 0.318309886183790671537767526745028724f
+
+/*
+ * M_2_PI: 2 / pi, as a 32 bit float
+ *
+ * 2 divided by pi, as a 32 bit float.
+ */
+#define M_2_PI 0.636619772367581343075535053490057448f
+
+/*
+ * M_2_PIl: 2 / pi, as a 32 bit float
+ *
+ * DEPRECATED. Do not use.
+ *
+ * 2 divided by pi, as a 32 bit float.
+ */
+#define M_2_PIl 0.636619772367581343075535053490057448f
+
+/*
+ * M_2_SQRTPI: 2 / sqrt(pi), as a 32 bit float
+ *
+ * 2 divided by the square root of pi, as a 32 bit float.
+ */
+#define M_2_SQRTPI 1.128379167095512573896158903121545172f
+
+/*
+ * M_E: e, as a 32 bit float
+ *
+ * The number e, the base of the natural logarithm, as a 32 bit float.
+ */
+#define M_E 2.718281828459045235360287471352662498f
+
+/*
+ * M_LN10: log_e(10), as a 32 bit float
+ *
+ * The natural logarithm of 10, as a 32 bit float.
+ */
+#define M_LN10 2.302585092994045684017991454684364208f
+
+/*
+ * M_LN2: log_e(2), as a 32 bit float
+ *
+ * The natural logarithm of 2, as a 32 bit float.
+ */
+#define M_LN2 0.693147180559945309417232121458176568f
+
+/*
+ * M_LOG10E: log_10(e), as a 32 bit float
+ *
+ * The logarithm base 10 of e, as a 32 bit float.
+ */
+#define M_LOG10E 0.434294481903251827651128918916605082f
+
+/*
+ * M_LOG2E: log_2(e), as a 32 bit float
+ *
+ * The logarithm base 2 of e, as a 32 bit float.
+ */
+#define M_LOG2E 1.442695040888963407359924681001892137f
+
+/*
+ * M_PI: pi, as a 32 bit float
+ *
+ * The constant pi, as a 32 bit float.
+ */
+#define M_PI 3.141592653589793238462643383279502884f
+
+/*
+ * M_PI_2: pi / 2, as a 32 bit float
+ *
+ * Pi divided by 2, as a 32 bit float.
+ */
+#define M_PI_2 1.570796326794896619231321691639751442f
+
+/*
+ * M_PI_4: pi / 4, as a 32 bit float
+ *
+ * Pi divided by 4, as a 32 bit float.
+ */
+#define M_PI_4 0.785398163397448309615660845819875721f
+
+/*
+ * M_SQRT1_2: 1 / sqrt(2), as a 32 bit float
+ *
+ * The inverse of the square root of 2, as a 32 bit float.
+ */
+#define M_SQRT1_2 0.707106781186547524400844362104849039f
+
+/*
+ * M_SQRT2: sqrt(2), as a 32 bit float
+ *
+ * The square root of 2, as a 32 bit float.
+ */
+#define M_SQRT2 1.414213562373095048801688724209698079f
+
+/*
+ * abs: Absolute value of an integer
+ *
+ * Returns the absolute value of an integer.
+ *
+ * For floats, use fabs().
+ */
+extern uchar __attribute__((const, overloadable))
+ abs(char v);
+
+extern uchar2 __attribute__((const, overloadable))
+ abs(char2 v);
+
+extern uchar3 __attribute__((const, overloadable))
+ abs(char3 v);
+
+extern uchar4 __attribute__((const, overloadable))
+ abs(char4 v);
+
+extern ushort __attribute__((const, overloadable))
+ abs(short v);
+
+extern ushort2 __attribute__((const, overloadable))
+ abs(short2 v);
+
+extern ushort3 __attribute__((const, overloadable))
+ abs(short3 v);
+
+extern ushort4 __attribute__((const, overloadable))
+ abs(short4 v);
+
+extern uint __attribute__((const, overloadable))
+ abs(int v);
+
+extern uint2 __attribute__((const, overloadable))
+ abs(int2 v);
+
+extern uint3 __attribute__((const, overloadable))
+ abs(int3 v);
+
+extern uint4 __attribute__((const, overloadable))
+ abs(int4 v);
+
+/*
+ * acos: Inverse cosine
+ *
+ * Returns the inverse cosine, in radians.
+ *
+ * See also native_acos().
+ */
+extern float __attribute__((const, overloadable))
+ acos(float v);
+
+extern float2 __attribute__((const, overloadable))
+ acos(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ acos(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ acos(float4 v);
+
+/*
+ * acosh: Inverse hyperbolic cosine
+ *
+ * Returns the inverse hyperbolic cosine, in radians.
+ *
+ * See also native_acosh().
+ */
+extern float __attribute__((const, overloadable))
+ acosh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ acosh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ acosh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ acosh(float4 v);
+
+/*
+ * acospi: Inverse cosine divided by pi
+ *
+ * Returns the inverse cosine in radians, divided by pi.
+ *
+ * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
+ *
+ * See also native_acospi().
+ */
+extern float __attribute__((const, overloadable))
+ acospi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ acospi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ acospi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ acospi(float4 v);
+
+/*
+ * asin: Inverse sine
+ *
+ * Returns the inverse sine, in radians.
+ *
+ * See also native_asin().
+ */
+extern float __attribute__((const, overloadable))
+ asin(float v);
+
+extern float2 __attribute__((const, overloadable))
+ asin(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ asin(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ asin(float4 v);
+
+/*
+ * asinh: Inverse hyperbolic sine
+ *
+ * Returns the inverse hyperbolic sine, in radians.
+ *
+ * See also native_asinh().
+ */
+extern float __attribute__((const, overloadable))
+ asinh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ asinh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ asinh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ asinh(float4 v);
+
+/*
+ * asinpi: Inverse sine divided by pi
+ *
+ * Returns the inverse sine in radians, divided by pi.
+ *
+ * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
+ *
+ * See also native_asinpi().
+ */
+extern float __attribute__((const, overloadable))
+ asinpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ asinpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ asinpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ asinpi(float4 v);
+
+/*
+ * atan: Inverse tangent
+ *
+ * Returns the inverse tangent, in radians.
+ *
+ * See also native_atan().
+ */
+extern float __attribute__((const, overloadable))
+ atan(float v);
+
+extern float2 __attribute__((const, overloadable))
+ atan(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ atan(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ atan(float4 v);
+
+/*
+ * atan2: Inverse tangent of a ratio
+ *
+ * Returns the inverse tangent of (numerator / denominator), in radians.
+ *
+ * See also native_atan2().
+ *
+ * Parameters:
+ * numerator: Numerator.
+ * denominator: Denominator. Can be 0.
+ */
+extern float __attribute__((const, overloadable))
+ atan2(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ atan2(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ atan2(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ atan2(float4 numerator, float4 denominator);
+
+/*
+ * atan2pi: Inverse tangent of a ratio, divided by pi
+ *
+ * Returns the inverse tangent of (numerator / denominator), in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atan2pi(n, d) * 180.f.
+ *
+ * See also native_atan2pi().
+ *
+ * Parameters:
+ * numerator: Numerator.
+ * denominator: Denominator. Can be 0.
+ */
+extern float __attribute__((const, overloadable))
+ atan2pi(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ atan2pi(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ atan2pi(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ atan2pi(float4 numerator, float4 denominator);
+
+/*
+ * atanh: Inverse hyperbolic tangent
+ *
+ * Returns the inverse hyperbolic tangent, in radians.
+ *
+ * See also native_atanh().
+ */
+extern float __attribute__((const, overloadable))
+ atanh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ atanh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ atanh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ atanh(float4 v);
+
+/*
+ * atanpi: Inverse tangent divided by pi
+ *
+ * Returns the inverse tangent in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
+ *
+ * See also native_atanpi().
+ */
+extern float __attribute__((const, overloadable))
+ atanpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ atanpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ atanpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ atanpi(float4 v);
+
+/*
+ * cbrt: Cube root
+ *
+ * Returns the cube root.
+ *
+ * See also native_cbrt().
+ */
+extern float __attribute__((const, overloadable))
+ cbrt(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cbrt(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cbrt(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cbrt(float4 v);
+
+/*
+ * ceil: Smallest integer not less than a value
+ *
+ * Returns the smallest integer not less than a value.
+ *
+ * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
+ *
+ * See also floor().
+ */
+extern float __attribute__((const, overloadable))
+ ceil(float v);
+
+extern float2 __attribute__((const, overloadable))
+ ceil(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ ceil(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ ceil(float4 v);
+
+/*
+ * clamp: Restrain a value to a range
+ *
+ * Clamps a value to a specified high and low bound. clamp() returns min_value
+ * if value < min_value, max_value if value > max_value, otherwise value.
+ *
+ * There are two variants of clamp: one where the min and max are scalars applied
+ * to all entries of the value, the other where the min and max are also vectors.
+ *
+ * If min_value is greater than max_value, the results are undefined.
+ *
+ * Parameters:
+ * value: Value to be clamped.
+ * min_value: Lower bound, a scalar or matching vector.
+ * max_value: High bound, must match the type of low.
+ */
+extern float __attribute__((const, overloadable))
+ clamp(float value, float min_value, float max_value);
+
+extern float2 __attribute__((const, overloadable))
+ clamp(float2 value, float2 min_value, float2 max_value);
+
+extern float3 __attribute__((const, overloadable))
+ clamp(float3 value, float3 min_value, float3 max_value);
+
+extern float4 __attribute__((const, overloadable))
+ clamp(float4 value, float4 min_value, float4 max_value);
+
+extern float2 __attribute__((const, overloadable))
+ clamp(float2 value, float min_value, float max_value);
+
+extern float3 __attribute__((const, overloadable))
+ clamp(float3 value, float min_value, float max_value);
+
+extern float4 __attribute__((const, overloadable))
+ clamp(float4 value, float min_value, float max_value);
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char __attribute__((const, overloadable))
+ clamp(char value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char2 __attribute__((const, overloadable))
+ clamp(char2 value, char2 min_value, char2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char3 __attribute__((const, overloadable))
+ clamp(char3 value, char3 min_value, char3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char4 __attribute__((const, overloadable))
+ clamp(char4 value, char4 min_value, char4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar __attribute__((const, overloadable))
+ clamp(uchar value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar2 __attribute__((const, overloadable))
+ clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar3 __attribute__((const, overloadable))
+ clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar4 __attribute__((const, overloadable))
+ clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short __attribute__((const, overloadable))
+ clamp(short value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short2 __attribute__((const, overloadable))
+ clamp(short2 value, short2 min_value, short2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short3 __attribute__((const, overloadable))
+ clamp(short3 value, short3 min_value, short3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short4 __attribute__((const, overloadable))
+ clamp(short4 value, short4 min_value, short4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort __attribute__((const, overloadable))
+ clamp(ushort value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort2 __attribute__((const, overloadable))
+ clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort3 __attribute__((const, overloadable))
+ clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort4 __attribute__((const, overloadable))
+ clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int __attribute__((const, overloadable))
+ clamp(int value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int2 __attribute__((const, overloadable))
+ clamp(int2 value, int2 min_value, int2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int3 __attribute__((const, overloadable))
+ clamp(int3 value, int3 min_value, int3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int4 __attribute__((const, overloadable))
+ clamp(int4 value, int4 min_value, int4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint __attribute__((const, overloadable))
+ clamp(uint value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint2 __attribute__((const, overloadable))
+ clamp(uint2 value, uint2 min_value, uint2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint3 __attribute__((const, overloadable))
+ clamp(uint3 value, uint3 min_value, uint3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint4 __attribute__((const, overloadable))
+ clamp(uint4 value, uint4 min_value, uint4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long __attribute__((const, overloadable))
+ clamp(long value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long2 __attribute__((const, overloadable))
+ clamp(long2 value, long2 min_value, long2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long3 __attribute__((const, overloadable))
+ clamp(long3 value, long3 min_value, long3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long4 __attribute__((const, overloadable))
+ clamp(long4 value, long4 min_value, long4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong __attribute__((const, overloadable))
+ clamp(ulong value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong2 __attribute__((const, overloadable))
+ clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong3 __attribute__((const, overloadable))
+ clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong4 __attribute__((const, overloadable))
+ clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char2 __attribute__((const, overloadable))
+ clamp(char2 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char3 __attribute__((const, overloadable))
+ clamp(char3 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern char4 __attribute__((const, overloadable))
+ clamp(char4 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar2 __attribute__((const, overloadable))
+ clamp(uchar2 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar3 __attribute__((const, overloadable))
+ clamp(uchar3 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uchar4 __attribute__((const, overloadable))
+ clamp(uchar4 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short2 __attribute__((const, overloadable))
+ clamp(short2 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short3 __attribute__((const, overloadable))
+ clamp(short3 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern short4 __attribute__((const, overloadable))
+ clamp(short4 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort2 __attribute__((const, overloadable))
+ clamp(ushort2 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort3 __attribute__((const, overloadable))
+ clamp(ushort3 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ushort4 __attribute__((const, overloadable))
+ clamp(ushort4 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int2 __attribute__((const, overloadable))
+ clamp(int2 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int3 __attribute__((const, overloadable))
+ clamp(int3 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern int4 __attribute__((const, overloadable))
+ clamp(int4 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint2 __attribute__((const, overloadable))
+ clamp(uint2 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint3 __attribute__((const, overloadable))
+ clamp(uint3 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern uint4 __attribute__((const, overloadable))
+ clamp(uint4 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long2 __attribute__((const, overloadable))
+ clamp(long2 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long3 __attribute__((const, overloadable))
+ clamp(long3 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern long4 __attribute__((const, overloadable))
+ clamp(long4 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong2 __attribute__((const, overloadable))
+ clamp(ulong2 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong3 __attribute__((const, overloadable))
+ clamp(ulong3 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+extern ulong4 __attribute__((const, overloadable))
+ clamp(ulong4 value, ulong min_value, ulong max_value);
+#endif
+
+/*
+ * clz: Number of leading 0 bits
+ *
+ * Returns the number of leading 0-bits in a value.
+ *
+ * For example, clz((char)0x03) returns 6.
+ */
+extern char __attribute__((const, overloadable))
+ clz(char value);
+
+extern char2 __attribute__((const, overloadable))
+ clz(char2 value);
+
+extern char3 __attribute__((const, overloadable))
+ clz(char3 value);
+
+extern char4 __attribute__((const, overloadable))
+ clz(char4 value);
+
+extern uchar __attribute__((const, overloadable))
+ clz(uchar value);
+
+extern uchar2 __attribute__((const, overloadable))
+ clz(uchar2 value);
+
+extern uchar3 __attribute__((const, overloadable))
+ clz(uchar3 value);
+
+extern uchar4 __attribute__((const, overloadable))
+ clz(uchar4 value);
+
+extern short __attribute__((const, overloadable))
+ clz(short value);
+
+extern short2 __attribute__((const, overloadable))
+ clz(short2 value);
+
+extern short3 __attribute__((const, overloadable))
+ clz(short3 value);
+
+extern short4 __attribute__((const, overloadable))
+ clz(short4 value);
+
+extern ushort __attribute__((const, overloadable))
+ clz(ushort value);
+
+extern ushort2 __attribute__((const, overloadable))
+ clz(ushort2 value);
+
+extern ushort3 __attribute__((const, overloadable))
+ clz(ushort3 value);
+
+extern ushort4 __attribute__((const, overloadable))
+ clz(ushort4 value);
+
+extern int __attribute__((const, overloadable))
+ clz(int value);
+
+extern int2 __attribute__((const, overloadable))
+ clz(int2 value);
+
+extern int3 __attribute__((const, overloadable))
+ clz(int3 value);
+
+extern int4 __attribute__((const, overloadable))
+ clz(int4 value);
+
+extern uint __attribute__((const, overloadable))
+ clz(uint value);
+
+extern uint2 __attribute__((const, overloadable))
+ clz(uint2 value);
+
+extern uint3 __attribute__((const, overloadable))
+ clz(uint3 value);
+
+extern uint4 __attribute__((const, overloadable))
+ clz(uint4 value);
+
+/*
+ * copysign: Copies the sign of a number to another
+ *
+ * Copies the sign from sign_value to magnitude_value.
+ *
+ * The value returned is either magnitude_value or -magnitude_value.
+ *
+ * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
+ */
+extern float __attribute__((const, overloadable))
+ copysign(float magnitude_value, float sign_value);
+
+extern float2 __attribute__((const, overloadable))
+ copysign(float2 magnitude_value, float2 sign_value);
+
+extern float3 __attribute__((const, overloadable))
+ copysign(float3 magnitude_value, float3 sign_value);
+
+extern float4 __attribute__((const, overloadable))
+ copysign(float4 magnitude_value, float4 sign_value);
+
+/*
+ * cos: Cosine
+ *
+ * Returns the cosine of an angle measured in radians.
+ *
+ * See also native_cos().
+ */
+extern float __attribute__((const, overloadable))
+ cos(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cos(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cos(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cos(float4 v);
+
+/*
+ * cosh: Hypebolic cosine
+ *
+ * Returns the hypebolic cosine of v, where v is measured in radians.
+ *
+ * See also native_cosh().
+ */
+extern float __attribute__((const, overloadable))
+ cosh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cosh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cosh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cosh(float4 v);
+
+/*
+ * cospi: Cosine of a number multiplied by pi
+ *
+ * Returns the cosine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the cosine of a value measured in degrees, call cospi(v / 180.f).
+ *
+ * See also native_cospi().
+ */
+extern float __attribute__((const, overloadable))
+ cospi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ cospi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ cospi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ cospi(float4 v);
+
+/*
+ * degrees: Converts radians into degrees
+ *
+ * Converts from radians to degrees.
+ */
+extern float __attribute__((const, overloadable))
+ degrees(float v);
+
+extern float2 __attribute__((const, overloadable))
+ degrees(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ degrees(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ degrees(float4 v);
+
+/*
+ * erf: Mathematical error function
+ *
+ * Returns the error function.
+ */
+extern float __attribute__((const, overloadable))
+ erf(float v);
+
+extern float2 __attribute__((const, overloadable))
+ erf(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ erf(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ erf(float4 v);
+
+/*
+ * erfc: Mathematical complementary error function
+ *
+ * Returns the complementary error function.
+ */
+extern float __attribute__((const, overloadable))
+ erfc(float v);
+
+extern float2 __attribute__((const, overloadable))
+ erfc(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ erfc(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ erfc(float4 v);
+
+/*
+ * exp: e raised to a number
+ *
+ * Returns e raised to v, i.e. e ^ v.
+ *
+ * See also native_exp().
+ */
+extern float __attribute__((const, overloadable))
+ exp(float v);
+
+extern float2 __attribute__((const, overloadable))
+ exp(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ exp(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ exp(float4 v);
+
+/*
+ * exp10: 10 raised to a number
+ *
+ * Returns 10 raised to v, i.e. 10.f ^ v.
+ *
+ * See also native_exp10().
+ */
+extern float __attribute__((const, overloadable))
+ exp10(float v);
+
+extern float2 __attribute__((const, overloadable))
+ exp10(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ exp10(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ exp10(float4 v);
+
+/*
+ * exp2: 2 raised to a number
+ *
+ * Returns 2 raised to v, i.e. 2.f ^ v.
+ *
+ * See also native_exp2().
+ */
+extern float __attribute__((const, overloadable))
+ exp2(float v);
+
+extern float2 __attribute__((const, overloadable))
+ exp2(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ exp2(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ exp2(float4 v);
+
+/*
+ * expm1: e raised to a number minus one
+ *
+ * Returns e raised to v minus 1, i.e. (e ^ v) - 1.
+ *
+ * See also native_expm1().
+ */
+extern float __attribute__((const, overloadable))
+ expm1(float v);
+
+extern float2 __attribute__((const, overloadable))
+ expm1(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ expm1(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ expm1(float4 v);
+
+/*
+ * fabs: Absolute value of a float
+ *
+ * Returns the absolute value of the float v.
+ *
+ * For integers, use abs().
+ */
+extern float __attribute__((const, overloadable))
+ fabs(float v);
+
+extern float2 __attribute__((const, overloadable))
+ fabs(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ fabs(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ fabs(float4 v);
+
+/*
+ * fdim: Positive difference between two values
+ *
+ * Returns the positive difference between two values.
+ *
+ * If a > b, returns (a - b) otherwise returns 0f.
+ */
+extern float __attribute__((const, overloadable))
+ fdim(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ fdim(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ fdim(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ fdim(float4 a, float4 b);
+
+/*
+ * floor: Smallest integer not greater than a value
+ *
+ * Returns the smallest integer not greater than a value.
+ *
+ * For example, floor(1.2f) returns 1.f, and floor(-1.2f) returns -2.f.
+ *
+ * See also ceil().
+ */
+extern float __attribute__((const, overloadable))
+ floor(float v);
+
+extern float2 __attribute__((const, overloadable))
+ floor(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ floor(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ floor(float4 v);
+
+/*
+ * fma: Multiply and add
+ *
+ * Multiply and add. Returns (multiplicand1 * multiplicand2) + offset.
+ *
+ * This function is similar to mad(). fma() retains full precision of the multiplied result
+ * and rounds only after the addition. mad() rounds after the multiplication and the addition.
+ * This extra precision is not guaranteed in rs_fp_relaxed mode.
+ */
+extern float __attribute__((const, overloadable))
+ fma(float multiplicand1, float multiplicand2, float offset);
+
+extern float2 __attribute__((const, overloadable))
+ fma(float2 multiplicand1, float2 multiplicand2, float2 offset);
+
+extern float3 __attribute__((const, overloadable))
+ fma(float3 multiplicand1, float3 multiplicand2, float3 offset);
+
+extern float4 __attribute__((const, overloadable))
+ fma(float4 multiplicand1, float4 multiplicand2, float4 offset);
+
+/*
+ * fmax: Maximum of two floats
+ *
+ * Returns the maximum of a and b, i.e. (a < b ? b : a).
+ *
+ * The max() function returns identical results but can be applied to more data types.
+ */
+extern float __attribute__((const, overloadable))
+ fmax(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ fmax(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ fmax(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ fmax(float4 a, float4 b);
+
+extern float2 __attribute__((const, overloadable))
+ fmax(float2 a, float b);
+
+extern float3 __attribute__((const, overloadable))
+ fmax(float3 a, float b);
+
+extern float4 __attribute__((const, overloadable))
+ fmax(float4 a, float b);
+
+/*
+ * fmin: Minimum of two floats
+ *
+ * Returns the minimum of a and b, i.e. (a > b ? b : a).
+ *
+ * The min() function returns identical results but can be applied to more data types.
+ */
+extern float __attribute__((const, overloadable))
+ fmin(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ fmin(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ fmin(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ fmin(float4 a, float4 b);
+
+extern float2 __attribute__((const, overloadable))
+ fmin(float2 a, float b);
+
+extern float3 __attribute__((const, overloadable))
+ fmin(float3 a, float b);
+
+extern float4 __attribute__((const, overloadable))
+ fmin(float4 a, float b);
+
+/*
+ * fmod: Modulo
+ *
+ * Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero.
+ *
+ * The function remainder() is similar but rounds toward the closest interger.
+ * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
+ * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
+ */
+extern float __attribute__((const, overloadable))
+ fmod(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ fmod(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ fmod(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ fmod(float4 numerator, float4 denominator);
+
+/*
+ * fract: Positive fractional part
+ *
+ * Returns the positive fractional part of v, i.e. v - floor(v).
+ *
+ * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
+ * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
+ *
+ * Parameters:
+ * v: Input value.
+ * floor: If floor is not null, *floor will be set to the floor of v.
+ */
+extern float __attribute__((overloadable))
+ fract(float v, float* floor);
+
+extern float2 __attribute__((overloadable))
+ fract(float2 v, float2* floor);
+
+extern float3 __attribute__((overloadable))
+ fract(float3 v, float3* floor);
+
+extern float4 __attribute__((overloadable))
+ fract(float4 v, float4* floor);
+
+static inline float __attribute__((const, overloadable))
+ fract(float v) {
+ float unused;
+ return fract(v, &unused);
+}
+
+static inline float2 __attribute__((const, overloadable))
+ fract(float2 v) {
+ float2 unused;
+ return fract(v, &unused);
+}
+
+static inline float3 __attribute__((const, overloadable))
+ fract(float3 v) {
+ float3 unused;
+ return fract(v, &unused);
+}
+
+static inline float4 __attribute__((const, overloadable))
+ fract(float4 v) {
+ float4 unused;
+ return fract(v, &unused);
+}
+
+/*
+ * frexp: Binary mantissa and exponent
+ *
+ * Returns the binary mantissa and exponent of v, i.e. v == mantissa * 2 ^ exponent.
+ *
+ * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
+ *
+ * See ldexp() for the reverse operation. See also logb() and ilogb().
+ *
+ * Parameters:
+ * v: Input value.
+ * exponent: If exponent is not null, *exponent will be set to the exponent of v.
+ */
+extern float __attribute__((overloadable))
+ frexp(float v, int* exponent);
+
+extern float2 __attribute__((overloadable))
+ frexp(float2 v, int2* exponent);
+
+extern float3 __attribute__((overloadable))
+ frexp(float3 v, int3* exponent);
+
+extern float4 __attribute__((overloadable))
+ frexp(float4 v, int4* exponent);
+
+/*
+ * half_recip: Reciprocal computed to 16 bit precision
+ *
+ * Returns the approximate reciprocal of a value.
+ *
+ * The precision is that of a 16 bit floating point value.
+ *
+ * See also native_recip().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ half_recip(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ half_recip(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ half_recip(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ half_recip(float4 v);
+#endif
+
+/*
+ * half_rsqrt: Reciprocal of a square root computed to 16 bit precision
+ *
+ * Returns the approximate value of (1.f / sqrt(value)).
+ *
+ * The precision is that of a 16 bit floating point value.
+ *
+ * See also rsqrt(), native_rsqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ half_rsqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ half_rsqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ half_rsqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ half_rsqrt(float4 v);
+#endif
+
+/*
+ * half_sqrt: Square root computed to 16 bit precision
+ *
+ * Returns the approximate square root of a value.
+ *
+ * The precision is that of a 16 bit floating point value.
+ *
+ * See also sqrt(), native_sqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float __attribute__((const, overloadable))
+ half_sqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float2 __attribute__((const, overloadable))
+ half_sqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float3 __attribute__((const, overloadable))
+ half_sqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+extern float4 __attribute__((const, overloadable))
+ half_sqrt(float4 v);
+#endif
+
+/*
+ * hypot: Hypotenuse
+ *
+ * Returns the hypotenuse, i.e. sqrt(a * a + b * b).
+ *
+ * See also native_hypot().
+ */
+extern float __attribute__((const, overloadable))
+ hypot(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ hypot(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ hypot(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ hypot(float4 a, float4 b);
+
+/*
+ * ilogb: Base two exponent
+ *
+ * Returns the base two exponent of a value, where the mantissa is between
+ * 1.f (inclusive) and 2.f (exclusive).
+ *
+ * For example, ilogb(8.5f) returns 3.
+ *
+ * Because of the difference in mantissa, this number is one less than is returned by frexp().
+ *
+ * logb() is similar but returns a float.
+ */
+extern int __attribute__((const, overloadable))
+ ilogb(float v);
+
+extern int2 __attribute__((const, overloadable))
+ ilogb(float2 v);
+
+extern int3 __attribute__((const, overloadable))
+ ilogb(float3 v);
+
+extern int4 __attribute__((const, overloadable))
+ ilogb(float4 v);
+
+/*
+ * ldexp: Creates a floating point from mantissa and exponent
+ *
+ * Returns the floating point created from the mantissa and exponent,
+ * i.e. (mantissa * 2 ^ exponent).
+ *
+ * See frexp() for the reverse operation.
+ *
+ * Parameters:
+ * mantissa: Mantissa.
+ * exponent: Exponent, a single component or matching vector.
+ */
+extern float __attribute__((const, overloadable))
+ ldexp(float mantissa, int exponent);
+
+extern float2 __attribute__((const, overloadable))
+ ldexp(float2 mantissa, int2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ ldexp(float3 mantissa, int3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ ldexp(float4 mantissa, int4 exponent);
+
+extern float2 __attribute__((const, overloadable))
+ ldexp(float2 mantissa, int exponent);
+
+extern float3 __attribute__((const, overloadable))
+ ldexp(float3 mantissa, int exponent);
+
+extern float4 __attribute__((const, overloadable))
+ ldexp(float4 mantissa, int exponent);
+
+/*
+ * lgamma: Natural logarithm of the gamma function
+ *
+ * Returns the natural logarithm of the absolute value of the gamma function,
+ * i.e. log(fabs(tgamma(v))).
+ *
+ * See also tgamma().
+ *
+ * Parameters:
+ * sign_of_gamma: If sign_of_gamma is not null, *sign_of_gamma will be set to -1.f if the gamma of v is negative, otherwise to 1.f.
+ */
+extern float __attribute__((const, overloadable))
+ lgamma(float v);
+
+extern float2 __attribute__((const, overloadable))
+ lgamma(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ lgamma(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ lgamma(float4 v);
+
+extern float __attribute__((overloadable))
+ lgamma(float v, int* sign_of_gamma);
+
+extern float2 __attribute__((overloadable))
+ lgamma(float2 v, int2* sign_of_gamma);
+
+extern float3 __attribute__((overloadable))
+ lgamma(float3 v, int3* sign_of_gamma);
+
+extern float4 __attribute__((overloadable))
+ lgamma(float4 v, int4* sign_of_gamma);
+
+/*
+ * log: Natural logarithm
+ *
+ * Returns the natural logarithm.
+ *
+ * See also native_log().
+ */
+extern float __attribute__((const, overloadable))
+ log(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log(float4 v);
+
+/*
+ * log10: Base 10 logarithm
+ *
+ * Returns the base 10 logarithm.
+ *
+ * See also native_log10().
+ */
+extern float __attribute__((const, overloadable))
+ log10(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log10(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log10(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log10(float4 v);
+
+/*
+ * log1p: Natural logarithm of a value plus 1
+ *
+ * Returns the natural logarithm of (v + 1.f).
+ *
+ * See also native_log1p().
+ */
+extern float __attribute__((const, overloadable))
+ log1p(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log1p(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log1p(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log1p(float4 v);
+
+/*
+ * log2: Base 2 logarithm
+ *
+ * Returns the base 2 logarithm.
+ *
+ * See also native_log2().
+ */
+extern float __attribute__((const, overloadable))
+ log2(float v);
+
+extern float2 __attribute__((const, overloadable))
+ log2(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ log2(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ log2(float4 v);
+
+/*
+ * logb: Base two exponent
+ *
+ * Returns the base two exponent of a value, where the mantissa is between
+ * 1.f (inclusive) and 2.f (exclusive).
+ *
+ * For example, logb(8.5f) returns 3.f.
+ *
+ * Because of the difference in mantissa, this number is one less than is returned by frexp().
+ *
+ * ilogb() is similar but returns an integer.
+ */
+extern float __attribute__((const, overloadable))
+ logb(float v);
+
+extern float2 __attribute__((const, overloadable))
+ logb(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ logb(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ logb(float4 v);
+
+/*
+ * mad: Multiply and add
+ *
+ * Multiply and add. Returns (multiplicand1 * multiplicand2) + offset.
+ *
+ * This function is similar to fma(). fma() retains full precision of the multiplied result
+ * and rounds only after the addition. mad() rounds after the multiplication and the addition.
+ * In rs_fp_relaxed mode, mad() may not do the rounding after multiplicaiton.
+ */
+extern float __attribute__((const, overloadable))
+ mad(float multiplicand1, float multiplicand2, float offset);
+
+extern float2 __attribute__((const, overloadable))
+ mad(float2 multiplicand1, float2 multiplicand2, float2 offset);
+
+extern float3 __attribute__((const, overloadable))
+ mad(float3 multiplicand1, float3 multiplicand2, float3 offset);
+
+extern float4 __attribute__((const, overloadable))
+ mad(float4 multiplicand1, float4 multiplicand2, float4 offset);
+
+/*
+ * max: Maximum
+ *
+ * Returns the maximum value of two arguments.
+ */
+extern float __attribute__((const, overloadable))
+ max(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ max(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ max(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ max(float4 a, float4 b);
+
+extern float2 __attribute__((const, overloadable))
+ max(float2 a, float b);
+
+extern float3 __attribute__((const, overloadable))
+ max(float3 a, float b);
+
+extern float4 __attribute__((const, overloadable))
+ max(float4 a, float b);
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char __attribute__((const, overloadable))
+ max(char a, char b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar __attribute__((const, overloadable))
+ max(uchar a, uchar b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short __attribute__((const, overloadable))
+ max(short a, short b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort __attribute__((const, overloadable))
+ max(ushort a, ushort b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int __attribute__((const, overloadable))
+ max(int a, int b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint __attribute__((const, overloadable))
+ max(uint a, uint b) {
+ return (a > b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char2 __attribute__((const, overloadable))
+ max(char2 a, char2 b) {
+ char2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar2 __attribute__((const, overloadable))
+ max(uchar2 a, uchar2 b) {
+ uchar2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short2 __attribute__((const, overloadable))
+ max(short2 a, short2 b) {
+ short2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort2 __attribute__((const, overloadable))
+ max(ushort2 a, ushort2 b) {
+ ushort2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int2 __attribute__((const, overloadable))
+ max(int2 a, int2 b) {
+ int2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint2 __attribute__((const, overloadable))
+ max(uint2 a, uint2 b) {
+ uint2 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char3 __attribute__((const, overloadable))
+ max(char3 a, char3 b) {
+ char3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar3 __attribute__((const, overloadable))
+ max(uchar3 a, uchar3 b) {
+ uchar3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short3 __attribute__((const, overloadable))
+ max(short3 a, short3 b) {
+ short3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort3 __attribute__((const, overloadable))
+ max(ushort3 a, ushort3 b) {
+ ushort3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int3 __attribute__((const, overloadable))
+ max(int3 a, int3 b) {
+ int3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint3 __attribute__((const, overloadable))
+ max(uint3 a, uint3 b) {
+ uint3 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char4 __attribute__((const, overloadable))
+ max(char4 a, char4 b) {
+ char4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar4 __attribute__((const, overloadable))
+ max(uchar4 a, uchar4 b) {
+ uchar4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short4 __attribute__((const, overloadable))
+ max(short4 a, short4 b) {
+ short4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort4 __attribute__((const, overloadable))
+ max(ushort4 a, ushort4 b) {
+ ushort4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int4 __attribute__((const, overloadable))
+ max(int4 a, int4 b) {
+ int4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint4 __attribute__((const, overloadable))
+ max(uint4 a, uint4 b) {
+ uint4 tmp;
+ tmp.x = (a.x > b.x ? a.x : b.x);
+ tmp.y = (a.y > b.y ? a.y : b.y);
+ tmp.z = (a.z > b.z ? a.z : b.z);
+ tmp.w = (a.w > b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char __attribute__((const, overloadable))
+ max(char a, char b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ max(char2 a, char2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ max(char3 a, char3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ max(char4 a, char4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar __attribute__((const, overloadable))
+ max(uchar a, uchar b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ max(uchar2 a, uchar2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ max(uchar3 a, uchar3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ max(uchar4 a, uchar4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short __attribute__((const, overloadable))
+ max(short a, short b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ max(short2 a, short2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ max(short3 a, short3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ max(short4 a, short4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort __attribute__((const, overloadable))
+ max(ushort a, ushort b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ max(ushort2 a, ushort2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ max(ushort3 a, ushort3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ max(ushort4 a, ushort4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int __attribute__((const, overloadable))
+ max(int a, int b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ max(int2 a, int2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ max(int3 a, int3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ max(int4 a, int4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint __attribute__((const, overloadable))
+ max(uint a, uint b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ max(uint2 a, uint2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ max(uint3 a, uint3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ max(uint4 a, uint4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long __attribute__((const, overloadable))
+ max(long a, long b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ max(long2 a, long2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ max(long3 a, long3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ max(long4 a, long4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong __attribute__((const, overloadable))
+ max(ulong a, ulong b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ max(ulong2 a, ulong2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ max(ulong3 a, ulong3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ max(ulong4 a, ulong4 b);
+#endif
+
+/*
+ * min: Minimum
+ *
+ * Returns the minimum value of two arguments.
+ */
+extern float __attribute__((const, overloadable))
+ min(float a, float b);
+
+extern float2 __attribute__((const, overloadable))
+ min(float2 a, float2 b);
+
+extern float3 __attribute__((const, overloadable))
+ min(float3 a, float3 b);
+
+extern float4 __attribute__((const, overloadable))
+ min(float4 a, float4 b);
+
+extern float2 __attribute__((const, overloadable))
+ min(float2 a, float b);
+
+extern float3 __attribute__((const, overloadable))
+ min(float3 a, float b);
+
+extern float4 __attribute__((const, overloadable))
+ min(float4 a, float b);
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char __attribute__((const, overloadable))
+ min(char a, char b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar __attribute__((const, overloadable))
+ min(uchar a, uchar b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short __attribute__((const, overloadable))
+ min(short a, short b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort __attribute__((const, overloadable))
+ min(ushort a, ushort b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int __attribute__((const, overloadable))
+ min(int a, int b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint __attribute__((const, overloadable))
+ min(uint a, uint b) {
+ return (a < b ? a : b);
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char2 __attribute__((const, overloadable))
+ min(char2 a, char2 b) {
+ char2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar2 __attribute__((const, overloadable))
+ min(uchar2 a, uchar2 b) {
+ uchar2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short2 __attribute__((const, overloadable))
+ min(short2 a, short2 b) {
+ short2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort2 __attribute__((const, overloadable))
+ min(ushort2 a, ushort2 b) {
+ ushort2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int2 __attribute__((const, overloadable))
+ min(int2 a, int2 b) {
+ int2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint2 __attribute__((const, overloadable))
+ min(uint2 a, uint2 b) {
+ uint2 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char3 __attribute__((const, overloadable))
+ min(char3 a, char3 b) {
+ char3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar3 __attribute__((const, overloadable))
+ min(uchar3 a, uchar3 b) {
+ uchar3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short3 __attribute__((const, overloadable))
+ min(short3 a, short3 b) {
+ short3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort3 __attribute__((const, overloadable))
+ min(ushort3 a, ushort3 b) {
+ ushort3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int3 __attribute__((const, overloadable))
+ min(int3 a, int3 b) {
+ int3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint3 __attribute__((const, overloadable))
+ min(uint3 a, uint3 b) {
+ uint3 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline char4 __attribute__((const, overloadable))
+ min(char4 a, char4 b) {
+ char4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uchar4 __attribute__((const, overloadable))
+ min(uchar4 a, uchar4 b) {
+ uchar4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline short4 __attribute__((const, overloadable))
+ min(short4 a, short4 b) {
+ short4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline ushort4 __attribute__((const, overloadable))
+ min(ushort4 a, ushort4 b) {
+ ushort4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline int4 __attribute__((const, overloadable))
+ min(int4 a, int4 b) {
+ int4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if !defined(RS_VERSION) || (RS_VERSION <= 20)
+static inline uint4 __attribute__((const, overloadable))
+ min(uint4 a, uint4 b) {
+ uint4 tmp;
+ tmp.x = (a.x < b.x ? a.x : b.x);
+ tmp.y = (a.y < b.y ? a.y : b.y);
+ tmp.z = (a.z < b.z ? a.z : b.z);
+ tmp.w = (a.w < b.w ? a.w : b.w);
+ return tmp;
+}
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char __attribute__((const, overloadable))
+ min(char a, char b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char2 __attribute__((const, overloadable))
+ min(char2 a, char2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char3 __attribute__((const, overloadable))
+ min(char3 a, char3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern char4 __attribute__((const, overloadable))
+ min(char4 a, char4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar __attribute__((const, overloadable))
+ min(uchar a, uchar b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar2 __attribute__((const, overloadable))
+ min(uchar2 a, uchar2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar3 __attribute__((const, overloadable))
+ min(uchar3 a, uchar3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uchar4 __attribute__((const, overloadable))
+ min(uchar4 a, uchar4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short __attribute__((const, overloadable))
+ min(short a, short b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short2 __attribute__((const, overloadable))
+ min(short2 a, short2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short3 __attribute__((const, overloadable))
+ min(short3 a, short3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern short4 __attribute__((const, overloadable))
+ min(short4 a, short4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort __attribute__((const, overloadable))
+ min(ushort a, ushort b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort2 __attribute__((const, overloadable))
+ min(ushort2 a, ushort2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort3 __attribute__((const, overloadable))
+ min(ushort3 a, ushort3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ushort4 __attribute__((const, overloadable))
+ min(ushort4 a, ushort4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int __attribute__((const, overloadable))
+ min(int a, int b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int2 __attribute__((const, overloadable))
+ min(int2 a, int2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int3 __attribute__((const, overloadable))
+ min(int3 a, int3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern int4 __attribute__((const, overloadable))
+ min(int4 a, int4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint __attribute__((const, overloadable))
+ min(uint a, uint b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint2 __attribute__((const, overloadable))
+ min(uint2 a, uint2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint3 __attribute__((const, overloadable))
+ min(uint3 a, uint3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern uint4 __attribute__((const, overloadable))
+ min(uint4 a, uint4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long __attribute__((const, overloadable))
+ min(long a, long b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long2 __attribute__((const, overloadable))
+ min(long2 a, long2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long3 __attribute__((const, overloadable))
+ min(long3 a, long3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern long4 __attribute__((const, overloadable))
+ min(long4 a, long4 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong __attribute__((const, overloadable))
+ min(ulong a, ulong b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong2 __attribute__((const, overloadable))
+ min(ulong2 a, ulong2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong3 __attribute__((const, overloadable))
+ min(ulong3 a, ulong3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern ulong4 __attribute__((const, overloadable))
+ min(ulong4 a, ulong4 b);
+#endif
+
+/*
+ * mix: Mixes two values
+ *
+ * Returns start + ((stop - start) * fraction).
+ *
+ * This can be useful for mixing two values. For example, to create a new color that is
+ * 40% color1 and 60% color2, use mix(color1, color2, 0.6f).
+ */
+extern float __attribute__((const, overloadable))
+ mix(float start, float stop, float fraction);
+
+extern float2 __attribute__((const, overloadable))
+ mix(float2 start, float2 stop, float2 fraction);
+
+extern float3 __attribute__((const, overloadable))
+ mix(float3 start, float3 stop, float3 fraction);
+
+extern float4 __attribute__((const, overloadable))
+ mix(float4 start, float4 stop, float4 fraction);
+
+extern float2 __attribute__((const, overloadable))
+ mix(float2 start, float2 stop, float fraction);
+
+extern float3 __attribute__((const, overloadable))
+ mix(float3 start, float3 stop, float fraction);
+
+extern float4 __attribute__((const, overloadable))
+ mix(float4 start, float4 stop, float fraction);
+
+/*
+ * modf: Integral and fractional components
+ *
+ * Returns the integral and fractional components of a number.
+ *
+ * Both components will have the same sign as x. For example, for an input of -3.72f,
+ * iret will be set to -3.f and .72f will be returned.
+ *
+ * Parameters:
+ * v: Source value.
+ * integral_part: *integral_part will be set to the integral portion of the number.
+ *
+ * Returns: Floating point portion of the value.
+ */
+extern float __attribute__((overloadable))
+ modf(float v, float* integral_part);
+
+extern float2 __attribute__((overloadable))
+ modf(float2 v, float2* integral_part);
+
+extern float3 __attribute__((overloadable))
+ modf(float3 v, float3* integral_part);
+
+extern float4 __attribute__((overloadable))
+ modf(float4 v, float4* integral_part);
+
+/*
+ * nan: Not a Number
+ *
+ * Returns a NaN value (Not a Number).
+ *
+ * Parameters:
+ * v: Not used.
+ */
+extern float __attribute__((const, overloadable))
+ nan(uint v);
+
+/*
+ * native_acos: Approximate inverse cosine
+ *
+ * Returns the approximate inverse cosine, in radians.
+ *
+ * This function yields undefined results from input values less than -1 or greater than 1.
+ *
+ * See also acos().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_acos(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_acos(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_acos(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_acos(float4 v);
+#endif
+
+/*
+ * native_acosh: Approximate inverse hyperbolic cosine
+ *
+ * Returns the approximate inverse hyperbolic cosine, in radians.
+ *
+ * See also acosh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_acosh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_acosh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_acosh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_acosh(float4 v);
+#endif
+
+/*
+ * native_acospi: Approximate inverse cosine divided by pi
+ *
+ * Returns the approximate inverse cosine in radians, divided by pi.
+ *
+ * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
+ *
+ * This function yields undefined results from input values less than -1 or greater than 1.
+ *
+ * See also acospi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_acospi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_acospi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_acospi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_acospi(float4 v);
+#endif
+
+/*
+ * native_asin: Approximate inverse sine
+ *
+ * Returns the approximate inverse sine, in radians.
+ *
+ * This function yields undefined results from input values less than -1 or greater than 1.
+ *
+ * See also asin().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_asin(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_asin(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_asin(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_asin(float4 v);
+#endif
+
+/*
+ * native_asinh: Approximate inverse hyperbolic sine
+ *
+ * Returns the approximate inverse hyperbolic sine, in radians.
+ *
+ * See also asinh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_asinh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_asinh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_asinh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_asinh(float4 v);
+#endif
+
+/*
+ * native_asinpi: Approximate inverse sine divided by pi
+ *
+ * Returns the approximate inverse sine in radians, divided by pi.
+ *
+ * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
+ *
+ * This function yields undefined results from input values less than -1 or greater than 1.
+ *
+ * See also asinpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_asinpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_asinpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_asinpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_asinpi(float4 v);
+#endif
+
+/*
+ * native_atan: Approximate inverse tangent
+ *
+ * Returns the approximate inverse tangent, in radians.
+ *
+ * See also atan().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atan(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atan(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atan(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atan(float4 v);
+#endif
+
+/*
+ * native_atan2: Approximate inverse tangent of a ratio
+ *
+ * Returns the approximate inverse tangent of (numerator / denominator), in radians.
+ *
+ * See also atan2().
+ *
+ * Parameters:
+ * numerator: Numerator.
+ * denominator: Denominator. Can be 0.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atan2(float numerator, float denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atan2(float2 numerator, float2 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atan2(float3 numerator, float3 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atan2(float4 numerator, float4 denominator);
+#endif
+
+/*
+ * native_atan2pi: Approximate inverse tangent of a ratio, divided by pi
+ *
+ * Returns the approximate inverse tangent of (numerator / denominator),
+ * in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atan2pi(n, d) * 180.f.
+ *
+ * See also atan2pi().
+ *
+ * Parameters:
+ * numerator: Numerator.
+ * denominator: Denominator. Can be 0.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atan2pi(float numerator, float denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atan2pi(float2 numerator, float2 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atan2pi(float3 numerator, float3 denominator);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atan2pi(float4 numerator, float4 denominator);
+#endif
+
+/*
+ * native_atanh: Approximate inverse hyperbolic tangent
+ *
+ * Returns the approximate inverse hyperbolic tangent, in radians.
+ *
+ * See also atanh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atanh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atanh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atanh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atanh(float4 v);
+#endif
+
+/*
+ * native_atanpi: Approximate inverse tangent divided by pi
+ *
+ * Returns the approximate inverse tangent in radians, divided by pi.
+ *
+ * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
+ *
+ * See also atanpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_atanpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_atanpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_atanpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_atanpi(float4 v);
+#endif
+
+/*
+ * native_cbrt: Approximate cube root
+ *
+ * Returns the approximate cubic root.
+ *
+ * See also cbrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cbrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cbrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cbrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cbrt(float4 v);
+#endif
+
+/*
+ * native_cos: Approximate cosine
+ *
+ * Returns the approximate cosine of an angle measured in radians.
+ *
+ * See also cos().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cos(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cos(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cos(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cos(float4 v);
+#endif
+
+/*
+ * native_cosh: Approximate hypebolic cosine
+ *
+ * Returns the approximate hypebolic cosine.
+ *
+ * See also cosh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cosh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cosh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cosh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cosh(float4 v);
+#endif
+
+/*
+ * native_cospi: Approximate cosine of a number multiplied by pi
+ *
+ * Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the cosine of a value measured in degrees, call cospi(v / 180.f).
+ *
+ * See also cospi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_cospi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_cospi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_cospi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_cospi(float4 v);
+#endif
+
+/*
+ * native_divide: Approximate division
+ *
+ * Computes the approximate division of two values.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_divide(float left_vector, float right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_divide(float2 left_vector, float2 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_divide(float3 left_vector, float3 right_vector);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_divide(float4 left_vector, float4 right_vector);
+#endif
+
+/*
+ * native_exp: Approximate e raised to a number
+ *
+ * Fast approximate exp.
+ *
+ * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be
+ * expected from using 16 bit floating point values.
+ *
+ * See also exp().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_exp(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_exp(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_exp(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_exp(float4 v);
+#endif
+
+/*
+ * native_exp10: Approximate 10 raised to a number
+ *
+ * Fast approximate exp10.
+ *
+ * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be
+ * expected from using 16 bit floating point values.
+ *
+ * See also exp10().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_exp10(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_exp10(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_exp10(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_exp10(float4 v);
+#endif
+
+/*
+ * native_exp2: Approximate 2 raised to a number
+ *
+ * Fast approximate exp2.
+ *
+ * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be
+ * expected from using 16 bit floating point values.
+ *
+ * See also exp2().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_exp2(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_exp2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_exp2(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_exp2(float4 v);
+#endif
+
+/*
+ * native_expm1: Approximate e raised to a number minus one
+ *
+ * Returns the approximate (e ^ v) - 1.
+ *
+ * See also expm1().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_expm1(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_expm1(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_expm1(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_expm1(float4 v);
+#endif
+
+/*
+ * native_hypot: Approximate hypotenuse
+ *
+ * Returns the approximate native_sqrt(a * a + b * b)
+ *
+ * See also hypot().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_hypot(float a, float b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_hypot(float2 a, float2 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_hypot(float3 a, float3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_hypot(float4 a, float4 b);
+#endif
+
+/*
+ * native_log: Approximate natural logarithm
+ *
+ * Fast approximate log.
+ *
+ * It is not accurate for values very close to zero.
+ *
+ * See also log().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_log(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_log(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_log(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_log(float4 v);
+#endif
+
+/*
+ * native_log10: Approximate base 10 logarithm
+ *
+ * Fast approximate log10.
+ *
+ * It is not accurate for values very close to zero.
+ *
+ * See also log10().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_log10(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_log10(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_log10(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_log10(float4 v);
+#endif
+
+/*
+ * native_log1p: Approximate natural logarithm of a value plus 1
+ *
+ * Returns the approximate natural logarithm of (v + 1.0f)
+ *
+ * See also log1p().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_log1p(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_log1p(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_log1p(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_log1p(float4 v);
+#endif
+
+/*
+ * native_log2: Approximate base 2 logarithm
+ *
+ * Fast approximate log2.
+ *
+ * It is not accurate for values very close to zero.
+ *
+ * See also log2().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_log2(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_log2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_log2(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_log2(float4 v);
+#endif
+
+/*
+ * native_powr: Approximate positive base raised to an exponent
+ *
+ * Fast approximate (base ^ exponent).
+ *
+ * See also powr().
+ *
+ * Parameters:
+ * base: Must be between 0.f and 256.f. The function is not accurate for values very close to zero.
+ * exponent: Must be between -15.f and 15.f.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float __attribute__((const, overloadable))
+ native_powr(float base, float exponent);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float2 __attribute__((const, overloadable))
+ native_powr(float2 base, float2 exponent);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float3 __attribute__((const, overloadable))
+ native_powr(float3 base, float3 exponent);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+extern float4 __attribute__((const, overloadable))
+ native_powr(float4 base, float4 exponent);
+#endif
+
+/*
+ * native_recip: Approximate reciprocal
+ *
+ * Returns the approximate approximate reciprocal of a value.
+ *
+ * See also half_recip().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_recip(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_recip(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_recip(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_recip(float4 v);
+#endif
+
+/*
+ * native_rootn: Approximate nth root
+ *
+ * Compute the approximate Nth root of a value.
+ *
+ * See also rootn().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_rootn(float v, int n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_rootn(float2 v, int2 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_rootn(float3 v, int3 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_rootn(float4 v, int4 n);
+#endif
+
+/*
+ * native_rsqrt: Approximate reciprocal of a square root
+ *
+ * Returns approximate (1 / sqrt(v)).
+ *
+ * See also rsqrt(), half_rsqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_rsqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_rsqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_rsqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_rsqrt(float4 v);
+#endif
+
+/*
+ * native_sin: Approximate sine
+ *
+ * Returns the approximate sine of an angle measured in radians.
+ *
+ * See also sin().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sin(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sin(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sin(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sin(float4 v);
+#endif
+
+/*
+ * native_sincos: Approximate sine and cosine
+ *
+ * Returns the approximate sine and cosine of a value.
+ *
+ * See also sincos().
+ *
+ * Parameters:
+ * v: Incoming value in radians.
+ * cos: *cos will be set to the cosine value.
+ *
+ * Returns: Sine.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((overloadable))
+ native_sincos(float v, float* cos);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((overloadable))
+ native_sincos(float2 v, float2* cos);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((overloadable))
+ native_sincos(float3 v, float3* cos);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((overloadable))
+ native_sincos(float4 v, float4* cos);
+#endif
+
+/*
+ * native_sinh: Approximate hyperbolic sine
+ *
+ * Returns the approximate hyperbolic sine of a value specified in radians.
+ *
+ * See also sinh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sinh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sinh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sinh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sinh(float4 v);
+#endif
+
+/*
+ * native_sinpi: Approximate sine of a number multiplied by pi
+ *
+ * Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the sine of a value measured in degrees, call sinpi(v / 180.f).
+ *
+ * See also sinpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sinpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sinpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sinpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sinpi(float4 v);
+#endif
+
+/*
+ * native_sqrt: Approximate square root
+ *
+ * Returns the approximate sqrt(v).
+ *
+ * See also sqrt(), half_sqrt().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_sqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_sqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_sqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_sqrt(float4 v);
+#endif
+
+/*
+ * native_tan: Approximate tangent
+ *
+ * Returns the approximate tangent of an angle measured in radians.
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_tan(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_tan(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_tan(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_tan(float4 v);
+#endif
+
+/*
+ * native_tanh: Approximate hyperbolic tangent
+ *
+ * Returns the approximate hyperbolic tangent of a value.
+ *
+ * See also tanh().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_tanh(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_tanh(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_tanh(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_tanh(float4 v);
+#endif
+
+/*
+ * native_tanpi: Approximate tangent of a number multiplied by pi
+ *
+ * Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the tangent of a value measured in degrees, call tanpi(v / 180.f).
+ *
+ * See also tanpi().
+ */
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float __attribute__((const, overloadable))
+ native_tanpi(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ native_tanpi(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ native_tanpi(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ native_tanpi(float4 v);
+#endif
+
+/*
+ * nextafter: Next floating point number
+ *
+ * Returns the next representable floating point number from v towards target.
+ *
+ * In rs_fp_relaxed mode, a denormalized input value may not yield the next denormalized
+ * value, as support of denormalized values is optional in relaxed mode.
+ */
+extern float __attribute__((const, overloadable))
+ nextafter(float v, float target);
+
+extern float2 __attribute__((const, overloadable))
+ nextafter(float2 v, float2 target);
+
+extern float3 __attribute__((const, overloadable))
+ nextafter(float3 v, float3 target);
+
+extern float4 __attribute__((const, overloadable))
+ nextafter(float4 v, float4 target);
+
+/*
+ * pow: Base raised to an exponent
+ *
+ * Returns base raised to the power exponent, i.e. base ^ exponent.
+ *
+ * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the
+ * base to be non-negative.
+ */
+extern float __attribute__((const, overloadable))
+ pow(float base, float exponent);
+
+extern float2 __attribute__((const, overloadable))
+ pow(float2 base, float2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ pow(float3 base, float3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ pow(float4 base, float4 exponent);
+
+/*
+ * pown: Base raised to an integer exponent
+ *
+ * Returns base raised to the power exponent, i.e. base ^ exponent.
+ *
+ * pow() and powr() are similar. The both take a float exponent. powr() also assumes the
+ * base to be non-negative.
+ */
+extern float __attribute__((const, overloadable))
+ pown(float base, int exponent);
+
+extern float2 __attribute__((const, overloadable))
+ pown(float2 base, int2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ pown(float3 base, int3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ pown(float4 base, int4 exponent);
+
+/*
+ * powr: Positive base raised to an exponent
+ *
+ * Returns base raised to the power exponent, i.e. base ^ exponent. base must be >= 0.
+ *
+ * pow() and pown() are similar. They both make no assumptions about the base.
+ * pow() takes a float exponent while pown() take an integer.
+ *
+ * See also native_powr().
+ */
+extern float __attribute__((const, overloadable))
+ powr(float base, float exponent);
+
+extern float2 __attribute__((const, overloadable))
+ powr(float2 base, float2 exponent);
+
+extern float3 __attribute__((const, overloadable))
+ powr(float3 base, float3 exponent);
+
+extern float4 __attribute__((const, overloadable))
+ powr(float4 base, float4 exponent);
+
+/*
+ * radians: Converts degrees into radians
+ *
+ * Converts from degrees to radians.
+ */
+extern float __attribute__((const, overloadable))
+ radians(float v);
+
+extern float2 __attribute__((const, overloadable))
+ radians(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ radians(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ radians(float4 v);
+
+/*
+ * remainder: Remainder of a division
+ *
+ * Returns the remainder of (numerator / denominator), where the quotient is rounded towards
+ * the nearest integer.
+ *
+ * The function fmod() is similar but rounds toward the closest interger.
+ * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
+ * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
+ */
+extern float __attribute__((const, overloadable))
+ remainder(float numerator, float denominator);
+
+extern float2 __attribute__((const, overloadable))
+ remainder(float2 numerator, float2 denominator);
+
+extern float3 __attribute__((const, overloadable))
+ remainder(float3 numerator, float3 denominator);
+
+extern float4 __attribute__((const, overloadable))
+ remainder(float4 numerator, float4 denominator);
+
+/*
+ * remquo: Remainder and quotient of a division
+ *
+ * Returns the quotient and the remainder of (numerator / denominator).
+ *
+ * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
+ *
+ * This function is useful for implementing periodic functions. The low three bits of the
+ * quotient gives the quadrant and the remainder the distance within the quadrant.
+ * For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant)
+ * to reduce very large value of x to something within a limited range.
+ *
+ * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3
+ * and the sign negative. It returns 0.5f.
+ *
+ * Parameters:
+ * numerator: Numerator.
+ * denominator: Denominator.
+ * quotient: *quotient will be set to the integer quotient.
+ *
+ * Returns: Remainder, precise only for the low three bits.
+ */
+extern float __attribute__((overloadable))
+ remquo(float numerator, float denominator, int* quotient);
+
+extern float2 __attribute__((overloadable))
+ remquo(float2 numerator, float2 denominator, int2* quotient);
+
+extern float3 __attribute__((overloadable))
+ remquo(float3 numerator, float3 denominator, int3* quotient);
+
+extern float4 __attribute__((overloadable))
+ remquo(float4 numerator, float4 denominator, int4* quotient);
+
+/*
+ * rint: Round to even
+ *
+ * Rounds to the nearest integral value.
+ *
+ * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and
+ * rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and
+ * rint(-1.5f) returns -2.f.
+ *
+ * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
+ */
+extern float __attribute__((const, overloadable))
+ rint(float v);
+
+extern float2 __attribute__((const, overloadable))
+ rint(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ rint(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ rint(float4 v);
+
+/*
+ * rootn: Nth root
+ *
+ * Compute the Nth root of a value.
+ *
+ * See also native_rootn().
+ */
+extern float __attribute__((const, overloadable))
+ rootn(float v, int n);
+
+extern float2 __attribute__((const, overloadable))
+ rootn(float2 v, int2 n);
+
+extern float3 __attribute__((const, overloadable))
+ rootn(float3 v, int3 n);
+
+extern float4 __attribute__((const, overloadable))
+ rootn(float4 v, int4 n);
+
+/*
+ * round: Round away from zero
+ *
+ * Round to the nearest integral value.
+ *
+ * round() rounds half values away from zero. For example, round(0.5f) returns 1.f
+ * and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f
+ * and round(-1.5f) returns -2.f.
+ *
+ * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
+ */
+extern float __attribute__((const, overloadable))
+ round(float v);
+
+extern float2 __attribute__((const, overloadable))
+ round(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ round(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ round(float4 v);
+
+/*
+ * rsqrt: Reciprocal of a square root
+ *
+ * Returns (1 / sqrt(v)).
+ *
+ * See also half_rsqrt(), native_rsqrt().
+ */
+extern float __attribute__((const, overloadable))
+ rsqrt(float v);
+
+extern float2 __attribute__((const, overloadable))
+ rsqrt(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ rsqrt(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ rsqrt(float4 v);
+
+/*
+ * sign: Sign of a value
+ *
+ * Returns the sign of a value.
+ *
+ * if (v < 0) return -1.f;
+ * else if (v > 0) return 1.f;
+ * else return 0.f;
+ */
+extern float __attribute__((const, overloadable))
+ sign(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sign(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sign(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sign(float4 v);
+
+/*
+ * sin: Sine
+ *
+ * Returns the sine of an angle measured in radians.
+ *
+ * See also native_sin().
+ */
+extern float __attribute__((const, overloadable))
+ sin(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sin(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sin(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sin(float4 v);
+
+/*
+ * sincos: Sine and cosine
+ *
+ * Returns the sine and cosine of a value.
+ *
+ * See also native_sincos().
+ *
+ * Parameters:
+ * v: Incoming value in radians.
+ * cos: *cos will be set to the cosine value.
+ *
+ * Returns: Sine of v.
+ */
+extern float __attribute__((overloadable))
+ sincos(float v, float* cos);
+
+extern float2 __attribute__((overloadable))
+ sincos(float2 v, float2* cos);
+
+extern float3 __attribute__((overloadable))
+ sincos(float3 v, float3* cos);
+
+extern float4 __attribute__((overloadable))
+ sincos(float4 v, float4* cos);
+
+/*
+ * sinh: Hyperbolic sine
+ *
+ * Returns the hyperbolic sine of v, where v is measured in radians.
+ *
+ * See also native_sinh().
+ */
+extern float __attribute__((const, overloadable))
+ sinh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sinh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sinh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sinh(float4 v);
+
+/*
+ * sinpi: Sine of a number multiplied by pi
+ *
+ * Returns the sine of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the sine of a value measured in degrees, call sinpi(v / 180.f).
+ *
+ * See also native_sinpi().
+ */
+extern float __attribute__((const, overloadable))
+ sinpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sinpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sinpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sinpi(float4 v);
+
+/*
+ * sqrt: Square root
+ *
+ * Returns the square root of a value.
+ *
+ * See also half_sqrt(), native_sqrt().
+ */
+extern float __attribute__((const, overloadable))
+ sqrt(float v);
+
+extern float2 __attribute__((const, overloadable))
+ sqrt(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ sqrt(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ sqrt(float4 v);
+
+/*
+ * step: 0 if less than a value, 0 otherwise
+ *
+ * Returns 0.f if v < edge, 1.f otherwise.
+ *
+ * This can be useful to create conditional computations without using loops and branching
+ * instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i])
+ * for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
+ */
+extern float __attribute__((const, overloadable))
+ step(float edge, float v);
+
+extern float2 __attribute__((const, overloadable))
+ step(float2 edge, float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ step(float3 edge, float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ step(float4 edge, float4 v);
+
+extern float2 __attribute__((const, overloadable))
+ step(float2 edge, float v);
+
+extern float3 __attribute__((const, overloadable))
+ step(float3 edge, float v);
+
+extern float4 __attribute__((const, overloadable))
+ step(float4 edge, float v);
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float2 __attribute__((const, overloadable))
+ step(float edge, float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float3 __attribute__((const, overloadable))
+ step(float edge, float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+extern float4 __attribute__((const, overloadable))
+ step(float edge, float4 v);
+#endif
+
+/*
+ * tan: Tangent
+ *
+ * Returns the tangent of an angle measured in radians.
+ *
+ * See also native_tan().
+ */
+extern float __attribute__((const, overloadable))
+ tan(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tan(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tan(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tan(float4 v);
+
+/*
+ * tanh: Hyperbolic tangent
+ *
+ * Returns the hyperbolic tangent of a value.
+ *
+ * See also native_tanh().
+ */
+extern float __attribute__((const, overloadable))
+ tanh(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tanh(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tanh(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tanh(float4 v);
+
+/*
+ * tanpi: Tangent of a number multiplied by pi
+ *
+ * Returns the tangent of (v * pi), where (v * pi) is measured in radians.
+ *
+ * To get the tangent of a value measured in degrees, call tanpi(v / 180.f).
+ *
+ * See also native_tanpi().
+ */
+extern float __attribute__((const, overloadable))
+ tanpi(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tanpi(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tanpi(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tanpi(float4 v);
+
+/*
+ * tgamma: Gamma function
+ *
+ * Returns the gamma function of a value.
+ *
+ * See also lgamma().
+ */
+extern float __attribute__((const, overloadable))
+ tgamma(float v);
+
+extern float2 __attribute__((const, overloadable))
+ tgamma(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ tgamma(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ tgamma(float4 v);
+
+/*
+ * trunc: Truncates a floating point
+ *
+ * Rounds to integral using truncation.
+ *
+ * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
+ *
+ * See rint() and round() for other rounding options.
+ */
+extern float __attribute__((const, overloadable))
+ trunc(float v);
+
+extern float2 __attribute__((const, overloadable))
+ trunc(float2 v);
+
+extern float3 __attribute__((const, overloadable))
+ trunc(float3 v);
+
+extern float4 __attribute__((const, overloadable))
+ trunc(float4 v);
+
+/*
+ * rsClamp: Restrain a value to a range
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Clamp a value between low and high.
+ *
+ * Parameters:
+ * amount: Value to clamp.
+ * low: Lower bound.
+ * high: Upper bound.
+ */
+extern char __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
+ rsClamp(char amount, char low, char high);
+
+extern uchar __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
+ rsClamp(uchar amount, uchar low, uchar high);
+
+extern short __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
+ rsClamp(short amount, short low, short high);
+
+extern ushort __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
+ rsClamp(ushort amount, ushort low, ushort high);
+
+extern int __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
+ rsClamp(int amount, int low, int high);
+
+extern uint __attribute__((const, always_inline, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use clamp() instead.")
+#endif
+))
+ rsClamp(uint amount, uint low, uint high);
+
+/*
+ * rsFrac: Returns the fractional part of a float
+ *
+ * DEPRECATED. Do not use.
+ *
+ * Returns the fractional part of a float
+ */
+extern float __attribute__((const, overloadable
+#if (defined(RS_VERSION) && (RS_VERSION >= 22))
+, deprecated("Use fract() instead.")
+#endif
+))
+ rsFrac(float v);
+
+/*
+ * rsRand: Pseudo-random number
+ *
+ * Return a random value between 0 (or min_value) and max_malue.
+ */
+extern int __attribute__((overloadable))
+ rsRand(int max_value);
+
+extern int __attribute__((overloadable))
+ rsRand(int min_value, int max_value);
+
+extern float __attribute__((overloadable))
+ rsRand(float max_value);
+
+extern float __attribute__((overloadable))
+ rsRand(float min_value, float max_value);
+
+#endif // RENDERSCRIPT_RS_MATH_RSH
diff --git a/23.0.3/include/rs_matrix.rsh b/23.0.3/include/rs_matrix.rsh
new file mode 100644
index 0000000..aafc864
--- /dev/null
+++ b/23.0.3/include/rs_matrix.rsh
@@ -0,0 +1,596 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+static inline void __attribute__((always_inline, 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;
+}
+
+/*
+ * 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.
+ */
+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;
+}
+
+/*
+ * 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
diff --git a/23.0.3/include/rs_object_info.rsh b/23.0.3/include/rs_object_info.rsh
new file mode 100644
index 0000000..d4c40fe
--- /dev/null
+++ b/23.0.3/include/rs_object_info.rsh
@@ -0,0 +1,462 @@
+/*
+ * Copyright (C) 2015 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
diff --git a/23.0.3/include/rs_object_types.rsh b/23.0.3/include/rs_object_types.rsh
new file mode 100644
index 0000000..9b11b32
--- /dev/null
+++ b/23.0.3/include/rs_object_types.rsh
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2015 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_HANDLE \
+struct {\
+ const int* const p;\
+} __attribute__((packed, aligned(4)))
+#else
+#define _RS_HANDLE \
+struct {\
+ const long* const p;\
+ const long* const r;\
+ const long* const v1;\
+ const long* const v2;\
+}
+#endif
+
+/*
+ * rs_element: Handle to an element
+ *
+ * An opaque handle to a RenderScript element.
+ *
+ * See android.renderscript.Element.
+ */
+typedef _RS_HANDLE rs_element;
+
+/*
+ * rs_type: Handle to a Type
+ *
+ * An opaque handle to a RenderScript type.
+ *
+ * See android.renderscript.Type.
+ */
+typedef _RS_HANDLE rs_type;
+
+/*
+ * rs_allocation: Handle to an allocation
+ *
+ * An opaque handle to a RenderScript allocation.
+ *
+ * See android.renderscript.Allocation.
+ */
+typedef _RS_HANDLE rs_allocation;
+
+/*
+ * rs_sampler: Handle to a Sampler
+ *
+ * An opaque handle to a RenderScript sampler object.
+ *
+ * See android.renderscript.Sampler.
+ */
+typedef _RS_HANDLE rs_sampler;
+
+/*
+ * rs_script: Handle to a Script
+ *
+ * An opaque handle to a RenderScript script object.
+ *
+ * See android.renderscript.ScriptC.
+ */
+typedef _RS_HANDLE 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, // Deprecated.
+ 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_32 = 2, // A 32 bit float 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_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
diff --git a/23.0.3/include/rs_quaternion.rsh b/23.0.3/include/rs_quaternion.rsh
new file mode 100644
index 0000000..524eeb0
--- /dev/null
+++ b/23.0.3/include/rs_quaternion.rsh
@@ -0,0 +1,290 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+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;
+}
+
+/*
+ * rsQuaternionConjugate: Conjugate a quaternion
+ *
+ * Conjugates the quaternion.
+ *
+ * Parameters:
+ * q: Quaternion to modify.
+ */
+static inline void __attribute__((overloadable))
+ rsQuaternionConjugate(rs_quaternion* q) {
+ q->x = -q->x;
+ q->y = -q->y;
+ q->z = -q->z;
+}
+
+/*
+ * rsQuaternionDot: Dot product of two quaternions
+ *
+ * Returns the dot product of two quaternions.
+ *
+ * Parameters:
+ * q0: First quaternion.
+ * q1: Second quaternion.
+ */
+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;
+}
+
+/*
+ * rsQuaternionGetMatrixUnit: Get a rotation matrix from a quaternion
+ *
+ * Computes a rotation matrix from the normalized quaternion.
+ *
+ * Parameters:
+ * m: Resulting matrix.
+ * q: Normalized quaternion.
+ */
+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;
+}
+
+/*
+ * 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.
+ */
+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;
+}
+
+/*
+ * 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.
+ */
+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;
+}
+
+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;
+}
+
+/*
+ * 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.
+ */
+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);
+}
+
+/*
+ * rsQuaternionNormalize: Normalize a quaternion
+ *
+ * Normalizes the quaternion.
+ *
+ * Parameters:
+ * q: Quaternion to normalize.
+ */
+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;
+ }
+}
+
+/*
+ * 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.
+ */
+static inline void __attribute__((overloadable))
+ rsQuaternionMultiply(rs_quaternion* q, float scalar) {
+ q->w *= scalar;
+ q->x *= scalar;
+ q->y *= scalar;
+ q->z *= scalar;
+}
+
+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);
+}
+
+/*
+ * 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.
+ */
+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 // RENDERSCRIPT_RS_QUATERNION_RSH
diff --git a/23.0.3/include/rs_time.rsh b/23.0.3/include/rs_time.rsh
new file mode 100644
index 0000000..05987f8
--- /dev/null
+++ b/23.0.3/include/rs_time.rsh
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2015 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
diff --git a/23.0.3/include/rs_value_types.rsh b/23.0.3/include/rs_value_types.rsh
new file mode 100644
index 0000000..faf397c
--- /dev/null
+++ b/23.0.3/include/rs_value_types.rsh
@@ -0,0 +1,543 @@
+/*
+ * Copyright (C) 2015 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 parentheses, 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
diff --git a/23.0.3/include/rs_vector_math.rsh b/23.0.3/include/rs_vector_math.rsh
new file mode 100644
index 0000000..a2757e9
--- /dev/null
+++ b/23.0.3/include/rs_vector_math.rsh
@@ -0,0 +1,303 @@
+/*
+ * Copyright (C) 2015 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);
+
+/*
+ * 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);
+
+/*
+ * 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);
+
+/*
+ * 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);
+
+/*
+ * 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
+
+/*
+ * 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
+
+/*
+ * 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
+
+/*
+ * 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);
+
+#endif // RENDERSCRIPT_RS_VECTOR_MATH_RSH