diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs index 8d010a1495396..f3f2e5e7e780e 100644 --- a/docs/html/guide/guide_toc.cs +++ b/docs/html/guide/guide_toc.cs @@ -357,8 +357,61 @@
| + M_1_PI + | ++ 1 / pi, as a 32 bit float + | +
| + M_2_PI + | ++ 2 / pi, as a 32 bit float + | +
| + M_2_SQRTPI + | ++ 2 / sqrt(pi), as a 32 bit float + | +
| + M_E + | ++ e, as a 32 bit float + | +
| + M_LN10 + | ++ log_e(10), as a 32 bit float + | +
| + M_LN2 + | ++ log_e(2), as a 32 bit float + | +
| + M_LOG10E + | ++ log_10(e), as a 32 bit float + | +
| + M_LOG2E + | ++ log_2(e), as a 32 bit float + | +
| + M_PI + | ++ pi, as a 32 bit float + | +
| + M_PI_2 + | ++ pi / 2, as a 32 bit float + | +
| + M_PI_4 + | ++ pi / 4, as a 32 bit float + | +
| + M_SQRT1_2 + | ++ 1 / sqrt(2), as a 32 bit float + | +
| + M_SQRT2 + | ++ sqrt(2), as a 32 bit float + | +
| + char2 + | ++ Two 8 bit signed integers + | +
| + char3 + | ++ Three 8 bit signed integers + | +
| + char4 + | ++ Four 8 bit signed integers + | +
| + double2 + | ++ Two 64 bit floats + | +
| + double3 + | ++ Three 64 bit floats + | +
| + double4 + | ++ Four 64 bit floats + | +
| + float2 + | ++ Two 32 bit floats + | +
| + float3 + | ++ Three 32 bit floats + | +
| + float4 + | ++ Four 32 bit floats + | +
| + int16_t + | ++ 16 bit signed integer + | +
| + int2 + | ++ Two 32 bit signed integers + | +
| + int3 + | ++ Three 32 bit signed integers + | +
| + int32_t + | ++ 32 bit signed integer + | +
| + int4 + | ++ Four 32 bit signed integers + | +
| + int64_t + | ++ 64 bit signed integer + | +
| + int8_t + | ++ 8 bit signed integer + | +
| + long2 + | ++ Two 64 bit signed integers + | +
| + long3 + | ++ Three 64 bit signed integers + | +
| + long4 + | ++ Four 64 bit signed integers + | +
| + rs_allocation + | ++ Handle to an allocation + | +
| + rs_allocation_cubemap_face + | ++ Enum for selecting cube map faces + | +
| + rs_allocation_usage_type + | ++ Bitfield to specify how an allocation is used + | +
| + rs_data_kind + | ++ Element data kind + | +
| + rs_data_type + | ++ Element basic data type + | +
| + rs_element + | ++ Handle to an element + | +
| + rs_for_each_strategy_t + | ++ Suggested cell processing order + | +
| + rs_matrix2x2 + | ++ 2x2 matrix of 32 bit floats + | +
| + rs_matrix3x3 + | ++ 3x3 matrix of 32 bit floats + | +
| + rs_matrix4x4 + | ++ 4x4 matrix of 32 bit floats + | +
| + rs_quaternion + | ++ Quaternion + | +
| + rs_sampler + | ++ Handle to a Sampler + | +
| + rs_sampler_value + | ++ Sampler wrap T value + | +
| + rs_script + | ++ Handle to a Script + | +
| + rs_script_call_t + | ++ Cell iteration information + | +
| + rs_time_t + | ++ Seconds since January 1, 1970 + | +
| + rs_tm + | ++ Date and time structure + | +
| + rs_type + | ++ Handle to a Type + | +
| + short2 + | ++ Two 16 bit signed integers + | +
| + short3 + | ++ Three 16 bit signed integers + | +
| + short4 + | ++ Four 16 bit signed integers + | +
| + size_t + | ++ Unsigned size type + | +
| + ssize_t + | ++ Signed size type + | +
| + uchar + | ++ 8 bit unsigned integer + | +
| + uchar2 + | ++ Two 8 bit unsigned integers + | +
| + uchar3 + | ++ Three 8 bit unsigned integers + | +
| + uchar4 + | ++ Four 8 bit unsigned integers + | +
| + uint + | ++ 32 bit unsigned integer + | +
| + uint16_t + | ++ 16 bit unsigned integer + | +
| + uint2 + | ++ Two 32 bit unsigned integers + | +
| + uint3 + | ++ Three 32 bit unsigned integers + | +
| + uint32_t + | ++ 32 bit unsigned integer + | +
| + uint4 + | ++ Four 32 bit unsigned integers + | +
| + uint64_t + | ++ 64 bit unsigned integer + | +
| + uint8_t + | ++ 8 bit unsigned integer + | +
| + ulong + | ++ 64 bit unsigned integer + | +
| + ulong2 + | ++ Two 64 bit unsigned integers + | +
| + ulong3 + | ++ Three 64 bit unsigned integers + | +
| + ulong4 + | ++ Four 64 bit unsigned integers + | +
| + ushort + | ++ 16 bit unsigned integer + | +
| + ushort2 + | ++ Two 16 bit unsigned integers + | +
| + ushort3 + | ++ Three 16 bit unsigned integers + | +
| + ushort4 + | ++ Four 16 bit unsigned integers + | +
| + abs + | ++ Absolute value of an integer + | +
| + acos + | ++ Inverse cosine + | +
| + acosh + | ++ Inverse hyperbolic cosine + | +
| + acospi + | ++ Inverse cosine divided by pi + | +
| + asin + | ++ Inverse sine + | +
| + asinh + | ++ Inverse hyperbolic sine + | +
| + asinpi + | ++ Inverse sine divided by pi + | +
| + atan + | ++ Inverse tangent + | +
| + atan2 + | ++ Inverse tangent of a ratio + | +
| + atan2pi + | ++ Inverse tangent of a ratio, divided by pi + | +
| + atanh + | ++ Inverse hyperbolic tangent + | +
| + atanpi + | ++ Inverse tangent divided by pi + | +
| + cbrt + | ++ Cube root + | +
| + ceil + | ++ Smallest integer not less than a value + | +
| + clamp + | ++ Restrain a value to a range + | +
| + clz + | ++ Number of leading 0 bits + | +
| + convert + | ++ Convert numerical vectors + | +
| + copysign + | ++ Copies the sign of a number to another + | +
| + cos + | ++ Cosine + | +
| + cosh + | ++ Hypebolic cosine + | +
| + cospi + | ++ Cosine of a number multiplied by pi + | +
| + cross + | ++ Cross product of two vectors + | +
| + degrees + | ++ Converts radians into degrees + | +
| + distance + | ++ Distance between two points + | +
| + dot + | ++ Dot product of two vectors + | +
| + erf + | ++ Mathematical error function + | +
| + erfc + | ++ Mathematical complementary error function + | +
| + exp + | ++ e raised to a number + | +
| + exp10 + | ++ 10 raised to a number + | +
| + exp2 + | ++ 2 raised to a number + | +
| + expm1 + | ++ e raised to a number minus one + | +
| + fabs + | ++ Absolute value of a float + | +
| + fast_distance + | ++ Approximate distance between two points + | +
| + fast_length + | ++ Approximate length of a vector + | +
| + fast_normalize + | ++ Approximate normalized vector + | +
| + fdim + | ++ Positive difference between two values + | +
| + floor + | ++ Smallest integer not greater than a value + | +
| + fma + | ++ Multiply and add + | +
| + fmax + | ++ Maximum of two floats + | +
| + fmin + | ++ Minimum of two floats + | +
| + fmod + | ++ Modulo + | +
| + fract + | ++ Positive fractional part + | +
| + frexp + | ++ Binary mantissa and exponent + | +
| + half_recip + | ++ Reciprocal computed to 16 bit precision + | +
| + half_rsqrt + | ++ Reciprocal of a square root computed to 16 bit precision + | +
| + half_sqrt + | ++ Square root computed to 16 bit precision + | +
| + hypot + | ++ Hypotenuse + | +
| + ilogb + | ++ Base two exponent + | +
| + ldexp + | ++ Creates a floating point from mantissa and exponent + | +
| + length + | ++ Length of a vector + | +
| + lgamma + | ++ Natural logarithm of the gamma function + | +
| + log + | ++ Natural logarithm + | +
| + log10 + | ++ Base 10 logarithm + | +
| + log1p + | ++ Natural logarithm of a value plus 1 + | +
| + log2 + | ++ Base 2 logarithm + | +
| + logb + | ++ Base two exponent + | +
| + mad + | ++ Multiply and add + | +
| + max + | ++ Maximum + | +
| + min + | ++ Minimum + | +
| + mix + | ++ Mixes two values + | +
| + modf + | ++ Integral and fractional components + | +
| + nan + | ++ Not a Number + | +
| + native_acos + | ++ Approximate inverse cosine + | +
| + native_acosh + | ++ Approximate inverse hyperbolic cosine + | +
| + native_acospi + | ++ Approximate inverse cosine divided by pi + | +
| + native_asin + | ++ Approximate inverse sine + | +
| + native_asinh + | ++ Approximate inverse hyperbolic sine + | +
| + native_asinpi + | ++ Approximate inverse sine divided by pi + | +
| + native_atan + | ++ Approximate inverse tangent + | +
| + native_atan2 + | ++ Approximate inverse tangent of a ratio + | +
| + native_atan2pi + | ++ Approximate inverse tangent of a ratio, divided by pi + | +
| + native_atanh + | ++ Approximate inverse hyperbolic tangent + | +
| + native_atanpi + | ++ Approximate inverse tangent divided by pi + | +
| + native_cbrt + | ++ Approximate cube root + | +
| + native_cos + | ++ Approximate cosine + | +
| + native_cosh + | ++ Approximate hypebolic cosine + | +
| + native_cospi + | ++ Approximate cosine of a number multiplied by pi + | +
| + native_distance + | ++ Approximate distance between two points + | +
| + native_divide + | ++ Approximate division + | +
| + native_exp + | ++ Approximate e raised to a number + | +
| + native_exp10 + | ++ Approximate 10 raised to a number + | +
| + native_exp2 + | ++ Approximate 2 raised to a number + | +
| + native_expm1 + | ++ Approximate e raised to a number minus one + | +
| + native_hypot + | ++ Approximate hypotenuse + | +
| + native_length + | ++ Approximate length of a vector + | +
| + native_log + | ++ Approximate natural logarithm + | +
| + native_log10 + | ++ Approximate base 10 logarithm + | +
| + native_log1p + | ++ Approximate natural logarithm of a value plus 1 + | +
| + native_log2 + | ++ Approximate base 2 logarithm + | +
| + native_normalize + | ++ Approximately normalize a vector + | +
| + native_powr + | ++ Approximate positive base raised to an exponent + | +
| + native_recip + | ++ Approximate reciprocal + | +
| + native_rootn + | ++ Approximate nth root + | +
| + native_rsqrt + | ++ Approximate reciprocal of a square root + | +
| + native_sin + | ++ Approximate sine + | +
| + native_sincos + | ++ Approximate sine and cosine + | +
| + native_sinh + | ++ Approximate hyperbolic sine + | +
| + native_sinpi + | ++ Approximate sine of a number multiplied by pi + | +
| + native_sqrt + | ++ Approximate square root + | +
| + native_tan + | ++ Approximate tangent + | +
| + native_tanh + | ++ Approximate hyperbolic tangent + | +
| + native_tanpi + | ++ Approximate tangent of a number multiplied by pi + | +
| + nextafter + | ++ Next floating point number + | +
| + normalize + | ++ Normalize a vector + | +
| + pow + | ++ Base raised to an exponent + | +
| + pown + | ++ Base raised to an integer exponent + | +
| + powr + | ++ Positive base raised to an exponent + | +
| + radians + | ++ Converts degrees into radians + | +
| + remainder + | ++ Remainder of a division + | +
| + remquo + | ++ Remainder and quotient of a division + | +
| + rint + | ++ Round to even + | +
| + rootn + | ++ Nth root + | +
| + round + | ++ Round away from zero + | +
| + rsAllocationCopy1DRange + | ++ Copy consecutive cells between allocations + | +
| + rsAllocationCopy2DRange + | ++ Copy a rectangular region of cells between allocations + | +
| + rsAllocationGetDimFaces + | ++ Presence of more than one face + | +
| + rsAllocationGetDimLOD + | ++ Presence of levels of detail + | +
| + rsAllocationGetDimX + | ++ Size of the X dimension + | +
| + rsAllocationGetDimY + | ++ Size of the Y dimension + | +
| + rsAllocationGetDimZ + | ++ Size of the Z dimension + | +
| + rsAllocationGetElement + | ++ Get the object that describes the cell of an Allocation + | +
| + rsAllocationIoReceive + | ++ Receive new content from the queue + | +
| + rsAllocationIoSend + | ++ Send new content to the queue + | +
| + rsAllocationVLoadX + | ++ Get a vector from an allocation of scalars + | +
| + rsAllocationVStoreX + | ++ Store a vector into an allocation of scalars + | +
| + rsAtomicAdd + | ++ Thread-safe addition + | +
| + rsAtomicAnd + | ++ Thread-safe bitwise and + | +
| + rsAtomicCas + | ++ Thread-safe compare and set + | +
| + rsAtomicDec + | ++ Thread-safe decrement + | +
| + rsAtomicInc + | ++ Thread-safe increment + | +
| + rsAtomicMax + | ++ Thread-safe maximum + | +
| + rsAtomicMin + | ++ Thread-safe minimum + | +
| + rsAtomicOr + | ++ Thread-safe bitwise or + | +
| + rsAtomicSub + | ++ Thread-safe subtraction + | +
| + rsAtomicXor + | ++ Thread-safe bitwise exclusive or + | +
| + rsClearObject + | ++ Release an object + | +
| + rsDebug + | ++ Log a message and values + | +
| + rsElementGetBytesSize + | ++ Size of an Element + | +
| + rsElementGetDataKind + | ++ Kind of an Element + | +
| + rsElementGetDataType + | ++ Data type of an Element + | +
| + rsElementGetSubElement + | ++ Sub-element of a complex Element + | +
| + rsElementGetSubElementArraySize + | ++ Array size of a sub-element of a complex Element + | +
| + rsElementGetSubElementCount + | ++ Number of sub-elements + | +
| + rsElementGetSubElementName + | ++ Name of a sub-element + | +
| + rsElementGetSubElementNameLength + | ++ Length of the name of a sub-element + | +
| + rsElementGetSubElementOffsetBytes + | ++ Offset of the instantiated sub-element + | +
| + rsElementGetVectorSize + | ++ Vector size of the Element + | +
| + rsExtractFrustumPlanes + | ++ Compute frustum planes + | +
| + rsForEach + | ++ Invoke the root kernel of a script + | +
| + rsGetDt + | ++ Elapsed time since last call + | +
| + rsGetElementAt + | ++ Return a cell from an allocation + | +
| + rsGetElementAtYuv_uchar_U + | ++ Get the U component of an allocation of YUVs + | +
| + rsGetElementAtYuv_uchar_V + | ++ Get the V component of an allocation of YUVs + | +
| + rsGetElementAtYuv_uchar_Y + | ++ Get the Y component of an allocation of YUVs + | +
| + rsIsObject + | ++ Check for an empty handle + | +
| + rsIsSphereInFrustum + | ++ Checks if a sphere is within the frustum planes + | +
| + rsLocaltime + | ++ Convert to local time + | +
| + rsMatrixGet + | ++ Get one element + | +
| + rsMatrixInverse + | ++ Inverts a matrix in place + | +
| + rsMatrixInverseTranspose + | ++ Inverts and transpose a matrix in place + | +
| + rsMatrixLoad + | ++ Load or copy a matrix + | +
| + rsMatrixLoadFrustum + | ++ Load a frustum projection matrix + | +
| + rsMatrixLoadIdentity + | ++ Load identity matrix + | +
| + rsMatrixLoadMultiply + | ++ Multiply two matrices + | +
| + rsMatrixLoadOrtho + | ++ Load an orthographic projection matrix + | +
| + rsMatrixLoadPerspective + | ++ Load a perspective projection matrix + | +
| + rsMatrixLoadRotate + | ++ Load a rotation matrix + | +
| + rsMatrixLoadScale + | ++ Load a scaling matrix + | +
| + rsMatrixLoadTranslate + | ++ Load a translation matrix + | +
| + rsMatrixMultiply + | ++ Multiply a matrix by a vector or another matrix + | +
| + rsMatrixRotate + | ++ Apply a rotation to a transformation matrix + | +
| + rsMatrixScale + | ++ Apply a scaling to a transformation matrix + | +
| + rsMatrixSet + | ++ Set one element + | +
| + rsMatrixTranslate + | ++ Apply a translation to a transformation matrix + | +
| + rsMatrixTranspose + | ++ Transpose a matrix place + | +
| + rsPackColorTo8888 + | ++ Create a uchar4 RGBA from floats + | +
| + rsQuaternionAdd + | ++ Add two quaternions + | +
| + rsQuaternionConjugate + | ++ Conjugate a quaternion + | +
| + rsQuaternionDot + | ++ Dot product of two quaternions + | +
| + rsQuaternionGetMatrixUnit + | ++ Get a rotation matrix from a quaternion + | +
| + rsQuaternionLoadRotate + | ++ Create a rotation quaternion + | +
| + rsQuaternionLoadRotateUnit + | ++ Quaternion that represents a rotation about an arbitrary unit vector + | +
| + rsQuaternionMultiply + | ++ Multiply a quaternion by a scalar or another quaternion + | +
| + rsQuaternionNormalize + | ++ Normalize a quaternion + | +
| + rsQuaternionSet + | ++ Create a quaternion + | +
| + rsQuaternionSlerp + | ++ Spherical linear interpolation between two quaternions + | +
| + rsRand + | ++ Pseudo-random number + | +
| + rsSample + | ++ Sample a value from a texture allocation + | +
| + rsSamplerGetAnisotropy + | ++ Anisotropy of the Sampler + | +
| + rsSamplerGetMagnification + | ++ Sampler magnification value + | +
| + rsSamplerGetMinification + | ++ Sampler minification value + | +
| + rsSamplerGetWrapS + | ++ Sampler wrap S value + | +
| + rsSamplerGetWrapT + | ++ Sampler wrap T value + | +
| + rsSendToClient + | ++ Send a message to the client, non-blocking + | +
| + rsSendToClientBlocking + | ++ Send a message to the client, blocking + | +
| + rsSetElementAt + | ++ Set a cell of an allocation + | +
| + rsTime + | ++ Seconds since January 1, 1970 + | +
| + rsUnpackColor8888 + | ++ Create a float4 RGBA from uchar4 + | +
| + rsUptimeMillis + | ++ System uptime in milliseconds + | +
| + rsUptimeNanos + | ++ System uptime in nanoseconds + | +
| + rsYuvToRGBA + | ++ Convert a YUV value to RGBA + | +
| + rsqrt + | ++ Reciprocal of a square root + | +
| + sign + | ++ Sign of a value + | +
| + sin + | ++ Sine + | +
| + sincos + | ++ Sine and cosine + | +
| + sinh + | ++ Hyperbolic sine + | +
| + sinpi + | ++ Sine of a number multiplied by pi + | +
| + sqrt + | ++ Square root + | +
| + step + | ++ 0 if less than a value, 0 otherwise + | +
| + tan + | ++ Tangent + | +
| + tanh + | ++ Hyperbolic tangent + | +
| + tanpi + | ++ Tangent of a number multiplied by pi + | +
| + tgamma + | ++ Gamma function + | +
| + trunc + | ++ Truncates a floating point + | +
| + rs_blend_dst_func + | ++ Deprecated. Blend destination function + | +
| + rs_blend_src_func + | ++ Deprecated. Blend source function + | +
| + rs_cull_mode + | ++ Deprecated. Culling mode + | +
| + rs_depth_func + | ++ Deprecated. Depth function + | +
| + rs_font + | ++ Deprecated. Handle to a Font + | +
| + rs_mesh + | ++ Deprecated. Handle to a Mesh + | +
| + rs_primitive + | ++ Deprecated. How to intepret mesh vertex data + | +
| + rs_program_fragment + | ++ Deprecated. Handle to a ProgramFragment + | +
| + rs_program_raster + | ++ Deprecated. Handle to a ProgramRaster + | +
| + rs_program_store + | ++ Deprecated. Handle to a ProgramStore + | +
| + rs_program_vertex + | ++ Deprecated. Handle to a ProgramVertex + | +
| + rsClamp + | ++ Deprecated. Restrain a value to a range + | +
| + rsFrac + | ++ Deprecated. Returns the fractional part of a float + | +
| + rsGetAllocation + | ++ Deprecated. Return the Allocation for a given pointer + | +
| + rsgAllocationSyncAll + | ++ Deprecated. Sync the contents of an allocation + | +
| + rsgBindColorTarget + | ++ Deprecated. Set the color target + | +
| + rsgBindConstant + | ++ Deprecated. Bind a constant allocation + | +
| + rsgBindDepthTarget + | ++ Deprecated. Set the depth target + | +
| + rsgBindFont + | ++ Deprecated. Bind a font object + | +
| + rsgBindProgramFragment + | ++ Deprecated. Bind a ProgramFragment + | +
| + rsgBindProgramRaster + | ++ Deprecated. Bind a ProgramRaster + | +
| + rsgBindProgramStore + | ++ Deprecated. Bind a ProgramStore + | +
| + rsgBindProgramVertex + | ++ Deprecated. Bind a ProgramVertex + | +
| + rsgBindSampler + | ++ Deprecated. Bind a sampler + | +
| + rsgBindTexture + | ++ Deprecated. Bind a texture allocation + | +
| + rsgClearAllRenderTargets + | ++ Deprecated. Clear all color and depth targets + | +
| + rsgClearColor + | ++ Deprecated. Clear the specified color from the surface + | +
| + rsgClearColorTarget + | ++ Deprecated. Clear the color target + | +
| + rsgClearDepth + | ++ Deprecated. Clear the depth surface + | +
| + rsgClearDepthTarget + | ++ Deprecated. Clear the depth target + | +
| + rsgDrawMesh + | ++ Deprecated. Draw a mesh + | +
| + rsgDrawQuad + | ++ Deprecated. Draw a quad + | +
| + rsgDrawQuadTexCoords + | ++ Deprecated. Draw a textured quad + | +
| + rsgDrawRect + | ++ Deprecated. Draw a rectangle + | +
| + rsgDrawSpriteScreenspace + | ++ Deprecated. Draw rectangles in screenspace + | +
| + rsgDrawText + | ++ Deprecated. Draw a text string + | +
| + rsgFinish + | ++ Deprecated. End rendering commands + | +
| + rsgFontColor + | ++ Deprecated. Set the font color + | +
| + rsgGetHeight + | ++ Deprecated. Get the surface height + | +
| + rsgGetWidth + | ++ Deprecated. Get the surface width + | +
| + rsgMeasureText + | ++ Deprecated. Get the bounding box for a text string + | +
| + rsgMeshComputeBoundingBox + | ++ Deprecated. Compute a bounding box + | +
| + rsgMeshGetIndexAllocation + | ++ Deprecated. Return an allocation containing index data + | +
| + rsgMeshGetPrimitive + | ++ Deprecated. Return the primitive + | +
| + rsgMeshGetPrimitiveCount + | ++ Deprecated. Return the number of index sets + | +
| + rsgMeshGetVertexAllocation + | ++ Deprecated. Return a vertex allocation + | +
| + rsgMeshGetVertexAllocationCount + | ++ Deprecated. Return the number of vertex allocations + | +
| + rsgProgramFragmentConstantColor + | ++ Deprecated. Set the constant color for a fixed function emulation program + | +
| + rsgProgramRasterGetCullMode + | ++ Deprecated. Get program raster cull mode + | +
| + rsgProgramRasterIsPointSpriteEnabled + | ++ Deprecated. Get program raster point sprite state + | +
| + rsgProgramStoreGetBlendDstFunc + | ++ Deprecated. Get program store blend destination function + | +
| + rsgProgramStoreGetBlendSrcFunc + | ++ Deprecated. Get program store blend source function + | +
| + rsgProgramStoreGetDepthFunc + | ++ Deprecated. Get program store depth function + | +
| + rsgProgramStoreIsColorMaskAlphaEnabled + | ++ Deprecated. Get program store alpha component color mask + | +
| + rsgProgramStoreIsColorMaskBlueEnabled + | ++ Deprecated. Get program store blur component color mask + | +
| + rsgProgramStoreIsColorMaskGreenEnabled + | ++ Deprecated. Get program store green component color mask + | +
| + rsgProgramStoreIsColorMaskRedEnabled + | ++ Deprecated. Get program store red component color mask + | +
| + rsgProgramStoreIsDepthMaskEnabled + | ++ Deprecated. Get program store depth mask + | +
| + rsgProgramStoreIsDitherEnabled + | ++ Deprecated. Get program store dither state + | +
| + rsgProgramVertexGetProjectionMatrix + | ++ Deprecated. Get the projection matrix for a fixed function vertex program + | +
| + rsgProgramVertexLoadModelMatrix + | ++ Deprecated. Load the model matrix for a bound fixed function vertex program + | +
| + rsgProgramVertexLoadProjectionMatrix + | ++ Deprecated. Load the projection matrix for a bound fixed function vertex program + | +
| + rsgProgramVertexLoadTextureMatrix + | ++ Deprecated. Load the texture matrix for a bound fixed function vertex program + | +
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. +
+
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: | float | double |
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:
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
+
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. +
+| Types | |
|---|---|
| + char2 + | ++ Two 8 bit signed integers + | +
| + char3 + | ++ Three 8 bit signed integers + | +
| + char4 + | ++ Four 8 bit signed integers + | +
| + double2 + | ++ Two 64 bit floats + | +
| + double3 + | ++ Three 64 bit floats + | +
| + double4 + | ++ Four 64 bit floats + | +
| + float2 + | ++ Two 32 bit floats + | +
| + float3 + | ++ Three 32 bit floats + | +
| + float4 + | ++ Four 32 bit floats + | +
| + int16_t + | ++ 16 bit signed integer + | +
| + int2 + | ++ Two 32 bit signed integers + | +
| + int3 + | ++ Three 32 bit signed integers + | +
| + int32_t + | ++ 32 bit signed integer + | +
| + int4 + | ++ Four 32 bit signed integers + | +
| + int64_t + | ++ 64 bit signed integer + | +
| + int8_t + | ++ 8 bit signed integer + | +
| + long2 + | ++ Two 64 bit signed integers + | +
| + long3 + | ++ Three 64 bit signed integers + | +
| + long4 + | ++ Four 64 bit signed integers + | +
| + rs_matrix2x2 + | ++ 2x2 matrix of 32 bit floats + | +
| + rs_matrix3x3 + | ++ 3x3 matrix of 32 bit floats + | +
| + rs_matrix4x4 + | ++ 4x4 matrix of 32 bit floats + | +
| + rs_quaternion + | ++ Quaternion + | +
| + short2 + | ++ Two 16 bit signed integers + | +
| + short3 + | ++ Three 16 bit signed integers + | +
| + short4 + | ++ Four 16 bit signed integers + | +
| + size_t + | ++ Unsigned size type + | +
| + ssize_t + | ++ Signed size type + | +
| + uchar + | ++ 8 bit unsigned integer + | +
| + uchar2 + | ++ Two 8 bit unsigned integers + | +
| + uchar3 + | ++ Three 8 bit unsigned integers + | +
| + uchar4 + | ++ Four 8 bit unsigned integers + | +
| + uint + | ++ 32 bit unsigned integer + | +
| + uint16_t + | ++ 16 bit unsigned integer + | +
| + uint2 + | ++ Two 32 bit unsigned integers + | +
| + uint3 + | ++ Three 32 bit unsigned integers + | +
| + uint32_t + | ++ 32 bit unsigned integer + | +
| + uint4 + | ++ Four 32 bit unsigned integers + | +
| + uint64_t + | ++ 64 bit unsigned integer + | +
| + uint8_t + | ++ 8 bit unsigned integer + | +
| + ulong + | ++ 64 bit unsigned integer + | +
| + ulong2 + | ++ Two 64 bit unsigned integers + | +
| + ulong3 + | ++ Three 64 bit unsigned integers + | +
| + ulong4 + | ++ Four 64 bit unsigned integers + | +
| + ushort + | ++ 16 bit unsigned integer + | +
| + ushort2 + | ++ Two 16 bit unsigned integers + | +
| + ushort3 + | ++ Three 16 bit unsigned integers + | +
| + ushort4 + | ++ Four 16 bit unsigned integers + | +
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. +
+| Types | |
|---|---|
| + rs_allocation + | ++ Handle to an allocation + | +
| + rs_allocation_cubemap_face + | ++ Enum for selecting cube map faces + | +
| + rs_allocation_usage_type + | ++ Bitfield to specify how an allocation is used + | +
| + rs_data_kind + | ++ Element data kind + | +
| + rs_data_type + | ++ Element basic data type + | +
| + rs_element + | ++ Handle to an element + | +
| + rs_sampler + | ++ Handle to a Sampler + | +
| + rs_sampler_value + | ++ Sampler wrap T value + | +
| + rs_script + | ++ Handle to a Script + | +
| + rs_type + | ++ Handle to a Type + | +
The functions below convert from a numerical vector type to another, of from one color +representation to another. +
+| Functions | |
|---|---|
| + convert + | ++ Convert numerical vectors + | +
| + rsPackColorTo8888 + | ++ Create a uchar4 RGBA from floats + | +
| + rsUnpackColor8888 + | ++ Create a float4 RGBA from uchar4 + | +
| + rsYuvToRGBA + | ++ Convert a YUV value to RGBA + | +
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
| Constants | |
|---|---|
| + M_1_PI + | ++ 1 / pi, as a 32 bit float + | +
| + M_2_PI + | ++ 2 / pi, as a 32 bit float + | +
| + M_2_SQRTPI + | ++ 2 / sqrt(pi), as a 32 bit float + | +
| + M_E + | ++ e, as a 32 bit float + | +
| + M_LN10 + | ++ log_e(10), as a 32 bit float + | +
| + M_LN2 + | ++ log_e(2), as a 32 bit float + | +
| + M_LOG10E + | ++ log_10(e), as a 32 bit float + | +
| + M_LOG2E + | ++ log_2(e), as a 32 bit float + | +
| + M_PI + | ++ pi, as a 32 bit float + | +
| + M_PI_2 + | ++ pi / 2, as a 32 bit float + | +
| + M_PI_4 + | ++ pi / 4, as a 32 bit float + | +
| + M_SQRT1_2 + | ++ 1 / sqrt(2), as a 32 bit float + | +
| + M_SQRT2 + | ++ sqrt(2), as a 32 bit float + | +
| Functions | |
|---|---|
| + abs + | ++ Absolute value of an integer + | +
| + acos + | ++ Inverse cosine + | +
| + acosh + | ++ Inverse hyperbolic cosine + | +
| + acospi + | ++ Inverse cosine divided by pi + | +
| + asin + | ++ Inverse sine + | +
| + asinh + | ++ Inverse hyperbolic sine + | +
| + asinpi + | ++ Inverse sine divided by pi + | +
| + atan + | ++ Inverse tangent + | +
| + atan2 + | ++ Inverse tangent of a ratio + | +
| + atan2pi + | ++ Inverse tangent of a ratio, divided by pi + | +
| + atanh + | ++ Inverse hyperbolic tangent + | +
| + atanpi + | ++ Inverse tangent divided by pi + | +
| + cbrt + | ++ Cube root + | +
| + ceil + | ++ Smallest integer not less than a value + | +
| + clamp + | ++ Restrain a value to a range + | +
| + clz + | ++ Number of leading 0 bits + | +
| + copysign + | ++ Copies the sign of a number to another + | +
| + cos + | ++ Cosine + | +
| + cosh + | ++ Hypebolic cosine + | +
| + cospi + | ++ Cosine of a number multiplied by pi + | +
| + degrees + | ++ Converts radians into degrees + | +
| + erf + | ++ Mathematical error function + | +
| + erfc + | ++ Mathematical complementary error function + | +
| + exp + | ++ e raised to a number + | +
| + exp10 + | ++ 10 raised to a number + | +
| + exp2 + | ++ 2 raised to a number + | +
| + expm1 + | ++ e raised to a number minus one + | +
| + fabs + | ++ Absolute value of a float + | +
| + fdim + | ++ Positive difference between two values + | +
| + floor + | ++ Smallest integer not greater than a value + | +
| + fma + | ++ Multiply and add + | +
| + fmax + | ++ Maximum of two floats + | +
| + fmin + | ++ Minimum of two floats + | +
| + fmod + | ++ Modulo + | +
| + fract + | ++ Positive fractional part + | +
| + frexp + | ++ Binary mantissa and exponent + | +
| + half_recip + | ++ Reciprocal computed to 16 bit precision + | +
| + half_rsqrt + | ++ Reciprocal of a square root computed to 16 bit precision + | +
| + half_sqrt + | ++ Square root computed to 16 bit precision + | +
| + hypot + | ++ Hypotenuse + | +
| + ilogb + | ++ Base two exponent + | +
| + ldexp + | ++ Creates a floating point from mantissa and exponent + | +
| + lgamma + | ++ Natural logarithm of the gamma function + | +
| + log + | ++ Natural logarithm + | +
| + log10 + | ++ Base 10 logarithm + | +
| + log1p + | ++ Natural logarithm of a value plus 1 + | +
| + log2 + | ++ Base 2 logarithm + | +
| + logb + | ++ Base two exponent + | +
| + mad + | ++ Multiply and add + | +
| + max + | ++ Maximum + | +
| + min + | ++ Minimum + | +
| + mix + | ++ Mixes two values + | +
| + modf + | ++ Integral and fractional components + | +
| + nan + | ++ Not a Number + | +
| + native_acos + | ++ Approximate inverse cosine + | +
| + native_acosh + | ++ Approximate inverse hyperbolic cosine + | +
| + native_acospi + | ++ Approximate inverse cosine divided by pi + | +
| + native_asin + | ++ Approximate inverse sine + | +
| + native_asinh + | ++ Approximate inverse hyperbolic sine + | +
| + native_asinpi + | ++ Approximate inverse sine divided by pi + | +
| + native_atan + | ++ Approximate inverse tangent + | +
| + native_atan2 + | ++ Approximate inverse tangent of a ratio + | +
| + native_atan2pi + | ++ Approximate inverse tangent of a ratio, divided by pi + | +
| + native_atanh + | ++ Approximate inverse hyperbolic tangent + | +
| + native_atanpi + | ++ Approximate inverse tangent divided by pi + | +
| + native_cbrt + | ++ Approximate cube root + | +
| + native_cos + | ++ Approximate cosine + | +
| + native_cosh + | ++ Approximate hypebolic cosine + | +
| + native_cospi + | ++ Approximate cosine of a number multiplied by pi + | +
| + native_divide + | ++ Approximate division + | +
| + native_exp + | ++ Approximate e raised to a number + | +
| + native_exp10 + | ++ Approximate 10 raised to a number + | +
| + native_exp2 + | ++ Approximate 2 raised to a number + | +
| + native_expm1 + | ++ Approximate e raised to a number minus one + | +
| + native_hypot + | ++ Approximate hypotenuse + | +
| + native_log + | ++ Approximate natural logarithm + | +
| + native_log10 + | ++ Approximate base 10 logarithm + | +
| + native_log1p + | ++ Approximate natural logarithm of a value plus 1 + | +
| + native_log2 + | ++ Approximate base 2 logarithm + | +
| + native_powr + | ++ Approximate positive base raised to an exponent + | +
| + native_recip + | ++ Approximate reciprocal + | +
| + native_rootn + | ++ Approximate nth root + | +
| + native_rsqrt + | ++ Approximate reciprocal of a square root + | +
| + native_sin + | ++ Approximate sine + | +
| + native_sincos + | ++ Approximate sine and cosine + | +
| + native_sinh + | ++ Approximate hyperbolic sine + | +
| + native_sinpi + | ++ Approximate sine of a number multiplied by pi + | +
| + native_sqrt + | ++ Approximate square root + | +
| + native_tan + | ++ Approximate tangent + | +
| + native_tanh + | ++ Approximate hyperbolic tangent + | +
| + native_tanpi + | ++ Approximate tangent of a number multiplied by pi + | +
| + nextafter + | ++ Next floating point number + | +
| + pow + | ++ Base raised to an exponent + | +
| + pown + | ++ Base raised to an integer exponent + | +
| + powr + | ++ Positive base raised to an exponent + | +
| + radians + | ++ Converts degrees into radians + | +
| + remainder + | ++ Remainder of a division + | +
| + remquo + | ++ Remainder and quotient of a division + | +
| + rint + | ++ Round to even + | +
| + rootn + | ++ Nth root + | +
| + round + | ++ Round away from zero + | +
| + rsRand + | ++ Pseudo-random number + | +
| + rsqrt + | ++ Reciprocal of a square root + | +
| + sign + | ++ Sign of a value + | +
| + sin + | ++ Sine + | +
| + sincos + | ++ Sine and cosine + | +
| + sinh + | ++ Hyperbolic sine + | +
| + sinpi + | ++ Sine of a number multiplied by pi + | +
| + sqrt + | ++ Square root + | +
| + step + | ++ 0 if less than a value, 0 otherwise + | +
| + tan + | ++ Tangent + | +
| + tanh + | ++ Hyperbolic tangent + | +
| + tanpi + | ++ Tangent of a number multiplied by pi + | +
| + tgamma + | ++ Gamma function + | +
| + trunc + | ++ Truncates a floating point + | +
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
| Functions | |
|---|---|
| + cross + | ++ Cross product of two vectors + | +
| + distance + | ++ Distance between two points + | +
| + dot + | ++ Dot product of two vectors + | +
| + fast_distance + | ++ Approximate distance between two points + | +
| + fast_length + | ++ Approximate length of a vector + | +
| + fast_normalize + | ++ Approximate normalized vector + | +
| + length + | ++ Length of a vector + | +
| + native_distance + | ++ Approximate distance between two points + | +
| + native_length + | ++ Approximate length of a vector + | +
| + native_normalize + | ++ Approximately normalize a vector + | +
| + normalize + | ++ Normalize a vector + | +
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. +
+| Functions | |
|---|---|
| + rsExtractFrustumPlanes + | ++ Compute frustum planes + | +
| + rsIsSphereInFrustum + | ++ Checks if a sphere is within the frustum planes + | +
| + rsMatrixGet + | ++ Get one element + | +
| + rsMatrixInverse + | ++ Inverts a matrix in place + | +
| + rsMatrixInverseTranspose + | ++ Inverts and transpose a matrix in place + | +
| + rsMatrixLoad + | ++ Load or copy a matrix + | +
| + rsMatrixLoadFrustum + | ++ Load a frustum projection matrix + | +
| + rsMatrixLoadIdentity + | ++ Load identity matrix + | +
| + rsMatrixLoadMultiply + | ++ Multiply two matrices + | +
| + rsMatrixLoadOrtho + | ++ Load an orthographic projection matrix + | +
| + rsMatrixLoadPerspective + | ++ Load a perspective projection matrix + | +
| + rsMatrixLoadRotate + | ++ Load a rotation matrix + | +
| + rsMatrixLoadScale + | ++ Load a scaling matrix + | +
| + rsMatrixLoadTranslate + | ++ Load a translation matrix + | +
| + rsMatrixMultiply + | ++ Multiply a matrix by a vector or another matrix + | +
| + rsMatrixRotate + | ++ Apply a rotation to a transformation matrix + | +
| + rsMatrixScale + | ++ Apply a scaling to a transformation matrix + | +
| + rsMatrixSet + | ++ Set one element + | +
| + rsMatrixTranslate + | ++ Apply a translation to a transformation matrix + | +
| + rsMatrixTranspose + | ++ Transpose a matrix place + | +
The following functions manipulate quaternions. +
+| Functions | |
|---|---|
| + rsQuaternionAdd + | ++ Add two quaternions + | +
| + rsQuaternionConjugate + | ++ Conjugate a quaternion + | +
| + rsQuaternionDot + | ++ Dot product of two quaternions + | +
| + rsQuaternionGetMatrixUnit + | ++ Get a rotation matrix from a quaternion + | +
| + rsQuaternionLoadRotate + | ++ Create a rotation quaternion + | +
| + rsQuaternionLoadRotateUnit + | ++ Quaternion that represents a rotation about an arbitrary unit vector + | +
| + rsQuaternionMultiply + | ++ Multiply a quaternion by a scalar or another quaternion + | +
| + rsQuaternionNormalize + | ++ Normalize a quaternion + | +
| + rsQuaternionSet + | ++ Create a quaternion + | +
| + rsQuaternionSlerp + | ++ Spherical linear interpolation between two quaternions + | +
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. +
+| Functions | |
|---|---|
| + rsAtomicAdd + | ++ Thread-safe addition + | +
| + rsAtomicAnd + | ++ Thread-safe bitwise and + | +
| + rsAtomicCas + | ++ Thread-safe compare and set + | +
| + rsAtomicDec + | ++ Thread-safe decrement + | +
| + rsAtomicInc + | ++ Thread-safe increment + | +
| + rsAtomicMax + | ++ Thread-safe maximum + | +
| + rsAtomicMin + | ++ Thread-safe minimum + | +
| + rsAtomicOr + | ++ Thread-safe bitwise or + | +
| + rsAtomicSub + | ++ Thread-safe subtraction + | +
| + rsAtomicXor + | ++ Thread-safe bitwise exclusive or + | +
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. +
+| Types | |
|---|---|
| + rs_time_t + | ++ Seconds since January 1, 1970 + | +
| + rs_tm + | ++ Date and time structure + | +
| Functions | |
|---|---|
| + rsGetDt + | ++ Elapsed time since last call + | +
| + rsLocaltime + | ++ Convert to local time + | +
| + rsTime + | ++ Seconds since January 1, 1970 + | +
| + rsUptimeMillis + | ++ System uptime in milliseconds + | +
| + rsUptimeNanos + | ++ System uptime in nanoseconds + | +
The functions below can be used to get and set the cells that comprise +an allocation. +
| Functions | |
|---|---|
| + rsAllocationCopy1DRange + | ++ Copy consecutive cells between allocations + | +
| + rsAllocationCopy2DRange + | ++ Copy a rectangular region of cells between allocations + | +
| + rsAllocationVLoadX + | ++ Get a vector from an allocation of scalars + | +
| + rsAllocationVStoreX + | ++ Store a vector into an allocation of scalars + | +
| + rsGetElementAt + | ++ Return a cell from an allocation + | +
| + rsGetElementAtYuv_uchar_U + | ++ Get the U component of an allocation of YUVs + | +
| + rsGetElementAtYuv_uchar_V + | ++ Get the V component of an allocation of YUVs + | +
| + rsGetElementAtYuv_uchar_Y + | ++ Get the Y component of an allocation of YUVs + | +
| + rsSample + | ++ Sample a value from a texture allocation + | +
| + rsSetElementAt + | ++ Set a cell of an allocation + | +
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 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. +
+ +
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:
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 objects define how Allocations can be read as structure within a kernel. +See android.renderscript.S. +
+| Functions | |
|---|---|
| + rsAllocationGetDimFaces + | ++ Presence of more than one face + | +
| + rsAllocationGetDimLOD + | ++ Presence of levels of detail + | +
| + rsAllocationGetDimX + | ++ Size of the X dimension + | +
| + rsAllocationGetDimY + | ++ Size of the Y dimension + | +
| + rsAllocationGetDimZ + | ++ Size of the Z dimension + | +
| + rsAllocationGetElement + | ++ Get the object that describes the cell of an Allocation + | +
| + rsClearObject + | ++ Release an object + | +
| + rsElementGetBytesSize + | ++ Size of an Element + | +
| + rsElementGetDataKind + | ++ Kind of an Element + | +
| + rsElementGetDataType + | ++ Data type of an Element + | +
| + rsElementGetSubElement + | ++ Sub-element of a complex Element + | +
| + rsElementGetSubElementArraySize + | ++ Array size of a sub-element of a complex Element + | +
| + rsElementGetSubElementCount + | ++ Number of sub-elements + | +
| + rsElementGetSubElementName + | ++ Name of a sub-element + | +
| + rsElementGetSubElementNameLength + | ++ Length of the name of a sub-element + | +
| + rsElementGetSubElementOffsetBytes + | ++ Offset of the instantiated sub-element + | +
| + rsElementGetVectorSize + | ++ Vector size of the Element + | +
| + rsIsObject + | ++ Check for an empty handle + | +
| + rsSamplerGetAnisotropy + | ++ Anisotropy of the Sampler + | +
| + rsSamplerGetMagnification + | ++ Sampler magnification value + | +
| + rsSamplerGetMinification + | ++ Sampler minification value + | +
| + rsSamplerGetWrapS + | ++ Sampler wrap S value + | +
| + rsSamplerGetWrapT + | ++ Sampler wrap T value + | +
The rsForEach() function can be used to invoke the root kernel of a script. +
+| Types | |
|---|---|
| + rs_for_each_strategy_t + | ++ Suggested cell processing order + | +
| + rs_script_call_t + | ++ Cell iteration information + | +
| Functions | |
|---|---|
| + rsForEach + | ++ Invoke the root kernel of a script + | +
These functions are used to:
| Functions | |
|---|---|
| + rsAllocationIoReceive + | ++ Receive new content from the queue + | +
| + rsAllocationIoSend + | ++ Send new content to the queue + | +
| + rsSendToClient + | ++ Send a message to the client, non-blocking + | +
| + rsSendToClientBlocking + | ++ Send a message to the client, blocking + | +
The functions below are intended to be used during application developement. +They should not be used in shipping applications. +
+| Functions | |
|---|---|
| + rsDebug + | ++ Log a message and values + | +
The graphics subsystem of RenderScript has been deprecated. +
+The functions below can be used to get and set the cells that comprise +an allocation. +
| Functions | |
|---|---|
| + rsAllocationCopy1DRange + | ++ Copy consecutive cells between allocations + | +
| + rsAllocationCopy2DRange + | ++ Copy a rectangular region of cells between allocations + | +
| + rsAllocationVLoadX + | ++ Get a vector from an allocation of scalars + | +
| + rsAllocationVStoreX + | ++ Store a vector into an allocation of scalars + | +
| + rsGetElementAt + | ++ Return a cell from an allocation + | +
| + rsGetElementAtYuv_uchar_U + | ++ Get the U component of an allocation of YUVs + | +
| + rsGetElementAtYuv_uchar_V + | ++ Get the V component of an allocation of YUVs + | +
| + rsGetElementAtYuv_uchar_Y + | ++ Get the Y component of an allocation of YUVs + | +
| + rsSample + | ++ Sample a value from a texture allocation + | +
| + rsSetElementAt + | ++ Set a cell of an allocation + | +
| void rsAllocationCopy1DRange(rs_allocation dstAlloc, uint32_t dstOff, uint32_t dstMip, uint32_t count, rs_allocation srcAlloc, uint32_t srcOff, uint32_t srcMip); + | +Added in API level 14 + | +
| 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. |
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. +
+| void 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); + | +Added in API level 14 + | +
| 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. |
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. +
+| char2 rsAllocationVLoadX_char2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| char2 rsAllocationVLoadX_char2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| char2 rsAllocationVLoadX_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| char3 rsAllocationVLoadX_char3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| char3 rsAllocationVLoadX_char3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| char3 rsAllocationVLoadX_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| char4 rsAllocationVLoadX_char4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| char4 rsAllocationVLoadX_char4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| char4 rsAllocationVLoadX_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| double2 rsAllocationVLoadX_double2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| double2 rsAllocationVLoadX_double2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| double2 rsAllocationVLoadX_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| double3 rsAllocationVLoadX_double3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| double3 rsAllocationVLoadX_double3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| double3 rsAllocationVLoadX_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| double4 rsAllocationVLoadX_double4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| double4 rsAllocationVLoadX_double4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| double4 rsAllocationVLoadX_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| float2 rsAllocationVLoadX_float2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| float2 rsAllocationVLoadX_float2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| float2 rsAllocationVLoadX_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| float3 rsAllocationVLoadX_float3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| float3 rsAllocationVLoadX_float3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| float3 rsAllocationVLoadX_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| float4 rsAllocationVLoadX_float4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| float4 rsAllocationVLoadX_float4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| float4 rsAllocationVLoadX_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| int2 rsAllocationVLoadX_int2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| int2 rsAllocationVLoadX_int2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| int2 rsAllocationVLoadX_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| int3 rsAllocationVLoadX_int3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| int3 rsAllocationVLoadX_int3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| int3 rsAllocationVLoadX_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| int4 rsAllocationVLoadX_int4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| int4 rsAllocationVLoadX_int4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| int4 rsAllocationVLoadX_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| long2 rsAllocationVLoadX_long2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| long2 rsAllocationVLoadX_long2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| long2 rsAllocationVLoadX_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| long3 rsAllocationVLoadX_long3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| long3 rsAllocationVLoadX_long3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| long3 rsAllocationVLoadX_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| long4 rsAllocationVLoadX_long4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| long4 rsAllocationVLoadX_long4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| long4 rsAllocationVLoadX_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| short2 rsAllocationVLoadX_short2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| short2 rsAllocationVLoadX_short2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| short2 rsAllocationVLoadX_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| short3 rsAllocationVLoadX_short3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| short3 rsAllocationVLoadX_short3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| short3 rsAllocationVLoadX_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| short4 rsAllocationVLoadX_short4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| short4 rsAllocationVLoadX_short4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| short4 rsAllocationVLoadX_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| uchar2 rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| uchar2 rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| uchar2 rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| uchar3 rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| uchar3 rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| uchar3 rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| uchar4 rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| uchar4 rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| uchar4 rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| uint2 rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| uint2 rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| uint2 rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| uint3 rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| uint3 rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| uint3 rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| uint4 rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| uint4 rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| uint4 rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| ulong2 rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| ulong2 rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| ulong2 rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| ulong3 rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| ulong3 rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| ulong3 rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| ulong4 rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| ulong4 rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| ulong4 rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| ushort2 rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| ushort2 rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| ushort2 rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| ushort3 rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| ushort3 rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| ushort3 rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| ushort4 rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x); + | +Added in API level 22 + | +
| ushort4 rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| ushort4 rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| 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. |
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(). +
+| void rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y); + | +Added in API level 22 + | +
| void rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 22 + | +
| 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. |
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(). +
+| char rsGetElementAt_char(rs_allocation a, uint32_t x); + | ++ |
| char rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| char rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| char2 rsGetElementAt_char2(rs_allocation a, uint32_t x); + | ++ |
| char2 rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| char2 rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| char3 rsGetElementAt_char3(rs_allocation a, uint32_t x); + | ++ |
| char3 rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| char3 rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| char4 rsGetElementAt_char4(rs_allocation a, uint32_t x); + | ++ |
| char4 rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| char4 rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| const void* rsGetElementAt(rs_allocation a, uint32_t x); + | ++ |
| const void* rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| const void* rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| double rsGetElementAt_double(rs_allocation a, uint32_t x); + | ++ |
| double rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| double rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| double2 rsGetElementAt_double2(rs_allocation a, uint32_t x); + | ++ |
| double2 rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| double2 rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| double3 rsGetElementAt_double3(rs_allocation a, uint32_t x); + | ++ |
| double3 rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| double3 rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| double4 rsGetElementAt_double4(rs_allocation a, uint32_t x); + | ++ |
| double4 rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| double4 rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| float rsGetElementAt_float(rs_allocation a, uint32_t x); + | ++ |
| float rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| float rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| float2 rsGetElementAt_float2(rs_allocation a, uint32_t x); + | ++ |
| float2 rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| float2 rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| float3 rsGetElementAt_float3(rs_allocation a, uint32_t x); + | ++ |
| float3 rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| float3 rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| float4 rsGetElementAt_float4(rs_allocation a, uint32_t x); + | ++ |
| float4 rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| float4 rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| int rsGetElementAt_int(rs_allocation a, uint32_t x); + | ++ |
| int rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| int rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| int2 rsGetElementAt_int2(rs_allocation a, uint32_t x); + | ++ |
| int2 rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| int2 rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| int3 rsGetElementAt_int3(rs_allocation a, uint32_t x); + | ++ |
| int3 rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| int3 rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| int4 rsGetElementAt_int4(rs_allocation a, uint32_t x); + | ++ |
| int4 rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| int4 rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| long rsGetElementAt_long(rs_allocation a, uint32_t x); + | ++ |
| long rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| long rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| long2 rsGetElementAt_long2(rs_allocation a, uint32_t x); + | ++ |
| long2 rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| long2 rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| long3 rsGetElementAt_long3(rs_allocation a, uint32_t x); + | ++ |
| long3 rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| long3 rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| long4 rsGetElementAt_long4(rs_allocation a, uint32_t x); + | ++ |
| long4 rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| long4 rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| short rsGetElementAt_short(rs_allocation a, uint32_t x); + | ++ |
| short rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| short rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| short2 rsGetElementAt_short2(rs_allocation a, uint32_t x); + | ++ |
| short2 rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| short2 rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| short3 rsGetElementAt_short3(rs_allocation a, uint32_t x); + | ++ |
| short3 rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| short3 rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| short4 rsGetElementAt_short4(rs_allocation a, uint32_t x); + | ++ |
| short4 rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| short4 rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uchar rsGetElementAt_uchar(rs_allocation a, uint32_t x); + | ++ |
| uchar rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uchar rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uchar2 rsGetElementAt_uchar2(rs_allocation a, uint32_t x); + | ++ |
| uchar2 rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uchar2 rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uchar3 rsGetElementAt_uchar3(rs_allocation a, uint32_t x); + | ++ |
| uchar3 rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uchar3 rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uchar4 rsGetElementAt_uchar4(rs_allocation a, uint32_t x); + | ++ |
| uchar4 rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uchar4 rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uint rsGetElementAt_uint(rs_allocation a, uint32_t x); + | ++ |
| uint rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uint rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uint2 rsGetElementAt_uint2(rs_allocation a, uint32_t x); + | ++ |
| uint2 rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uint2 rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uint3 rsGetElementAt_uint3(rs_allocation a, uint32_t x); + | ++ |
| uint3 rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uint3 rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| uint4 rsGetElementAt_uint4(rs_allocation a, uint32_t x); + | ++ |
| uint4 rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| uint4 rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ulong rsGetElementAt_ulong(rs_allocation a, uint32_t x); + | ++ |
| ulong rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ulong rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ulong2 rsGetElementAt_ulong2(rs_allocation a, uint32_t x); + | ++ |
| ulong2 rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ulong2 rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ulong3 rsGetElementAt_ulong3(rs_allocation a, uint32_t x); + | ++ |
| ulong3 rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ulong3 rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ulong4 rsGetElementAt_ulong4(rs_allocation a, uint32_t x); + | ++ |
| ulong4 rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ulong4 rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ushort rsGetElementAt_ushort(rs_allocation a, uint32_t x); + | ++ |
| ushort rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ushort rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ushort2 rsGetElementAt_ushort2(rs_allocation a, uint32_t x); + | ++ |
| ushort2 rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ushort2 rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ushort3 rsGetElementAt_ushort3(rs_allocation a, uint32_t x); + | ++ |
| ushort3 rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ushort3 rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
| ushort4 rsGetElementAt_ushort4(rs_allocation a, uint32_t x); + | ++ |
| ushort4 rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y); + | ++ |
| ushort4 rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); + | ++ |
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. +
+| uchar rsGetElementAtYuv_uchar_U(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
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(). +
+| uchar rsGetElementAtYuv_uchar_V(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
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(). +
+| uchar rsGetElementAtYuv_uchar_Y(rs_allocation a, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
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(). +
+| float4 rsSample(rs_allocation a, rs_sampler s, float location); + | +Added in API level 16 + | +
| float4 rsSample(rs_allocation a, rs_sampler s, float location, float lod); + | +Added in API level 16 + | +
| float4 rsSample(rs_allocation a, rs_sampler s, float2 location); + | +Added in API level 16 + | +
| float4 rsSample(rs_allocation a, rs_sampler s, float2 location, float lod); + | +Added in API level 16 + | +
| 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. |
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. +
+| void rsSetElementAt(rs_allocation a, void* ptr, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt(rs_allocation a, void* ptr, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_char(rs_allocation a, char val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_char(rs_allocation a, char val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_char(rs_allocation a, char val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_double(rs_allocation a, double val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_double(rs_allocation a, double val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_double(rs_allocation a, double val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_float(rs_allocation a, float val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_float(rs_allocation a, float val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_float(rs_allocation a, float val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_int(rs_allocation a, int val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_int(rs_allocation a, int val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_int(rs_allocation a, int val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_long(rs_allocation a, long val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_long(rs_allocation a, long val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_long(rs_allocation a, long val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_short(rs_allocation a, short val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_short(rs_allocation a, short val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_short(rs_allocation a, short val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y); + | +Added in API level 18 + | +
| void rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y, uint32_t z); + | +Added in API level 18 + | +
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(). +
+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. +
+| Functions | |
|---|---|
| + rsAtomicAdd + | ++ Thread-safe addition + | +
| + rsAtomicAnd + | ++ Thread-safe bitwise and + | +
| + rsAtomicCas + | ++ Thread-safe compare and set + | +
| + rsAtomicDec + | ++ Thread-safe decrement + | +
| + rsAtomicInc + | ++ Thread-safe increment + | +
| + rsAtomicMax + | ++ Thread-safe maximum + | +
| + rsAtomicMin + | ++ Thread-safe minimum + | +
| + rsAtomicOr + | ++ Thread-safe bitwise or + | +
| + rsAtomicSub + | ++ Thread-safe subtraction + | +
| + rsAtomicXor + | ++ Thread-safe bitwise exclusive or + | +
| int32_t rsAtomicAdd(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| int32_t rsAtomicAdd(volatile uint32_t* addr, uint32_t value); + | +Added in API level 20 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Amount to add. |
| Value of *addr prior to the operation. |
Atomicly adds a value to the value at addr, i.e. *addr += value.
+
| int32_t rsAtomicAnd(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| int32_t rsAtomicAnd(volatile uint32_t* addr, uint32_t value); + | +Added in API level 20 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Value to and with. |
| Value of *addr prior to the operation. |
Atomicly performs a bitwise and of two values, storing the result back at addr,
+i.e. *addr &= value.
+
| int32_t rsAtomicCas(volatile int32_t* addr, int32_t compareValue, int32_t newValue); + | +Added in API level 14 + | +
| uint32_t rsAtomicCas(volatile uint32_t* addr, uint32_t compareValue, uint32_t newValue); + | +Added in API level 14 + | +
| 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. |
| Value of *addr prior to the operation. |
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. +
+| int32_t rsAtomicDec(volatile int32_t* addr); + | +Added in API level 14 + | +
| int32_t rsAtomicDec(volatile uint32_t* addr); + | +Added in API level 20 + | +
| addr | Address of the value to decrement. |
|---|
| Value of *addr prior to the operation. |
Atomicly subtracts one from the value at addr. This is equivalent to rsAtomicSub(addr, 1).
+
| int32_t rsAtomicInc(volatile int32_t* addr); + | +Added in API level 14 + | +
| int32_t rsAtomicInc(volatile uint32_t* addr); + | +Added in API level 20 + | +
| addr | Address of the value to increment. |
|---|
| Value of *addr prior to the operation. |
Atomicly adds one to the value at addr. This is equivalent to rsAtomicAdd(addr, 1).
+
| int32_t rsAtomicMax(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| uint32_t rsAtomicMax(volatile uint32_t* addr, uint32_t value); + | +Added in API level 14 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Comparison value. |
| Value of *addr prior to the operation. |
Atomicly sets the value at addr to the maximum of *addr and value, i.e.
+*addr = max(*addr, value).
+
| int32_t rsAtomicMin(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| uint32_t rsAtomicMin(volatile uint32_t* addr, uint32_t value); + | +Added in API level 14 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Comparison value. |
| Value of *addr prior to the operation. |
Atomicly sets the value at addr to the minimum of *addr and value, i.e.
+*addr = min(*addr, value).
+
| int32_t rsAtomicOr(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| int32_t rsAtomicOr(volatile uint32_t* addr, uint32_t value); + | +Added in API level 20 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Value to or with. |
| Value of *addr prior to the operation. |
Atomicly perform a bitwise or two values, storing the result at addr,
+i.e. *addr |= value.
+
| int32_t rsAtomicSub(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| int32_t rsAtomicSub(volatile uint32_t* addr, uint32_t value); + | +Added in API level 20 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Amount to subtract. |
| Value of *addr prior to the operation. |
Atomicly subtracts a value from the value at addr, i.e. *addr -= value.
+
| int32_t rsAtomicXor(volatile int32_t* addr, int32_t value); + | +Added in API level 14 + | +
| int32_t rsAtomicXor(volatile uint32_t* addr, uint32_t value); + | +Added in API level 20 + | +
| addr | Address of the value to modify. |
|---|---|
| value | Value to xor with. |
| Value of *addr prior to the operation. |
Atomicly performs a bitwise xor of two values, storing the result at addr,
+i.e. *addr ^= value.
+
The functions below convert from a numerical vector type to another, of from one color +representation to another. +
+| Functions | |
|---|---|
| + convert + | ++ Convert numerical vectors + | +
| + rsPackColorTo8888 + | ++ Create a uchar4 RGBA from floats + | +
| + rsUnpackColor8888 + | ++ Create a float4 RGBA from uchar4 + | +
| + rsYuvToRGBA + | ++ Convert a YUV value to RGBA + | +
| char2 convert_char2(char2 v); + | ++ |
| char2 convert_char2(double2 v); + | +Added in API level 21 + | +
| char2 convert_char2(float2 v); + | ++ |
| char2 convert_char2(int2 v); + | ++ |
| char2 convert_char2(long2 v); + | +Added in API level 21 + | +
| char2 convert_char2(short2 v); + | ++ |
| char2 convert_char2(uchar2 v); + | ++ |
| char2 convert_char2(uint2 v); + | ++ |
| char2 convert_char2(ulong2 v); + | +Added in API level 21 + | +
| char2 convert_char2(ushort2 v); + | ++ |
| char3 convert_char3(char3 v); + | ++ |
| char3 convert_char3(double3 v); + | +Added in API level 21 + | +
| char3 convert_char3(float3 v); + | ++ |
| char3 convert_char3(int3 v); + | ++ |
| char3 convert_char3(long3 v); + | +Added in API level 21 + | +
| char3 convert_char3(short3 v); + | ++ |
| char3 convert_char3(uchar3 v); + | ++ |
| char3 convert_char3(uint3 v); + | ++ |
| char3 convert_char3(ulong3 v); + | +Added in API level 21 + | +
| char3 convert_char3(ushort3 v); + | ++ |
| char4 convert_char4(char4 v); + | ++ |
| char4 convert_char4(double4 v); + | +Added in API level 21 + | +
| char4 convert_char4(float4 v); + | ++ |
| char4 convert_char4(int4 v); + | ++ |
| char4 convert_char4(long4 v); + | +Added in API level 21 + | +
| char4 convert_char4(short4 v); + | ++ |
| char4 convert_char4(uchar4 v); + | ++ |
| char4 convert_char4(uint4 v); + | ++ |
| char4 convert_char4(ulong4 v); + | +Added in API level 21 + | +
| char4 convert_char4(ushort4 v); + | ++ |
| double2 convert_double2(char2 v); + | +Added in API level 21 + | +
| double2 convert_double2(double2 v); + | +Added in API level 21 + | +
| double2 convert_double2(float2 v); + | +Added in API level 21 + | +
| double2 convert_double2(int2 v); + | +Added in API level 21 + | +
| double2 convert_double2(long2 v); + | +Added in API level 21 + | +
| double2 convert_double2(short2 v); + | +Added in API level 21 + | +
| double2 convert_double2(uchar2 v); + | +Added in API level 21 + | +
| double2 convert_double2(uint2 v); + | +Added in API level 21 + | +
| double2 convert_double2(ulong2 v); + | +Added in API level 21 + | +
| double2 convert_double2(ushort2 v); + | +Added in API level 21 + | +
| double3 convert_double3(char3 v); + | +Added in API level 21 + | +
| double3 convert_double3(double3 v); + | +Added in API level 21 + | +
| double3 convert_double3(float3 v); + | +Added in API level 21 + | +
| double3 convert_double3(int3 v); + | +Added in API level 21 + | +
| double3 convert_double3(long3 v); + | +Added in API level 21 + | +
| double3 convert_double3(short3 v); + | +Added in API level 21 + | +
| double3 convert_double3(uchar3 v); + | +Added in API level 21 + | +
| double3 convert_double3(uint3 v); + | +Added in API level 21 + | +
| double3 convert_double3(ulong3 v); + | +Added in API level 21 + | +
| double3 convert_double3(ushort3 v); + | +Added in API level 21 + | +
| double4 convert_double4(char4 v); + | +Added in API level 21 + | +
| double4 convert_double4(double4 v); + | +Added in API level 21 + | +
| double4 convert_double4(float4 v); + | +Added in API level 21 + | +
| double4 convert_double4(int4 v); + | +Added in API level 21 + | +
| double4 convert_double4(long4 v); + | +Added in API level 21 + | +
| double4 convert_double4(short4 v); + | +Added in API level 21 + | +
| double4 convert_double4(uchar4 v); + | +Added in API level 21 + | +
| double4 convert_double4(uint4 v); + | +Added in API level 21 + | +
| double4 convert_double4(ulong4 v); + | +Added in API level 21 + | +
| double4 convert_double4(ushort4 v); + | +Added in API level 21 + | +
| float2 convert_float2(char2 v); + | ++ |
| float2 convert_float2(double2 v); + | +Added in API level 21 + | +
| float2 convert_float2(float2 v); + | ++ |
| float2 convert_float2(int2 v); + | ++ |
| float2 convert_float2(long2 v); + | +Added in API level 21 + | +
| float2 convert_float2(short2 v); + | ++ |
| float2 convert_float2(uchar2 v); + | ++ |
| float2 convert_float2(uint2 v); + | ++ |
| float2 convert_float2(ulong2 v); + | +Added in API level 21 + | +
| float2 convert_float2(ushort2 v); + | ++ |
| float3 convert_float3(char3 v); + | ++ |
| float3 convert_float3(double3 v); + | +Added in API level 21 + | +
| float3 convert_float3(float3 v); + | ++ |
| float3 convert_float3(int3 v); + | ++ |
| float3 convert_float3(long3 v); + | +Added in API level 21 + | +
| float3 convert_float3(short3 v); + | ++ |
| float3 convert_float3(uchar3 v); + | ++ |
| float3 convert_float3(uint3 v); + | ++ |
| float3 convert_float3(ulong3 v); + | +Added in API level 21 + | +
| float3 convert_float3(ushort3 v); + | ++ |
| float4 convert_float4(char4 v); + | ++ |
| float4 convert_float4(double4 v); + | +Added in API level 21 + | +
| float4 convert_float4(float4 v); + | ++ |
| float4 convert_float4(int4 v); + | ++ |
| float4 convert_float4(long4 v); + | +Added in API level 21 + | +
| float4 convert_float4(short4 v); + | ++ |
| float4 convert_float4(uchar4 v); + | ++ |
| float4 convert_float4(uint4 v); + | ++ |
| float4 convert_float4(ulong4 v); + | +Added in API level 21 + | +
| float4 convert_float4(ushort4 v); + | ++ |
| int2 convert_int2(char2 v); + | ++ |
| int2 convert_int2(double2 v); + | +Added in API level 21 + | +
| int2 convert_int2(float2 v); + | ++ |
| int2 convert_int2(int2 v); + | ++ |
| int2 convert_int2(long2 v); + | +Added in API level 21 + | +
| int2 convert_int2(short2 v); + | ++ |
| int2 convert_int2(uchar2 v); + | ++ |
| int2 convert_int2(uint2 v); + | ++ |
| int2 convert_int2(ulong2 v); + | +Added in API level 21 + | +
| int2 convert_int2(ushort2 v); + | ++ |
| int3 convert_int3(char3 v); + | ++ |
| int3 convert_int3(double3 v); + | +Added in API level 21 + | +
| int3 convert_int3(float3 v); + | ++ |
| int3 convert_int3(int3 v); + | ++ |
| int3 convert_int3(long3 v); + | +Added in API level 21 + | +
| int3 convert_int3(short3 v); + | ++ |
| int3 convert_int3(uchar3 v); + | ++ |
| int3 convert_int3(uint3 v); + | ++ |
| int3 convert_int3(ulong3 v); + | +Added in API level 21 + | +
| int3 convert_int3(ushort3 v); + | ++ |
| int4 convert_int4(char4 v); + | ++ |
| int4 convert_int4(double4 v); + | +Added in API level 21 + | +
| int4 convert_int4(float4 v); + | ++ |
| int4 convert_int4(int4 v); + | ++ |
| int4 convert_int4(long4 v); + | +Added in API level 21 + | +
| int4 convert_int4(short4 v); + | ++ |
| int4 convert_int4(uchar4 v); + | ++ |
| int4 convert_int4(uint4 v); + | ++ |
| int4 convert_int4(ulong4 v); + | +Added in API level 21 + | +
| int4 convert_int4(ushort4 v); + | ++ |
| long2 convert_long2(char2 v); + | +Added in API level 21 + | +
| long2 convert_long2(double2 v); + | +Added in API level 21 + | +
| long2 convert_long2(float2 v); + | +Added in API level 21 + | +
| long2 convert_long2(int2 v); + | +Added in API level 21 + | +
| long2 convert_long2(long2 v); + | +Added in API level 21 + | +
| long2 convert_long2(short2 v); + | +Added in API level 21 + | +
| long2 convert_long2(uchar2 v); + | +Added in API level 21 + | +
| long2 convert_long2(uint2 v); + | +Added in API level 21 + | +
| long2 convert_long2(ulong2 v); + | +Added in API level 21 + | +
| long2 convert_long2(ushort2 v); + | +Added in API level 21 + | +
| long3 convert_long3(char3 v); + | +Added in API level 21 + | +
| long3 convert_long3(double3 v); + | +Added in API level 21 + | +
| long3 convert_long3(float3 v); + | +Added in API level 21 + | +
| long3 convert_long3(int3 v); + | +Added in API level 21 + | +
| long3 convert_long3(long3 v); + | +Added in API level 21 + | +
| long3 convert_long3(short3 v); + | +Added in API level 21 + | +
| long3 convert_long3(uchar3 v); + | +Added in API level 21 + | +
| long3 convert_long3(uint3 v); + | +Added in API level 21 + | +
| long3 convert_long3(ulong3 v); + | +Added in API level 21 + | +
| long3 convert_long3(ushort3 v); + | +Added in API level 21 + | +
| long4 convert_long4(char4 v); + | +Added in API level 21 + | +
| long4 convert_long4(double4 v); + | +Added in API level 21 + | +
| long4 convert_long4(float4 v); + | +Added in API level 21 + | +
| long4 convert_long4(int4 v); + | +Added in API level 21 + | +
| long4 convert_long4(long4 v); + | +Added in API level 21 + | +
| long4 convert_long4(short4 v); + | +Added in API level 21 + | +
| long4 convert_long4(uchar4 v); + | +Added in API level 21 + | +
| long4 convert_long4(uint4 v); + | +Added in API level 21 + | +
| long4 convert_long4(ulong4 v); + | +Added in API level 21 + | +
| long4 convert_long4(ushort4 v); + | +Added in API level 21 + | +
| short2 convert_short2(char2 v); + | ++ |
| short2 convert_short2(double2 v); + | +Added in API level 21 + | +
| short2 convert_short2(float2 v); + | ++ |
| short2 convert_short2(int2 v); + | ++ |
| short2 convert_short2(long2 v); + | +Added in API level 21 + | +
| short2 convert_short2(short2 v); + | ++ |
| short2 convert_short2(uchar2 v); + | ++ |
| short2 convert_short2(uint2 v); + | ++ |
| short2 convert_short2(ulong2 v); + | +Added in API level 21 + | +
| short2 convert_short2(ushort2 v); + | ++ |
| short3 convert_short3(char3 v); + | ++ |
| short3 convert_short3(double3 v); + | +Added in API level 21 + | +
| short3 convert_short3(float3 v); + | ++ |
| short3 convert_short3(int3 v); + | ++ |
| short3 convert_short3(long3 v); + | +Added in API level 21 + | +
| short3 convert_short3(short3 v); + | ++ |
| short3 convert_short3(uchar3 v); + | ++ |
| short3 convert_short3(uint3 v); + | ++ |
| short3 convert_short3(ulong3 v); + | +Added in API level 21 + | +
| short3 convert_short3(ushort3 v); + | ++ |
| short4 convert_short4(char4 v); + | ++ |
| short4 convert_short4(double4 v); + | +Added in API level 21 + | +
| short4 convert_short4(float4 v); + | ++ |
| short4 convert_short4(int4 v); + | ++ |
| short4 convert_short4(long4 v); + | +Added in API level 21 + | +
| short4 convert_short4(short4 v); + | ++ |
| short4 convert_short4(uchar4 v); + | ++ |
| short4 convert_short4(uint4 v); + | ++ |
| short4 convert_short4(ulong4 v); + | +Added in API level 21 + | +
| short4 convert_short4(ushort4 v); + | ++ |
| uchar2 convert_uchar2(char2 v); + | ++ |
| uchar2 convert_uchar2(double2 v); + | +Added in API level 21 + | +
| uchar2 convert_uchar2(float2 v); + | ++ |
| uchar2 convert_uchar2(int2 v); + | ++ |
| uchar2 convert_uchar2(long2 v); + | +Added in API level 21 + | +
| uchar2 convert_uchar2(short2 v); + | ++ |
| uchar2 convert_uchar2(uchar2 v); + | ++ |
| uchar2 convert_uchar2(uint2 v); + | ++ |
| uchar2 convert_uchar2(ulong2 v); + | +Added in API level 21 + | +
| uchar2 convert_uchar2(ushort2 v); + | ++ |
| uchar3 convert_uchar3(char3 v); + | ++ |
| uchar3 convert_uchar3(double3 v); + | +Added in API level 21 + | +
| uchar3 convert_uchar3(float3 v); + | ++ |
| uchar3 convert_uchar3(int3 v); + | ++ |
| uchar3 convert_uchar3(long3 v); + | +Added in API level 21 + | +
| uchar3 convert_uchar3(short3 v); + | ++ |
| uchar3 convert_uchar3(uchar3 v); + | ++ |
| uchar3 convert_uchar3(uint3 v); + | ++ |
| uchar3 convert_uchar3(ulong3 v); + | +Added in API level 21 + | +
| uchar3 convert_uchar3(ushort3 v); + | ++ |
| uchar4 convert_uchar4(char4 v); + | ++ |
| uchar4 convert_uchar4(double4 v); + | +Added in API level 21 + | +
| uchar4 convert_uchar4(float4 v); + | ++ |
| uchar4 convert_uchar4(int4 v); + | ++ |
| uchar4 convert_uchar4(long4 v); + | +Added in API level 21 + | +
| uchar4 convert_uchar4(short4 v); + | ++ |
| uchar4 convert_uchar4(uchar4 v); + | ++ |
| uchar4 convert_uchar4(uint4 v); + | ++ |
| uchar4 convert_uchar4(ulong4 v); + | +Added in API level 21 + | +
| uchar4 convert_uchar4(ushort4 v); + | ++ |
| uint2 convert_uint2(char2 v); + | ++ |
| uint2 convert_uint2(double2 v); + | +Added in API level 21 + | +
| uint2 convert_uint2(float2 v); + | ++ |
| uint2 convert_uint2(int2 v); + | ++ |
| uint2 convert_uint2(long2 v); + | +Added in API level 21 + | +
| uint2 convert_uint2(short2 v); + | ++ |
| uint2 convert_uint2(uchar2 v); + | ++ |
| uint2 convert_uint2(uint2 v); + | ++ |
| uint2 convert_uint2(ulong2 v); + | +Added in API level 21 + | +
| uint2 convert_uint2(ushort2 v); + | ++ |
| uint3 convert_uint3(char3 v); + | ++ |
| uint3 convert_uint3(double3 v); + | +Added in API level 21 + | +
| uint3 convert_uint3(float3 v); + | ++ |
| uint3 convert_uint3(int3 v); + | ++ |
| uint3 convert_uint3(long3 v); + | +Added in API level 21 + | +
| uint3 convert_uint3(short3 v); + | ++ |
| uint3 convert_uint3(uchar3 v); + | ++ |
| uint3 convert_uint3(uint3 v); + | ++ |
| uint3 convert_uint3(ulong3 v); + | +Added in API level 21 + | +
| uint3 convert_uint3(ushort3 v); + | ++ |
| uint4 convert_uint4(char4 v); + | ++ |
| uint4 convert_uint4(double4 v); + | +Added in API level 21 + | +
| uint4 convert_uint4(float4 v); + | ++ |
| uint4 convert_uint4(int4 v); + | ++ |
| uint4 convert_uint4(long4 v); + | +Added in API level 21 + | +
| uint4 convert_uint4(short4 v); + | ++ |
| uint4 convert_uint4(uchar4 v); + | ++ |
| uint4 convert_uint4(uint4 v); + | ++ |
| uint4 convert_uint4(ulong4 v); + | +Added in API level 21 + | +
| uint4 convert_uint4(ushort4 v); + | ++ |
| ulong2 convert_ulong2(char2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(double2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(float2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(int2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(long2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(short2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(uchar2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(uint2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(ulong2 v); + | +Added in API level 21 + | +
| ulong2 convert_ulong2(ushort2 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(char3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(double3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(float3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(int3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(long3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(short3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(uchar3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(uint3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(ulong3 v); + | +Added in API level 21 + | +
| ulong3 convert_ulong3(ushort3 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(char4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(double4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(float4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(int4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(long4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(short4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(uchar4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(uint4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(ulong4 v); + | +Added in API level 21 + | +
| ulong4 convert_ulong4(ushort4 v); + | +Added in API level 21 + | +
| ushort2 convert_ushort2(char2 v); + | ++ |
| ushort2 convert_ushort2(double2 v); + | +Added in API level 21 + | +
| ushort2 convert_ushort2(float2 v); + | ++ |
| ushort2 convert_ushort2(int2 v); + | ++ |
| ushort2 convert_ushort2(long2 v); + | +Added in API level 21 + | +
| ushort2 convert_ushort2(short2 v); + | ++ |
| ushort2 convert_ushort2(uchar2 v); + | ++ |
| ushort2 convert_ushort2(uint2 v); + | ++ |
| ushort2 convert_ushort2(ulong2 v); + | +Added in API level 21 + | +
| ushort2 convert_ushort2(ushort2 v); + | ++ |
| ushort3 convert_ushort3(char3 v); + | ++ |
| ushort3 convert_ushort3(double3 v); + | +Added in API level 21 + | +
| ushort3 convert_ushort3(float3 v); + | ++ |
| ushort3 convert_ushort3(int3 v); + | ++ |
| ushort3 convert_ushort3(long3 v); + | +Added in API level 21 + | +
| ushort3 convert_ushort3(short3 v); + | ++ |
| ushort3 convert_ushort3(uchar3 v); + | ++ |
| ushort3 convert_ushort3(uint3 v); + | ++ |
| ushort3 convert_ushort3(ulong3 v); + | +Added in API level 21 + | +
| ushort3 convert_ushort3(ushort3 v); + | ++ |
| ushort4 convert_ushort4(char4 v); + | ++ |
| ushort4 convert_ushort4(double4 v); + | +Added in API level 21 + | +
| ushort4 convert_ushort4(float4 v); + | ++ |
| ushort4 convert_ushort4(int4 v); + | ++ |
| ushort4 convert_ushort4(long4 v); + | +Added in API level 21 + | +
| ushort4 convert_ushort4(short4 v); + | ++ |
| ushort4 convert_ushort4(uchar4 v); + | ++ |
| ushort4 convert_ushort4(uint4 v); + | ++ |
| ushort4 convert_ushort4(ulong4 v); + | +Added in API level 21 + | +
| ushort4 convert_ushort4(ushort4 v); + | ++ |
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. +
+| uchar4 rsPackColorTo8888(float r, float g, float b); + | ++ |
| uchar4 rsPackColorTo8888(float r, float g, float b, float a); + | ++ |
| uchar4 rsPackColorTo8888(float3 color); + | ++ |
| uchar4 rsPackColorTo8888(float4 color); + | ++ |
| 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. |
Packs three or four floating point RGBA values into a uchar4. The RGBA values should be +between 0.0 and 1.0 inclusive. Values outside of this range are clamped to this range. +However numbers greater than INT_MAX or less than INT_MIN 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. +
+Unpacks a uchar4 color to float4. The resulting floats will be between 0.0 and 1.0 inclusive. +
+| float4 rsYuvToRGBA_float4(uchar y, uchar u, uchar v); + | ++ |
| uchar4 rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v); + | ++ |
| y | Luminance component. |
|---|---|
| u | U chrominance component. |
| v | V chrominance component. |
Converts a color from a YUV representation to RGBA. +
+ +We currently don't provide a function to do the reverse conversion. +
+The functions below are intended to be used during application developement. +They should not be used in shipping applications. +
+| Functions | |
|---|---|
| + rsDebug + | ++ Log a message and values + | +
| void rsDebug(const char* message, char a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, char2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, char3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, char4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, const rs_matrix2x2* a); + | ++ |
| void rsDebug(const char* message, const rs_matrix3x3* a); + | ++ |
| void rsDebug(const char* message, const rs_matrix4x4* a); + | ++ |
| void rsDebug(const char* message, const void* a); + | ++ |
| void rsDebug(const char* message, double a); + | ++ |
| void rsDebug(const char* message, float a); + | ++ |
| void rsDebug(const char* message, float a, float b); + | ++ |
| void rsDebug(const char* message, float a, float b, float c); + | ++ |
| void rsDebug(const char* message, float a, float b, float c, float d); + | ++ |
| void rsDebug(const char* message, float2 a); + | ++ |
| void rsDebug(const char* message, float3 a); + | ++ |
| void rsDebug(const char* message, float4 a); + | ++ |
| void rsDebug(const char* message, int a); + | ++ |
| void rsDebug(const char* message, int2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, int3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, int4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, long a); + | ++ |
| void rsDebug(const char* message, long long a); + | ++ |
| void rsDebug(const char* message, long2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, long3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, long4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, short a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, short2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, short3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, short4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uchar a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uchar2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uchar3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uchar4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uint a); + | ++ |
| void rsDebug(const char* message, uint2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uint3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, uint4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, ulong a); + | ++ |
| void rsDebug(const char* message, ulong2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, ulong3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, ulong4 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, unsigned long long a); + | ++ |
| void rsDebug(const char* message, ushort a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, ushort2 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, ushort3 a); + | +Added in API level 17 + | +
| void rsDebug(const char* message, ushort4 a); + | +Added in API level 17 + | +
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. +
+The rsForEach() function can be used to invoke the root kernel of a script. +
+| Types | |
|---|---|
| + rs_for_each_strategy_t + | ++ Suggested cell processing order + | +
| + rs_script_call_t + | ++ Cell iteration information + | +
| Functions | |
|---|---|
| + rsForEach + | ++ Invoke the root kernel of a script + | +
An enum with the following values: +
+| 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. |
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. +
+A structure with the following fields:
+| 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. |
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. +
+| void rsForEach(rs_script script, rs_allocation input, rs_allocation output); + | +Added in API level 14 + | +
| void rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData); + | +Removed from API level 14 + | +
| void rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData, const rs_script_call_t* sc); + | +Removed from API level 14 + | +
| void rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData, size_t usrDataLen); + | +API level 14 - 20 + | +
| void rsForEach(rs_script script, rs_allocation input, rs_allocation output, const void* usrData, size_t usrDataLen, const rs_script_call_t* sc); + | +API level 14 - 20 + | +
| 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. |
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. +
+The graphics subsystem of RenderScript has been deprecated. +
+| Deprecated Types | |
|---|---|
| + rs_blend_dst_func + | ++ Deprecated. Blend destination function + | +
| + rs_blend_src_func + | ++ Deprecated. Blend source function + | +
| + rs_cull_mode + | ++ Deprecated. Culling mode + | +
| + rs_depth_func + | ++ Deprecated. Depth function + | +
| + rs_font + | ++ Deprecated. Handle to a Font + | +
| + rs_mesh + | ++ Deprecated. Handle to a Mesh + | +
| + rs_primitive + | ++ Deprecated. How to intepret mesh vertex data + | +
| + rs_program_fragment + | ++ Deprecated. Handle to a ProgramFragment + | +
| + rs_program_raster + | ++ Deprecated. Handle to a ProgramRaster + | +
| + rs_program_store + | ++ Deprecated. Handle to a ProgramStore + | +
| + rs_program_vertex + | ++ Deprecated. Handle to a ProgramVertex + | +
| Deprecated Functions | |
|---|---|
| + rsgAllocationSyncAll + | ++ Deprecated. Sync the contents of an allocation + | +
| + rsgBindColorTarget + | ++ Deprecated. Set the color target + | +
| + rsgBindConstant + | ++ Deprecated. Bind a constant allocation + | +
| + rsgBindDepthTarget + | ++ Deprecated. Set the depth target + | +
| + rsgBindFont + | ++ Deprecated. Bind a font object + | +
| + rsgBindProgramFragment + | ++ Deprecated. Bind a ProgramFragment + | +
| + rsgBindProgramRaster + | ++ Deprecated. Bind a ProgramRaster + | +
| + rsgBindProgramStore + | ++ Deprecated. Bind a ProgramStore + | +
| + rsgBindProgramVertex + | ++ Deprecated. Bind a ProgramVertex + | +
| + rsgBindSampler + | ++ Deprecated. Bind a sampler + | +
| + rsgBindTexture + | ++ Deprecated. Bind a texture allocation + | +
| + rsgClearAllRenderTargets + | ++ Deprecated. Clear all color and depth targets + | +
| + rsgClearColor + | ++ Deprecated. Clear the specified color from the surface + | +
| + rsgClearColorTarget + | ++ Deprecated. Clear the color target + | +
| + rsgClearDepth + | ++ Deprecated. Clear the depth surface + | +
| + rsgClearDepthTarget + | ++ Deprecated. Clear the depth target + | +
| + rsgDrawMesh + | ++ Deprecated. Draw a mesh + | +
| + rsgDrawQuad + | ++ Deprecated. Draw a quad + | +
| + rsgDrawQuadTexCoords + | ++ Deprecated. Draw a textured quad + | +
| + rsgDrawRect + | ++ Deprecated. Draw a rectangle + | +
| + rsgDrawSpriteScreenspace + | ++ Deprecated. Draw rectangles in screenspace + | +
| + rsgDrawText + | ++ Deprecated. Draw a text string + | +
| + rsgFinish + | ++ Deprecated. End rendering commands + | +
| + rsgFontColor + | ++ Deprecated. Set the font color + | +
| + rsgGetHeight + | ++ Deprecated. Get the surface height + | +
| + rsgGetWidth + | ++ Deprecated. Get the surface width + | +
| + rsgMeasureText + | ++ Deprecated. Get the bounding box for a text string + | +
| + rsgMeshComputeBoundingBox + | ++ Deprecated. Compute a bounding box + | +
| + rsgMeshGetIndexAllocation + | ++ Deprecated. Return an allocation containing index data + | +
| + rsgMeshGetPrimitive + | ++ Deprecated. Return the primitive + | +
| + rsgMeshGetPrimitiveCount + | ++ Deprecated. Return the number of index sets + | +
| + rsgMeshGetVertexAllocation + | ++ Deprecated. Return a vertex allocation + | +
| + rsgMeshGetVertexAllocationCount + | ++ Deprecated. Return the number of vertex allocations + | +
| + rsgProgramFragmentConstantColor + | ++ Deprecated. Set the constant color for a fixed function emulation program + | +
| + rsgProgramRasterGetCullMode + | ++ Deprecated. Get program raster cull mode + | +
| + rsgProgramRasterIsPointSpriteEnabled + | ++ Deprecated. Get program raster point sprite state + | +
| + rsgProgramStoreGetBlendDstFunc + | ++ Deprecated. Get program store blend destination function + | +
| + rsgProgramStoreGetBlendSrcFunc + | ++ Deprecated. Get program store blend source function + | +
| + rsgProgramStoreGetDepthFunc + | ++ Deprecated. Get program store depth function + | +
| + rsgProgramStoreIsColorMaskAlphaEnabled + | ++ Deprecated. Get program store alpha component color mask + | +
| + rsgProgramStoreIsColorMaskBlueEnabled + | ++ Deprecated. Get program store blur component color mask + | +
| + rsgProgramStoreIsColorMaskGreenEnabled + | ++ Deprecated. Get program store green component color mask + | +
| + rsgProgramStoreIsColorMaskRedEnabled + | ++ Deprecated. Get program store red component color mask + | +
| + rsgProgramStoreIsDepthMaskEnabled + | ++ Deprecated. Get program store depth mask + | +
| + rsgProgramStoreIsDitherEnabled + | ++ Deprecated. Get program store dither state + | +
| + rsgProgramVertexGetProjectionMatrix + | ++ Deprecated. Get the projection matrix for a fixed function vertex program + | +
| + rsgProgramVertexLoadModelMatrix + | ++ Deprecated. Load the model matrix for a bound fixed function vertex program + | +
| + rsgProgramVertexLoadProjectionMatrix + | ++ Deprecated. Load the projection matrix for a bound fixed function vertex program + | +
| + rsgProgramVertexLoadTextureMatrix + | ++ Deprecated. Load the texture matrix for a bound fixed function vertex program + | +
An enum with the following values: + When compiling for 32 bits. Added in API level 16 +
+| 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 |
Deprecated. Do not use.
+An enum with the following values: + When compiling for 32 bits. Added in API level 16 +
+| 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 |
Deprecated. Do not use.
+An enum with the following values: + When compiling for 32 bits. Added in API level 16 +
+| RS_CULL_BACK = 0 | |
|---|---|
| RS_CULL_FRONT = 1 | |
| RS_CULL_NONE = 2 | |
| RS_CULL_INVALID = 100 |
Deprecated. Do not use.
+An enum with the following values: + When compiling for 32 bits. Added in API level 16 +
+| 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 |
Deprecated. Do not use.
+Specifies conditional drawing depending on the comparison of the incoming +depth to that found in the depth buffer. +
+A typedef of: _RS_HANDLE When compiling for 32 bits. +
+Deprecated. Do not use.
+Opaque handle to a RenderScript font object. +See: android.renderscript.Font +
+A typedef of: _RS_HANDLE When compiling for 32 bits. +
+Deprecated. Do not use.
+Opaque handle to a RenderScript mesh object. +See: android.renderscript.Mesh +
+An enum with the following values: + When compiling for 32 bits. Added in API level 16 +
+| 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 |
Deprecated. Do not use.
+Describes the way mesh vertex data is interpreted when rendering +
+A typedef of: _RS_HANDLE When compiling for 32 bits. +
+Deprecated. Do not use.
+Opaque handle to a RenderScript ProgramFragment object. +See: android.renderscript.ProgramFragment +
+A typedef of: _RS_HANDLE When compiling for 32 bits. +
+Deprecated. Do not use.
+Opaque handle to a RenderScript ProgramRaster object. +See: android.renderscript.ProgramRaster +
+A typedef of: _RS_HANDLE When compiling for 32 bits. +
+Deprecated. Do not use.
+Opaque handle to a RenderScript ProgramStore object. +See: android.renderscript.ProgramStore +
+A typedef of: _RS_HANDLE When compiling for 32 bits. +
+Deprecated. Do not use.
+Opaque handle to a RenderScript ProgramVertex object. +See: android.renderscript.ProgramVertex +
+| void rsgAllocationSyncAll(rs_allocation alloc); + | +When compiling for 32 bits. + | +
| void rsgAllocationSyncAll(rs_allocation alloc, rs_allocation_usage_type source); + | +When compiling for 32 bits. Added in API level 14 + | +
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. +
+| void rsgBindColorTarget(rs_allocation colorTarget, uint slot); + | +When compiling for 32 bits. Added in API level 14 + | +
Deprecated. Do not use.
+Set the color target used for all subsequent rendering calls +
+| void rsgBindConstant(rs_program_fragment ps, uint slot, rs_allocation c); + | +When compiling for 32 bits. + | +
| void rsgBindConstant(rs_program_vertex pv, uint slot, rs_allocation c); + | +When compiling for 32 bits. + | +
| ps | program fragment object |
|---|---|
| slot | index of the constant buffer on the program |
| c | constants to bind |
| pv | program vertex object |
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. +
+| void rsgBindDepthTarget(rs_allocation depthTarget); + | +When compiling for 32 bits. Added in API level 14 + | +
Deprecated. Do not use.
+Set the depth target used for all subsequent rendering calls +
+| void rsgBindFont(rs_font font); + | +When compiling for 32 bits. + | +
| font | object to bind |
|---|
Deprecated. Do not use.
+Binds the font object to be used for all subsequent font rendering calls +
+| void rsgBindProgramFragment(rs_program_fragment pf); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Bind a new ProgramFragment to the rendering context. +
+| void rsgBindProgramRaster(rs_program_raster pr); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Bind a new ProgramRaster to the rendering context. +
+| void rsgBindProgramStore(rs_program_store ps); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Bind a new ProgramStore to the rendering context. +
+| void rsgBindProgramVertex(rs_program_vertex pv); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Bind a new ProgramVertex to the rendering context. +
+| void rsgBindSampler(rs_program_fragment fragment, uint slot, rs_sampler sampler); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Bind a new Sampler object to a ProgramFragment. The sampler will +operate on the texture bound at the matching slot. +
+| void rsgBindTexture(rs_program_fragment v, uint slot, rs_allocation alloc); + | +When compiling for 32 bits. + | +
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. +
+| void rsgClearAllRenderTargets(); + | +When compiling for 32 bits. Added in API level 14 + | +
Deprecated. Do not use.
+Clear all color and depth targets and resume rendering into +the framebuffer +
+| void rsgClearColor(float r, float g, float b, float a); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Clears the rendering surface to the specified color. +
+| void rsgClearColorTarget(uint slot); + | +When compiling for 32 bits. Added in API level 14 + | +
Deprecated. Do not use.
+Clear the previously set color target +
+| void rsgClearDepth(float value); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Clears the depth suface to the specified value. +
+| void rsgClearDepthTarget(); + | +When compiling for 32 bits. Added in API level 14 + | +
Deprecated. Do not use.
+Clear the previously set depth target +
+| void rsgDrawMesh(rs_mesh ism); + | +When compiling for 32 bits. + | +
| void rsgDrawMesh(rs_mesh ism, uint primitiveIndex); + | +When compiling for 32 bits. + | +
| void rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len); + | +When compiling for 32 bits. + | +
| 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 |
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. +
+| void rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Low performance utility function for drawing a simple quad. Not intended for +drawing large quantities of geometry. +
+| void rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Low performance utility function for drawing a textured quad. Not intended +for drawing large quantities of geometry. +
+| void rsgDrawRect(float x1, float y1, float x2, float y2, float z); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Low performance utility function for drawing a simple rectangle. Not +intended for drawing large quantities of geometry. +
+| void rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); + | +When compiling for 32 bits. + | +
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. +
+| void rsgDrawText(const char* text, int x, int y); + | +When compiling for 32 bits. + | +
| void rsgDrawText(rs_allocation alloc, int x, int y); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Draws text given a string and location +
+| uint rsgFinish(); + | +When compiling for 32 bits. Added in API level 14 + | +
Deprecated. Do not use.
+Force RenderScript to finish all rendering commands +
+| void rsgFontColor(float r, float g, float b, float a); + | +When compiling for 32 bits. + | +
| r | red component |
|---|---|
| g | green component |
| b | blue component |
| a | alpha component |
Deprecated. Do not use.
+Sets the font color for all subsequent rendering calls +
+| uint rsgGetHeight(); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Get the height of the current rendering surface. +
+| uint rsgGetWidth(); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Get the width of the current rendering surface. +
+| void rsgMeasureText(const char* text, int* left, int* right, int* top, int* bottom); + | +When compiling for 32 bits. + | +
| void rsgMeasureText(rs_allocation alloc, int* left, int* right, int* top, int* bottom); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Returns the bounding box of the text relative to (0, 0) +Any of left, right, top, bottom could be NULL +
+| void rsgMeshComputeBoundingBox(rs_mesh mesh, float* minX, float* minY, float* min, float* maxX, float* maxY, float* maxZ); + | +When compiling for 32 bits. + | +
| void rsgMeshComputeBoundingBox(rs_mesh mesh, float3* bBoxMin, float3* bBoxMax); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Computes an axis aligned bounding box of a mesh object +
+| rs_allocation rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index); + | +When compiling for 32 bits. Added in API level 16 + | +
| m | mesh to get data from |
|---|---|
| index | index of the index allocation |
| allocation containing index data |
Deprecated. Do not use.
+Returns an allocation containing index data or a null +allocation if only the primitive is specified +
+| rs_primitive rsgMeshGetPrimitive(rs_mesh m, uint32_t index); + | +When compiling for 32 bits. Added in API level 16 + | +
| m | mesh to get data from |
|---|---|
| index | index of the primitive |
| primitive describing how the mesh is rendered |
Deprecated. Do not use.
+Returns the primitive describing how a part of the mesh is +rendered +
+| uint32_t rsgMeshGetPrimitiveCount(rs_mesh m); + | +When compiling for 32 bits. Added in API level 16 + | +
| m | mesh to get data from |
|---|
| number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data |
Deprecated. Do not use.
+Meshes could have multiple index sets, this function returns +the number. +
+| rs_allocation rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index); + | +When compiling for 32 bits. Added in API level 16 + | +
| m | mesh to get data from |
|---|---|
| index | index of the vertex allocation |
| allocation containing vertex data |
Deprecated. Do not use.
+Returns an allocation that is part of the mesh and contains +vertex data, e.g. positions, normals, texcoords +
+| uint32_t rsgMeshGetVertexAllocationCount(rs_mesh m); + | +When compiling for 32 bits. Added in API level 16 + | +
| m | mesh to get data from |
|---|
| number of allocations in the mesh that contain vertex data |
Deprecated. Do not use.
+Returns the number of allocations in the mesh that contain +vertex data +
+| void rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a); + | +When compiling for 32 bits. + | +
Deprecated. Do not use.
+Set the constant color for a fixed function emulation program. +
+| rs_cull_mode rsgProgramRasterGetCullMode(rs_program_raster pr); + | +When compiling for 32 bits. Added in API level 16 + | +
| pr | program raster to query |
|---|
Deprecated. Do not use.
+Get program raster cull mode +
+| bool rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr); + | +When compiling for 32 bits. Added in API level 16 + | +
| pr | program raster to query |
|---|
Deprecated. Do not use.
+Get program raster point sprite state +
+| rs_blend_dst_func rsgProgramStoreGetBlendDstFunc(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store blend destination function +
+| rs_blend_src_func rsgProgramStoreGetBlendSrcFunc(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store blend source function +
+| rs_depth_func rsgProgramStoreGetDepthFunc(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store depth function +
+| bool rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store alpha component color mask +
+| bool rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store blur component color mask +
+| bool rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store green component color mask +
+| bool rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store red component color mask +
+| bool rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store depth mask +
+| bool rsgProgramStoreIsDitherEnabled(rs_program_store ps); + | +When compiling for 32 bits. Added in API level 16 + | +
| ps | program store to query |
|---|
Deprecated. Do not use.
+Get program store dither state +
+| void rsgProgramVertexGetProjectionMatrix(rs_matrix4x4* proj); + | +When compiling for 32 bits. + | +
| proj | matrix to store the current projection matrix into |
|---|
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. +
+| void rsgProgramVertexLoadModelMatrix(const rs_matrix4x4* model); + | +When compiling for 32 bits. + | +
| model | model matrix |
|---|
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. +
+| void rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4* proj); + | +When compiling for 32 bits. + | +
| proj | projection matrix |
|---|
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. +
+| void rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4* tex); + | +When compiling for 32 bits. + | +
| tex | texture matrix |
|---|
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. +
+These functions are used to:
| Functions | |
|---|---|
| + rsAllocationIoReceive + | ++ Receive new content from the queue + | +
| + rsAllocationIoSend + | ++ Send new content to the queue + | +
| + rsSendToClient + | ++ Send a message to the client, non-blocking + | +
| + rsSendToClientBlocking + | ++ Send a message to the client, blocking + | +
| void rsAllocationIoReceive(rs_allocation a); + | +Added in API level 16 + | +
| a | Allocation to work on. |
|---|
Receive a new set of contents from the queue. +
+| void rsAllocationIoSend(rs_allocation a); + | +Added in API level 16 + | +
| a | Allocation to work on. |
|---|
Send the contents of the Allocation to the queue. +
+| bool rsSendToClient(int cmdID); + | ++ |
| bool rsSendToClient(int cmdID, const void* data, uint len); + | ++ |
| cmdID | |
|---|---|
| data | Application specific data. |
| len | Length of the data, in bytes. |
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. +
+ + +| void rsSendToClientBlocking(int cmdID); + | ++ |
| void rsSendToClientBlocking(int cmdID, const void* data, uint len); + | ++ |
| cmdID | |
|---|---|
| data | Application specific data. |
| len | Length of the data, in bytes. |
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. +
+ + +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
| Constants | |
|---|---|
| + M_1_PI + | ++ 1 / pi, as a 32 bit float + | +
| + M_2_PI + | ++ 2 / pi, as a 32 bit float + | +
| + M_2_SQRTPI + | ++ 2 / sqrt(pi), as a 32 bit float + | +
| + M_E + | ++ e, as a 32 bit float + | +
| + M_LN10 + | ++ log_e(10), as a 32 bit float + | +
| + M_LN2 + | ++ log_e(2), as a 32 bit float + | +
| + M_LOG10E + | ++ log_10(e), as a 32 bit float + | +
| + M_LOG2E + | ++ log_2(e), as a 32 bit float + | +
| + M_PI + | ++ pi, as a 32 bit float + | +
| + M_PI_2 + | ++ pi / 2, as a 32 bit float + | +
| + M_PI_4 + | ++ pi / 4, as a 32 bit float + | +
| + M_SQRT1_2 + | ++ 1 / sqrt(2), as a 32 bit float + | +
| + M_SQRT2 + | ++ sqrt(2), as a 32 bit float + | +
| Functions | |
|---|---|
| + abs + | ++ Absolute value of an integer + | +
| + acos + | ++ Inverse cosine + | +
| + acosh + | ++ Inverse hyperbolic cosine + | +
| + acospi + | ++ Inverse cosine divided by pi + | +
| + asin + | ++ Inverse sine + | +
| + asinh + | ++ Inverse hyperbolic sine + | +
| + asinpi + | ++ Inverse sine divided by pi + | +
| + atan + | ++ Inverse tangent + | +
| + atan2 + | ++ Inverse tangent of a ratio + | +
| + atan2pi + | ++ Inverse tangent of a ratio, divided by pi + | +
| + atanh + | ++ Inverse hyperbolic tangent + | +
| + atanpi + | ++ Inverse tangent divided by pi + | +
| + cbrt + | ++ Cube root + | +
| + ceil + | ++ Smallest integer not less than a value + | +
| + clamp + | ++ Restrain a value to a range + | +
| + clz + | ++ Number of leading 0 bits + | +
| + copysign + | ++ Copies the sign of a number to another + | +
| + cos + | ++ Cosine + | +
| + cosh + | ++ Hypebolic cosine + | +
| + cospi + | ++ Cosine of a number multiplied by pi + | +
| + degrees + | ++ Converts radians into degrees + | +
| + erf + | ++ Mathematical error function + | +
| + erfc + | ++ Mathematical complementary error function + | +
| + exp + | ++ e raised to a number + | +
| + exp10 + | ++ 10 raised to a number + | +
| + exp2 + | ++ 2 raised to a number + | +
| + expm1 + | ++ e raised to a number minus one + | +
| + fabs + | ++ Absolute value of a float + | +
| + fdim + | ++ Positive difference between two values + | +
| + floor + | ++ Smallest integer not greater than a value + | +
| + fma + | ++ Multiply and add + | +
| + fmax + | ++ Maximum of two floats + | +
| + fmin + | ++ Minimum of two floats + | +
| + fmod + | ++ Modulo + | +
| + fract + | ++ Positive fractional part + | +
| + frexp + | ++ Binary mantissa and exponent + | +
| + half_recip + | ++ Reciprocal computed to 16 bit precision + | +
| + half_rsqrt + | ++ Reciprocal of a square root computed to 16 bit precision + | +
| + half_sqrt + | ++ Square root computed to 16 bit precision + | +
| + hypot + | ++ Hypotenuse + | +
| + ilogb + | ++ Base two exponent + | +
| + ldexp + | ++ Creates a floating point from mantissa and exponent + | +
| + lgamma + | ++ Natural logarithm of the gamma function + | +
| + log + | ++ Natural logarithm + | +
| + log10 + | ++ Base 10 logarithm + | +
| + log1p + | ++ Natural logarithm of a value plus 1 + | +
| + log2 + | ++ Base 2 logarithm + | +
| + logb + | ++ Base two exponent + | +
| + mad + | ++ Multiply and add + | +
| + max + | ++ Maximum + | +
| + min + | ++ Minimum + | +
| + mix + | ++ Mixes two values + | +
| + modf + | ++ Integral and fractional components + | +
| + nan + | ++ Not a Number + | +
| + native_acos + | ++ Approximate inverse cosine + | +
| + native_acosh + | ++ Approximate inverse hyperbolic cosine + | +
| + native_acospi + | ++ Approximate inverse cosine divided by pi + | +
| + native_asin + | ++ Approximate inverse sine + | +
| + native_asinh + | ++ Approximate inverse hyperbolic sine + | +
| + native_asinpi + | ++ Approximate inverse sine divided by pi + | +
| + native_atan + | ++ Approximate inverse tangent + | +
| + native_atan2 + | ++ Approximate inverse tangent of a ratio + | +
| + native_atan2pi + | ++ Approximate inverse tangent of a ratio, divided by pi + | +
| + native_atanh + | ++ Approximate inverse hyperbolic tangent + | +
| + native_atanpi + | ++ Approximate inverse tangent divided by pi + | +
| + native_cbrt + | ++ Approximate cube root + | +
| + native_cos + | ++ Approximate cosine + | +
| + native_cosh + | ++ Approximate hypebolic cosine + | +
| + native_cospi + | ++ Approximate cosine of a number multiplied by pi + | +
| + native_divide + | ++ Approximate division + | +
| + native_exp + | ++ Approximate e raised to a number + | +
| + native_exp10 + | ++ Approximate 10 raised to a number + | +
| + native_exp2 + | ++ Approximate 2 raised to a number + | +
| + native_expm1 + | ++ Approximate e raised to a number minus one + | +
| + native_hypot + | ++ Approximate hypotenuse + | +
| + native_log + | ++ Approximate natural logarithm + | +
| + native_log10 + | ++ Approximate base 10 logarithm + | +
| + native_log1p + | ++ Approximate natural logarithm of a value plus 1 + | +
| + native_log2 + | ++ Approximate base 2 logarithm + | +
| + native_powr + | ++ Approximate positive base raised to an exponent + | +
| + native_recip + | ++ Approximate reciprocal + | +
| + native_rootn + | ++ Approximate nth root + | +
| + native_rsqrt + | ++ Approximate reciprocal of a square root + | +
| + native_sin + | ++ Approximate sine + | +
| + native_sincos + | ++ Approximate sine and cosine + | +
| + native_sinh + | ++ Approximate hyperbolic sine + | +
| + native_sinpi + | ++ Approximate sine of a number multiplied by pi + | +
| + native_sqrt + | ++ Approximate square root + | +
| + native_tan + | ++ Approximate tangent + | +
| + native_tanh + | ++ Approximate hyperbolic tangent + | +
| + native_tanpi + | ++ Approximate tangent of a number multiplied by pi + | +
| + nextafter + | ++ Next floating point number + | +
| + pow + | ++ Base raised to an exponent + | +
| + pown + | ++ Base raised to an integer exponent + | +
| + powr + | ++ Positive base raised to an exponent + | +
| + radians + | ++ Converts degrees into radians + | +
| + remainder + | ++ Remainder of a division + | +
| + remquo + | ++ Remainder and quotient of a division + | +
| + rint + | ++ Round to even + | +
| + rootn + | ++ Nth root + | +
| + round + | ++ Round away from zero + | +
| + rsRand + | ++ Pseudo-random number + | +
| + rsqrt + | ++ Reciprocal of a square root + | +
| + sign + | ++ Sign of a value + | +
| + sin + | ++ Sine + | +
| + sincos + | ++ Sine and cosine + | +
| + sinh + | ++ Hyperbolic sine + | +
| + sinpi + | ++ Sine of a number multiplied by pi + | +
| + sqrt + | ++ Square root + | +
| + step + | ++ 0 if less than a value, 0 otherwise + | +
| + tan + | ++ Tangent + | +
| + tanh + | ++ Hyperbolic tangent + | +
| + tanpi + | ++ Tangent of a number multiplied by pi + | +
| + tgamma + | ++ Gamma function + | +
| + trunc + | ++ Truncates a floating point + | +
| Deprecated Functions | |
|---|---|
| + rsClamp + | ++ Deprecated. Restrain a value to a range + | +
| + rsFrac + | ++ Deprecated. Returns the fractional part of a float + | +
| Value: 0.318309886183790671537767526745028724f + |
The inverse of pi, as a 32 bit float. +
+| Value: 0.636619772367581343075535053490057448f + |
2 divided by pi, as a 32 bit float. +
+| Value: 1.128379167095512573896158903121545172f + |
2 divided by the square root of pi, as a 32 bit float. +
+| Value: 2.718281828459045235360287471352662498f + |
The number e, the base of the natural logarithm, as a 32 bit float. +
+| Value: 2.302585092994045684017991454684364208f + |
The natural logarithm of 10, as a 32 bit float. +
+| Value: 0.693147180559945309417232121458176568f + |
The natural logarithm of 2, as a 32 bit float. +
+| Value: 0.434294481903251827651128918916605082f + |
The logarithm base 10 of e, as a 32 bit float. +
+| Value: 1.442695040888963407359924681001892137f + |
The logarithm base 2 of e, as a 32 bit float. +
+| Value: 3.141592653589793238462643383279502884f + |
The constant pi, as a 32 bit float. +
+| Value: 1.570796326794896619231321691639751442f + |
Pi divided by 2, as a 32 bit float. +
+| Value: 0.785398163397448309615660845819875721f + |
Pi divided by 4, as a 32 bit float. +
+| Value: 0.707106781186547524400844362104849039f + |
The inverse of the square root of 2, as a 32 bit float. +
+| Value: 1.414213562373095048801688724209698079f + |
The square root of 2, as a 32 bit float. +
+| uchar abs(char v); + | ++ |
| uchar2 abs(char2 v); + | ++ |
| uchar3 abs(char3 v); + | ++ |
| uchar4 abs(char4 v); + | ++ |
| uint abs(int v); + | ++ |
| uint2 abs(int2 v); + | ++ |
| uint3 abs(int3 v); + | ++ |
| uint4 abs(int4 v); + | ++ |
| ushort abs(short v); + | ++ |
| ushort2 abs(short2 v); + | ++ |
| ushort3 abs(short3 v); + | ++ |
| ushort4 abs(short4 v); + | ++ |
Returns the absolute value of an integer. +
+ +For floats, use fabs(). +
+| float acos(float v); + | ++ |
| float2 acos(float2 v); + | ++ |
| float3 acos(float3 v); + | ++ |
| float4 acos(float4 v); + | ++ |
Returns the inverse cosine, in radians. +
+ +See also native_acos(). +
+| float acosh(float v); + | ++ |
| float2 acosh(float2 v); + | ++ |
| float3 acosh(float3 v); + | ++ |
| float4 acosh(float4 v); + | ++ |
Returns the inverse hyperbolic cosine, in radians. +
+ +See also native_acosh(). +
+| float acospi(float v); + | ++ |
| float2 acospi(float2 v); + | ++ |
| float3 acospi(float3 v); + | ++ |
| float4 acospi(float4 v); + | ++ |
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(). +
+| float asin(float v); + | ++ |
| float2 asin(float2 v); + | ++ |
| float3 asin(float3 v); + | ++ |
| float4 asin(float4 v); + | ++ |
Returns the inverse sine, in radians. +
+ +See also native_asin(). +
+| float asinh(float v); + | ++ |
| float2 asinh(float2 v); + | ++ |
| float3 asinh(float3 v); + | ++ |
| float4 asinh(float4 v); + | ++ |
Returns the inverse hyperbolic sine, in radians. +
+ +See also native_asinh(). +
+| float asinpi(float v); + | ++ |
| float2 asinpi(float2 v); + | ++ |
| float3 asinpi(float3 v); + | ++ |
| float4 asinpi(float4 v); + | ++ |
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(). +
+| float atan(float v); + | ++ |
| float2 atan(float2 v); + | ++ |
| float3 atan(float3 v); + | ++ |
| float4 atan(float4 v); + | ++ |
Returns the inverse tangent, in radians. +
+ +See also native_atan(). +
+| float atan2(float numerator, float denominator); + | ++ |
| float2 atan2(float2 numerator, float2 denominator); + | ++ |
| float3 atan2(float3 numerator, float3 denominator); + | ++ |
| float4 atan2(float4 numerator, float4 denominator); + | ++ |
| numerator | Numerator. |
|---|---|
| denominator | Denominator. Can be 0. |
Returns the inverse tangent of (numerator / denominator), in radians.
+
See also native_atan2(). +
+| float atan2pi(float numerator, float denominator); + | ++ |
| float2 atan2pi(float2 numerator, float2 denominator); + | ++ |
| float3 atan2pi(float3 numerator, float3 denominator); + | ++ |
| float4 atan2pi(float4 numerator, float4 denominator); + | ++ |
| numerator | Numerator. |
|---|---|
| denominator | Denominator. Can be 0. |
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(). +
+| float atanh(float v); + | ++ |
| float2 atanh(float2 v); + | ++ |
| float3 atanh(float3 v); + | ++ |
| float4 atanh(float4 v); + | ++ |
Returns the inverse hyperbolic tangent, in radians. +
+ +See also native_atanh(). +
+| float atanpi(float v); + | ++ |
| float2 atanpi(float2 v); + | ++ |
| float3 atanpi(float3 v); + | ++ |
| float4 atanpi(float4 v); + | ++ |
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(). +
+| float cbrt(float v); + | ++ |
| float2 cbrt(float2 v); + | ++ |
| float3 cbrt(float3 v); + | ++ |
| float4 cbrt(float4 v); + | ++ |
Returns the cube root. +
+ +See also native_cbrt(). +
+| float ceil(float v); + | ++ |
| float2 ceil(float2 v); + | ++ |
| float3 ceil(float3 v); + | ++ |
| float4 ceil(float4 v); + | ++ |
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(). +
+| char clamp(char value, char min_value, char max_value); + | +Added in API level 19 + | +
| char2 clamp(char2 value, char min_value, char max_value); + | +Added in API level 19 + | +
| char2 clamp(char2 value, char2 min_value, char2 max_value); + | +Added in API level 19 + | +
| char3 clamp(char3 value, char min_value, char max_value); + | +Added in API level 19 + | +
| char3 clamp(char3 value, char3 min_value, char3 max_value); + | +Added in API level 19 + | +
| char4 clamp(char4 value, char min_value, char max_value); + | +Added in API level 19 + | +
| char4 clamp(char4 value, char4 min_value, char4 max_value); + | +Added in API level 19 + | +
| float clamp(float value, float min_value, float max_value); + | ++ |
| float2 clamp(float2 value, float min_value, float max_value); + | ++ |
| float2 clamp(float2 value, float2 min_value, float2 max_value); + | ++ |
| float3 clamp(float3 value, float min_value, float max_value); + | ++ |
| float3 clamp(float3 value, float3 min_value, float3 max_value); + | ++ |
| float4 clamp(float4 value, float min_value, float max_value); + | ++ |
| float4 clamp(float4 value, float4 min_value, float4 max_value); + | ++ |
| int clamp(int value, int min_value, int max_value); + | +Added in API level 19 + | +
| int2 clamp(int2 value, int min_value, int max_value); + | +Added in API level 19 + | +
| int2 clamp(int2 value, int2 min_value, int2 max_value); + | +Added in API level 19 + | +
| int3 clamp(int3 value, int min_value, int max_value); + | +Added in API level 19 + | +
| int3 clamp(int3 value, int3 min_value, int3 max_value); + | +Added in API level 19 + | +
| int4 clamp(int4 value, int min_value, int max_value); + | +Added in API level 19 + | +
| int4 clamp(int4 value, int4 min_value, int4 max_value); + | +Added in API level 19 + | +
| long clamp(long value, long min_value, long max_value); + | +Added in API level 19 + | +
| long2 clamp(long2 value, long min_value, long max_value); + | +Added in API level 19 + | +
| long2 clamp(long2 value, long2 min_value, long2 max_value); + | +Added in API level 19 + | +
| long3 clamp(long3 value, long min_value, long max_value); + | +Added in API level 19 + | +
| long3 clamp(long3 value, long3 min_value, long3 max_value); + | +Added in API level 19 + | +
| long4 clamp(long4 value, long min_value, long max_value); + | +Added in API level 19 + | +
| long4 clamp(long4 value, long4 min_value, long4 max_value); + | +Added in API level 19 + | +
| short clamp(short value, short min_value, short max_value); + | +Added in API level 19 + | +
| short2 clamp(short2 value, short min_value, short max_value); + | +Added in API level 19 + | +
| short2 clamp(short2 value, short2 min_value, short2 max_value); + | +Added in API level 19 + | +
| short3 clamp(short3 value, short min_value, short max_value); + | +Added in API level 19 + | +
| short3 clamp(short3 value, short3 min_value, short3 max_value); + | +Added in API level 19 + | +
| short4 clamp(short4 value, short min_value, short max_value); + | +Added in API level 19 + | +
| short4 clamp(short4 value, short4 min_value, short4 max_value); + | +Added in API level 19 + | +
| uchar clamp(uchar value, uchar min_value, uchar max_value); + | +Added in API level 19 + | +
| uchar2 clamp(uchar2 value, uchar min_value, uchar max_value); + | +Added in API level 19 + | +
| uchar2 clamp(uchar2 value, uchar2 min_value, uchar2 max_value); + | +Added in API level 19 + | +
| uchar3 clamp(uchar3 value, uchar min_value, uchar max_value); + | +Added in API level 19 + | +
| uchar3 clamp(uchar3 value, uchar3 min_value, uchar3 max_value); + | +Added in API level 19 + | +
| uchar4 clamp(uchar4 value, uchar min_value, uchar max_value); + | +Added in API level 19 + | +
| uchar4 clamp(uchar4 value, uchar4 min_value, uchar4 max_value); + | +Added in API level 19 + | +
| uint clamp(uint value, uint min_value, uint max_value); + | +Added in API level 19 + | +
| uint2 clamp(uint2 value, uint min_value, uint max_value); + | +Added in API level 19 + | +
| uint2 clamp(uint2 value, uint2 min_value, uint2 max_value); + | +Added in API level 19 + | +
| uint3 clamp(uint3 value, uint min_value, uint max_value); + | +Added in API level 19 + | +
| uint3 clamp(uint3 value, uint3 min_value, uint3 max_value); + | +Added in API level 19 + | +
| uint4 clamp(uint4 value, uint min_value, uint max_value); + | +Added in API level 19 + | +
| uint4 clamp(uint4 value, uint4 min_value, uint4 max_value); + | +Added in API level 19 + | +
| ulong clamp(ulong value, ulong min_value, ulong max_value); + | +Added in API level 19 + | +
| ulong2 clamp(ulong2 value, ulong min_value, ulong max_value); + | +Added in API level 19 + | +
| ulong2 clamp(ulong2 value, ulong2 min_value, ulong2 max_value); + | +Added in API level 19 + | +
| ulong3 clamp(ulong3 value, ulong min_value, ulong max_value); + | +Added in API level 19 + | +
| ulong3 clamp(ulong3 value, ulong3 min_value, ulong3 max_value); + | +Added in API level 19 + | +
| ulong4 clamp(ulong4 value, ulong min_value, ulong max_value); + | +Added in API level 19 + | +
| ulong4 clamp(ulong4 value, ulong4 min_value, ulong4 max_value); + | +Added in API level 19 + | +
| ushort clamp(ushort value, ushort min_value, ushort max_value); + | +Added in API level 19 + | +
| ushort2 clamp(ushort2 value, ushort min_value, ushort max_value); + | +Added in API level 19 + | +
| ushort2 clamp(ushort2 value, ushort2 min_value, ushort2 max_value); + | +Added in API level 19 + | +
| ushort3 clamp(ushort3 value, ushort min_value, ushort max_value); + | +Added in API level 19 + | +
| ushort3 clamp(ushort3 value, ushort3 min_value, ushort3 max_value); + | +Added in API level 19 + | +
| ushort4 clamp(ushort4 value, ushort min_value, ushort max_value); + | +Added in API level 19 + | +
| ushort4 clamp(ushort4 value, ushort4 min_value, ushort4 max_value); + | +Added in API level 19 + | +
| value | Value to be clamped. |
|---|---|
| min_value | Lower bound, a scalar or matching vector. |
| max_value | High bound, must match the type of low. |
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. +
+| char clz(char value); + | ++ |
| char2 clz(char2 value); + | ++ |
| char3 clz(char3 value); + | ++ |
| char4 clz(char4 value); + | ++ |
| int clz(int value); + | ++ |
| int2 clz(int2 value); + | ++ |
| int3 clz(int3 value); + | ++ |
| int4 clz(int4 value); + | ++ |
| short clz(short value); + | ++ |
| short2 clz(short2 value); + | ++ |
| short3 clz(short3 value); + | ++ |
| short4 clz(short4 value); + | ++ |
| uchar clz(uchar value); + | ++ |
| uchar2 clz(uchar2 value); + | ++ |
| uchar3 clz(uchar3 value); + | ++ |
| uchar4 clz(uchar4 value); + | ++ |
| uint clz(uint value); + | ++ |
| uint2 clz(uint2 value); + | ++ |
| uint3 clz(uint3 value); + | ++ |
| uint4 clz(uint4 value); + | ++ |
| ushort clz(ushort value); + | ++ |
| ushort2 clz(ushort2 value); + | ++ |
| ushort3 clz(ushort3 value); + | ++ |
| ushort4 clz(ushort4 value); + | ++ |
Returns the number of leading 0-bits in a value. +
+ + For example, clz((char)0x03) returns 6.
+
| float copysign(float magnitude_value, float sign_value); + | ++ |
| float2 copysign(float2 magnitude_value, float2 sign_value); + | ++ |
| float3 copysign(float3 magnitude_value, float3 sign_value); + | ++ |
| float4 copysign(float4 magnitude_value, float4 sign_value); + | ++ |
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.
+
| float cos(float v); + | ++ |
| float2 cos(float2 v); + | ++ |
| float3 cos(float3 v); + | ++ |
| float4 cos(float4 v); + | ++ |
Returns the cosine of an angle measured in radians. +
+ +See also native_cos(). +
+| float cosh(float v); + | ++ |
| float2 cosh(float2 v); + | ++ |
| float3 cosh(float3 v); + | ++ |
| float4 cosh(float4 v); + | ++ |
Returns the hypebolic cosine of v, where v is measured in radians. +
+ +See also native_cosh(). +
+| float cospi(float v); + | ++ |
| float2 cospi(float2 v); + | ++ |
| float3 cospi(float3 v); + | ++ |
| float4 cospi(float4 v); + | ++ |
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(). +
+| float degrees(float v); + | ++ |
| float2 degrees(float2 v); + | ++ |
| float3 degrees(float3 v); + | ++ |
| float4 degrees(float4 v); + | ++ |
Converts from radians to degrees. +
+| float erf(float v); + | ++ |
| float2 erf(float2 v); + | ++ |
| float3 erf(float3 v); + | ++ |
| float4 erf(float4 v); + | ++ |
Returns the error function. +
+| float erfc(float v); + | ++ |
| float2 erfc(float2 v); + | ++ |
| float3 erfc(float3 v); + | ++ |
| float4 erfc(float4 v); + | ++ |
Returns the complementary error function. +
+| float exp(float v); + | ++ |
| float2 exp(float2 v); + | ++ |
| float3 exp(float3 v); + | ++ |
| float4 exp(float4 v); + | ++ |
Returns e raised to v, i.e. e ^ v. +
+ +See also native_exp(). +
+| float exp10(float v); + | ++ |
| float2 exp10(float2 v); + | ++ |
| float3 exp10(float3 v); + | ++ |
| float4 exp10(float4 v); + | ++ |
Returns 10 raised to v, i.e. 10.f ^ v. +
+ +See also native_exp10(). +
+| float exp2(float v); + | ++ |
| float2 exp2(float2 v); + | ++ |
| float3 exp2(float3 v); + | ++ |
| float4 exp2(float4 v); + | ++ |
Returns 2 raised to v, i.e. 2.f ^ v. +
+ +See also native_exp2(). +
+| float expm1(float v); + | ++ |
| float2 expm1(float2 v); + | ++ |
| float3 expm1(float3 v); + | ++ |
| float4 expm1(float4 v); + | ++ |
Returns e raised to v minus 1, i.e. (e ^ v) - 1. +
+ +See also native_expm1(). +
+| float fabs(float v); + | ++ |
| float2 fabs(float2 v); + | ++ |
| float3 fabs(float3 v); + | ++ |
| float4 fabs(float4 v); + | ++ |
Returns the absolute value of the float v. +
+ +For integers, use abs(). +
+| float fdim(float a, float b); + | ++ |
| float2 fdim(float2 a, float2 b); + | ++ |
| float3 fdim(float3 a, float3 b); + | ++ |
| float4 fdim(float4 a, float4 b); + | ++ |
Returns the positive difference between two values. +
+ +If a > b, returns (a - b) otherwise returns 0f. +
+| float floor(float v); + | ++ |
| float2 floor(float2 v); + | ++ |
| float3 floor(float3 v); + | ++ |
| float4 floor(float4 v); + | ++ |
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(). +
+| float fma(float multiplicand1, float multiplicand2, float offset); + | ++ |
| float2 fma(float2 multiplicand1, float2 multiplicand2, float2 offset); + | ++ |
| float3 fma(float3 multiplicand1, float3 multiplicand2, float3 offset); + | ++ |
| float4 fma(float4 multiplicand1, float4 multiplicand2, float4 offset); + | ++ |
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. +
+| float fmax(float a, float b); + | ++ |
| float2 fmax(float2 a, float b); + | ++ |
| float2 fmax(float2 a, float2 b); + | ++ |
| float3 fmax(float3 a, float b); + | ++ |
| float3 fmax(float3 a, float3 b); + | ++ |
| float4 fmax(float4 a, float b); + | ++ |
| float4 fmax(float4 a, float4 b); + | ++ |
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. +
+| float fmin(float a, float b); + | ++ |
| float2 fmin(float2 a, float b); + | ++ |
| float2 fmin(float2 a, float2 b); + | ++ |
| float3 fmin(float3 a, float b); + | ++ |
| float3 fmin(float3 a, float3 b); + | ++ |
| float4 fmin(float4 a, float b); + | ++ |
| float4 fmin(float4 a, float4 b); + | ++ |
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. +
+| float fmod(float numerator, float denominator); + | ++ |
| float2 fmod(float2 numerator, float2 denominator); + | ++ |
| float3 fmod(float3 numerator, float3 denominator); + | ++ |
| float4 fmod(float4 numerator, float4 denominator); + | ++ |
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).
+
| float fract(float v); + | ++ |
| float fract(float v, float* floor); + | ++ |
| float2 fract(float2 v); + | ++ |
| float2 fract(float2 v, float2* floor); + | ++ |
| float3 fract(float3 v); + | ++ |
| float3 fract(float3 v, float3* floor); + | ++ |
| float4 fract(float4 v); + | ++ |
| float4 fract(float4 v, float4* floor); + | ++ |
| v | Input value. |
|---|---|
| floor | If floor is not null, *floor will be set to the floor of v. |
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.
+
| float frexp(float v, int* exponent); + | ++ |
| float2 frexp(float2 v, int2* exponent); + | ++ |
| float3 frexp(float3 v, int3* exponent); + | ++ |
| float4 frexp(float4 v, int4* exponent); + | ++ |
| v | Input value. |
|---|---|
| exponent | If exponent is not null, *exponent will be set to the exponent of v. |
| float half_recip(float v); + | +Added in API level 17 + | +
| float2 half_recip(float2 v); + | +Added in API level 17 + | +
| float3 half_recip(float3 v); + | +Added in API level 17 + | +
| float4 half_recip(float4 v); + | +Added in API level 17 + | +
Returns the approximate reciprocal of a value. +
+ +The precision is that of a 16 bit floating point value. +
+ +See also native_recip(). +
+| float half_rsqrt(float v); + | +Added in API level 17 + | +
| float2 half_rsqrt(float2 v); + | +Added in API level 17 + | +
| float3 half_rsqrt(float3 v); + | +Added in API level 17 + | +
| float4 half_rsqrt(float4 v); + | +Added in API level 17 + | +
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(). +
+| float half_sqrt(float v); + | +Added in API level 17 + | +
| float2 half_sqrt(float2 v); + | +Added in API level 17 + | +
| float3 half_sqrt(float3 v); + | +Added in API level 17 + | +
| float4 half_sqrt(float4 v); + | +Added in API level 17 + | +
Returns the approximate square root of a value. +
+ +The precision is that of a 16 bit floating point value. +
+ +See also sqrt(), native_sqrt(). +
+| float hypot(float a, float b); + | ++ |
| float2 hypot(float2 a, float2 b); + | ++ |
| float3 hypot(float3 a, float3 b); + | ++ |
| float4 hypot(float4 a, float4 b); + | ++ |
Returns the hypotenuse, i.e. sqrt(a * a + b * b).
+
See also native_hypot(). +
+| int ilogb(float v); + | ++ |
| int2 ilogb(float2 v); + | ++ |
| int3 ilogb(float3 v); + | ++ |
| int4 ilogb(float4 v); + | ++ |
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. +
+| float ldexp(float mantissa, int exponent); + | ++ |
| float2 ldexp(float2 mantissa, int exponent); + | ++ |
| float2 ldexp(float2 mantissa, int2 exponent); + | ++ |
| float3 ldexp(float3 mantissa, int exponent); + | ++ |
| float3 ldexp(float3 mantissa, int3 exponent); + | ++ |
| float4 ldexp(float4 mantissa, int exponent); + | ++ |
| float4 ldexp(float4 mantissa, int4 exponent); + | ++ |
| mantissa | Mantissa. |
|---|---|
| exponent | Exponent, a single component or matching vector. |
Returns the floating point created from the mantissa and exponent, +i.e. (mantissa * 2 ^ exponent). +
+ +See frexp() for the reverse operation. +
+| float lgamma(float v); + | ++ |
| float lgamma(float v, int* sign_of_gamma); + | ++ |
| float2 lgamma(float2 v); + | ++ |
| float2 lgamma(float2 v, int2* sign_of_gamma); + | ++ |
| float3 lgamma(float3 v); + | ++ |
| float3 lgamma(float3 v, int3* sign_of_gamma); + | ++ |
| float4 lgamma(float4 v); + | ++ |
| float4 lgamma(float4 v, int4* sign_of_gamma); + | ++ |
| v | |
|---|---|
| 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. |
| float log(float v); + | ++ |
| float2 log(float2 v); + | ++ |
| float3 log(float3 v); + | ++ |
| float4 log(float4 v); + | ++ |
Returns the natural logarithm. +
+ +See also native_log(). +
+| float log10(float v); + | ++ |
| float2 log10(float2 v); + | ++ |
| float3 log10(float3 v); + | ++ |
| float4 log10(float4 v); + | ++ |
Returns the base 10 logarithm. +
+ +See also native_log10(). +
+| float log1p(float v); + | ++ |
| float2 log1p(float2 v); + | ++ |
| float3 log1p(float3 v); + | ++ |
| float4 log1p(float4 v); + | ++ |
Returns the natural logarithm of (v + 1.f).
+
See also native_log1p(). +
+| float log2(float v); + | ++ |
| float2 log2(float2 v); + | ++ |
| float3 log2(float3 v); + | ++ |
| float4 log2(float4 v); + | ++ |
Returns the base 2 logarithm. +
+ +See also native_log2(). +
+| float logb(float v); + | ++ |
| float2 logb(float2 v); + | ++ |
| float3 logb(float3 v); + | ++ |
| float4 logb(float4 v); + | ++ |
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. +
+| float mad(float multiplicand1, float multiplicand2, float offset); + | ++ |
| float2 mad(float2 multiplicand1, float2 multiplicand2, float2 offset); + | ++ |
| float3 mad(float3 multiplicand1, float3 multiplicand2, float3 offset); + | ++ |
| float4 mad(float4 multiplicand1, float4 multiplicand2, float4 offset); + | ++ |
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. +
+| char max(char a, char b); + | ++ |
| char2 max(char2 a, char2 b); + | ++ |
| char3 max(char3 a, char3 b); + | ++ |
| char4 max(char4 a, char4 b); + | ++ |
| float max(float a, float b); + | ++ |
| float2 max(float2 a, float2 b); + | ++ |
| float3 max(float3 a, float3 b); + | ++ |
| float4 max(float4 a, float4 b); + | ++ |
| int max(int a, int b); + | ++ |
| int2 max(int2 a, int2 b); + | ++ |
| int3 max(int3 a, int3 b); + | ++ |
| int4 max(int4 a, int4 b); + | ++ |
| long max(long a, long b); + | +Added in API level 21 + | +
| long2 max(long2 a, long2 b); + | +Added in API level 21 + | +
| long3 max(long3 a, long3 b); + | +Added in API level 21 + | +
| long4 max(long4 a, long4 b); + | +Added in API level 21 + | +
| short max(short a, short b); + | ++ |
| short2 max(short2 a, short2 b); + | ++ |
| short3 max(short3 a, short3 b); + | ++ |
| short4 max(short4 a, short4 b); + | ++ |
| uchar max(uchar a, uchar b); + | ++ |
| uchar2 max(uchar2 a, uchar2 b); + | ++ |
| uchar3 max(uchar3 a, uchar3 b); + | ++ |
| uchar4 max(uchar4 a, uchar4 b); + | ++ |
| uint max(uint a, uint b); + | ++ |
| uint2 max(uint2 a, uint2 b); + | ++ |
| uint3 max(uint3 a, uint3 b); + | ++ |
| uint4 max(uint4 a, uint4 b); + | ++ |
| ulong max(ulong a, ulong b); + | +Added in API level 21 + | +
| ulong2 max(ulong2 a, ulong2 b); + | +Added in API level 21 + | +
| ulong3 max(ulong3 a, ulong3 b); + | +Added in API level 21 + | +
| ulong4 max(ulong4 a, ulong4 b); + | +Added in API level 21 + | +
| ushort max(ushort a, ushort b); + | ++ |
| ushort2 max(ushort2 a, ushort2 b); + | ++ |
| ushort3 max(ushort3 a, ushort3 b); + | ++ |
| ushort4 max(ushort4 a, ushort4 b); + | ++ |
Returns the maximum value of two arguments. +
+| char min(char a, char b); + | ++ |
| char2 min(char2 a, char2 b); + | ++ |
| char3 min(char3 a, char3 b); + | ++ |
| char4 min(char4 a, char4 b); + | ++ |
| float min(float a, float b); + | ++ |
| float2 min(float2 a, float2 b); + | ++ |
| float3 min(float3 a, float3 b); + | ++ |
| float4 min(float4 a, float4 b); + | ++ |
| int min(int a, int b); + | ++ |
| int2 min(int2 a, int2 b); + | ++ |
| int3 min(int3 a, int3 b); + | ++ |
| int4 min(int4 a, int4 b); + | ++ |
| long min(long a, long b); + | +Added in API level 21 + | +
| long2 min(long2 a, long2 b); + | +Added in API level 21 + | +
| long3 min(long3 a, long3 b); + | +Added in API level 21 + | +
| long4 min(long4 a, long4 b); + | +Added in API level 21 + | +
| short min(short a, short b); + | ++ |
| short2 min(short2 a, short2 b); + | ++ |
| short3 min(short3 a, short3 b); + | ++ |
| short4 min(short4 a, short4 b); + | ++ |
| uchar min(uchar a, uchar b); + | ++ |
| uchar2 min(uchar2 a, uchar2 b); + | ++ |
| uchar3 min(uchar3 a, uchar3 b); + | ++ |
| uchar4 min(uchar4 a, uchar4 b); + | ++ |
| uint min(uint a, uint b); + | ++ |
| uint2 min(uint2 a, uint2 b); + | ++ |
| uint3 min(uint3 a, uint3 b); + | ++ |
| uint4 min(uint4 a, uint4 b); + | ++ |
| ulong min(ulong a, ulong b); + | +Added in API level 21 + | +
| ulong2 min(ulong2 a, ulong2 b); + | +Added in API level 21 + | +
| ulong3 min(ulong3 a, ulong3 b); + | +Added in API level 21 + | +
| ulong4 min(ulong4 a, ulong4 b); + | +Added in API level 21 + | +
| ushort min(ushort a, ushort b); + | ++ |
| ushort2 min(ushort2 a, ushort2 b); + | ++ |
| ushort3 min(ushort3 a, ushort3 b); + | ++ |
| ushort4 min(ushort4 a, ushort4 b); + | ++ |
Returns the minimum value of two arguments. +
+| float mix(float start, float stop, float fraction); + | ++ |
| float2 mix(float2 start, float2 stop, float fraction); + | ++ |
| float2 mix(float2 start, float2 stop, float2 fraction); + | ++ |
| float3 mix(float3 start, float3 stop, float fraction); + | ++ |
| float3 mix(float3 start, float3 stop, float3 fraction); + | ++ |
| float4 mix(float4 start, float4 stop, float fraction); + | ++ |
| float4 mix(float4 start, float4 stop, float4 fraction); + | ++ |
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).
+
| float modf(float v, float* integral_part); + | ++ |
| float2 modf(float2 v, float2* integral_part); + | ++ |
| float3 modf(float3 v, float3* integral_part); + | ++ |
| float4 modf(float4 v, float4* integral_part); + | ++ |
| v | Source value. |
|---|---|
| integral_part | *integral_part will be set to the integral portion of the number. |
| Floating point portion of the value. |
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. +
+| float nan(uint v); + | ++ |
| v | Not used. |
|---|
Returns a NaN value (Not a Number). +
+| float native_acos(float v); + | +Added in API level 21 + | +
| float2 native_acos(float2 v); + | +Added in API level 21 + | +
| float3 native_acos(float3 v); + | +Added in API level 21 + | +
| float4 native_acos(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_acosh(float v); + | +Added in API level 21 + | +
| float2 native_acosh(float2 v); + | +Added in API level 21 + | +
| float3 native_acosh(float3 v); + | +Added in API level 21 + | +
| float4 native_acosh(float4 v); + | +Added in API level 21 + | +
Returns the approximate inverse hyperbolic cosine, in radians. +
+ +See also acosh(). +
+| float native_acospi(float v); + | +Added in API level 21 + | +
| float2 native_acospi(float2 v); + | +Added in API level 21 + | +
| float3 native_acospi(float3 v); + | +Added in API level 21 + | +
| float4 native_acospi(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_asin(float v); + | +Added in API level 21 + | +
| float2 native_asin(float2 v); + | +Added in API level 21 + | +
| float3 native_asin(float3 v); + | +Added in API level 21 + | +
| float4 native_asin(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_asinh(float v); + | +Added in API level 21 + | +
| float2 native_asinh(float2 v); + | +Added in API level 21 + | +
| float3 native_asinh(float3 v); + | +Added in API level 21 + | +
| float4 native_asinh(float4 v); + | +Added in API level 21 + | +
Returns the approximate inverse hyperbolic sine, in radians. +
+ +See also asinh(). +
+| float native_asinpi(float v); + | +Added in API level 21 + | +
| float2 native_asinpi(float2 v); + | +Added in API level 21 + | +
| float3 native_asinpi(float3 v); + | +Added in API level 21 + | +
| float4 native_asinpi(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_atan(float v); + | +Added in API level 21 + | +
| float2 native_atan(float2 v); + | +Added in API level 21 + | +
| float3 native_atan(float3 v); + | +Added in API level 21 + | +
| float4 native_atan(float4 v); + | +Added in API level 21 + | +
Returns the approximate inverse tangent, in radians. +
+ +See also atan(). +
+| float native_atan2(float numerator, float denominator); + | +Added in API level 21 + | +
| float2 native_atan2(float2 numerator, float2 denominator); + | +Added in API level 21 + | +
| float3 native_atan2(float3 numerator, float3 denominator); + | +Added in API level 21 + | +
| float4 native_atan2(float4 numerator, float4 denominator); + | +Added in API level 21 + | +
| numerator | Numerator. |
|---|---|
| denominator | Denominator. Can be 0. |
Returns the approximate inverse tangent of (numerator / denominator), in radians.
+
See also atan2(). +
+| float native_atan2pi(float numerator, float denominator); + | +Added in API level 21 + | +
| float2 native_atan2pi(float2 numerator, float2 denominator); + | +Added in API level 21 + | +
| float3 native_atan2pi(float3 numerator, float3 denominator); + | +Added in API level 21 + | +
| float4 native_atan2pi(float4 numerator, float4 denominator); + | +Added in API level 21 + | +
| numerator | Numerator. |
|---|---|
| denominator | Denominator. Can be 0. |
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(). +
+| float native_atanh(float v); + | +Added in API level 21 + | +
| float2 native_atanh(float2 v); + | +Added in API level 21 + | +
| float3 native_atanh(float3 v); + | +Added in API level 21 + | +
| float4 native_atanh(float4 v); + | +Added in API level 21 + | +
Returns the approximate inverse hyperbolic tangent, in radians. +
+ +See also atanh(). +
+| float native_atanpi(float v); + | +Added in API level 21 + | +
| float2 native_atanpi(float2 v); + | +Added in API level 21 + | +
| float3 native_atanpi(float3 v); + | +Added in API level 21 + | +
| float4 native_atanpi(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_cbrt(float v); + | +Added in API level 21 + | +
| float2 native_cbrt(float2 v); + | +Added in API level 21 + | +
| float3 native_cbrt(float3 v); + | +Added in API level 21 + | +
| float4 native_cbrt(float4 v); + | +Added in API level 21 + | +
Returns the approximate cubic root. +
+ +See also cbrt(). +
+| float native_cos(float v); + | +Added in API level 21 + | +
| float2 native_cos(float2 v); + | +Added in API level 21 + | +
| float3 native_cos(float3 v); + | +Added in API level 21 + | +
| float4 native_cos(float4 v); + | +Added in API level 21 + | +
Returns the approximate cosine of an angle measured in radians. +
+ +See also cos(). +
+| float native_cosh(float v); + | +Added in API level 21 + | +
| float2 native_cosh(float2 v); + | +Added in API level 21 + | +
| float3 native_cosh(float3 v); + | +Added in API level 21 + | +
| float4 native_cosh(float4 v); + | +Added in API level 21 + | +
Returns the approximate hypebolic cosine. +
+ +See also cosh(). +
+| float native_cospi(float v); + | +Added in API level 21 + | +
| float2 native_cospi(float2 v); + | +Added in API level 21 + | +
| float3 native_cospi(float3 v); + | +Added in API level 21 + | +
| float4 native_cospi(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_divide(float left_vector, float right_vector); + | +Added in API level 21 + | +
| float2 native_divide(float2 left_vector, float2 right_vector); + | +Added in API level 21 + | +
| float3 native_divide(float3 left_vector, float3 right_vector); + | +Added in API level 21 + | +
| float4 native_divide(float4 left_vector, float4 right_vector); + | +Added in API level 21 + | +
Computes the approximate division of two values. +
+| float native_exp(float v); + | +Added in API level 18 + | +
| float2 native_exp(float2 v); + | +Added in API level 18 + | +
| float3 native_exp(float3 v); + | +Added in API level 18 + | +
| float4 native_exp(float4 v); + | +Added in API level 18 + | +
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(). +
+| float native_exp10(float v); + | +Added in API level 18 + | +
| float2 native_exp10(float2 v); + | +Added in API level 18 + | +
| float3 native_exp10(float3 v); + | +Added in API level 18 + | +
| float4 native_exp10(float4 v); + | +Added in API level 18 + | +
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(). +
+| float native_exp2(float v); + | +Added in API level 18 + | +
| float2 native_exp2(float2 v); + | +Added in API level 18 + | +
| float3 native_exp2(float3 v); + | +Added in API level 18 + | +
| float4 native_exp2(float4 v); + | +Added in API level 18 + | +
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(). +
+| float native_expm1(float v); + | +Added in API level 21 + | +
| float2 native_expm1(float2 v); + | +Added in API level 21 + | +
| float3 native_expm1(float3 v); + | +Added in API level 21 + | +
| float4 native_expm1(float4 v); + | +Added in API level 21 + | +
Returns the approximate (e ^ v) - 1. +
+ +See also expm1(). +
+| float native_hypot(float a, float b); + | +Added in API level 21 + | +
| float2 native_hypot(float2 a, float2 b); + | +Added in API level 21 + | +
| float3 native_hypot(float3 a, float3 b); + | +Added in API level 21 + | +
| float4 native_hypot(float4 a, float4 b); + | +Added in API level 21 + | +
Returns the approximate native_sqrt(a * a + b * b) +
+ +See also hypot(). +
+| float native_log(float v); + | +Added in API level 18 + | +
| float2 native_log(float2 v); + | +Added in API level 18 + | +
| float3 native_log(float3 v); + | +Added in API level 18 + | +
| float4 native_log(float4 v); + | +Added in API level 18 + | +
Fast approximate log. +
+ +It is not accurate for values very close to zero. +
+ +See also log(). +
+| float native_log10(float v); + | +Added in API level 18 + | +
| float2 native_log10(float2 v); + | +Added in API level 18 + | +
| float3 native_log10(float3 v); + | +Added in API level 18 + | +
| float4 native_log10(float4 v); + | +Added in API level 18 + | +
Fast approximate log10. +
+ +It is not accurate for values very close to zero. +
+ +See also log10(). +
+| float native_log1p(float v); + | +Added in API level 21 + | +
| float2 native_log1p(float2 v); + | +Added in API level 21 + | +
| float3 native_log1p(float3 v); + | +Added in API level 21 + | +
| float4 native_log1p(float4 v); + | +Added in API level 21 + | +
Returns the approximate natural logarithm of (v + 1.0f) +
+ +See also log1p(). +
+| float native_log2(float v); + | +Added in API level 18 + | +
| float2 native_log2(float2 v); + | +Added in API level 18 + | +
| float3 native_log2(float3 v); + | +Added in API level 18 + | +
| float4 native_log2(float4 v); + | +Added in API level 18 + | +
Fast approximate log2. +
+ +It is not accurate for values very close to zero. +
+ +See also log2(). +
+| float native_powr(float base, float exponent); + | +Added in API level 18 + | +
| float2 native_powr(float2 base, float2 exponent); + | +Added in API level 18 + | +
| float3 native_powr(float3 base, float3 exponent); + | +Added in API level 18 + | +
| float4 native_powr(float4 base, float4 exponent); + | +Added in API level 18 + | +
| 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. |
Fast approximate (base ^ exponent). +
+ +See also powr(). +
+| float native_recip(float v); + | +Added in API level 21 + | +
| float2 native_recip(float2 v); + | +Added in API level 21 + | +
| float3 native_recip(float3 v); + | +Added in API level 21 + | +
| float4 native_recip(float4 v); + | +Added in API level 21 + | +
Returns the approximate approximate reciprocal of a value. +
+ +See also half_recip(). +
+| float native_rootn(float v, int n); + | +Added in API level 21 + | +
| float2 native_rootn(float2 v, int2 n); + | +Added in API level 21 + | +
| float3 native_rootn(float3 v, int3 n); + | +Added in API level 21 + | +
| float4 native_rootn(float4 v, int4 n); + | +Added in API level 21 + | +
Compute the approximate Nth root of a value. +
+ +See also rootn(). +
+| float native_rsqrt(float v); + | +Added in API level 21 + | +
| float2 native_rsqrt(float2 v); + | +Added in API level 21 + | +
| float3 native_rsqrt(float3 v); + | +Added in API level 21 + | +
| float4 native_rsqrt(float4 v); + | +Added in API level 21 + | +
Returns approximate (1 / sqrt(v)). +
+ +See also rsqrt(), half_rsqrt(). +
+| float native_sin(float v); + | +Added in API level 21 + | +
| float2 native_sin(float2 v); + | +Added in API level 21 + | +
| float3 native_sin(float3 v); + | +Added in API level 21 + | +
| float4 native_sin(float4 v); + | +Added in API level 21 + | +
Returns the approximate sine of an angle measured in radians. +
+ +See also sin(). +
+| float native_sincos(float v, float* cos); + | +Added in API level 21 + | +
| float2 native_sincos(float2 v, float2* cos); + | +Added in API level 21 + | +
| float3 native_sincos(float3 v, float3* cos); + | +Added in API level 21 + | +
| float4 native_sincos(float4 v, float4* cos); + | +Added in API level 21 + | +
| v | Incoming value in radians. |
|---|---|
| cos | *cos will be set to the cosine value. |
| Sine. |
Returns the approximate sine and cosine of a value. +
+ +See also sincos(). +
+| float native_sinh(float v); + | +Added in API level 21 + | +
| float2 native_sinh(float2 v); + | +Added in API level 21 + | +
| float3 native_sinh(float3 v); + | +Added in API level 21 + | +
| float4 native_sinh(float4 v); + | +Added in API level 21 + | +
Returns the approximate hyperbolic sine of a value specified in radians. +
+ +See also sinh(). +
+| float native_sinpi(float v); + | +Added in API level 21 + | +
| float2 native_sinpi(float2 v); + | +Added in API level 21 + | +
| float3 native_sinpi(float3 v); + | +Added in API level 21 + | +
| float4 native_sinpi(float4 v); + | +Added in API level 21 + | +
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(). +
+| float native_sqrt(float v); + | +Added in API level 21 + | +
| float2 native_sqrt(float2 v); + | +Added in API level 21 + | +
| float3 native_sqrt(float3 v); + | +Added in API level 21 + | +
| float4 native_sqrt(float4 v); + | +Added in API level 21 + | +
| float native_tan(float v); + | +Added in API level 21 + | +
| float2 native_tan(float2 v); + | +Added in API level 21 + | +
| float3 native_tan(float3 v); + | +Added in API level 21 + | +
| float4 native_tan(float4 v); + | +Added in API level 21 + | +
Returns the approximate tangent of an angle measured in radians. +
+| float native_tanh(float v); + | +Added in API level 21 + | +
| float2 native_tanh(float2 v); + | +Added in API level 21 + | +
| float3 native_tanh(float3 v); + | +Added in API level 21 + | +
| float4 native_tanh(float4 v); + | +Added in API level 21 + | +
Returns the approximate hyperbolic tangent of a value. +
+ +See also tanh(). +
+| float native_tanpi(float v); + | +Added in API level 21 + | +
| float2 native_tanpi(float2 v); + | +Added in API level 21 + | +
| float3 native_tanpi(float3 v); + | +Added in API level 21 + | +
| float4 native_tanpi(float4 v); + | +Added in API level 21 + | +
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(). +
+| float nextafter(float v, float target); + | ++ |
| float2 nextafter(float2 v, float2 target); + | ++ |
| float3 nextafter(float3 v, float3 target); + | ++ |
| float4 nextafter(float4 v, float4 target); + | ++ |
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. +
+| float powr(float base, float exponent); + | ++ |
| float2 powr(float2 base, float2 exponent); + | ++ |
| float3 powr(float3 base, float3 exponent); + | ++ |
| float4 powr(float4 base, float4 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(). +
+| float radians(float v); + | ++ |
| float2 radians(float2 v); + | ++ |
| float3 radians(float3 v); + | ++ |
| float4 radians(float4 v); + | ++ |
Converts from degrees to radians. +
+| float remainder(float numerator, float denominator); + | ++ |
| float2 remainder(float2 numerator, float2 denominator); + | ++ |
| float3 remainder(float3 numerator, float3 denominator); + | ++ |
| float4 remainder(float4 numerator, float4 denominator); + | ++ |
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).
+
| float remquo(float numerator, float denominator, int* quotient); + | ++ |
| float2 remquo(float2 numerator, float2 denominator, int2* quotient); + | ++ |
| float3 remquo(float3 numerator, float3 denominator, int3* quotient); + | ++ |
| float4 remquo(float4 numerator, float4 denominator, int4* quotient); + | ++ |
| numerator | Numerator. |
|---|---|
| denominator | Denominator. |
| quotient | *quotient will be set to the integer quotient. |
| Remainder, precise only for the low three bits. |
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, ") sets the lowest three bits of quot to 3
+and the sign negative. It returns 0.5f.
+
| float rint(float v); + | ++ |
| float2 rint(float2 v); + | ++ |
| float3 rint(float3 v); + | ++ |
| float4 rint(float4 v); + | ++ |
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. +
+| float rootn(float v, int n); + | ++ |
| float2 rootn(float2 v, int2 n); + | ++ |
| float3 rootn(float3 v, int3 n); + | ++ |
| float4 rootn(float4 v, int4 n); + | ++ |
Compute the Nth root of a value. +
+ +See also native_rootn(). +
+| float round(float v); + | ++ |
| float2 round(float2 v); + | ++ |
| float3 round(float3 v); + | ++ |
| float4 round(float4 v); + | ++ |
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. +
+| char rsClamp(char amount, char low, char high); + | ++ |
| int rsClamp(int amount, int low, int high); + | ++ |
| short rsClamp(short amount, short low, short high); + | ++ |
| uchar rsClamp(uchar amount, uchar low, uchar high); + | ++ |
| uint rsClamp(uint amount, uint low, uint high); + | ++ |
| ushort rsClamp(ushort amount, ushort low, ushort high); + | ++ |
| amount | Value to clamp. |
|---|---|
| low | Lower bound. |
| high | Upper bound. |
Deprecated. Use clamp() instead.
+Clamp a value between low and high. +
+| float rsFrac(float v); + | ++ |
Deprecated. Use fract() instead.
+Returns the fractional part of a float +
+| float rsRand(float max_value); + | ++ |
| float rsRand(float min_value, float max_value); + | ++ |
| int rsRand(int max_value); + | ++ |
| int rsRand(int min_value, int max_value); + | ++ |
Return a random value between 0 (or min_value) and max_malue. +
+| float rsqrt(float v); + | ++ |
| float2 rsqrt(float2 v); + | ++ |
| float3 rsqrt(float3 v); + | ++ |
| float4 rsqrt(float4 v); + | ++ |
Returns (1 / sqrt(v)). +
+ +See also half_rsqrt(), native_rsqrt(). +
+| float sign(float v); + | ++ |
| float2 sign(float2 v); + | ++ |
| float3 sign(float3 v); + | ++ |
| float4 sign(float4 v); + | ++ |
Returns the sign of a value. +
+ +if (v < 0) return -1.f; +else if (v > 0) return 1.f; +else return 0.f; +
+| float sin(float v); + | ++ |
| float2 sin(float2 v); + | ++ |
| float3 sin(float3 v); + | ++ |
| float4 sin(float4 v); + | ++ |
Returns the sine of an angle measured in radians. +
+ +See also native_sin(). +
+| float sincos(float v, float* cos); + | ++ |
| float2 sincos(float2 v, float2* cos); + | ++ |
| float3 sincos(float3 v, float3* cos); + | ++ |
| float4 sincos(float4 v, float4* cos); + | ++ |
| v | Incoming value in radians. |
|---|---|
| cos | *cos will be set to the cosine value. |
| Sine of v. |
Returns the sine and cosine of a value. +
+ +See also native_sincos(). +
+| float sinh(float v); + | ++ |
| float2 sinh(float2 v); + | ++ |
| float3 sinh(float3 v); + | ++ |
| float4 sinh(float4 v); + | ++ |
Returns the hyperbolic sine of v, where v is measured in radians. +
+ +See also native_sinh(). +
+| float sinpi(float v); + | ++ |
| float2 sinpi(float2 v); + | ++ |
| float3 sinpi(float3 v); + | ++ |
| float4 sinpi(float4 v); + | ++ |
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(). +
+| float sqrt(float v); + | ++ |
| float2 sqrt(float2 v); + | ++ |
| float3 sqrt(float3 v); + | ++ |
| float4 sqrt(float4 v); + | ++ |
Returns the square root of a value. +
+ +See also half_sqrt(), native_sqrt(). +
+| float step(float edge, float v); + | ++ |
| float2 step(float edge, float2 v); + | +Added in API level 21 + | +
| float2 step(float2 edge, float v); + | ++ |
| float2 step(float2 edge, float2 v); + | ++ |
| float3 step(float edge, float3 v); + | +Added in API level 21 + | +
| float3 step(float3 edge, float v); + | ++ |
| float3 step(float3 edge, float3 v); + | ++ |
| float4 step(float edge, float4 v); + | +Added in API level 21 + | +
| float4 step(float4 edge, float v); + | ++ |
| float4 step(float4 edge, float4 v); + | ++ |
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).
+
| float tan(float v); + | ++ |
| float2 tan(float2 v); + | ++ |
| float3 tan(float3 v); + | ++ |
| float4 tan(float4 v); + | ++ |
Returns the tangent of an angle measured in radians. +
+ +See also native_tan(). +
+| float tanh(float v); + | ++ |
| float2 tanh(float2 v); + | ++ |
| float3 tanh(float3 v); + | ++ |
| float4 tanh(float4 v); + | ++ |
Returns the hyperbolic tangent of a value. +
+ +See also native_tanh(). +
+| float tanpi(float v); + | ++ |
| float2 tanpi(float2 v); + | ++ |
| float3 tanpi(float3 v); + | ++ |
| float4 tanpi(float4 v); + | ++ |
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(). +
+| float tgamma(float v); + | ++ |
| float2 tgamma(float2 v); + | ++ |
| float3 tgamma(float3 v); + | ++ |
| float4 tgamma(float4 v); + | ++ |
Returns the gamma function of a value. +
+ +See also lgamma(). +
+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. +
+| Functions | |
|---|---|
| + rsExtractFrustumPlanes + | ++ Compute frustum planes + | +
| + rsIsSphereInFrustum + | ++ Checks if a sphere is within the frustum planes + | +
| + rsMatrixGet + | ++ Get one element + | +
| + rsMatrixInverse + | ++ Inverts a matrix in place + | +
| + rsMatrixInverseTranspose + | ++ Inverts and transpose a matrix in place + | +
| + rsMatrixLoad + | ++ Load or copy a matrix + | +
| + rsMatrixLoadFrustum + | ++ Load a frustum projection matrix + | +
| + rsMatrixLoadIdentity + | ++ Load identity matrix + | +
| + rsMatrixLoadMultiply + | ++ Multiply two matrices + | +
| + rsMatrixLoadOrtho + | ++ Load an orthographic projection matrix + | +
| + rsMatrixLoadPerspective + | ++ Load a perspective projection matrix + | +
| + rsMatrixLoadRotate + | ++ Load a rotation matrix + | +
| + rsMatrixLoadScale + | ++ Load a scaling matrix + | +
| + rsMatrixLoadTranslate + | ++ Load a translation matrix + | +
| + rsMatrixMultiply + | ++ Multiply a matrix by a vector or another matrix + | +
| + rsMatrixRotate + | ++ Apply a rotation to a transformation matrix + | +
| + rsMatrixScale + | ++ Apply a scaling to a transformation matrix + | +
| + rsMatrixSet + | ++ Set one element + | +
| + rsMatrixTranslate + | ++ Apply a translation to a transformation matrix + | +
| + rsMatrixTranspose + | ++ Transpose a matrix place + | +
| void rsExtractFrustumPlanes(const rs_matrix4x4* viewProj, float4* left, float4* right, float4* top, float4* bottom, float4* near, float4* far); + | ++ |
| viewProj | Matrix to extract planes from. |
|---|---|
| left | Left plane. |
| right | Right plane. |
| top | Top plane. |
| bottom | Bottom plane. |
| near | Near plane. |
| far | Far plane. |
Computes 6 frustum planes from the view projection matrix +
+| bool rsIsSphereInFrustum(float4* sphere, float4* left, float4* right, float4* top, float4* bottom, float4* near, float4* far); + | ++ |
| sphere | float4 representing the sphere. |
|---|---|
| left | Left plane. |
| right | Right plane. |
| top | Top plane. |
| bottom | Bottom plane. |
| near | Near plane. |
| far | Far plane. |
Returns true if the sphere is within the 6 frustum planes. +
+| float rsMatrixGet(const rs_matrix2x2* m, uint32_t col, uint32_t row); + | ++ |
| float rsMatrixGet(const rs_matrix3x3* m, uint32_t col, uint32_t row); + | ++ |
| float rsMatrixGet(const rs_matrix4x4* m, uint32_t col, uint32_t row); + | ++ |
| 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. |
Returns one element of a matrix. +
+ +Warning: The order of the column and row parameters may be unexpected. +
+| bool rsMatrixInverse(rs_matrix4x4* m); + | ++ |
| m | Matrix to invert. |
|---|
Returns true if the matrix was successfully inverted. +
+| bool rsMatrixInverseTranspose(rs_matrix4x4* m); + | ++ |
| m | Matrix to modify. |
|---|
The matrix is first inverted then transposed. Returns true if the matrix was +successfully inverted. +
+| void rsMatrixLoad(rs_matrix2x2* destination, const float* array); + | ++ |
| void rsMatrixLoad(rs_matrix2x2* destination, const rs_matrix2x2* source); + | ++ |
| void rsMatrixLoad(rs_matrix3x3* destination, const float* array); + | ++ |
| void rsMatrixLoad(rs_matrix3x3* destination, const rs_matrix3x3* source); + | ++ |
| void rsMatrixLoad(rs_matrix4x4* destination, const float* array); + | ++ |
| void rsMatrixLoad(rs_matrix4x4* destination, const rs_matrix2x2* source); + | ++ |
| void rsMatrixLoad(rs_matrix4x4* destination, const rs_matrix3x3* source); + | ++ |
| void rsMatrixLoad(rs_matrix4x4* destination, const rs_matrix4x4* source); + | ++ |
| 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. |
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 |
| void rsMatrixLoadFrustum(rs_matrix4x4* m, float left, float right, float bottom, float top, float near, float far); + | ++ |
| m | Matrix to set. |
|---|---|
| left | |
| right | |
| bottom | |
| top | |
| near | |
| far |
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(). +
+| void rsMatrixLoadIdentity(rs_matrix2x2* m); + | ++ |
| void rsMatrixLoadIdentity(rs_matrix3x3* m); + | ++ |
| void rsMatrixLoadIdentity(rs_matrix4x4* m); + | ++ |
| m | Matrix to set. |
|---|
Set the elements of a matrix to the identity matrix. +
+| void rsMatrixLoadMultiply(rs_matrix2x2* m, const rs_matrix2x2* lhs, const rs_matrix2x2* rhs); + | ++ |
| void rsMatrixLoadMultiply(rs_matrix3x3* m, const rs_matrix3x3* lhs, const rs_matrix3x3* rhs); + | ++ |
| void rsMatrixLoadMultiply(rs_matrix4x4* m, const rs_matrix4x4* lhs, const rs_matrix4x4* rhs); + | ++ |
| m | Matrix to set. |
|---|---|
| lhs | Left matrix of the product. |
| rhs | Right matrix of the product. |
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. +
+| void rsMatrixLoadOrtho(rs_matrix4x4* m, float left, float right, float bottom, float top, float near, float far); + | ++ |
| m | Matrix to set. |
|---|---|
| left | |
| right | |
| bottom | |
| top | |
| near | |
| far |
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 . +
+| void rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far); + | ++ |
| 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. |
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(). +
+| void rsMatrixLoadRotate(rs_matrix4x4* m, float rot, float x, float y, float z); + | ++ |
| 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. |
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 . +
+| void rsMatrixLoadScale(rs_matrix4x4* m, float x, float y, float z); + | ++ |
| 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. |
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(). +
+| void rsMatrixLoadTranslate(rs_matrix4x4* m, float x, float y, float z); + | ++ |
| 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. |
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(). +
+| float2 rsMatrixMultiply(const rs_matrix2x2* m, float2 in); + | +Added in API level 14 + | +
| float2 rsMatrixMultiply(rs_matrix2x2* m, float2 in); + | +Removed from API level 14 + | +
| float3 rsMatrixMultiply(const rs_matrix3x3* m, float2 in); + | +Added in API level 14 + | +
| float3 rsMatrixMultiply(const rs_matrix3x3* m, float3 in); + | +Added in API level 14 + | +
| float3 rsMatrixMultiply(rs_matrix3x3* m, float2 in); + | +Removed from API level 14 + | +
| float3 rsMatrixMultiply(rs_matrix3x3* m, float3 in); + | +Removed from API level 14 + | +
| float4 rsMatrixMultiply(const rs_matrix4x4* m, float2 in); + | +Added in API level 14 + | +
| float4 rsMatrixMultiply(const rs_matrix4x4* m, float3 in); + | +Added in API level 14 + | +
| float4 rsMatrixMultiply(const rs_matrix4x4* m, float4 in); + | +Added in API level 14 + | +
| float4 rsMatrixMultiply(rs_matrix4x4* m, float2 in); + | +Removed from API level 14 + | +
| float4 rsMatrixMultiply(rs_matrix4x4* m, float3 in); + | +Removed from API level 14 + | +
| float4 rsMatrixMultiply(rs_matrix4x4* m, float4 in); + | +Removed from API level 14 + | +
| void rsMatrixMultiply(rs_matrix2x2* m, const rs_matrix2x2* rhs); + | ++ |
| void rsMatrixMultiply(rs_matrix3x3* m, const rs_matrix3x3* rhs); + | ++ |
| void rsMatrixMultiply(rs_matrix4x4* m, const rs_matrix4x4* rhs); + | ++ |
| m | Left matrix of the product and the matrix to be set. |
|---|---|
| rhs | Right matrix of the product. |
| in |
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. +
+| void rsMatrixRotate(rs_matrix4x4* m, float rot, float x, float y, float z); + | ++ |
| 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. |
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(). +
+| void rsMatrixScale(rs_matrix4x4* m, float x, float y, float z); + | ++ |
| 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. |
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(). +
+| void rsMatrixSet(rs_matrix2x2* m, uint32_t col, uint32_t row, float v); + | ++ |
| void rsMatrixSet(rs_matrix3x3* m, uint32_t col, uint32_t row, float v); + | ++ |
| void rsMatrixSet(rs_matrix4x4* m, uint32_t col, uint32_t row, float v); + | ++ |
| 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. |
Set an element of a matrix. +
+ +Warning: The order of the column and row parameters may be unexpected. +
+| void rsMatrixTranslate(rs_matrix4x4* m, float x, float y, float z); + | ++ |
| 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. |
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(). +
+| void rsMatrixTranspose(rs_matrix2x2* m); + | ++ |
| void rsMatrixTranspose(rs_matrix3x3* m); + | ++ |
| void rsMatrixTranspose(rs_matrix4x4* m); + | ++ |
| m | Matrix to transpose. |
|---|
Transpose the matrix m in place. +
+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 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. +
+ +
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:
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 objects define how Allocations can be read as structure within a kernel. +See android.renderscript.S. +
+| Functions | |
|---|---|
| + rsAllocationGetDimFaces + | ++ Presence of more than one face + | +
| + rsAllocationGetDimLOD + | ++ Presence of levels of detail + | +
| + rsAllocationGetDimX + | ++ Size of the X dimension + | +
| + rsAllocationGetDimY + | ++ Size of the Y dimension + | +
| + rsAllocationGetDimZ + | ++ Size of the Z dimension + | +
| + rsAllocationGetElement + | ++ Get the object that describes the cell of an Allocation + | +
| + rsClearObject + | ++ Release an object + | +
| + rsElementGetBytesSize + | ++ Size of an Element + | +
| + rsElementGetDataKind + | ++ Kind of an Element + | +
| + rsElementGetDataType + | ++ Data type of an Element + | +
| + rsElementGetSubElement + | ++ Sub-element of a complex Element + | +
| + rsElementGetSubElementArraySize + | ++ Array size of a sub-element of a complex Element + | +
| + rsElementGetSubElementCount + | ++ Number of sub-elements + | +
| + rsElementGetSubElementName + | ++ Name of a sub-element + | +
| + rsElementGetSubElementNameLength + | ++ Length of the name of a sub-element + | +
| + rsElementGetSubElementOffsetBytes + | ++ Offset of the instantiated sub-element + | +
| + rsElementGetVectorSize + | ++ Vector size of the Element + | +
| + rsIsObject + | ++ Check for an empty handle + | +
| + rsSamplerGetAnisotropy + | ++ Anisotropy of the Sampler + | +
| + rsSamplerGetMagnification + | ++ Sampler magnification value + | +
| + rsSamplerGetMinification + | ++ Sampler minification value + | +
| + rsSamplerGetWrapS + | ++ Sampler wrap S value + | +
| + rsSamplerGetWrapT + | ++ Sampler wrap T value + | +
| Deprecated Functions | |
|---|---|
| + rsGetAllocation + | ++ Deprecated. Return the Allocation for a given pointer + | +
| uint32_t rsAllocationGetDimFaces(rs_allocation a); + | ++ |
| Returns 1 if more than one face is present, 0 otherwise. |
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. +
+| uint32_t rsAllocationGetDimLOD(rs_allocation a); + | ++ |
| Returns 1 if more than one LOD is present, 0 otherwise. |
Query an Allocation for the presence of more than one Level Of Detail. This is useful +for mipmaps. +
+| uint32_t rsAllocationGetDimX(rs_allocation a); + | ++ |
| X dimension of the Allocation. |
Returns the size of the X dimension of the Allocation. +
+| uint32_t rsAllocationGetDimY(rs_allocation a); + | ++ |
| Y dimension of the Allocation. |
Returns the size of the Y dimension of the Allocation. If the Allocation has less +than two dimensions, returns 0. +
+| uint32_t rsAllocationGetDimZ(rs_allocation a); + | ++ |
| Z dimension of the Allocation. |
Returns the size of the Z dimension of the Allocation. If the Allocation has less +than three dimensions, returns 0. +
+| rs_element rsAllocationGetElement(rs_allocation a); + | ++ |
| a | Allocation to get data from. |
|---|
| Element describing Allocation layout. |
Get the Element object describing the type, kind, and other characteristics of a cell +of an Allocation. See the rsElement* functions below. +
+| void rsClearObject(rs_allocation* dst); + | ++ |
| void rsClearObject(rs_element* dst); + | ++ |
| void rsClearObject(rs_font* dst); + | +When compiling for 32 bits. + | +
| void rsClearObject(rs_mesh* dst); + | +When compiling for 32 bits. + | +
| void rsClearObject(rs_program_fragment* dst); + | +When compiling for 32 bits. + | +
| void rsClearObject(rs_program_raster* dst); + | +When compiling for 32 bits. + | +
| void rsClearObject(rs_program_store* dst); + | +When compiling for 32 bits. + | +
| void rsClearObject(rs_program_vertex* dst); + | +When compiling for 32 bits. + | +
| void rsClearObject(rs_sampler* dst); + | ++ |
| void rsClearObject(rs_script* dst); + | ++ |
| void rsClearObject(rs_type* dst); + | ++ |
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(). +
+| uint32_t rsElementGetBytesSize(rs_element e); + | +Added in API level 16 + | +
Returns the size in bytes that an instantiation of this Element will occupy. +
+| rs_data_kind rsElementGetDataKind(rs_element e); + | +Added in API level 16 + | +
Returns the Element's data kind. This is used to interpret pixel data. +
+ +See rs_data_kind. +
+| rs_data_type rsElementGetDataType(rs_element e); + | +Added in API level 16 + | +
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. +
+| rs_element rsElementGetSubElement(rs_element e, uint32_t index); + | +Added in API level 16 + | +
| e | Element to query. |
|---|---|
| index | Index of the sub-element to return. |
| Sub-element at the given index. |
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. +
+| uint32_t rsElementGetSubElementArraySize(rs_element e, uint32_t index); + | +Added in API level 16 + | +
| e | Element to query. |
|---|---|
| index | Index of the sub-element. |
| Array size of the sub-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. +
+| uint32_t rsElementGetSubElementCount(rs_element e); + | +Added in API level 16 + | +
| e | Element to get data from. |
|---|
| 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. +
+| uint32_t rsElementGetSubElementName(rs_element e, uint32_t index, char* name, uint32_t nameLength); + | +Added in API level 16 + | +
| 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. |
| Number of characters copied, excluding the null terminator. |
For complex Elements, this function returns the name of the sub-element at the +specified index. +
+| uint32_t rsElementGetSubElementNameLength(rs_element e, uint32_t index); + | +Added in API level 16 + | +
| e | Element to get data from. |
|---|---|
| index | Index of the sub-element. |
| Length of the sub-element name including the null terminator. |
For complex Elements, this function returns the length of the name of the sub-element +at the specified index. +
+| uint32_t rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index); + | +Added in API level 16 + | +
| e | Element to get data from. |
|---|---|
| index | Index of the sub-element. |
| Offset in bytes. |
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. +
+| uint32_t rsElementGetVectorSize(rs_element e); + | +Added in API level 16 + | +
| e | Element to get data from. |
|---|
| Length of the element vector. |
Returns the Element's vector size. If the Element does not represent a vector, +1 is returned. +
+| rs_allocation rsGetAllocation(const void* p); + | ++ |
Deprecated. This function is deprecated and will be removed from the SDK in a future release.
+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. +
+| bool rsIsObject(rs_allocation v); + | ++ |
| bool rsIsObject(rs_element v); + | ++ |
| bool rsIsObject(rs_font v); + | +When compiling for 32 bits. + | +
| bool rsIsObject(rs_mesh v); + | +When compiling for 32 bits. + | +
| bool rsIsObject(rs_program_fragment v); + | +When compiling for 32 bits. + | +
| bool rsIsObject(rs_program_raster v); + | +When compiling for 32 bits. + | +
| bool rsIsObject(rs_program_store v); + | +When compiling for 32 bits. + | +
| bool rsIsObject(rs_program_vertex v); + | +When compiling for 32 bits. + | +
| bool rsIsObject(rs_sampler v); + | ++ |
| bool rsIsObject(rs_script v); + | ++ |
| bool rsIsObject(rs_type v); + | ++ |
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. +
+| float rsSamplerGetAnisotropy(rs_sampler s); + | +Added in API level 16 + | +
Get the Sampler's anisotropy. +
+ +See android.renderscript.S. +
+| rs_sampler_value rsSamplerGetMagnification(rs_sampler s); + | +Added in API level 16 + | +
Get the Sampler's magnification value. +
+ +See android.renderscript.S. +
+| rs_sampler_value rsSamplerGetMinification(rs_sampler s); + | +Added in API level 16 + | +
Get the Sampler's minification value. +
+ +See android.renderscript.S. +
+| rs_sampler_value rsSamplerGetWrapS(rs_sampler s); + | +Added in API level 16 + | +
Get the Sampler's wrap S value. +
+ +See android.renderscript.S. +
+| rs_sampler_value rsSamplerGetWrapT(rs_sampler s); + | +Added in API level 16 + | +
Get the sampler's wrap T value. +
+ +See android.renderscript.S. +
+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. +
+| Types | |
|---|---|
| + rs_allocation + | ++ Handle to an allocation + | +
| + rs_allocation_cubemap_face + | ++ Enum for selecting cube map faces + | +
| + rs_allocation_usage_type + | ++ Bitfield to specify how an allocation is used + | +
| + rs_data_kind + | ++ Element data kind + | +
| + rs_data_type + | ++ Element basic data type + | +
| + rs_element + | ++ Handle to an element + | +
| + rs_sampler + | ++ Handle to a Sampler + | +
| + rs_sampler_value + | ++ Sampler wrap T value + | +
| + rs_script + | ++ Handle to a Script + | +
| + rs_type + | ++ Handle to a Type + | +
A typedef of: _RS_HANDLE
+An opaque handle to a RenderScript allocation. +
+ + +An enum with the following values: + Added in API level 14 +
+| 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 |
An enum used to specify one the six faces of a cubemap. +
+An enum with the following values: + Added in API level 14 +
+| 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. |
These values are ORed together to specify which usages or memory spaces are +relevant to an allocation or an operation on an allocation. +
+An enum with the following values: + Added in API level 16 +
+| 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 |
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. +
+An enum with the following values: + Added in API level 16 +
+| 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 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. +
+A typedef of: _RS_HANDLE
+An opaque handle to a RenderScript element. +
+ +See android.renderscript.Element. +
+A typedef of: _RS_HANDLE
+An opaque handle to a RenderScript sampler object. +
+ +See android.renderscript.Sampler. +
+An enum with the following values: + Added in API level 16 +
+| 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 |
A typedef of: _RS_HANDLE
+An opaque handle to a RenderScript script object. +
+ +See android.renderscript.ScriptC. +
+A typedef of: _RS_HANDLE
+An opaque handle to a RenderScript type. +
+ +See android.renderscript.Type. +
+The following functions manipulate quaternions. +
+| Functions | |
|---|---|
| + rsQuaternionAdd + | ++ Add two quaternions + | +
| + rsQuaternionConjugate + | ++ Conjugate a quaternion + | +
| + rsQuaternionDot + | ++ Dot product of two quaternions + | +
| + rsQuaternionGetMatrixUnit + | ++ Get a rotation matrix from a quaternion + | +
| + rsQuaternionLoadRotate + | ++ Create a rotation quaternion + | +
| + rsQuaternionLoadRotateUnit + | ++ Quaternion that represents a rotation about an arbitrary unit vector + | +
| + rsQuaternionMultiply + | ++ Multiply a quaternion by a scalar or another quaternion + | +
| + rsQuaternionNormalize + | ++ Normalize a quaternion + | +
| + rsQuaternionSet + | ++ Create a quaternion + | +
| + rsQuaternionSlerp + | ++ Spherical linear interpolation between two quaternions + | +
| void rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs); + | ++ |
| q | Destination quaternion to add to. |
|---|---|
| rhs | Quaternion to add. |
Adds two quaternions, i.e. *q += *rhs;
+
| void rsQuaternionConjugate(rs_quaternion* q); + | ++ |
| q | Quaternion to modify. |
|---|
Conjugates the quaternion. +
+| float rsQuaternionDot(const rs_quaternion* q0, const rs_quaternion* q1); + | ++ |
| q0 | First quaternion. |
|---|---|
| q1 | Second quaternion. |
Returns the dot product of two quaternions. +
+| void rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q); + | ++ |
| m | Resulting matrix. |
|---|---|
| q | Normalized quaternion. |
Computes a rotation matrix from the normalized quaternion. +
+| void rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z); + | ++ |
| 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. |
Loads a quaternion that represents a rotation about an arbitrary vector +(doesn't have to be unit) +
+| void rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z); + | ++ |
| 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. |
Loads a quaternion that represents a rotation about an arbitrary unit vector. +
+| void rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs); + | ++ |
| void rsQuaternionMultiply(rs_quaternion* q, float scalar); + | ++ |
| q | Destination quaternion. |
|---|---|
| scalar | Scalar to multiply the quaternion by. |
| rhs | Quaternion to multiply the destination quaternion by. |
Multiplies a quaternion by a scalar or by another quaternion, e.g
+*q = *q * scalar; or *q = *q * *rhs;.
+
| void rsQuaternionNormalize(rs_quaternion* q); + | ++ |
| q | Quaternion to normalize. |
|---|
Normalizes the quaternion. +
+| void rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs); + | ++ |
| void rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z); + | ++ |
| q | Destination quaternion. |
|---|---|
| w | W component. |
| x | X component. |
| y | Y component. |
| z | Z component. |
| rhs | Source quaternion. |
Creates a quaternion from its four components or from another quaternion. +
+| void rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t); + | ++ |
| q | Result quaternion from the interpolation. |
|---|---|
| q0 | First input quaternion. |
| q1 | Second input quaternion. |
| t | How much to interpolate by. |
Performs spherical linear interpolation between two quaternions. +
+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. +
+| Types | |
|---|---|
| + rs_time_t + | ++ Seconds since January 1, 1970 + | +
| + rs_tm + | ++ Date and time structure + | +
| Functions | |
|---|---|
| + rsGetDt + | ++ Elapsed time since last call + | +
| + rsLocaltime + | ++ Convert to local time + | +
| + rsTime + | ++ Seconds since January 1, 1970 + | +
| + rsUptimeMillis + | ++ System uptime in milliseconds + | +
| + rsUptimeNanos + | ++ System uptime in nanoseconds + | +
A typedef of: int When compiling for 32 bits. +
+A typedef of: long When compiling for 64 bits. +
+Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on +January 1, 1970, Coordinated Universal Time (UTC)). +
+A structure with the following fields:
+| 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. |
Data structure for broken-down time components. +
+| float rsGetDt(); + | ++ |
| Time in seconds. |
Returns the time in seconds since this function was last called in this script. +
+| local | Pointer to time structure where the local time will be stored. |
|---|---|
| timer | Input time as a number of seconds since January 1, 1970. |
| Pointer to the output local time, i.e. the same value as the parameter local. |
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. +
+| timer | Location to also store the returned calendar time. |
|---|
| Seconds since the Epoch, -1 if there's an error. |
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. +
+| int64_t rsUptimeMillis(); + | ++ |
| Uptime in milliseconds. |
Returns the current system clock (uptime) in milliseconds. +
+| int64_t rsUptimeNanos(); + | ++ |
| 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. +
+
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: | float | double |
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:
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
+
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. +
+| Types | |
|---|---|
| + char2 + | ++ Two 8 bit signed integers + | +
| + char3 + | ++ Three 8 bit signed integers + | +
| + char4 + | ++ Four 8 bit signed integers + | +
| + double2 + | ++ Two 64 bit floats + | +
| + double3 + | ++ Three 64 bit floats + | +
| + double4 + | ++ Four 64 bit floats + | +
| + float2 + | ++ Two 32 bit floats + | +
| + float3 + | ++ Three 32 bit floats + | +
| + float4 + | ++ Four 32 bit floats + | +
| + int16_t + | ++ 16 bit signed integer + | +
| + int2 + | ++ Two 32 bit signed integers + | +
| + int3 + | ++ Three 32 bit signed integers + | +
| + int32_t + | ++ 32 bit signed integer + | +
| + int4 + | ++ Four 32 bit signed integers + | +
| + int64_t + | ++ 64 bit signed integer + | +
| + int8_t + | ++ 8 bit signed integer + | +
| + long2 + | ++ Two 64 bit signed integers + | +
| + long3 + | ++ Three 64 bit signed integers + | +
| + long4 + | ++ Four 64 bit signed integers + | +
| + rs_matrix2x2 + | ++ 2x2 matrix of 32 bit floats + | +
| + rs_matrix3x3 + | ++ 3x3 matrix of 32 bit floats + | +
| + rs_matrix4x4 + | ++ 4x4 matrix of 32 bit floats + | +
| + rs_quaternion + | ++ Quaternion + | +
| + short2 + | ++ Two 16 bit signed integers + | +
| + short3 + | ++ Three 16 bit signed integers + | +
| + short4 + | ++ Four 16 bit signed integers + | +
| + size_t + | ++ Unsigned size type + | +
| + ssize_t + | ++ Signed size type + | +
| + uchar + | ++ 8 bit unsigned integer + | +
| + uchar2 + | ++ Two 8 bit unsigned integers + | +
| + uchar3 + | ++ Three 8 bit unsigned integers + | +
| + uchar4 + | ++ Four 8 bit unsigned integers + | +
| + uint + | ++ 32 bit unsigned integer + | +
| + uint16_t + | ++ 16 bit unsigned integer + | +
| + uint2 + | ++ Two 32 bit unsigned integers + | +
| + uint3 + | ++ Three 32 bit unsigned integers + | +
| + uint32_t + | ++ 32 bit unsigned integer + | +
| + uint4 + | ++ Four 32 bit unsigned integers + | +
| + uint64_t + | ++ 64 bit unsigned integer + | +
| + uint8_t + | ++ 8 bit unsigned integer + | +
| + ulong + | ++ 64 bit unsigned integer + | +
| + ulong2 + | ++ Two 64 bit unsigned integers + | +
| + ulong3 + | ++ Three 64 bit unsigned integers + | +
| + ulong4 + | ++ Four 64 bit unsigned integers + | +
| + ushort + | ++ 16 bit unsigned integer + | +
| + ushort2 + | ++ Two 16 bit unsigned integers + | +
| + ushort3 + | ++ Three 16 bit unsigned integers + | +
| + ushort4 + | ++ Four 16 bit unsigned integers + | +
A typedef of: char __attribute__((ext_vector_type(2)))
+A vector of two chars. These two chars are packed into a single 16 bit field +with a 16 bit alignment. +
+A typedef of: char __attribute__((ext_vector_type(3)))
+A vector of three chars. These three chars are packed into a single 32 bit field +with a 32 bit alignment. +
+A typedef of: char __attribute__((ext_vector_type(4)))
+A vector of four chars. These four chars are packed into a single 32 bit field +with a 32 bit alignment. +
+A typedef of: double __attribute__((ext_vector_type(2)))
+A vector of two doubles. These two double fields packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: double __attribute__((ext_vector_type(3)))
+A vector of three doubles. These three double fields packed into a single 256 bit field +with a 256 bit alignment. +
+A typedef of: double __attribute__((ext_vector_type(4)))
+A vector of four doubles. These four double fields packed into a single 256 bit field +with a 256 bit alignment. +
+A typedef of: float __attribute__((ext_vector_type(2)))
+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. +
+A typedef of: float __attribute__((ext_vector_type(3)))
+A vector of three floats. These three floats are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: float __attribute__((ext_vector_type(4)))
+A vector of four floats type. These four floats are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: short
+A 16 bit signed integer type. +
+A typedef of: int __attribute__((ext_vector_type(2)))
+A vector of two ints. These two ints are packed into a single 64 bit field +with a 64 bit alignment. +
+A typedef of: int __attribute__((ext_vector_type(3)))
+A vector of three ints. These three ints are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: int
+A 32 bit signed integer type. +
+A typedef of: int __attribute__((ext_vector_type(4)))
+A vector of four ints. These two fours are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: long long Removed from API level 21 +
+A typedef of: long Added in API level 21 +
+A 64 bit signed integer type. +
+A typedef of: char
+8 bit signed integer type. +
+A typedef of: long __attribute__((ext_vector_type(2)))
+A vector of two longs. These two longs are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: long __attribute__((ext_vector_type(3)))
+A vector of three longs. These three longs are packed into a single 256 bit field +with a 256 bit alignment. +
+A typedef of: long __attribute__((ext_vector_type(4)))
+A vector of four longs. These four longs are packed into a single 256 bit field +with a 256 bit alignment. +
+A structure with the following fields:
+| float m[4] |
|---|
A square 2x2 matrix of floats. The entries are stored in the array at the +location [row*2 + col]. +
+ +See Matrix Functions. +
+A structure with the following fields:
+| float m[9] |
|---|
A square 3x3 matrix of floats. The entries are stored in the array at the +location [row*3 + col]. +
+ +See Matrix Functions. +
+A structure with the following fields:
+| float m[16] |
|---|
A square 4x4 matrix of floats. The entries are stored in the array at the +location [row*4 + col]. +
+ +See Matrix Functions. +
+A typedef of: float4
+A square 4x4 matrix of floats that represents a quaternion. +
+ +See Quaternion Functions. +
+A typedef of: short __attribute__((ext_vector_type(2)))
+A vector of two shorts. These two shorts are packed into a single 32 bit field +with a 32 bit alignment. +
+A typedef of: short __attribute__((ext_vector_type(3)))
+A vector of three shorts. These three short fields packed into a single 64 bit field +with a 64 bit alignment. +
+A typedef of: short __attribute__((ext_vector_type(4)))
+A vector of four shorts. These four short fields packed into a single 64 bit field +with a 64 bit alignment. +
+A typedef of: uint64_t When compiling for 64 bits. +
+A typedef of: uint32_t When compiling for 32 bits. +
+Unsigned size type. The number of bits depend on the compilation flags. +
+A typedef of: int64_t When compiling for 64 bits. +
+A typedef of: int32_t When compiling for 32 bits. +
+Signed size type. The number of bits depend on the compilation flags. +
+A typedef of: uint8_t
+8 bit unsigned integer type. +
+A typedef of: uchar __attribute__((ext_vector_type(2)))
+A vector of two uchars. These two uchar fields packed into a single 16 bit field +with a 16 bit alignment. +
+A typedef of: uchar __attribute__((ext_vector_type(3)))
+A vector of three uchars. These three uchar fields packed into a single 32 bit field +with a 32 bit alignment. +
+A typedef of: uchar __attribute__((ext_vector_type(4)))
+A vector of four uchars. These four uchar fields packed into a single 32 bit field +with a 32 bit alignment. +
+A typedef of: uint32_t
+A 32 bit unsigned integer type. +
+A typedef of: unsigned short
+A 16 bit unsigned integer type. +
+A typedef of: uint __attribute__((ext_vector_type(2)))
+A vector of two uints. These two uints are packed into a single 64 bit field +with a 64 bit alignment. +
+A typedef of: uint __attribute__((ext_vector_type(3)))
+A vector of three uints. These three uints are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: unsigned int
+A 32 bit unsigned integer type. +
+A typedef of: uint __attribute__((ext_vector_type(4)))
+A vector of four uints. These four uints are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: unsigned long long Removed from API level 21 +
+A typedef of: unsigned long Added in API level 21 +
+A 64 bit unsigned integer type. +
+A typedef of: unsigned char
+8 bit unsigned integer type. +
+A typedef of: uint64_t
+A 64 bit unsigned integer type. +
+A typedef of: ulong __attribute__((ext_vector_type(2)))
+A vector of two ulongs. These two ulongs are packed into a single 128 bit field +with a 128 bit alignment. +
+A typedef of: ulong __attribute__((ext_vector_type(3)))
+A vector of three ulongs. These three ulong fields packed into a single 256 bit field +with a 256 bit alignment. +
+A typedef of: ulong __attribute__((ext_vector_type(4)))
+A vector of four ulongs. These four ulong fields packed into a single 256 bit field +with a 256 bit alignment. +
+A typedef of: uint16_t
+A 16 bit unsigned integer type. +
+A typedef of: ushort __attribute__((ext_vector_type(2)))
+A vector of two ushorts. These two ushort fields packed into a single 32 bit field +with a 32 bit alignment. +
+A typedef of: ushort __attribute__((ext_vector_type(3)))
+A vector of three ushorts. These three ushort fields packed into a single 64 bit field +with a 64 bit alignment. +
+A typedef of: ushort __attribute__((ext_vector_type(4)))
+A vector of four ushorts. These four ushort fields packed into a single 64 bit field +with a 64 bit alignment. +
+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
| Functions | |
|---|---|
| + cross + | ++ Cross product of two vectors + | +
| + distance + | ++ Distance between two points + | +
| + dot + | ++ Dot product of two vectors + | +
| + fast_distance + | ++ Approximate distance between two points + | +
| + fast_length + | ++ Approximate length of a vector + | +
| + fast_normalize + | ++ Approximate normalized vector + | +
| + length + | ++ Length of a vector + | +
| + native_distance + | ++ Approximate distance between two points + | +
| + native_length + | ++ Approximate length of a vector + | +
| + native_normalize + | ++ Approximately normalize a vector + | +
| + normalize + | ++ Normalize a vector + | +
| float3 cross(float3 left_vector, float3 right_vector); + | ++ |
| float4 cross(float4 left_vector, float4 right_vector); + | ++ |
Computes the cross product of two vectors. +
+| float distance(float left_vector, float right_vector); + | ++ |
| float distance(float2 left_vector, float2 right_vector); + | ++ |
| float distance(float3 left_vector, float3 right_vector); + | ++ |
| float distance(float4 left_vector, float4 right_vector); + | ++ |
Compute the distance between two points. +
+ +See also fast_distance(), native_distance(). +
+| float dot(float left_vector, float right_vector); + | ++ |
| float dot(float2 left_vector, float2 right_vector); + | ++ |
| float dot(float3 left_vector, float3 right_vector); + | ++ |
| float dot(float4 left_vector, float4 right_vector); + | ++ |
Computes the dot product of two vectors. +
+| float fast_distance(float left_vector, float right_vector); + | +Added in API level 17 + | +
| float fast_distance(float2 left_vector, float2 right_vector); + | +Added in API level 17 + | +
| float fast_distance(float3 left_vector, float3 right_vector); + | +Added in API level 17 + | +
| float fast_distance(float4 left_vector, float4 right_vector); + | +Added in API level 17 + | +
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(). +
+| float fast_length(float v); + | +Added in API level 17 + | +
| float fast_length(float2 v); + | +Added in API level 17 + | +
| float fast_length(float3 v); + | +Added in API level 17 + | +
| float fast_length(float4 v); + | +Added in API level 17 + | +
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(). +
+| float fast_normalize(float v); + | +Added in API level 17 + | +
| float2 fast_normalize(float2 v); + | +Added in API level 17 + | +
| float3 fast_normalize(float3 v); + | +Added in API level 17 + | +
| float4 fast_normalize(float4 v); + | +Added in API level 17 + | +
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(). +
+| float length(float v); + | ++ |
| float length(float2 v); + | ++ |
| float length(float3 v); + | ++ |
| float length(float4 v); + | ++ |
Computes the length of a vector. +
+ +See also fast_length(), native_length(). +
+| float native_distance(float left_vector, float right_vector); + | +Added in API level 21 + | +
| float native_distance(float2 left_vector, float2 right_vector); + | +Added in API level 21 + | +
| float native_distance(float3 left_vector, float3 right_vector); + | +Added in API level 21 + | +
| float native_distance(float4 left_vector, float4 right_vector); + | +Added in API level 21 + | +
Computes the approximate distance between two points. +
+ +See also distance(), fast_distance(). +
+| float native_length(float v); + | +Added in API level 21 + | +
| float native_length(float2 v); + | +Added in API level 21 + | +
| float native_length(float3 v); + | +Added in API level 21 + | +
| float native_length(float4 v); + | +Added in API level 21 + | +
Compute the approximate length of a vector. +
+ +See also length(), fast_length(). +
+| float native_normalize(float v); + | +Added in API level 21 + | +
| float2 native_normalize(float2 v); + | +Added in API level 21 + | +
| float3 native_normalize(float3 v); + | +Added in API level 21 + | +
| float4 native_normalize(float4 v); + | +Added in API level 21 + | +
Approximately normalizes a vector. +
+ +See also normalize(), fast_normalize(). +
+| float normalize(float v); + | ++ |
| float2 normalize(float2 v); + | ++ |
| float3 normalize(float3 v); + | ++ |
| float4 normalize(float4 v); + | ++ |
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(). +
+| rs_allocation | Opaque handle to a RenderScript allocation |
| rs_element | Opaque handle to a RenderScript element |
| rs_font | Opaque handle to a RenderScript font object |
| rs_matrix2x2 | 2x2 float matrix |
| rs_matrix3x3 | 3x3 float matrix |
| rs_matrix4x4 | 4x4 float matrix |
| rs_mesh | Opaque handle to a RenderScript mesh object |
| rs_path | Opaque handle to a RenderScript Path object |
| rs_program_fragment | Opaque handle to a RenderScript ProgramFragment object |
| rs_program_raster | Opaque handle to a RenderScript ProgramRaster object |
| rs_program_store | Opaque handle to a RenderScript ProgramStore object |
| rs_program_vertex | Opaque handle to a RenderScript ProgramVertex object |
| rs_sampler | Opaque handle to a RenderScript sampler object |
| rs_script | Opaque handle to a RenderScript script object |
| rs_script_call | |
| rs_tm | |
| rs_type | Opaque handle to a RenderScript type |
RenderScript is a high-performance runtime that provides 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.
-Allocation routines.
- -Definition in file rs_allocation.rsh.
-| void rsAllocationCopy1DRange | -( | -rs_allocation | -dstAlloc, | -
| - | - | uint32_t | -dstOff, | -
| - | - | uint32_t | -dstMip, | -
| - | - | uint32_t | -count, | -
| - | - | rs_allocation | -srcAlloc, | -
| - | - | uint32_t | -srcOff, | -
| - | - | uint32_t | -srcMip | -
| - | ) | -- |
Copy part of an allocation from another allocation.
-| dstAlloc | Allocation to copy data into. |
| dstOff | The offset of the first element to be copied in the destination allocation. |
| dstMip | Mip level in the destination allocation. |
| count | The number of elements to be copied. |
| srcAlloc | The source data allocation. |
| srcOff | The offset of the first element in data to be copied in the source allocation. |
| srcMip | Mip level in the source allocation. |
| void 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 | -
| - | ) | -- |
Copy a rectangular region into the allocation from another allocation.
-| dstAlloc | allocation to copy data into. |
| dstXoff | X offset of the region to update in the destination allocation. |
| dstYoff | Y offset of the region to update in the destination allocation. |
| dstMip | Mip level in the destination allocation. |
| 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 | The source data allocation. |
| srcXoff | X offset in data of the source allocation. |
| srcYoff | Y offset in data of the source allocation. |
| srcMip | Mip level in the source allocation. |
| srcFace | Cubemap face of the source allocation, ignored for allocations that aren't cubemaps. |
| uint32_t rsAllocationGetDimFaces | -( | -rs_allocation | -) | -- |
Query an allocation for the presence of more than one face.
-| uint32_t rsAllocationGetDimLOD | -( | -rs_allocation | -) | -- |
Query an allocation for the presence of more than one LOD.
-| uint32_t rsAllocationGetDimX | -( | -rs_allocation | -) | -- |
Query the dimension of an allocation.
-| uint32_t rsAllocationGetDimY | -( | -rs_allocation | -) | -- |
Query the dimension of an allocation.
-| uint32_t rsAllocationGetDimZ | -( | -rs_allocation | -) | -- |
Query the dimension of an allocation.
-| rs_element rsAllocationGetElement | -( | -rs_allocation | -a | ) | -- |
Get the element object describing the allocation's layout
-| a | allocation to get data from |
| const void rsAllocationIoReceive | -( | -rs_allocation | -a | ) | -- |
Receive a new set of contents from the queue.
-| a | allocation to work on |
| const void rsAllocationIoSend | -( | -rs_allocation | -a | ) | -- |
Send the contents of the Allocation to the queue.
-| a | allocation to work on |
| rs_allocation rsGetAllocation | -( | -const void * | -) | -- |
Returns the Allocation for a given pointer. The pointer should point within a valid allocation. The results are undefined if the pointer is not from a valid allocation.
-This function is deprecated and will be removed in the SDK from a future release.
- -| const void* rsGetElementAt | -( | -rs_allocation | -a, | -
| - | - | uint32_t | -x | -
| - | ) | -- |
Extract a single element from an allocation.
- -| const void* rsGetElementAt | -( | -rs_allocation | -a, | -
| - | - | uint32_t | -x, | -
| - | - | uint32_t | -y | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| const void* rsGetElementAt | -( | -rs_allocation | -a, | -
| - | - | uint32_t | -x, | -
| - | - | uint32_t | -y, | -
| - | - | uint32_t | -z | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| const uchar rsGetElementAtYuv_uchar_U | -( | -rs_allocation | -a, | -
| - | - | uint32_t | -x, | -
| - | - | uint32_t | -y | -
| - | ) | -- |
Extract a single element from an allocation.
-Coordinates are in the dimensions of the Y plane
- -| const uchar rsGetElementAtYuv_uchar_V | -( | -rs_allocation | -a, | -
| - | - | uint32_t | -x, | -
| - | - | uint32_t | -y | -
| - | ) | -- |
Extract a single element from an allocation.
-Coordinates are in the dimensions of the Y plane
- -| const uchar rsGetElementAtYuv_uchar_Y | -( | -rs_allocation | -a, | -
| - | - | uint32_t | -x, | -
| - | - | uint32_t | -y | -
| - | ) | -- |
Extract a single element from an allocation.
- -| const float4 rsSample | -( | -rs_allocation | -a, | -
| - | - | rs_sampler | -s, | -
| - | - | float | -location | -
| - | ) | -- |
Fetch allocation in a way described by the sampler
-| a | 1D allocation to sample from |
| s | sampler state |
| location | to sample from |
Fetch allocation in a way described by the sampler
-| a | 2D allocation to sample from |
| s | sampler state |
| location | to sample from |
| const float4 rsSample | -( | -rs_allocation | -a, | -
| - | - | rs_sampler | -s, | -
| - | - | float | -location, | -
| - | - | float | -lod | -
| - | ) | -- |
Fetch allocation in a way described by the sampler
-| a | 1D allocation to sample from |
| s | sampler state |
| 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 |
Fetch allocation in a way described by the sampler
-| a | 2D allocation to sample from |
| s | sampler state |
| 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 |
| void rsSetElementAt | -( | -rs_allocation | -a, | -
| - | - | void * | -ptr, | -
| - | - | uint32_t | -x | -
| - | ) | -- |
Set single element of an allocation.
- -| void rsSetElementAt | -( | -rs_allocation | -a, | -
| - | - | void * | -ptr, | -
| - | - | uint32_t | -x, | -
| - | - | uint32_t | -y | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_ALLOCATION_RSH__ -00024 #define __RS_ALLOCATION_RSH__ -00025 -00034 extern rs_allocation __attribute__((overloadable)) -00035 rsGetAllocation(const void *); -00036 -00042 extern uint32_t __attribute__((overloadable)) -00043 rsAllocationGetDimX(rs_allocation); -00044 -00050 extern uint32_t __attribute__((overloadable)) -00051 rsAllocationGetDimY(rs_allocation); -00052 -00058 extern uint32_t __attribute__((overloadable)) -00059 rsAllocationGetDimZ(rs_allocation); -00060 -00066 extern uint32_t __attribute__((overloadable)) -00067 rsAllocationGetDimLOD(rs_allocation); -00068 -00074 extern uint32_t __attribute__((overloadable)) -00075 rsAllocationGetDimFaces(rs_allocation); -00076 -00077 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) -00078 -00092 extern void __attribute__((overloadable)) -00093 rsAllocationCopy1DRange(rs_allocation dstAlloc, -00094 uint32_t dstOff, uint32_t dstMip, -00095 uint32_t count, -00096 rs_allocation srcAlloc, -00097 uint32_t srcOff, uint32_t srcMip); -00098 -00120 extern void __attribute__((overloadable)) -00121 rsAllocationCopy2DRange(rs_allocation dstAlloc, -00122 uint32_t dstXoff, uint32_t dstYoff, -00123 uint32_t dstMip, -00124 rs_allocation_cubemap_face dstFace, -00125 uint32_t width, uint32_t height, -00126 rs_allocation srcAlloc, -00127 uint32_t srcXoff, uint32_t srcYoff, -00128 uint32_t srcMip, -00129 rs_allocation_cubemap_face srcFace); -00130 -00131 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) -00132 -00136 extern const void * __attribute__((overloadable)) -00137 rsGetElementAt(rs_allocation a, uint32_t x); -00141 extern const void * __attribute__((overloadable)) -00142 rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y); -00146 extern const void * __attribute__((overloadable)) -00147 rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); -00148 -00149 -00150 #if (defined(RS_VERSION) && (RS_VERSION >= 18)) -00151 #define GET_ELEMENT_AT(T) \ -00152 extern T __attribute__((overloadable)) \ -00153 rsGetElementAt_##T(rs_allocation a, uint32_t x); \ -00154 extern T __attribute__((overloadable)) \ -00155 rsGetElementAt_##T(rs_allocation a, uint32_t x, uint32_t y); \ -00156 extern T __attribute__((overloadable)) \ -00157 rsGetElementAt_##T(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); -00158 #else -00159 #define GET_ELEMENT_AT(T) \ -00160 static inline T __attribute__((overloadable)) \ -00161 rsGetElementAt_##T(rs_allocation a, uint32_t x) { \ -00162 return ((T *)rsGetElementAt(a, x))[0]; \ -00163 } \ -00164 static inline T __attribute__((overloadable)) \ -00165 rsGetElementAt_##T(rs_allocation a, uint32_t x, uint32_t y) { \ -00166 return ((T *)rsGetElementAt(a, x, y))[0]; \ -00167 } \ -00168 static inline T __attribute__((overloadable)) \ -00169 rsGetElementAt_##T(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) { \ -00170 return ((T *)rsGetElementAt(a, x, y, z))[0]; \ -00171 } -00172 #endif -00173 -00174 GET_ELEMENT_AT(char) -00175 GET_ELEMENT_AT(char2) -00176 GET_ELEMENT_AT(char3) -00177 GET_ELEMENT_AT(char4) -00178 GET_ELEMENT_AT(uchar) -00179 GET_ELEMENT_AT(uchar2) -00180 GET_ELEMENT_AT(uchar3) -00181 GET_ELEMENT_AT(uchar4) -00182 GET_ELEMENT_AT(short) -00183 GET_ELEMENT_AT(short2) -00184 GET_ELEMENT_AT(short3) -00185 GET_ELEMENT_AT(short4) -00186 GET_ELEMENT_AT(ushort) -00187 GET_ELEMENT_AT(ushort2) -00188 GET_ELEMENT_AT(ushort3) -00189 GET_ELEMENT_AT(ushort4) -00190 GET_ELEMENT_AT(int) -00191 GET_ELEMENT_AT(int2) -00192 GET_ELEMENT_AT(int3) -00193 GET_ELEMENT_AT(int4) -00194 GET_ELEMENT_AT(uint) -00195 GET_ELEMENT_AT(uint2) -00196 GET_ELEMENT_AT(uint3) -00197 GET_ELEMENT_AT(uint4) -00198 GET_ELEMENT_AT(long) -00199 GET_ELEMENT_AT(long2) -00200 GET_ELEMENT_AT(long3) -00201 GET_ELEMENT_AT(long4) -00202 GET_ELEMENT_AT(ulong) -00203 GET_ELEMENT_AT(ulong2) -00204 GET_ELEMENT_AT(ulong3) -00205 GET_ELEMENT_AT(ulong4) -00206 GET_ELEMENT_AT(float) -00207 GET_ELEMENT_AT(float2) -00208 GET_ELEMENT_AT(float3) -00209 GET_ELEMENT_AT(float4) -00210 GET_ELEMENT_AT(double) -00211 GET_ELEMENT_AT(double2) -00212 GET_ELEMENT_AT(double3) -00213 GET_ELEMENT_AT(double4) -00214 -00215 #undef GET_ELEMENT_AT -00216 -00217 // Jelly Bean -00218 #if (defined(RS_VERSION) && (RS_VERSION >= 16)) -00219 -00224 extern const void __attribute__((overloadable)) -00225 rsAllocationIoSend(rs_allocation a); -00226 -00231 extern const void __attribute__((overloadable)) -00232 rsAllocationIoReceive(rs_allocation a); -00233 -00234 -00240 extern rs_element __attribute__((overloadable)) -00241 rsAllocationGetElement(rs_allocation a); -00242 -00249 extern const float4 __attribute__((overloadable)) -00250 rsSample(rs_allocation a, rs_sampler s, float location); -00260 extern const float4 __attribute__((overloadable)) -00261 rsSample(rs_allocation a, rs_sampler s, float location, float lod); -00262 -00269 extern const float4 __attribute__((overloadable)) -00270 rsSample(rs_allocation a, rs_sampler s, float2 location); -00271 -00281 extern const float4 __attribute__((overloadable)) -00282 rsSample(rs_allocation a, rs_sampler s, float2 location, float lod); -00283 -00284 #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) -00285 -00286 #if (defined(RS_VERSION) && (RS_VERSION >= 18)) -00287 -00291 extern void __attribute__((overloadable)) -00292 rsSetElementAt(rs_allocation a, void* ptr, uint32_t x); -00293 -00297 extern void __attribute__((overloadable)) -00298 rsSetElementAt(rs_allocation a, void* ptr, uint32_t x, uint32_t y); -00299 -00300 #define SET_ELEMENT_AT(T) \ -00301 extern void __attribute__((overloadable)) \ -00302 rsSetElementAt_##T(rs_allocation a, T val, uint32_t x); \ -00303 extern void __attribute__((overloadable)) \ -00304 rsSetElementAt_##T(rs_allocation a, T val, uint32_t x, uint32_t y); \ -00305 extern void __attribute__((overloadable)) \ -00306 rsSetElementAt_##T(rs_allocation a, T val, uint32_t x, uint32_t y, uint32_t z); -00307 -00308 -00309 SET_ELEMENT_AT(char) -00310 SET_ELEMENT_AT(char2) -00311 SET_ELEMENT_AT(char3) -00312 SET_ELEMENT_AT(char4) -00313 SET_ELEMENT_AT(uchar) -00314 SET_ELEMENT_AT(uchar2) -00315 SET_ELEMENT_AT(uchar3) -00316 SET_ELEMENT_AT(uchar4) -00317 SET_ELEMENT_AT(short) -00318 SET_ELEMENT_AT(short2) -00319 SET_ELEMENT_AT(short3) -00320 SET_ELEMENT_AT(short4) -00321 SET_ELEMENT_AT(ushort) -00322 SET_ELEMENT_AT(ushort2) -00323 SET_ELEMENT_AT(ushort3) -00324 SET_ELEMENT_AT(ushort4) -00325 SET_ELEMENT_AT(int) -00326 SET_ELEMENT_AT(int2) -00327 SET_ELEMENT_AT(int3) -00328 SET_ELEMENT_AT(int4) -00329 SET_ELEMENT_AT(uint) -00330 SET_ELEMENT_AT(uint2) -00331 SET_ELEMENT_AT(uint3) -00332 SET_ELEMENT_AT(uint4) -00333 SET_ELEMENT_AT(long) -00334 SET_ELEMENT_AT(long2) -00335 SET_ELEMENT_AT(long3) -00336 SET_ELEMENT_AT(long4) -00337 SET_ELEMENT_AT(ulong) -00338 SET_ELEMENT_AT(ulong2) -00339 SET_ELEMENT_AT(ulong3) -00340 SET_ELEMENT_AT(ulong4) -00341 SET_ELEMENT_AT(float) -00342 SET_ELEMENT_AT(float2) -00343 SET_ELEMENT_AT(float3) -00344 SET_ELEMENT_AT(float4) -00345 SET_ELEMENT_AT(double) -00346 SET_ELEMENT_AT(double2) -00347 SET_ELEMENT_AT(double3) -00348 SET_ELEMENT_AT(double4) -00349 -00350 #undef SET_ELEMENT_AT -00351 -00352 -00356 extern const uchar __attribute__((overloadable)) -00357 rsGetElementAtYuv_uchar_Y(rs_allocation a, uint32_t x, uint32_t y); -00358 -00364 extern const uchar __attribute__((overloadable)) -00365 rsGetElementAtYuv_uchar_U(rs_allocation a, uint32_t x, uint32_t y); -00366 -00372 extern const uchar __attribute__((overloadable)) -00373 rsGetElementAtYuv_uchar_V(rs_allocation a, uint32_t x, uint32_t y); -00374 -00375 #endif // (defined(RS_VERSION) && (RS_VERSION >= 18)) -00376 -00377 #endif -00378 -
Atomic routines.
- -Definition in file rs_atomic.rsh.
-| int32_t rsAtomicAdd | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -value | -
| - | ) | -- |
Atomic add a value to the value at addr. addr[0] += value
-| addr | Address of value to modify |
| value | Amount to add to the value at addr |
| uint32_t rsAtomicAdd | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic add a value to the value at addr. addr[0] += value
-| addr | Address of value to modify |
| value | Amount to add to the value at addr |
| int32_t rsAtomicAnd | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -value | -
| - | ) | -- |
Atomic Bitwise and a value from the value at addr. addr[0] &= value
-| addr | Address of value to modify |
| value | Amount to and with the value at addr |
| uint32_t rsAtomicAnd | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic Bitwise and a value from the value at addr. addr[0] &= value
-| addr | Address of value to modify |
| value | Amount to and with the value at addr |
| int32_t rsAtomicCas | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -compareValue, | -
| - | - | int32_t | -newValue | -
| - | ) | -- |
Compare-and-set operation with a full memory barrier.
-If the value at addr matches compareValue then newValue is written.
-| addr | The address to compare and replace if the compare passes. |
| compareValue | The value to test addr[0] against. |
| newValue | The value to write if the test passes. |
| uint32_t rsAtomicCas | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -compareValue, | -
| - | - | uint32_t | -newValue | -
| - | ) | -- |
Compare-and-set operation with a full memory barrier.
-If the value at addr matches compareValue then newValue is written.
-| addr | The address to compare and replace if the compare passes. |
| compareValue | The value to test addr[0] against. |
| newValue | The value to write if the test passes. |
Atomic subtract one from the value at addr. Equal to rsAtomicSub(addr, 1)
-| addr | Address of value to decrement |
Atomic subtract one from the value at addr. Equal to rsAtomicSub(addr, 1)
-| addr | Address of value to decrement |
Atomic add one to the value at addr. Equal to rsAtomicAdd(addr, 1)
-| addr | Address of value to increment |
Atomic add one to the value at addr. Equal to rsAtomicAdd(addr, 1)
-| addr | Address of value to increment |
| uint32_t rsAtomicMax | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic Set the value at addr to the max of addr and value addr[0] = rsMax(addr[0], value)
-| addr | Address of value to modify |
| value | comparison value |
| int32_t rsAtomicMax | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -value | -
| - | ) | -- |
Atomic Set the value at addr to the max of addr and value addr[0] = rsMin(addr[0], value)
-| addr | Address of value to modify |
| value | comparison value |
| uint32_t rsAtomicMin | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic Set the value at addr to the min of addr and value addr[0] = rsMin(addr[0], value)
-| addr | Address of value to modify |
| value | comparison value |
| int32_t rsAtomicMin | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -value | -
| - | ) | -- |
Atomic Set the value at addr to the min of addr and value addr[0] = rsMin(addr[0], value)
-| addr | Address of value to modify |
| value | comparison value |
| int32_t rsAtomicOr | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -value | -
| - | ) | -- |
Atomic Bitwise or a value from the value at addr. addr[0] |= value
-| addr | Address of value to modify |
| value | Amount to or with the value at addr |
| uint32_t rsAtomicOr | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic Bitwise or a value from the value at addr. addr[0] |= value
-| addr | Address of value to modify |
| value | Amount to or with the value at addr |
| int32_t rsAtomicSub | -( | -volatile int32_t * | -addr, | -
| - | - | int32_t | -value | -
| - | ) | -- |
Atomic Subtract a value from the value at addr. addr[0] -= value
-| addr | Address of value to modify |
| value | Amount to subtract from the value at addr |
| uint32_t rsAtomicSub | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic Subtract a value from the value at addr. addr[0] -= value
-| addr | Address of value to modify |
| value | Amount to subtract from the value at addr |
| uint32_t rsAtomicXor | -( | -volatile uint32_t * | -addr, | -
| - | - | uint32_t | -value | -
| - | ) | -- |
Atomic Bitwise xor a value from the value at addr. addr[0] ^= value
-| addr | Address of value to modify |
| value | Amount to xor with the value at addr |
00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_ATOMIC_RSH__ -00024 #define __RS_ATOMIC_RSH__ -00025 -00026 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) -00027 -00036 extern int32_t __attribute__((overloadable)) -00037 rsAtomicInc(volatile int32_t* addr); -00046 extern uint32_t __attribute__((overloadable)) -00047 rsAtomicInc(volatile uint32_t* addr); -00048 -00056 extern int32_t __attribute__((overloadable)) -00057 rsAtomicDec(volatile int32_t* addr); -00065 extern uint32_t __attribute__((overloadable)) -00066 rsAtomicDec(volatile uint32_t* addr); -00067 -00076 extern int32_t __attribute__((overloadable)) -00077 rsAtomicAdd(volatile int32_t* addr, int32_t value); -00086 extern uint32_t __attribute__((overloadable)) -00087 rsAtomicAdd(volatile uint32_t* addr, uint32_t value); -00088 -00097 extern int32_t __attribute__((overloadable)) -00098 rsAtomicSub(volatile int32_t* addr, int32_t value); -00107 extern uint32_t __attribute__((overloadable)) -00108 rsAtomicSub(volatile uint32_t* addr, uint32_t value); -00109 -00118 extern int32_t __attribute__((overloadable)) -00119 rsAtomicAnd(volatile int32_t* addr, int32_t value); -00128 extern uint32_t __attribute__((overloadable)) -00129 rsAtomicAnd(volatile uint32_t* addr, uint32_t value); -00130 -00139 extern int32_t __attribute__((overloadable)) -00140 rsAtomicOr(volatile int32_t* addr, int32_t value); -00149 extern uint32_t __attribute__((overloadable)) -00150 rsAtomicOr(volatile uint32_t* addr, uint32_t value); -00151 -00160 extern uint32_t __attribute__((overloadable)) -00161 rsAtomicXor(volatile uint32_t* addr, uint32_t value); -00170 extern int32_t __attribute__((overloadable)) -00171 rsAtomicXor(volatile int32_t* addr, int32_t value); -00172 -00182 extern uint32_t __attribute__((overloadable)) -00183 rsAtomicMin(volatile uint32_t* addr, uint32_t value); -00193 extern int32_t __attribute__((overloadable)) -00194 rsAtomicMin(volatile int32_t* addr, int32_t value); -00195 -00205 extern uint32_t __attribute__((overloadable)) -00206 rsAtomicMax(volatile uint32_t* addr, uint32_t value); -00216 extern int32_t __attribute__((overloadable)) -00217 rsAtomicMax(volatile int32_t* addr, int32_t value); -00218 -00230 extern int32_t __attribute__((overloadable)) -00231 rsAtomicCas(volatile int32_t* addr, int32_t compareValue, int32_t newValue); -00232 -00244 extern uint32_t __attribute__((overloadable)) -00245 rsAtomicCas(volatile uint32_t* addr, uint32_t compareValue, uint32_t newValue); -00246 -00247 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) -00248 -00249 #endif -00250 -
-Functions | |
| char2 | convert_char2 (uchar2 v) |
| uchar2 | convert_uchar2 (uchar2 v) |
| short2 | convert_short2 (uchar2 v) |
| ushort2 | convert_ushort2 (uchar2 v) |
| int2 | convert_int2 (uchar2 v) |
| uint2 | convert_uint2 (uchar2 v) |
| float2 | convert_float2 (uchar2 v) |
| float | acos (float) |
| float | acosh (float) |
| float | acospi (float v) |
| float | asin (float) |
| float | asinh (float) |
| float | asinpi (float v) |
| float | atan (float) |
| float | atan2 (float y, float x) |
| float | atanh (float) |
| float | atanpi (float v) |
| float | atan2pi (float y, float x) |
| float | cbrt (float) |
| float | ceil (float) |
| float | copysign (float x, float y) |
| float | cos (float) |
| float | cosh (float) |
| float | cospi (float v) |
| float | erfc (float) |
| float | erf (float) |
| float | exp (float) |
| float | exp2 (float) |
| float | pow (float x, float y) |
| float | exp10 (float v) |
| float | expm1 (float) |
| float | fabs (float) |
| float | fdim (float, float) |
| float | floor (float) |
| float | fma (float a, float b, float c) |
| float | fmax (float x, float y) |
| float | fmin (float x, float y) |
| float | fmod (float x, float y) |
| float | fract (float v, float *iptr) |
| static float | fract (float v) |
| float | frexp (float v, int *iptr) |
| float | hypot (float x, float y) |
| int | ilogb (float) |
| float | ldexp (float x, int y) |
| float | lgamma (float) |
| float | lgamma (float x, int *y) |
| float | log (float) |
| float | log10 (float) |
| float | log2 (float v) |
| float | log1p (float v) |
| float | logb (float) |
| float | mad (float a, float b, float c) |
| float | modf (float x, float *iret) |
| float | nextafter (float x, float y) |
| float | pown (float v, int p) |
| float | powr (float v, float p) |
| float | remainder (float x, float y) |
| float | rint (float) |
| float | rootn (float v, int n) |
| float | round (float) |
| float | sqrt (float) |
| float | rsqrt (float v) |
| float | sin (float v) |
| float | sincos (float v, float *cosptr) |
| float | sinh (float) |
| float | sinpi (float v) |
| float | tan (float v) |
| float | tanh (float) |
| float | tanpi (float v) |
| float | tgamma (float) |
| float | trunc (float) |
| uchar | abs (char v) |
| uchar | clz (uchar v) |
| uchar | min (uchar v1, uchar v2) |
| uchar | max (uchar v1, uchar v2) |
| float | clamp (float amount, float low, float high) |
| float | degrees (float radians) |
| float | mix (float start, float stop, float amount) |
| float | radians (float degrees) |
| float | step (float edge, float v) |
| float | sign (float v) |
| float3 | cross (float3 lhs, float3 rhs) |
| float | dot (float lhs, float rhs) |
| float | length (float v) |
| float | distance (float lhs, float rhs) |
| float | normalize (float v) |
| float | half_recip (float) |
| float | half_sqrt (float) |
| float | half_rsqrt (float v) |
| float | fast_length (float v) |
| float | fast_distance (float lhs, float rhs) |
| float | fast_normalize (float v) |
| float | native_exp2 (float v) |
| float | native_exp (float v) |
| float | native_exp10 (float v) |
Basic math functions.
- -Definition in file rs_cl.rsh.
-| uchar abs | -( | -char | -v | ) | -- |
Return the absolute value of a value.
-Supports 1,2,3,4 components of char, short, int.
- -| float acos | -( | -float | -) | -- |
Return the inverse cosine.
-Supports float, float2, float3, float4
- -| float acosh | -( | -float | -) | -- |
Return the inverse hyperbolic cosine.
-Supports float, float2, float3, float4
- -| float acospi | -( | -float | -v | ) | -- |
Return the inverse cosine divided by PI.
-Supports float, float2, float3, float4
- -| float asin | -( | -float | -) | -- |
Return the inverse sine.
-Supports float, float2, float3, float4
- -| float asinh | -( | -float | -) | -- |
Return the inverse hyperbolic sine.
-Supports float, float2, float3, float4
- -| float asinpi | -( | -float | -v | ) | -- |
Return the inverse sine divided by PI.
-Supports float, float2, float3, float4
- -| float atan | -( | -float | -) | -- |
Return the inverse tangent.
-Supports float, float2, float3, float4
- -| float atan2 | -( | -float | -y, | -
| - | - | float | -x | -
| - | ) | -- |
Return the inverse tangent of y / x.
-Supports float, float2, float3, float4. Both arguments must be of the same type.
-| y | |
| x |
| float atan2pi | -( | -float | -y, | -
| - | - | float | -x | -
| - | ) | -- |
Return the inverse tangent of y / x, divided by PI.
-Supports float, float2, float3, float4. Both arguments must be of the same type.
-| y | |
| x |
| float atanh | -( | -float | -) | -- |
Return the inverse hyperbolic tangent.
-Supports float, float2, float3, float4
- -| float atanpi | -( | -float | -v | ) | -- |
Return the inverse tangent divided by PI.
-Supports float, float2, float3, float4
- -| float cbrt | -( | -float | -) | -- |
Return the cube root.
-Supports float, float2, float3, float4.
- -| float ceil | -( | -float | -) | -- |
Return the smallest integer not less than a value.
-Supports float, float2, float3, float4.
- -| float clamp | -( | -float | -amount, | -
| - | - | float | -low, | -
| - | - | float | -high | -
| - | ) | -- |
Clamp a value to a specified high and low bound.
-| amount | value to be clamped. Supports 1,2,3,4 components |
| low | Lower bound, must be scalar or matching vector. |
| high | High bound, must match type of low |
Return the number of leading 0-bits in a value.
-Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int.
- -Convert to char.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Convert to float.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Convert to int.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Convert to short.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Convert to unsigned char.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Convert to unsigned int.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Convert to unsigned short.
-Supports 2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -| float copysign | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Copy the sign bit from y to x.
-Supports float, float2, float3, float4. Both arguments must be of the same type.
-| x | |
| y |
| float cos | -( | -float | -) | -- |
Return the cosine.
-Supports float, float2, float3, float4.
- -| float cosh | -( | -float | -) | -- |
Return the hypebolic cosine.
-Supports float, float2, float3, float4.
- -| float cospi | -( | -float | -v | ) | -- |
Return the cosine of the value * PI.
-Supports float, float2, float3, float4.
- -Compute the cross product of two vectors.
-Supports 3,4 components
- -| float degrees | -( | -float | -radians | ) | -- |
Convert from radians to degrees.
-Supports 1,2,3,4 components
- -| float distance | -( | -float | -lhs, | -
| - | - | float | -rhs | -
| - | ) | -- |
Compute the distance between two points.
-Supports 1,2,3,4 components
- -| float dot | -( | -float | -lhs, | -
| - | - | float | -rhs | -
| - | ) | -- |
Compute the dot product of two vectors.
-Supports 1,2,3,4 components
- -| float erf | -( | -float | -) | -- |
Return the error function.
-Supports float, float2, float3, float4.
- -| float erfc | -( | -float | -) | -- |
Return the complementary error function.
-Supports float, float2, float3, float4.
- -| float exp | -( | -float | -) | -- |
Return e ^ value.
-Supports float, float2, float3, float4.
- -| float exp10 | -( | -float | -v | ) | -- |
Return 10 ^ value.
-Supports float, float2, float3, float4.
- -| float exp2 | -( | -float | -) | -- |
Return 2 ^ value.
-Supports float, float2, float3, float4.
- -| float expm1 | -( | -float | -) | -- |
Return (e ^ value) - 1.
-Supports float, float2, float3, float4.
- -| float fabs | -( | -float | -) | -- |
Return the absolute value of a value.
-Supports float, float2, float3, float4.
- -| float fast_distance | -( | -float | -lhs, | -
| - | - | float | -rhs | -
| - | ) | -- |
Compute the approximate distance between two points.
-Supports 1,2,3,4 components
- -| float fast_length | -( | -float | -v | ) | -- |
Compute the approximate length of a vector.
-Supports 1,2,3,4 components
- -| float fast_normalize | -( | -float | -v | ) | -- |
Approximately normalize a vector.
-Supports 1,2,3,4 components
- -| float fdim | -( | -float | -, | -
| - | - | float | -- |
| - | ) | -- |
Return the positive difference between two values.
-Supports float, float2, float3, float4. Both arguments must be of the same type.
- -| float floor | -( | -float | -) | -- |
Return the smallest integer not greater than a value.
-Supports float, float2, float3, float4.
- -| float fma | -( | -float | -a, | -
| - | - | float | -b, | -
| - | - | float | -c | -
| - | ) | -- |
Return a*b + c.
-Supports float, float2, float3, float4.
- -| float fmax | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return (x < y ? y : x)
-Supports float, float2, float3, float4.
-| x,: | may be float, float2, float3, float4 |
| y,: | may be float or vector. If vector must match type of x. |
| float fmin | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return (x > y ? y : x)
-| x,: | may be float, float2, float3, float4 |
| y,: | may be float or vector. If vector must match type of x. |
| float fmod | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return the remainder from x / y
-Supports float, float2, float3, float4.
- -| float fract | -( | -float | -v, | -
| - | - | float * | -iptr | -
| - | ) | -- |
Return fractional part of v
-| iptr | iptr[0] will be set to the floor of the input value. Supports float, float2, float3, float4. |
| static float4 fract | -( | -float | -v | ) | - [inline, static] |
-
| float frexp | -( | -float | -v, | -
| - | - | int * | -iptr | -
| - | ) | -- |
Return the mantissa and place the exponent into iptr[0]
-| v | Supports float, float2, float3, float4. |
| iptr | Must have the same vector size as v. |
| float half_recip | -( | -float | -) | -- |
Return the approximate reciprocal of a value.
-Supports 1,2,3,4 components
- -| float half_rsqrt | -( | -float | -v | ) | -- |
Return the approximate value of (1 / sqrt(value)).
-Supports 1,2,3,4 components
- -| float half_sqrt | -( | -float | -) | -- |
Return the approximate square root of a value.
-Supports 1,2,3,4 components
- -| float hypot | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return sqrt(x*x + y*y)
-Supports float, float2, float3, float4.
- -| int ilogb | -( | -float | -) | -- |
Return the integer exponent of a value
-Supports 1,2,3,4 components
- -| float ldexp | -( | -float | -x, | -
| - | - | int | -y | -
| - | ) | -- |
Return (x * 2^y)
-| x | Supports 1,2,3,4 components |
| y | Supports single component or matching vector. |
| float length | -( | -float | -v | ) | -- |
Compute the length of a vector.
-Supports 1,2,3,4 components
- -| float lgamma | -( | -float | -) | -- |
Return the log gamma
-Supports 1,2,3,4 components
- -| float lgamma | -( | -float | -x, | -
| - | - | int * | -y | -
| - | ) | -- |
Return the log gamma and sign
-| x | Supports 1,2,3,4 components |
| y | Supports matching vector. |
| float log | -( | -float | -) | -- |
Return the natural logarithm
-Supports 1,2,3,4 components
- -| float log10 | -( | -float | -) | -- |
Return the base 10 logarithm
-Supports 1,2,3,4 components
- -| float log1p | -( | -float | -v | ) | -- |
Return the natural logarithm of (v + 1.0f)
-Supports 1,2,3,4 components
- -| float log2 | -( | -float | -v | ) | -- |
Return the base 2 logarithm
-Supports 1,2,3,4 components
- -| float logb | -( | -float | -) | -- |
Compute the exponent of the value.
-Supports 1,2,3,4 components
- -| float mad | -( | -float | -a, | -
| - | - | float | -b, | -
| - | - | float | -c | -
| - | ) | -- |
Compute (a * b) + c
-Supports 1,2,3,4 components
- -Return the maximum of two values.
-Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -Return the minimum of two values.
-Supports 1,2,3,4 components of uchar, char, ushort, short, uint, int, float.
- -| float mix | -( | -float | -start, | -
| - | - | float | -stop, | -
| - | - | float | -amount | -
| - | ) | -- |
return start + ((stop - start) * amount);
-Supports 1,2,3,4 components
- -| float modf | -( | -float | -x, | -
| - | - | float * | -iret | -
| - | ) | -- |
Return the integral and fractional components of a number. Supports 1,2,3,4 components
-| x | Source value |
| iret | iret[0] will be set to the integral portion of the number. |
| float native_exp | -( | -float | -v | ) | -- |
Fast approximate exp valid for inputs -86.f to 86.f Max 8192 ulps of error
-Supports 1,2,3,4 components
- -| float native_exp10 | -( | -float | -v | ) | -- |
Fast approximate exp10 valid for inputs -37.f to 37.f Max 8192 ulps of error
-Supports 1,2,3,4 components
- -| float native_exp2 | -( | -float | -v | ) | -- |
Fast approximate exp2 valid for inputs -125.f to 125.f Max 8192 ulps of error
-Supports 1,2,3,4 components
- -| float nextafter | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return the next floating point number from x towards y.
-Supports 1,2,3,4 components
- -| float normalize | -( | -float | -v | ) | -- |
Normalize a vector.
-Supports 1,2,3,4 components
- -| float pow | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return x ^ y.
-Supports float, float2, float3, float4. Both arguments must be of the same type.
- -| float pown | -( | -float | -v, | -
| - | - | int | -p | -
| - | ) | -- |
Return (v ^ p).
-Supports 1,2,3,4 components
- -| float powr | -( | -float | -v, | -
| - | - | float | -p | -
| - | ) | -- |
Return (v ^ p).
-| v | must be greater than 0. |
Supports 1,2,3,4 components
- -| float radians | -( | -float | -degrees | ) | -- |
Convert from degrees to radians.
-Supports 1,2,3,4 components
- -| float remainder | -( | -float | -x, | -
| - | - | float | -y | -
| - | ) | -- |
Return round x/y to the nearest integer then compute the remander.
-Supports 1,2,3,4 components
- -| float rint | -( | -float | -) | -- |
Round to the nearest integral value.
-Supports 1,2,3,4 components
- -| float rootn | -( | -float | -v, | -
| - | - | int | -n | -
| - | ) | -- |
Compute the Nth root of a value.
-Supports 1,2,3,4 components
- -| float round | -( | -float | -) | -- |
Round to the nearest integral value. Half values are rounded away from zero.
-Supports 1,2,3,4 components
- -| float rsqrt | -( | -float | -v | ) | -- |
Return (1 / sqrt(value)).
-Supports 1,2,3,4 components
- -| float sign | -( | -float | -v | ) | -- |
Return the sign of a value.
-if (v < 0) return -1.f; else if (v > 0) return 1.f; else return 0.f;
-Supports 1,2,3,4 components
- -| float sin | -( | -float | -v | ) | -- |
Return the sine of a value specified in radians.
-| v | The incoming value in radians Supports 1,2,3,4 components |
| float sincos | -( | -float | -v, | -
| - | - | float * | -cosptr | -
| - | ) | -- |
Return the sine and cosine of a value.
-| v | The incoming value in radians |
| *cosptr | cosptr[0] will be set to the cosine value. |
Supports 1,2,3,4 components
- -| float sinh | -( | -float | -) | -- |
Return the hyperbolic sine of a value specified in radians.
-Supports 1,2,3,4 components
- -| float sinpi | -( | -float | -v | ) | -- |
Return the sin(v * PI).
-Supports 1,2,3,4 components
- -| float sqrt | -( | -float | -) | -- |
Return the square root of a value.
-Supports 1,2,3,4 components
- -| float step | -( | -float | -edge, | -
| - | - | float | -v | -
| - | ) | -- |
if (v < edge) return 0.f; else return 1.f;
-Supports 1,2,3,4 components
- -| float tan | -( | -float | -v | ) | -- |
Return the tangent of a value.
-Supports 1,2,3,4 components
-| v | The incoming value in radians |
| float tanh | -( | -float | -) | -- |
Return the hyperbolic tangent of a value.
-Supports 1,2,3,4 components
-| v | The incoming value in radians |
| float tanpi | -( | -float | -v | ) | -- |
Return tan(v * PI)
-Supports 1,2,3,4 components
- -| float tgamma | -( | -float | -) | -- |
Compute the gamma function of a value.
-Supports 1,2,3,4 components
- -| float trunc | -( | -float | -) | -- |
Round to integral using truncation.
-Supports 1,2,3,4 components
- -00001 /* -00002 * Copyright (C) 2011-2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_CL_RSH__ -00024 #define __RS_CL_RSH__ -00025 -00026 // Conversions -00027 #define CVT_FUNC_2(typeout, typein) \ -00028 _RS_RUNTIME typeout##2 __attribute__((overloadable)) \ -00029 convert_##typeout##2(typein##2 v); \ -00030 _RS_RUNTIME typeout##3 __attribute__((overloadable)) \ -00031 convert_##typeout##3(typein##3 v); \ -00032 _RS_RUNTIME typeout##4 __attribute__((overloadable)) \ -00033 convert_##typeout##4(typein##4 v); -00034 -00035 -00036 #define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \ -00037 CVT_FUNC_2(type, char) \ -00038 CVT_FUNC_2(type, ushort) \ -00039 CVT_FUNC_2(type, short) \ -00040 CVT_FUNC_2(type, uint) \ -00041 CVT_FUNC_2(type, int) \ -00042 CVT_FUNC_2(type, float) -00043 -00049 CVT_FUNC(char) -00050 -00051 -00056 CVT_FUNC(uchar) -00057 -00063 CVT_FUNC(short) -00064 -00070 CVT_FUNC(ushort) -00071 -00077 CVT_FUNC(int) -00078 -00084 CVT_FUNC(uint) -00085 -00091 CVT_FUNC(float) -00092 -00093 // Float ops, 6.11.2 -00094 -00095 #ifdef DOXYGEN -00096 -00097 #define FN_FUNC_FN(fnc) -00098 #define F_FUNC_FN(fnc) -00099 #define IN_FUNC_FN(fnc) -00100 #define FN_FUNC_FN_FN(fnc) -00101 #define F_FUNC_FN_FN(fnc) -00102 #define FN_FUNC_FN_F(fnc) -00103 #define FN_FUNC_FN_IN(fnc) -00104 #define FN_FUNC_FN_I(fnc) -00105 #define FN_FUNC_FN_PFN(fnc) -00106 #define FN_FUNC_FN_PIN(fnc) -00107 #define FN_FUNC_FN_FN_FN(fnc) -00108 #define FN_FUNC_FN_FN_F(fnc) -00109 #define FN_FUNC_FN_F_F(fnc) -00110 #define FN_FUNC_FN_FN_PIN(fnc) -00111 -00112 #else -00113 -00114 #define FN_FUNC_FN(fnc) \ -00115 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v); \ -00116 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v); \ -00117 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v); -00118 -00119 #define F_FUNC_FN(fnc) \ -00120 _RS_RUNTIME float __attribute__((overloadable)) fnc(float2 v); \ -00121 _RS_RUNTIME float __attribute__((overloadable)) fnc(float3 v); \ -00122 _RS_RUNTIME float __attribute__((overloadable)) fnc(float4 v); -00123 -00124 #define IN_FUNC_FN(fnc) \ -00125 _RS_RUNTIME int2 __attribute__((overloadable)) fnc(float2 v); \ -00126 _RS_RUNTIME int3 __attribute__((overloadable)) fnc(float3 v); \ -00127 _RS_RUNTIME int4 __attribute__((overloadable)) fnc(float4 v); -00128 -00129 #define FN_FUNC_FN_FN(fnc) \ -00130 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2); \ -00131 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2); \ -00132 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2); -00133 -00134 #define F_FUNC_FN_FN(fnc) \ -00135 _RS_RUNTIME float __attribute__((overloadable)) fnc(float2 v1, float2 v2); \ -00136 _RS_RUNTIME float __attribute__((overloadable)) fnc(float3 v1, float3 v2); \ -00137 _RS_RUNTIME float __attribute__((overloadable)) fnc(float4 v1, float4 v2); -00138 -00139 #define FN_FUNC_FN_F(fnc) \ -00140 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, float v2); \ -00141 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, float v2); \ -00142 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, float v2); -00143 -00144 #define FN_FUNC_FN_IN(fnc) \ -00145 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2); \ -00146 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2); \ -00147 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2); \ -00148 -00149 #define FN_FUNC_FN_I(fnc) \ -00150 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int v2); \ -00151 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int v2); \ -00152 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int v2); -00153 -00154 #define FN_FUNC_FN_PFN(fnc) \ -00155 _RS_RUNTIME float2 __attribute__((overloadable)) \ -00156 fnc(float2 v1, float2 *v2); \ -00157 _RS_RUNTIME float3 __attribute__((overloadable)) \ -00158 fnc(float3 v1, float3 *v2); \ -00159 _RS_RUNTIME float4 __attribute__((overloadable)) \ -00160 fnc(float4 v1, float4 *v2); -00161 -00162 #define FN_FUNC_FN_PIN(fnc) \ -00163 _RS_RUNTIME float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2); \ -00164 _RS_RUNTIME float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2); \ -00165 _RS_RUNTIME float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2); -00166 -00167 #define FN_FUNC_FN_FN_FN(fnc) \ -00168 _RS_RUNTIME float2 __attribute__((overloadable)) \ -00169 fnc(float2 v1, float2 v2, float2 v3); \ -00170 _RS_RUNTIME float3 __attribute__((overloadable)) \ -00171 fnc(float3 v1, float3 v2, float3 v3); \ -00172 _RS_RUNTIME float4 __attribute__((overloadable)) \ -00173 fnc(float4 v1, float4 v2, float4 v3); -00174 -00175 #define FN_FUNC_FN_FN_F(fnc) \ -00176 _RS_RUNTIME float2 __attribute__((overloadable)) \ -00177 fnc(float2 v1, float2 v2, float v3); \ -00178 _RS_RUNTIME float3 __attribute__((overloadable)) \ -00179 fnc(float3 v1, float3 v2, float v3); \ -00180 _RS_RUNTIME float4 __attribute__((overloadable)) \ -00181 fnc(float4 v1, float4 v2, float v3); -00182 -00183 #define FN_FUNC_FN_F_F(fnc) \ -00184 _RS_RUNTIME float2 __attribute__((overloadable)) \ -00185 fnc(float2 v1, float v2, float v3); \ -00186 _RS_RUNTIME float3 __attribute__((overloadable)) \ -00187 fnc(float3 v1, float v2, float v3); \ -00188 _RS_RUNTIME float4 __attribute__((overloadable)) \ -00189 fnc(float4 v1, float v2, float v3); -00190 -00191 #define FN_FUNC_FN_FN_PIN(fnc) \ -00192 _RS_RUNTIME float2 __attribute__((overloadable)) \ -00193 fnc(float2 v1, float2 v2, int2 *v3); \ -00194 _RS_RUNTIME float3 __attribute__((overloadable)) \ -00195 fnc(float3 v1, float3 v2, int3 *v3); \ -00196 _RS_RUNTIME float4 __attribute__((overloadable)) \ -00197 fnc(float4 v1, float4 v2, int4 *v3); -00198 -00199 #endif // DOXYGEN -00200 -00201 -00207 extern float __attribute__((overloadable)) acos(float); -00208 FN_FUNC_FN(acos) -00209 -00215 extern float __attribute__((overloadable)) acosh(float); -00216 FN_FUNC_FN(acosh) -00217 -00223 _RS_RUNTIME float __attribute__((overloadable)) acospi(float v); -00224 FN_FUNC_FN(acospi) -00225 -00231 extern float __attribute__((overloadable)) asin(float); -00232 FN_FUNC_FN(asin) -00233 -00239 extern float __attribute__((overloadable)) asinh(float); -00240 FN_FUNC_FN(asinh) -00241 -00242 -00248 _RS_RUNTIME float __attribute__((overloadable)) asinpi(float v); -00249 FN_FUNC_FN(asinpi) -00250 -00256 extern float __attribute__((overloadable)) atan(float); -00257 FN_FUNC_FN(atan) -00258 -00268 extern float __attribute__((overloadable)) atan2(float y, float x); -00269 FN_FUNC_FN_FN(atan2) -00270 -00276 extern float __attribute__((overloadable)) atanh(float); -00277 FN_FUNC_FN(atanh) -00278 -00284 _RS_RUNTIME float __attribute__((overloadable)) atanpi(float v); -00285 FN_FUNC_FN(atanpi) -00286 -00296 _RS_RUNTIME float __attribute__((overloadable)) atan2pi(float y, float x); -00297 FN_FUNC_FN_FN(atan2pi) -00298 -00299 -00305 extern float __attribute__((overloadable)) cbrt(float); -00306 FN_FUNC_FN(cbrt) -00307 -00313 extern float __attribute__((overloadable)) ceil(float); -00314 FN_FUNC_FN(ceil) -00315 -00325 extern float __attribute__((overloadable)) copysign(float x, float y); -00326 FN_FUNC_FN_FN(copysign) -00327 -00333 extern float __attribute__((overloadable)) cos(float); -00334 FN_FUNC_FN(cos) -00335 -00341 extern float __attribute__((overloadable)) cosh(float); -00342 FN_FUNC_FN(cosh) -00343 -00349 _RS_RUNTIME float __attribute__((overloadable)) cospi(float v); -00350 FN_FUNC_FN(cospi) -00351 -00357 extern float __attribute__((overloadable)) erfc(float); -00358 FN_FUNC_FN(erfc) -00359 -00365 extern float __attribute__((overloadable)) erf(float); -00366 FN_FUNC_FN(erf) -00367 -00373 extern float __attribute__((overloadable)) exp(float); -00374 FN_FUNC_FN(exp) -00375 -00381 extern float __attribute__((overloadable)) exp2(float); -00382 FN_FUNC_FN(exp2) -00383 -00390 extern float __attribute__((overloadable)) pow(float x, float y); -00391 FN_FUNC_FN_FN(pow) -00392 -00398 _RS_RUNTIME float __attribute__((overloadable)) exp10(float v); -00399 FN_FUNC_FN(exp10) -00400 -00406 extern float __attribute__((overloadable)) expm1(float); -00407 FN_FUNC_FN(expm1) -00408 -00414 extern float __attribute__((overloadable)) fabs(float); -00415 FN_FUNC_FN(fabs) -00416 -00423 extern float __attribute__((overloadable)) fdim(float, float); -00424 FN_FUNC_FN_FN(fdim) -00425 -00431 extern float __attribute__((overloadable)) floor(float); -00432 FN_FUNC_FN(floor) -00433 -00439 extern float __attribute__((overloadable)) fma(float a, float b, float c); -00440 FN_FUNC_FN_FN_FN(fma) -00441 -00449 extern float __attribute__((overloadable)) fmax(float x, float y); -00450 FN_FUNC_FN_FN(fmax); -00451 FN_FUNC_FN_F(fmax); -00452 -00459 extern float __attribute__((overloadable)) fmin(float x, float y); -00460 FN_FUNC_FN_FN(fmin); -00461 FN_FUNC_FN_F(fmin); -00462 -00468 extern float __attribute__((overloadable)) fmod(float x, float y); -00469 FN_FUNC_FN_FN(fmod) -00470 -00477 _RS_RUNTIME float __attribute__((overloadable)) fract(float v, float *iptr); -00478 FN_FUNC_FN_PFN(fract) -00479 -00485 static inline float __attribute__((overloadable)) fract(float v) { -00486 float unused; -00487 return fract(v, &unused); -00488 } -00489 -00490 static inline float2 __attribute__((overloadable)) fract(float2 v) { -00491 float2 unused; -00492 return fract(v, &unused); -00493 } -00494 -00495 static inline float3 __attribute__((overloadable)) fract(float3 v) { -00496 float3 unused; -00497 return fract(v, &unused); -00498 } -00499 -00500 static inline float4 __attribute__((overloadable)) fract(float4 v) { -00501 float4 unused; -00502 return fract(v, &unused); -00503 } -00504 -00511 extern float __attribute__((overloadable)) frexp(float v, int *iptr); -00512 FN_FUNC_FN_PIN(frexp) -00513 -00519 extern float __attribute__((overloadable)) hypot(float x, float y); -00520 FN_FUNC_FN_FN(hypot) -00521 -00527 extern int __attribute__((overloadable)) ilogb(float); -00528 IN_FUNC_FN(ilogb) -00529 -00536 extern float __attribute__((overloadable)) ldexp(float x, int y); -00537 FN_FUNC_FN_IN(ldexp) -00538 FN_FUNC_FN_I(ldexp) -00539 -00545 extern float __attribute__((overloadable)) lgamma(float); -00546 FN_FUNC_FN(lgamma) -00547 -00554 extern float __attribute__((overloadable)) lgamma(float x, int* y); -00555 FN_FUNC_FN_PIN(lgamma) -00556 -00562 extern float __attribute__((overloadable)) log(float); -00563 FN_FUNC_FN(log) -00564 -00570 extern float __attribute__((overloadable)) log10(float); -00571 FN_FUNC_FN(log10) -00572 -00578 _RS_RUNTIME float __attribute__((overloadable)) log2(float v); -00579 FN_FUNC_FN(log2) -00580 -00586 extern float __attribute__((overloadable)) log1p(float v); -00587 FN_FUNC_FN(log1p) -00588 -00594 extern float __attribute__((overloadable)) logb(float); -00595 FN_FUNC_FN(logb) -00596 -00602 extern float __attribute__((overloadable)) mad(float a, float b, float c); -00603 FN_FUNC_FN_FN_FN(mad) -00604 -00613 extern float __attribute__((overloadable)) modf(float x, float *iret); -00614 FN_FUNC_FN_PFN(modf); -00615 -00616 extern float __attribute__((overloadable)) nan(uint); -00617 -00623 extern float __attribute__((overloadable)) nextafter(float x, float y); -00624 FN_FUNC_FN_FN(nextafter) -00625 -00631 _RS_RUNTIME float __attribute__((overloadable)) pown(float v, int p); -00632 FN_FUNC_FN_IN(pown) -00633 -00640 _RS_RUNTIME float __attribute__((overloadable)) powr(float v, float p); -00641 FN_FUNC_FN_FN(powr) -00642 -00648 extern float __attribute__((overloadable)) remainder(float x, float y); -00649 FN_FUNC_FN_FN(remainder) -00650 -00651 // document once we know the precision of bionic -00652 extern float __attribute__((overloadable)) remquo(float, float, int *); -00653 FN_FUNC_FN_FN_PIN(remquo) -00654 -00660 extern float __attribute__((overloadable)) rint(float); -00661 FN_FUNC_FN(rint) -00662 -00668 _RS_RUNTIME float __attribute__((overloadable)) rootn(float v, int n); -00669 FN_FUNC_FN_IN(rootn) -00670 -00676 extern float __attribute__((overloadable)) round(float); -00677 FN_FUNC_FN(round) -00678 -00684 extern float __attribute__((overloadable)) sqrt(float); -00685 FN_FUNC_FN(sqrt) -00686 -00692 _RS_RUNTIME float __attribute__((overloadable)) rsqrt(float v); -00693 FN_FUNC_FN(rsqrt) -00694 -00701 extern float __attribute__((overloadable)) sin(float v); -00702 FN_FUNC_FN(sin) -00703 -00713 _RS_RUNTIME float __attribute__((overloadable)) sincos(float v, float *cosptr); -00714 FN_FUNC_FN_PFN(sincos); -00715 -00721 extern float __attribute__((overloadable)) sinh(float); -00722 FN_FUNC_FN(sinh) -00723 -00729 _RS_RUNTIME float __attribute__((overloadable)) sinpi(float v); -00730 FN_FUNC_FN(sinpi) -00731 -00738 extern float __attribute__((overloadable)) tan(float v); -00739 FN_FUNC_FN(tan) -00740 -00747 extern float __attribute__((overloadable)) tanh(float); -00748 FN_FUNC_FN(tanh) -00749 -00755 _RS_RUNTIME float __attribute__((overloadable)) tanpi(float v); -00756 FN_FUNC_FN(tanpi) -00757 -00763 extern float __attribute__((overloadable)) tgamma(float); -00764 FN_FUNC_FN(tgamma) -00765 -00771 extern float __attribute__((overloadable)) trunc(float); -00772 FN_FUNC_FN(trunc) -00773 -00774 #ifdef DOXYGEN -00775 -00776 #define XN_FUNC_YN(typeout, fnc, typein) \ -00777 extern typeout __attribute__((overloadable)) fnc(typein v); -00778 -00779 #define XN_FUNC_XN_XN_BODY(type, fnc, body) \ -00780 _RS_RUNTIME type __attribute__((overloadable)) \ -00781 fnc(type v1, type v2); -00782 -00783 #else -00784 -00785 #define XN_FUNC_YN(typeout, fnc, typein) \ -00786 extern typeout __attribute__((overloadable)) fnc(typein v); \ -00787 _RS_RUNTIME typeout##2 __attribute__((overloadable)) fnc(typein##2 v); \ -00788 _RS_RUNTIME typeout##3 __attribute__((overloadable)) fnc(typein##3 v); \ -00789 _RS_RUNTIME typeout##4 __attribute__((overloadable)) fnc(typein##4 v); -00790 -00791 #define XN_FUNC_XN_XN_BODY(type, fnc, body) \ -00792 _RS_RUNTIME type __attribute__((overloadable)) \ -00793 fnc(type v1, type v2); \ -00794 _RS_RUNTIME type##2 __attribute__((overloadable)) \ -00795 fnc(type##2 v1, type##2 v2); \ -00796 _RS_RUNTIME type##3 __attribute__((overloadable)) \ -00797 fnc(type##3 v1, type##3 v2); \ -00798 _RS_RUNTIME type##4 __attribute__((overloadable)) \ -00799 fnc(type##4 v1, type##4 v2); -00800 -00801 #endif // DOXYGEN -00802 -00803 #define UIN_FUNC_IN(fnc) \ -00804 XN_FUNC_YN(uchar, fnc, char) \ -00805 XN_FUNC_YN(ushort, fnc, short) \ -00806 XN_FUNC_YN(uint, fnc, int) -00807 -00808 #define IN_FUNC_IN(fnc) \ -00809 XN_FUNC_YN(uchar, fnc, uchar) \ -00810 XN_FUNC_YN(char, fnc, char) \ -00811 XN_FUNC_YN(ushort, fnc, ushort) \ -00812 XN_FUNC_YN(short, fnc, short) \ -00813 XN_FUNC_YN(uint, fnc, uint) \ -00814 XN_FUNC_YN(int, fnc, int) -00815 -00816 #define IN_FUNC_IN_IN_BODY(fnc, body) \ -00817 XN_FUNC_XN_XN_BODY(uchar, fnc, body) \ -00818 XN_FUNC_XN_XN_BODY(char, fnc, body) \ -00819 XN_FUNC_XN_XN_BODY(ushort, fnc, body) \ -00820 XN_FUNC_XN_XN_BODY(short, fnc, body) \ -00821 XN_FUNC_XN_XN_BODY(uint, fnc, body) \ -00822 XN_FUNC_XN_XN_BODY(int, fnc, body) \ -00823 XN_FUNC_XN_XN_BODY(float, fnc, body) -00824 -00831 UIN_FUNC_IN(abs) -00832 -00833 -00838 IN_FUNC_IN(clz) -00839 -00845 IN_FUNC_IN_IN_BODY(min, (v1 < v2 ? v1 : v2)) -00846 FN_FUNC_FN_F(min) -00847 -00853 IN_FUNC_IN_IN_BODY(max, (v1 > v2 ? v1 : v2)) -00854 FN_FUNC_FN_F(max) -00855 -00863 _RS_RUNTIME float __attribute__((overloadable)) clamp(float amount, float low, float high); -00864 FN_FUNC_FN_FN_FN(clamp) -00865 FN_FUNC_FN_F_F(clamp) -00866 -00872 _RS_RUNTIME float __attribute__((overloadable)) degrees(float radians); -00873 FN_FUNC_FN(degrees) -00874 -00880 _RS_RUNTIME float __attribute__((overloadable)) mix(float start, float stop, float amount); -00881 FN_FUNC_FN_FN_FN(mix) -00882 FN_FUNC_FN_FN_F(mix) -00883 -00889 _RS_RUNTIME float __attribute__((overloadable)) radians(float degrees); -00890 FN_FUNC_FN(radians) -00891 -00900 _RS_RUNTIME float __attribute__((overloadable)) step(float edge, float v); -00901 FN_FUNC_FN_FN(step) -00902 FN_FUNC_FN_F(step) -00903 -00904 // not implemented -00905 extern float __attribute__((overloadable)) smoothstep(float, float, float); -00906 extern float2 __attribute__((overloadable)) smoothstep(float2, float2, float2); -00907 extern float3 __attribute__((overloadable)) smoothstep(float3, float3, float3); -00908 extern float4 __attribute__((overloadable)) smoothstep(float4, float4, float4); -00909 extern float2 __attribute__((overloadable)) smoothstep(float, float, float2); -00910 extern float3 __attribute__((overloadable)) smoothstep(float, float, float3); -00911 extern float4 __attribute__((overloadable)) smoothstep(float, float, float4); -00912 -00922 _RS_RUNTIME float __attribute__((overloadable)) sign(float v); -00923 FN_FUNC_FN(sign) -00924 -00930 _RS_RUNTIME float3 __attribute__((overloadable)) cross(float3 lhs, float3 rhs); -00931 _RS_RUNTIME float4 __attribute__((overloadable)) cross(float4 lhs, float4 rhs); -00932 -00938 _RS_RUNTIME float __attribute__((overloadable)) dot(float lhs, float rhs); -00939 F_FUNC_FN_FN(dot) -00940 -00946 _RS_RUNTIME float __attribute__((overloadable)) length(float v); -00947 F_FUNC_FN(length) -00948 -00954 _RS_RUNTIME float __attribute__((overloadable)) distance(float lhs, float rhs); -00955 F_FUNC_FN_FN(distance) -00956 -00962 _RS_RUNTIME float __attribute__((overloadable)) normalize(float v); -00963 FN_FUNC_FN(normalize) -00964 -00965 -00966 // New approx API functions -00967 #if (defined(RS_VERSION) && (RS_VERSION >= 17)) -00968 -00974 _RS_RUNTIME float __attribute__((overloadable)) half_recip(float); -00975 FN_FUNC_FN(half_recip) -00976 -00982 _RS_RUNTIME float __attribute__((overloadable)) half_sqrt(float); -00983 FN_FUNC_FN(half_sqrt) -00984 -00990 _RS_RUNTIME float __attribute__((overloadable)) half_rsqrt(float v); -00991 FN_FUNC_FN(half_rsqrt) -00992 -00998 _RS_RUNTIME float __attribute__((overloadable)) fast_length(float v); -00999 F_FUNC_FN(fast_length) -01000 -01006 _RS_RUNTIME float __attribute__((overloadable)) fast_distance(float lhs, float rhs); -01007 F_FUNC_FN_FN(fast_distance) -01008 -01014 _RS_RUNTIME float __attribute__((overloadable)) fast_normalize(float v); -01015 F_FUNC_FN(fast_normalize) -01016 -01017 #endif // (defined(RS_VERSION) && (RS_VERSION >= 17)) -01018 -01019 -01020 -01021 #if (defined(RS_VERSION) && (RS_VERSION >= 18)) -01022 // Fast native math functions. -01023 -01024 -01032 _RS_RUNTIME float __attribute__((overloadable)) native_exp2(float v); -01033 FN_FUNC_FN(native_exp2) -01034 -01042 _RS_RUNTIME float __attribute__((overloadable)) native_exp(float v); -01043 FN_FUNC_FN(native_exp) -01044 -01052 _RS_RUNTIME float __attribute__((overloadable)) native_exp10(float v); -01053 FN_FUNC_FN(native_exp10) -01054 -01055 -01056 _RS_RUNTIME float __attribute__((overloadable)) native_log2(float v); -01057 FN_FUNC_FN(native_log2) -01058 -01059 _RS_RUNTIME float __attribute__((overloadable)) native_log(float v); -01060 FN_FUNC_FN(native_log) -01061 -01062 _RS_RUNTIME float __attribute__((overloadable)) native_log10(float v); -01063 FN_FUNC_FN(native_log10) -01064 -01065 -01066 _RS_RUNTIME float __attribute__((overloadable)) native_powr(float v, float y); -01067 FN_FUNC_FN_FN(native_powr) -01068 -01069 -01070 #endif // (defined(RS_VERSION) && (RS_VERSION >= 18)) -01071 -01072 -01073 #undef CVT_FUNC -01074 #undef CVT_FUNC_2 -01075 #undef FN_FUNC_FN -01076 #undef F_FUNC_FN -01077 #undef IN_FUNC_FN -01078 #undef FN_FUNC_FN_FN -01079 #undef F_FUNC_FN_FN -01080 #undef FN_FUNC_FN_F -01081 #undef FN_FUNC_FN_IN -01082 #undef FN_FUNC_FN_I -01083 #undef FN_FUNC_FN_PFN -01084 #undef FN_FUNC_FN_PIN -01085 #undef FN_FUNC_FN_FN_FN -01086 #undef FN_FUNC_FN_FN_F -01087 #undef FN_FUNC_FN_F_F -01088 #undef FN_FUNC_FN_FN_PIN -01089 #undef XN_FUNC_YN -01090 #undef UIN_FUNC_IN -01091 #undef IN_FUNC_IN -01092 #undef XN_FUNC_XN_XN_BODY -01093 #undef IN_FUNC_IN_IN_BODY -01094 -01095 #endif -
#include "rs_types.rsh"#include "rs_allocation.rsh"#include "rs_atomic.rsh"#include "rs_cl.rsh"#include "rs_debug.rsh"#include "rs_element.rsh"#include "rs_math.rsh"#include "rs_matrix.rsh"#include "rs_object.rsh"#include "rs_quaternion.rsh"#include "rs_sampler.rsh"#include "rs_time.rsh"-Data Structures | |
| struct | rs_script_call |
-Typedefs | |
| typedef struct rs_script_call | rs_script_call_t |
-Enumerations | |
| enum | rs_for_each_strategy |
-Functions | |
| bool | rsSendToClient (int cmdID) |
| bool | rsSendToClient (int cmdID, const void *data, uint len) |
| void | rsSendToClientBlocking (int cmdID) |
| void | rsSendToClientBlocking (int cmdID, const void *data, uint len) |
| void | rsForEach (rs_script script, rs_allocation input, rs_allocation output, const void *usrData, size_t usrDataLen, const rs_script_call_t *) |
| void | rsForEach (rs_script script, rs_allocation input, rs_allocation output, const void *usrData, size_t usrDataLen) |
| void | rsForEach (rs_script script, rs_allocation input, rs_allocation output) |
todo-jsams
- -Definition in file rs_core.rsh.
-| typedef struct rs_script_call rs_script_call_t | -
Structure to provide extra information to a rsForEach call. Primarly used to restrict the call to a subset of cells in the allocation.
- -| enum rs_for_each_strategy | -
Launch order hint for rsForEach calls. This provides a hint to the system to determine in which order the root function of the target is called with each cell of the allocation.
-This is a hint and implementations may not obey the order.
- -Definition at line 96 of file rs_core.rsh.
- -| void rsForEach | -( | -rs_script | -script, | -
| - | - | rs_allocation | -input, | -
| - | - | rs_allocation | -output, | -
| - | - | const void * | -usrData, | -
| - | - | size_t | -usrDataLen, | -
| - | - | const rs_script_call_t * | -- |
| - | ) | -- |
Make a script to script call to launch work. One of the input or output is required to be a valid object. The input and output must be of the same dimensions. API 10-13
-| script | The target script to call |
| input | The allocation to source data from |
| output | the allocation to write date into |
| usrData | The user definied params to pass to the root script. May be NULL. |
| sc | Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL. Make a script to script call to launch work. One of the input or output is required to be a valid object. The input and output must be of the same dimensions. API 14+ |
| script | The target script to call |
| input | The allocation to source data from |
| output | the allocation to write date into |
| usrData | The user definied params to pass to the root script. May be NULL. |
| usrDataLen | The size of the userData structure. This will be used to perform a shallow copy of the data if necessary. |
| sc | Extra control infomation used to select a sub-region of the allocation to be processed or suggest a walking strategy. May be NULL. |
| void rsForEach | -( | -rs_script | -script, | -
| - | - | rs_allocation | -input, | -
| - | - | rs_allocation | -output, | -
| - | - | const void * | -usrData, | -
| - | - | size_t | -usrDataLen | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsForEach | -( | -rs_script | -script, | -
| - | - | rs_allocation | -input, | -
| - | - | rs_allocation | -output | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsSendToClient | -( | -int | -cmdID | ) | -- |
Send a message back to the client. Will not block and returns true if the message was sendable and false if the fifo was full. A message ID is required. Data payload is optional.
- -| bool rsSendToClient | -( | -int | -cmdID, | -
| - | - | const void * | -data, | -
| - | - | uint | -len | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSendToClientBlocking | -( | -int | -cmdID | ) | -- |
Send a message back to the client, blocking until the message is queued. A message ID is required. Data payload is optional.
- -| void rsSendToClientBlocking | -( | -int | -cmdID, | -
| - | - | const void * | -data, | -
| - | - | uint | -len | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -00001 /* -00002 * Copyright (C) 2011-2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00046 #ifndef __RS_CORE_RSH__ -00047 #define __RS_CORE_RSH__ -00048 -00049 #define _RS_RUNTIME extern -00050 -00051 #include "rs_types.rsh" -00052 #include "rs_allocation.rsh" -00053 #include "rs_atomic.rsh" -00054 #include "rs_cl.rsh" -00055 #include "rs_debug.rsh" -00056 #include "rs_element.rsh" -00057 #include "rs_math.rsh" -00058 #include "rs_matrix.rsh" -00059 #include "rs_object.rsh" -00060 #include "rs_quaternion.rsh" -00061 #include "rs_sampler.rsh" -00062 #include "rs_time.rsh" -00063 -00069 extern bool __attribute__((overloadable)) -00070 rsSendToClient(int cmdID); -00074 extern bool __attribute__((overloadable)) -00075 rsSendToClient(int cmdID, const void *data, uint len); -00080 extern void __attribute__((overloadable)) -00081 rsSendToClientBlocking(int cmdID); -00085 extern void __attribute__((overloadable)) -00086 rsSendToClientBlocking(int cmdID, const void *data, uint len); -00087 -00088 -00096 enum rs_for_each_strategy { -00097 RS_FOR_EACH_STRATEGY_SERIAL = 0, -00098 RS_FOR_EACH_STRATEGY_DONT_CARE = 1, -00099 RS_FOR_EACH_STRATEGY_DST_LINEAR = 2, -00100 RS_FOR_EACH_STRATEGY_TILE_SMALL= 3, -00101 RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4, -00102 RS_FOR_EACH_STRATEGY_TILE_LARGE = 5 -00103 }; -00104 -00105 -00110 typedef struct rs_script_call { -00111 enum rs_for_each_strategy strategy; -00112 uint32_t xStart; -00113 uint32_t xEnd; -00114 uint32_t yStart; -00115 uint32_t yEnd; -00116 uint32_t zStart; -00117 uint32_t zEnd; -00118 uint32_t arrayStart; -00119 uint32_t arrayEnd; -00120 } rs_script_call_t; -00121 -00138 #if !defined(RS_VERSION) || (RS_VERSION < 14) -00139 extern void __attribute__((overloadable)) -00140 rsForEach(rs_script script, rs_allocation input, -00141 rs_allocation output, const void * usrData, -00142 const rs_script_call_t *sc); -00146 extern void __attribute__((overloadable)) -00147 rsForEach(rs_script script, rs_allocation input, -00148 rs_allocation output, const void * usrData); -00149 #else -00150 -00169 extern void __attribute__((overloadable)) -00170 rsForEach(rs_script script, rs_allocation input, rs_allocation output, -00171 const void * usrData, size_t usrDataLen, const rs_script_call_t *); -00175 extern void __attribute__((overloadable)) -00176 rsForEach(rs_script script, rs_allocation input, rs_allocation output, -00177 const void * usrData, size_t usrDataLen); -00181 extern void __attribute__((overloadable)) -00182 rsForEach(rs_script script, rs_allocation input, rs_allocation output); -00183 #endif -00184 -00185 -00186 -00187 #undef _RS_RUNTIME -00188 -00189 #endif -
-Functions | |
| void | rsDebug (const char *, float) |
| void | rsDebug (const char *, float, float) |
| void | rsDebug (const char *, float, float, float) |
| void | rsDebug (const char *, float, float, float, float) |
| void | rsDebug (const char *, double) |
| void | rsDebug (const char *, const rs_matrix4x4 *) |
| void | rsDebug (const char *, const rs_matrix3x3 *) |
| void | rsDebug (const char *, const rs_matrix2x2 *) |
| void | rsDebug (const char *, int) |
| void | rsDebug (const char *, uint) |
| void | rsDebug (const char *, long) |
| void | rsDebug (const char *, unsigned long) |
| void | rsDebug (const char *, const void *) |
| void | rsDebug (const char *, char) |
| void | rsDebug (const char *, unsigned char) |
| void | rsDebug (const char *, uchar2) |
| void | rsDebug (const char *, short) |
| void | rsDebug (const char *, ushort2) |
| void | rsDebug (const char *, long2) |
| void | rsDebug (const char *, ulong2) |
Utility debugging routines.
-Routines intended to be used during application developement. These should not be used in shipping applications. All print a string and value pair to the standard log.
- -Definition in file rs_debug.rsh.
-| void rsDebug | -( | -const char * | -, | -
| - | - | float | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | float | -, | -
| - | - | float | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | float | -, | -
| - | - | float | -, | -
| - | - | float | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | float | -, | -
| - | - | float | -, | -
| - | - | float | -, | -
| - | - | float | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | double | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | const rs_matrix4x4 * | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | const rs_matrix3x3 * | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | const rs_matrix2x2 * | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | int | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | uint | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | long | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | unsigned | -long | -
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | const void * | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | char | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | unsigned | -char | -
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | uchar2 | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | short | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | ushort2 | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | long2 | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -| void rsDebug | -( | -const char * | -, | -
| - | - | ulong2 | -- |
| - | ) | -- |
Debug function. Prints a string and value to the log.
- -00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00026 #ifndef __RS_DEBUG_RSH__ -00027 #define __RS_DEBUG_RSH__ -00028 -00029 -00033 extern void __attribute__((overloadable)) -00034 rsDebug(const char *, float); -00038 extern void __attribute__((overloadable)) -00039 rsDebug(const char *, float, float); -00043 extern void __attribute__((overloadable)) -00044 rsDebug(const char *, float, float, float); -00048 extern void __attribute__((overloadable)) -00049 rsDebug(const char *, float, float, float, float); -00053 extern void __attribute__((overloadable)) -00054 rsDebug(const char *, float2); -00058 extern void __attribute__((overloadable)) -00059 rsDebug(const char *, float3); -00063 extern void __attribute__((overloadable)) -00064 rsDebug(const char *, float4); -00068 extern void __attribute__((overloadable)) -00069 rsDebug(const char *, double); -00073 extern void __attribute__((overloadable)) -00074 rsDebug(const char *, const rs_matrix4x4 *); -00078 extern void __attribute__((overloadable)) -00079 rsDebug(const char *, const rs_matrix3x3 *); -00083 extern void __attribute__((overloadable)) -00084 rsDebug(const char *, const rs_matrix2x2 *); -00088 extern void __attribute__((overloadable)) -00089 rsDebug(const char *, int); -00093 extern void __attribute__((overloadable)) -00094 rsDebug(const char *, uint); -00098 extern void __attribute__((overloadable)) -00099 rsDebug(const char *, long); -00103 extern void __attribute__((overloadable)) -00104 rsDebug(const char *, unsigned long); -00108 extern void __attribute__((overloadable)) -00109 rsDebug(const char *, long long); -00113 extern void __attribute__((overloadable)) -00114 rsDebug(const char *, unsigned long long); -00118 extern void __attribute__((overloadable)) -00119 rsDebug(const char *, const void *); -00120 -00121 #if (defined(RS_VERSION) && (RS_VERSION >= 17)) -00122 -00125 extern void __attribute__((overloadable)) -00126 rsDebug(const char *, char); -00130 extern void __attribute__((overloadable)) -00131 rsDebug(const char *, char2); -00135 extern void __attribute__((overloadable)) -00136 rsDebug(const char *, char3); -00140 extern void __attribute__((overloadable)) -00141 rsDebug(const char *, char4); -00145 extern void __attribute__((overloadable)) -00146 rsDebug(const char *, unsigned char); -00150 extern void __attribute__((overloadable)) -00151 rsDebug(const char *, uchar2); -00155 extern void __attribute__((overloadable)) -00156 rsDebug(const char *, uchar3); -00160 extern void __attribute__((overloadable)) -00161 rsDebug(const char *, uchar4); -00165 extern void __attribute__((overloadable)) -00166 rsDebug(const char *, short); -00170 extern void __attribute__((overloadable)) -00171 rsDebug(const char *, short2); -00175 extern void __attribute__((overloadable)) -00176 rsDebug(const char *, short3); -00180 extern void __attribute__((overloadable)) -00181 rsDebug(const char *, short4); -00185 extern void __attribute__((overloadable)) -00186 rsDebug(const char *, unsigned short); -00190 extern void __attribute__((overloadable)) -00191 rsDebug(const char *, ushort2); -00195 extern void __attribute__((overloadable)) -00196 rsDebug(const char *, ushort3); -00200 extern void __attribute__((overloadable)) -00201 rsDebug(const char *, ushort4); -00205 extern void __attribute__((overloadable)) -00206 rsDebug(const char *, int2); -00210 extern void __attribute__((overloadable)) -00211 rsDebug(const char *, int3); -00215 extern void __attribute__((overloadable)) -00216 rsDebug(const char *, int4); -00220 extern void __attribute__((overloadable)) -00221 rsDebug(const char *, uint2); -00225 extern void __attribute__((overloadable)) -00226 rsDebug(const char *, uint3); -00230 extern void __attribute__((overloadable)) -00231 rsDebug(const char *, uint4); -00235 extern void __attribute__((overloadable)) -00236 rsDebug(const char *, long2); -00240 extern void __attribute__((overloadable)) -00241 rsDebug(const char *, long3); -00245 extern void __attribute__((overloadable)) -00246 rsDebug(const char *, long4); -00250 extern void __attribute__((overloadable)) -00251 rsDebug(const char *, ulong2); -00255 extern void __attribute__((overloadable)) -00256 rsDebug(const char *, ulong3); -00260 extern void __attribute__((overloadable)) -00261 rsDebug(const char *, ulong4); -00262 #endif // (defined(RS_VERSION) && (RS_VERSION >= 17)) -00263 -00264 #define RS_DEBUG(a) rsDebug(#a, a) -00265 #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) -00266 -00267 #endif -
-Functions | |
| uint32_t | rsElementGetSubElementCount (rs_element e) |
| rs_element | rsElementGetSubElement (rs_element, uint32_t index) |
| uint32_t | rsElementGetSubElementNameLength (rs_element e, uint32_t index) |
| uint32_t | rsElementGetSubElementName (rs_element e, uint32_t index, char *name, uint32_t nameLength) |
| uint32_t | rsElementGetSubElementArraySize (rs_element e, uint32_t index) |
| uint32_t | rsElementGetSubElementOffsetBytes (rs_element e, uint32_t index) |
| uint32_t | rsElementGetBytesSize (rs_element e) |
| rs_data_type | rsElementGetDataType (rs_element e) |
| rs_data_kind | rsElementGetDataKind (rs_element e) |
| uint32_t | rsElementGetVectorSize (rs_element e) |
Element routines.
- -Definition in file rs_element.rsh.
-| uint32_t rsElementGetBytesSize | -( | -rs_element | -e | ) | -- |
Returns the size of element in bytes
-| e | element to get data from |
| rs_data_kind rsElementGetDataKind | -( | -rs_element | -e | ) | -- |
Returns the element's data kind
-| e | element to get data from |
| rs_data_type rsElementGetDataType | -( | -rs_element | -e | ) | -- |
Returns the element's data type
-| e | element to get data from |
| rs_element rsElementGetSubElement | -( | -rs_element | -, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
For complex elements, this function will return the sub-element at index
-| e | element to get data from |
| index | index of the sub-element to return |
| uint32_t rsElementGetSubElementArraySize | -( | -rs_element | -e, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
For complex elements, some sub-elements could be statically sized arrays. This function will return the array size for sub-element at index
-| e | element to get data from |
| index | index of the sub-element |
| uint32_t rsElementGetSubElementCount | -( | -rs_element | -e | ) | -- |
Elements could be simple, such as an int or a float, or a structure with multiple sub elements, such as a collection of floats, float2, float4. This function returns zero for simple elements or the number of sub-elements otherwise.
-| e | element to get data from |
| uint32_t rsElementGetSubElementName | -( | -rs_element | -e, | -
| - | - | uint32_t | -index, | -
| - | - | char * | -name, | -
| - | - | uint32_t | -nameLength | -
| - | ) | -- |
For complex elements, this function will return the sub-element name at index
-| e | element to get data from |
| index | index of the sub-element |
| name | array to store the name into |
| nameLength | length of the provided name array |
| uint32_t rsElementGetSubElementNameLength | -( | -rs_element | -e, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
For complex elements, this function will return the length of sub-element name at index
-| e | element to get data from |
| index | index of the sub-element to return |
| uint32_t rsElementGetSubElementOffsetBytes | -( | -rs_element | -e, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
This function specifies the location of a sub-element within the element
-| e | element to get data from |
| index | index of the sub-element |
| uint32_t rsElementGetVectorSize | -( | -rs_element | -e | ) | -- |
Returns the element's vector size
-| e | element to get data from |
00001 /* -00002 * Copyright (C) 2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_ELEMENT_RSH__ -00024 #define __RS_ELEMENT_RSH__ -00025 -00026 // New API's -00027 #if (defined(RS_VERSION) && (RS_VERSION >= 16)) -00028 -00038 extern uint32_t __attribute__((overloadable)) -00039 rsElementGetSubElementCount(rs_element e); -00040 -00049 extern rs_element __attribute__((overloadable)) -00050 rsElementGetSubElement(rs_element, uint32_t index); -00051 -00061 extern uint32_t __attribute__((overloadable)) -00062 rsElementGetSubElementNameLength(rs_element e, uint32_t index); -00063 -00075 extern uint32_t __attribute__((overloadable)) -00076 rsElementGetSubElementName(rs_element e, uint32_t index, char *name, uint32_t nameLength); -00077 -00088 extern uint32_t __attribute__((overloadable)) -00089 rsElementGetSubElementArraySize(rs_element e, uint32_t index); -00090 -00100 extern uint32_t __attribute__((overloadable)) -00101 rsElementGetSubElementOffsetBytes(rs_element e, uint32_t index); -00102 -00109 extern uint32_t __attribute__((overloadable)) -00110 rsElementGetBytesSize(rs_element e); -00111 -00118 extern rs_data_type __attribute__((overloadable)) -00119 rsElementGetDataType(rs_element e); -00120 -00127 extern rs_data_kind __attribute__((overloadable)) -00128 rsElementGetDataKind(rs_element e); -00129 -00137 extern uint32_t __attribute__((overloadable)) -00138 rsElementGetVectorSize(rs_element e); -00139 -00140 #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) -00141 -00142 #endif // __RS_ELEMENT_RSH__ -00143 -
-Functions | |
| void | rsgBindProgramFragment (rs_program_fragment pf) |
| void | rsgBindProgramStore (rs_program_store ps) |
| void | rsgBindProgramVertex (rs_program_vertex pv) |
| void | rsgBindProgramRaster (rs_program_raster pr) |
| void | rsgBindSampler (rs_program_fragment, uint slot, rs_sampler) |
| void | rsgBindTexture (rs_program_fragment, uint slot, rs_allocation) |
| void | rsgProgramVertexLoadProjectionMatrix (const rs_matrix4x4 *proj) |
| void | rsgProgramVertexLoadModelMatrix (const rs_matrix4x4 *model) |
| void | rsgProgramVertexLoadTextureMatrix (const rs_matrix4x4 *tex) |
| void | rsgProgramVertexGetProjectionMatrix (rs_matrix4x4 *proj) |
| void | rsgProgramFragmentConstantColor (rs_program_fragment pf, float r, float g, float b, float a) |
| void | rsgBindConstant (rs_program_fragment ps, uint slot, rs_allocation c) |
| void | rsgBindConstant (rs_program_vertex pv, uint slot, rs_allocation c) |
| uint | rsgGetWidth (void) |
| uint | rsgGetHeight (void) |
| void | rsgAllocationSyncAll (rs_allocation alloc) |
| void | rsgDrawRect (float x1, float y1, float x2, float y2, float z) |
| void | rsgDrawQuad (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) |
| void | rsgDrawQuadTexCoords (float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4) |
| void | rsgDrawSpriteScreenspace (float x, float y, float z, float w, float h) |
| void | rsgDrawMesh (rs_mesh ism) |
| void | rsgDrawMesh (rs_mesh ism, uint primitiveIndex) |
| void | rsgDrawMesh (rs_mesh ism, uint primitiveIndex, uint start, uint len) |
| void | rsgClearColor (float r, float g, float b, float a) |
| void | rsgClearDepth (float value) |
| void | rsgDrawText (const char *, int x, int y) |
| void | rsgDrawText (rs_allocation, int x, int y) |
| void | rsgBindFont (rs_font font) |
| void | rsgFontColor (float r, float g, float b, float a) |
| void | rsgMeasureText (const char *, int *left, int *right, int *top, int *bottom) |
| void | rsgMeasureText (rs_allocation, int *left, int *right, int *top, int *bottom) |
| void | rsgMeshComputeBoundingBox (rs_mesh mesh, float *minX, float *minY, float *minZ, float *maxX, float *maxY, float *maxZ) |
| static __inline__ void | rsgMeshComputeBoundingBox (rs_mesh mesh, float3 *bBoxMin, float3 *bBoxMax) |
Renderscript graphics API.
-A set of graphics functions used by Renderscript.
- -Definition in file rs_graphics.rsh.
-| void rsgAllocationSyncAll | -( | -rs_allocation | -alloc | ) | -- |
Sync the contents of an allocation from its SCRIPT memory space to its HW memory spaces.
-| alloc |
| void rsgBindConstant | -( | -rs_program_fragment | -ps, | -
| - | - | uint | -slot, | -
| - | - | rs_allocation | -c | -
| - | ) | -- |
Bind a new Allocation object to a ProgramFragment. The Allocation must be a valid constant input for the Program.
-| ps | program object |
| slot | index of the constant buffer on the program |
| c | constants to bind |
| void rsgBindConstant | -( | -rs_program_vertex | -pv, | -
| - | - | uint | -slot, | -
| - | - | rs_allocation | -c | -
| - | ) | -- |
Bind a new Allocation object to a ProgramVertex. The Allocation must be a valid constant input for the Program.
-| pv | program object |
| slot | index of the constant buffer on the program |
| c | constants to bind |
| void rsgBindFont | -( | -rs_font | -font | ) | -- |
Binds the font object to be used for all subsequent font rendering calls
-| font | object to bind |
| void rsgBindProgramFragment | -( | -rs_program_fragment | -pf | ) | -- |
Bind a new ProgramFragment to the rendering context.
-| pf |
| void rsgBindProgramRaster | -( | -rs_program_raster | -pr | ) | -- |
Bind a new ProgramRaster to the rendering context.
-| pr |
| void rsgBindProgramStore | -( | -rs_program_store | -ps | ) | -- |
Bind a new ProgramStore to the rendering context.
-| ps |
| void rsgBindProgramVertex | -( | -rs_program_vertex | -pv | ) | -- |
Bind a new ProgramVertex to the rendering context.
-| pv |
| void rsgBindSampler | -( | -rs_program_fragment | -, | -
| - | - | uint | -slot, | -
| - | - | rs_sampler | -- |
| - | ) | -- |
Bind a new Sampler object to a ProgramFragment. The sampler will operate on the texture bound at the matching slot.
-| slot |
| void rsgBindTexture | -( | -rs_program_fragment | -, | -
| - | - | uint | -slot, | -
| - | - | rs_allocation | -- |
| - | ) | -- |
Bind a new Allocation object to a ProgramFragment. The Allocation must be a valid texture for the Program. The sampling of the texture will be controled by the Sampler bound at the matching slot.
-| slot |
| void rsgClearColor | -( | -float | -r, | -
| - | - | float | -g, | -
| - | - | float | -b, | -
| - | - | float | -a | -
| - | ) | -- |
Clears the rendering surface to the specified color.
-| r | |
| g | |
| b | |
| a |
| void rsgClearDepth | -( | -float | -value | ) | -- |
Clears the depth suface to the specified value.
- -| void rsgDrawMesh | -( | -rs_mesh | -ism | ) | -- |
Draw a mesh using the current context state. The whole mesh is rendered.
-| ism |
Draw part of a mesh using the current context state.
-| ism | mesh object to render |
| primitiveIndex | for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. |
| void rsgDrawMesh | -( | -rs_mesh | -ism, | -
| - | - | uint | -primitiveIndex, | -
| - | - | uint | -start, | -
| - | - | uint | -len | -
| - | ) | -- |
Draw specified index range of part of a mesh using the current context state.
-| ism | mesh object to render |
| primitiveIndex | for meshes that contain multiple primitive groups this parameter specifies the index of the group to draw. |
| start | starting index in the range |
| len | number of indices to draw |
| void rsgDrawQuad | -( | -float | -x1, | -
| - | - | float | -y1, | -
| - | - | float | -z1, | -
| - | - | float | -x2, | -
| - | - | float | -y2, | -
| - | - | float | -z2, | -
| - | - | float | -x3, | -
| - | - | float | -y3, | -
| - | - | float | -z3, | -
| - | - | float | -x4, | -
| - | - | float | -y4, | -
| - | - | float | -z4 | -
| - | ) | -- |
Low performance utility function for drawing a simple quad. Not intended for drawing large quantities of geometry.
-| x1 | |
| y1 | |
| z1 | |
| x2 | |
| y2 | |
| z2 | |
| x3 | |
| y3 | |
| z3 | |
| x4 | |
| y4 | |
| z4 |
| void rsgDrawQuadTexCoords | -( | -float | -x1, | -
| - | - | float | -y1, | -
| - | - | float | -z1, | -
| - | - | float | -u1, | -
| - | - | float | -v1, | -
| - | - | float | -x2, | -
| - | - | float | -y2, | -
| - | - | float | -z2, | -
| - | - | float | -u2, | -
| - | - | float | -v2, | -
| - | - | float | -x3, | -
| - | - | float | -y3, | -
| - | - | float | -z3, | -
| - | - | float | -u3, | -
| - | - | float | -v3, | -
| - | - | float | -x4, | -
| - | - | float | -y4, | -
| - | - | float | -z4, | -
| - | - | float | -u4, | -
| - | - | float | -v4 | -
| - | ) | -- |
Low performance utility function for drawing a textured quad. Not intended for drawing large quantities of geometry.
-| x1 | |
| y1 | |
| z1 | |
| u1 | |
| v1 | |
| x2 | |
| y2 | |
| z2 | |
| u2 | |
| v2 | |
| x3 | |
| y3 | |
| z3 | |
| u3 | |
| v3 | |
| x4 | |
| y4 | |
| z4 | |
| u4 | |
| v4 |
| void rsgDrawRect | -( | -float | -x1, | -
| - | - | float | -y1, | -
| - | - | float | -x2, | -
| - | - | float | -y2, | -
| - | - | float | -z | -
| - | ) | -- |
Low performance utility function for drawing a simple rectangle. Not intended for drawing large quantities of geometry.
-| x1 | |
| y1 | |
| x2 | |
| y2 | |
| z |
| void rsgDrawSpriteScreenspace | -( | -float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z, | -
| - | - | float | -w, | -
| - | - | float | -h | -
| - | ) | -- |
Low performance function for drawing rectangles in screenspace. This function uses the default passthough ProgramVertex. Any bound ProgramVertex is ignored. This function has considerable overhead and should not be used for drawing in shipping applications.
-| x | |
| y | |
| z | |
| w | |
| h |
| void rsgDrawText | -( | -const char * | -, | -
| - | - | int | -x, | -
| - | - | int | -y | -
| - | ) | -- |
Draws text given a string and location
- -| void rsgDrawText | -( | -rs_allocation | -, | -
| - | - | int | -x, | -
| - | - | int | -y | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsgFontColor | -( | -float | -r, | -
| - | - | float | -g, | -
| - | - | float | -b, | -
| - | - | float | -a | -
| - | ) | -- |
Sets the font color for all subsequent rendering calls
-| r | red component |
| g | green component |
| b | blue component |
| a | alpha component |
| uint rsgGetHeight | -( | -void | -) | -- |
Get the height of the current rendering surface.
-| uint rsgGetWidth | -( | -void | -) | -- |
Get the width of the current rendering surface.
-| void rsgMeasureText | -( | -const char * | -, | -
| - | - | int * | -left, | -
| - | - | int * | -right, | -
| - | - | int * | -top, | -
| - | - | int * | -bottom | -
| - | ) | -- |
Returns the bounding box of the text relative to (0, 0) Any of left, right, top, bottom could be NULL
- -| void rsgMeasureText | -( | -rs_allocation | -, | -
| - | - | int * | -left, | -
| - | - | int * | -right, | -
| - | - | int * | -top, | -
| - | - | int * | -bottom | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsgMeshComputeBoundingBox | -( | -rs_mesh | -mesh, | -
| - | - | float * | -minX, | -
| - | - | float * | -minY, | -
| - | - | float * | -minZ, | -
| - | - | float * | -maxX, | -
| - | - | float * | -maxY, | -
| - | - | float * | -maxZ | -
| - | ) | -- |
Computes an axis aligned bounding box of a mesh object
- -| static __inline__ void rsgMeshComputeBoundingBox | -( | -rs_mesh | -mesh, | -
| - | - | float3 * | -bBoxMin, | -
| - | - | float3 * | -bBoxMax | -
| - | ) | - [static] |
-
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -Definition at line 409 of file rs_graphics.rsh.
- -| void rsgProgramFragmentConstantColor | -( | -rs_program_fragment | -pf, | -
| - | - | float | -r, | -
| - | - | float | -g, | -
| - | - | float | -b, | -
| - | - | float | -a | -
| - | ) | -- |
Set the constant color for a fixed function emulation program.
-| pf | |
| r | |
| g | |
| b | |
| a |
| void rsgProgramVertexGetProjectionMatrix | -( | -rs_matrix4x4 * | -proj | ) | -- |
Get the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
-| proj | matrix to store the current projection matrix into |
| void rsgProgramVertexLoadModelMatrix | -( | -const rs_matrix4x4 * | -model | ) | -- |
Load the model matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
-| model | model matrix |
| void rsgProgramVertexLoadProjectionMatrix | -( | -const rs_matrix4x4 * | -proj | ) | -- |
Load the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
-| proj | projection matrix |
| void rsgProgramVertexLoadTextureMatrix | -( | -const rs_matrix4x4 * | -tex | ) | -- |
Load the texture matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.
-| tex | texture matrix |
00001 /* -00002 * Copyright (C) 2011-2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_GRAPHICS_RSH__ -00024 #define __RS_GRAPHICS_RSH__ -00025 -00026 #include "rs_mesh.rsh" -00027 #include "rs_program.rsh" -00028 -00029 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) -00030 -00035 extern void __attribute__((overloadable)) -00036 rsgBindColorTarget(rs_allocation colorTarget, uint slot); -00037 -00042 extern void __attribute__((overloadable)) -00043 rsgClearColorTarget(uint slot); -00044 -00049 extern void __attribute__((overloadable)) -00050 rsgBindDepthTarget(rs_allocation depthTarget); -00051 -00055 extern void __attribute__((overloadable)) -00056 rsgClearDepthTarget(void); -00057 -00062 extern void __attribute__((overloadable)) -00063 rsgClearAllRenderTargets(void); -00064 -00068 extern uint __attribute__((overloadable)) -00069 rsgFinish(void); -00070 -00071 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) -00072 -00078 extern void __attribute__((overloadable)) -00079 rsgBindProgramFragment(rs_program_fragment pf); -00080 -00086 extern void __attribute__((overloadable)) -00087 rsgBindProgramStore(rs_program_store ps); -00088 -00094 extern void __attribute__((overloadable)) -00095 rsgBindProgramVertex(rs_program_vertex pv); -00096 -00102 extern void __attribute__((overloadable)) -00103 rsgBindProgramRaster(rs_program_raster pr); -00104 -00111 extern void __attribute__((overloadable)) -00112 rsgBindSampler(rs_program_fragment, uint slot, rs_sampler); -00113 -00122 extern void __attribute__((overloadable)) -00123 rsgBindTexture(rs_program_fragment, uint slot, rs_allocation); -00124 -00131 extern void __attribute__((overloadable)) -00132 rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4 *proj); -00139 extern void __attribute__((overloadable)) -00140 rsgProgramVertexLoadModelMatrix(const rs_matrix4x4 *model); -00147 extern void __attribute__((overloadable)) -00148 rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4 *tex); -00155 extern void __attribute__((overloadable)) -00156 rsgProgramVertexGetProjectionMatrix(rs_matrix4x4 *proj); -00157 -00167 extern void __attribute__((overloadable)) -00168 rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a); -00169 -00178 extern void __attribute__((overloadable)) -00179 rsgBindConstant(rs_program_fragment ps, uint slot, rs_allocation c); -00180 -00189 extern void __attribute__((overloadable)) -00190 rsgBindConstant(rs_program_vertex pv, uint slot, rs_allocation c); -00191 -00197 extern uint __attribute__((overloadable)) -00198 rsgGetWidth(void); -00199 -00205 extern uint __attribute__((overloadable)) -00206 rsgGetHeight(void); -00207 -00208 -00215 extern void __attribute__((overloadable)) -00216 rsgAllocationSyncAll(rs_allocation alloc); -00217 -00218 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) -00219 -00227 extern void __attribute__((overloadable)) -00228 rsgAllocationSyncAll(rs_allocation alloc, -00229 rs_allocation_usage_type source); -00230 -00231 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) -00232 -00243 extern void __attribute__((overloadable)) -00244 rsgDrawRect(float x1, float y1, float x2, float y2, float z); -00245 -00263 extern void __attribute__((overloadable)) -00264 rsgDrawQuad(float x1, float y1, float z1, -00265 float x2, float y2, float z2, -00266 float x3, float y3, float z3, -00267 float x4, float y4, float z4); -00268 -00269 -00295 extern void __attribute__((overloadable)) -00296 rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, -00297 float x2, float y2, float z2, float u2, float v2, -00298 float x3, float y3, float z3, float u3, float v3, -00299 float x4, float y4, float z4, float u4, float v4); -00300 -00301 -00314 extern void __attribute__((overloadable)) -00315 rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); -00316 -00317 extern void __attribute__((overloadable)) -00318 rsgDrawPath(rs_path p); -00319 -00326 extern void __attribute__((overloadable)) -00327 rsgDrawMesh(rs_mesh ism); -00334 extern void __attribute__((overloadable)) -00335 rsgDrawMesh(rs_mesh ism, uint primitiveIndex); -00344 extern void __attribute__((overloadable)) -00345 rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len); -00346 -00355 extern void __attribute__((overloadable)) -00356 rsgClearColor(float r, float g, float b, float a); -00357 -00361 extern void __attribute__((overloadable)) -00362 rsgClearDepth(float value); -00366 extern void __attribute__((overloadable)) -00367 rsgDrawText(const char *, int x, int y); -00371 extern void __attribute__((overloadable)) -00372 rsgDrawText(rs_allocation, int x, int y); -00377 extern void __attribute__((overloadable)) -00378 rsgBindFont(rs_font font); -00386 extern void __attribute__((overloadable)) -00387 rsgFontColor(float r, float g, float b, float a); -00392 extern void __attribute__((overloadable)) -00393 rsgMeasureText(const char *, int *left, int *right, int *top, int *bottom); -00397 extern void __attribute__((overloadable)) -00398 rsgMeasureText(rs_allocation, int *left, int *right, int *top, int *bottom); -00402 extern void __attribute__((overloadable)) -00403 rsgMeshComputeBoundingBox(rs_mesh mesh, float *minX, float *minY, float *minZ, -00404 float *maxX, float *maxY, float *maxZ); -00408 __inline__ static void __attribute__((overloadable, always_inline)) -00409 rsgMeshComputeBoundingBox(rs_mesh mesh, float3 *bBoxMin, float3 *bBoxMax) { -00410 float x1, y1, z1, x2, y2, z2; -00411 rsgMeshComputeBoundingBox(mesh, &x1, &y1, &z1, &x2, &y2, &z2); -00412 bBoxMin->x = x1; -00413 bBoxMin->y = y1; -00414 bBoxMin->z = z1; -00415 bBoxMax->x = x2; -00416 bBoxMax->y = y2; -00417 bBoxMax->z = z2; -00418 } -00419 -00420 #endif -00421 -
-Functions | |
| int | rsRand (int max_value) |
| int | rsRand (int min_value, int max_value) |
| float | rsRand (float max_value) |
| float | rsRand (float min_value, float max_value) |
| float | rsFrac (float) |
| uint | rsClamp (uint amount, uint low, uint high) |
| int | rsClamp (int amount, int low, int high) |
| ushort | rsClamp (ushort amount, ushort low, ushort high) |
| short | rsClamp (short amount, short low, short high) |
| uchar | rsClamp (uchar amount, uchar low, uchar high) |
| char | rsClamp (char amount, char low, char high) |
| static __inline__ void | rsExtractFrustumPlanes (const rs_matrix4x4 *viewProj, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far) |
| static __inline__ bool | rsIsSphereInFrustum (float4 *sphere, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far) |
| uchar4 | rsPackColorTo8888 (float r, float g, float b) |
| uchar4 | rsPackColorTo8888 (float r, float g, float b, float a) |
| uchar4 | rsPackColorTo8888 (float3 color) |
| float4 | rsUnpackColor8888 (uchar4 c) |
todo-jsams
- -Definition in file rs_math.rsh.
-| uint rsClamp | -( | -uint | -amount, | -
| - | - | uint | -low, | -
| - | - | uint | -high | -
| - | ) | -- |
Clamp the value amount between low and high.
-| amount | The value to clamp |
| low | |
| high |
| int rsClamp | -( | -int | -amount, | -
| - | - | int | -low, | -
| - | - | int | -high | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| ushort rsClamp | -( | -ushort | -amount, | -
| - | - | ushort | -low, | -
| - | - | ushort | -high | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| short rsClamp | -( | -short | -amount, | -
| - | - | short | -low, | -
| - | - | short | -high | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| uchar rsClamp | -( | -uchar | -amount, | -
| - | - | uchar | -low, | -
| - | - | uchar | -high | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| char rsClamp | -( | -char | -amount, | -
| - | - | char | -low, | -
| - | - | char | -high | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| static __inline__ void rsExtractFrustumPlanes | -( | -const rs_matrix4x4 * | -viewProj, | -
| - | - | float4 * | -left, | -
| - | - | float4 * | -right, | -
| - | - | float4 * | -top, | -
| - | - | float4 * | -bottom, | -
| - | - | float4 * | -near, | -
| - | - | float4 * | -far | -
| - | ) | - [static] |
-
Computes 6 frustum planes from the view projection matrix
-| viewProj | matrix to extract planes from |
| left | plane |
| right | plane |
| top | plane |
| bottom | plane |
| near | plane |
| far | plane |
Definition at line 102 of file rs_math.rsh.
- -| float rsFrac | -( | -float | -) | -- |
Returns the fractional part of a float
- -| static __inline__ bool rsIsSphereInFrustum | -( | -float4 * | -sphere, | -
| - | - | float4 * | -left, | -
| - | - | float4 * | -right, | -
| - | - | float4 * | -top, | -
| - | - | float4 * | -bottom, | -
| - | - | float4 * | -near, | -
| - | - | float4 * | -far | -
| - | ) | - [static] |
-
Checks if a sphere is withing the 6 frustum planes
-| sphere | float4 representing the sphere |
| left | plane |
| right | plane |
| top | plane |
| bottom | plane |
| near | plane |
| far | plane |
Definition at line 162 of file rs_math.rsh.
- -| uchar4 rsPackColorTo8888 | -( | -float | -r, | -
| - | - | float | -g, | -
| - | - | float | -b | -
| - | ) | -- |
Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).
-| r | |
| g | |
| b |
| uchar4 rsPackColorTo8888 | -( | -float | -r, | -
| - | - | float | -g, | -
| - | - | float | -b, | -
| - | - | float | -a | -
| - | ) | -- |
Pack floating point (0-1) RGBA values into a uchar4.
-| r | |
| g | |
| b | |
| a |
Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).
-| color |
Pack floating point (0-1) RGBA values into a uchar4.
-| color |
| int rsRand | -( | -int | -max_value | ) | -- |
Return a random value between 0 (or min_value) and max_malue.
- -| int rsRand | -( | -int | -min_value, | -
| - | - | int | -max_value | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| float rsRand | -( | -float | -max_value | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| float rsRand | -( | -float | -min_value, | -
| - | - | float | -max_value | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00024 #ifndef __RS_MATH_RSH__ -00025 #define __RS_MATH_RSH__ -00026 -00027 -00031 extern int __attribute__((overloadable)) -00032 rsRand(int max_value); -00036 extern int __attribute__((overloadable)) -00037 rsRand(int min_value, int max_value); -00041 extern float __attribute__((overloadable)) -00042 rsRand(float max_value); -00046 extern float __attribute__((overloadable)) -00047 rsRand(float min_value, float max_value); -00048 -00052 extern float __attribute__((overloadable)) -00053 rsFrac(float); -00054 -00055 -00057 // int ops -00059 -00067 _RS_RUNTIME uint __attribute__((overloadable, always_inline)) rsClamp(uint amount, uint low, uint high); -00068 -00072 _RS_RUNTIME int __attribute__((overloadable, always_inline)) rsClamp(int amount, int low, int high); -00076 _RS_RUNTIME ushort __attribute__((overloadable, always_inline)) rsClamp(ushort amount, ushort low, ushort high); -00080 _RS_RUNTIME short __attribute__((overloadable, always_inline)) rsClamp(short amount, short low, short high); -00084 _RS_RUNTIME uchar __attribute__((overloadable, always_inline)) rsClamp(uchar amount, uchar low, uchar high); -00088 _RS_RUNTIME char __attribute__((overloadable, always_inline)) rsClamp(char amount, char low, char high); -00089 -00090 -00101 __inline__ static void __attribute__((overloadable, always_inline)) -00102 rsExtractFrustumPlanes(const rs_matrix4x4 *viewProj, -00103 float4 *left, float4 *right, -00104 float4 *top, float4 *bottom, -00105 float4 *near, float4 *far) { -00106 // x y z w = a b c d in the plane equation -00107 left->x = viewProj->m[3] + viewProj->m[0]; -00108 left->y = viewProj->m[7] + viewProj->m[4]; -00109 left->z = viewProj->m[11] + viewProj->m[8]; -00110 left->w = viewProj->m[15] + viewProj->m[12]; -00111 -00112 right->x = viewProj->m[3] - viewProj->m[0]; -00113 right->y = viewProj->m[7] - viewProj->m[4]; -00114 right->z = viewProj->m[11] - viewProj->m[8]; -00115 right->w = viewProj->m[15] - viewProj->m[12]; -00116 -00117 top->x = viewProj->m[3] - viewProj->m[1]; -00118 top->y = viewProj->m[7] - viewProj->m[5]; -00119 top->z = viewProj->m[11] - viewProj->m[9]; -00120 top->w = viewProj->m[15] - viewProj->m[13]; -00121 -00122 bottom->x = viewProj->m[3] + viewProj->m[1]; -00123 bottom->y = viewProj->m[7] + viewProj->m[5]; -00124 bottom->z = viewProj->m[11] + viewProj->m[9]; -00125 bottom->w = viewProj->m[15] + viewProj->m[13]; -00126 -00127 near->x = viewProj->m[3] + viewProj->m[2]; -00128 near->y = viewProj->m[7] + viewProj->m[6]; -00129 near->z = viewProj->m[11] + viewProj->m[10]; -00130 near->w = viewProj->m[15] + viewProj->m[14]; -00131 -00132 far->x = viewProj->m[3] - viewProj->m[2]; -00133 far->y = viewProj->m[7] - viewProj->m[6]; -00134 far->z = viewProj->m[11] - viewProj->m[10]; -00135 far->w = viewProj->m[15] - viewProj->m[14]; -00136 -00137 float len = length(left->xyz); -00138 *left /= len; -00139 len = length(right->xyz); -00140 *right /= len; -00141 len = length(top->xyz); -00142 *top /= len; -00143 len = length(bottom->xyz); -00144 *bottom /= len; -00145 len = length(near->xyz); -00146 *near /= len; -00147 len = length(far->xyz); -00148 *far /= len; -00149 } -00150 -00161 __inline__ static bool __attribute__((overloadable, always_inline)) -00162 rsIsSphereInFrustum(float4 *sphere, -00163 float4 *left, float4 *right, -00164 float4 *top, float4 *bottom, -00165 float4 *near, float4 *far) { -00166 -00167 float distToCenter = dot(left->xyz, sphere->xyz) + left->w; -00168 if (distToCenter < -sphere->w) { -00169 return false; -00170 } -00171 distToCenter = dot(right->xyz, sphere->xyz) + right->w; -00172 if (distToCenter < -sphere->w) { -00173 return false; -00174 } -00175 distToCenter = dot(top->xyz, sphere->xyz) + top->w; -00176 if (distToCenter < -sphere->w) { -00177 return false; -00178 } -00179 distToCenter = dot(bottom->xyz, sphere->xyz) + bottom->w; -00180 if (distToCenter < -sphere->w) { -00181 return false; -00182 } -00183 distToCenter = dot(near->xyz, sphere->xyz) + near->w; -00184 if (distToCenter < -sphere->w) { -00185 return false; -00186 } -00187 distToCenter = dot(far->xyz, sphere->xyz) + far->w; -00188 if (distToCenter < -sphere->w) { -00189 return false; -00190 } -00191 return true; -00192 } -00193 -00194 -00205 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b); -00206 -00217 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b, float a); -00218 -00227 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float3 color); -00228 -00236 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float4 color); -00237 -00245 _RS_RUNTIME float4 rsUnpackColor8888(uchar4 c); -00246 -00247 _RS_RUNTIME uchar4 __attribute__((overloadable)) rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v); -00248 _RS_RUNTIME float4 __attribute__((overloadable)) rsYuvToRGBA_float4(uchar y, uchar u, uchar v); -00249 -00250 -00251 #endif -
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.
-A few general notes:
-Definition in file rs_matrix.rsh.
-| _RS_RUNTIME float rsMatrixGet | -( | -const rs_matrix4x4 * | -m, | -
| - | - | uint32_t | -col, | -
| - | - | uint32_t | -row | -
| - | ) | -- |
Returns one element of a matrix.
-| m | The matrix to extract the element from. |
| col | The zero-based column of the element to be extracted. |
| row | The zero-based row of the element to extracted. |
| _RS_RUNTIME float rsMatrixGet | -( | -const rs_matrix3x3 * | -m, | -
| - | - | uint32_t | -col, | -
| - | - | uint32_t | -row | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| _RS_RUNTIME float rsMatrixGet | -( | -const rs_matrix2x2 * | -m, | -
| - | - | uint32_t | -col, | -
| - | - | uint32_t | -row | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsMatrixInverse | -( | -rs_matrix4x4 * | -m | ) | -- |
Inverts a matrix in place.
-Returns true if the matrix was successfully inversed.
-| m | The matrix to invert. |
| bool rsMatrixInverseTranspose | -( | -rs_matrix4x4 * | -m | ) | -- |
Inverts and transpose a matrix in place.
-The matrix is first inverted then transposed. Returns true if the matrix was successfully inverted.
-| m | The matrix to modify. |
| void rsMatrixLoad | -( | -rs_matrix4x4 * | -m, | -
| - | - | const float * | -v | -
| - | ) | -- |
Set the elements of a matrix from an array of floats.
-The array of 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.
-| m | The matrix to set. |
| v | The array of values to set the matrix to. These arrays should be 4, 9, or 16 floats long, depending on the matrix size. |
| void rsMatrixLoad | -( | -rs_matrix3x3 * | -m, | -
| - | - | const float * | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoad | -( | -rs_matrix2x2 * | -m, | -
| - | - | const float * | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoad | -( | -rs_matrix4x4 * | -m, | -
| - | - | const rs_matrix4x4 * | -v | -
| - | ) | -- |
Set the elements of a matrix from another matrix.
-If the source matrix 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 |
| m | The matrix to set. |
| v | The source matrix. |
| void rsMatrixLoad | -( | -rs_matrix4x4 * | -m, | -
| - | - | const rs_matrix3x3 * | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoad | -( | -rs_matrix4x4 * | -m, | -
| - | - | const rs_matrix2x2 * | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoad | -( | -rs_matrix3x3 * | -m, | -
| - | - | const rs_matrix3x3 * | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoad | -( | -rs_matrix2x2 * | -m, | -
| - | - | const rs_matrix2x2 * | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoadFrustum | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -left, | -
| - | - | float | -right, | -
| - | - | float | -bottom, | -
| - | - | float | -top, | -
| - | - | float | -near, | -
| - | - | float | -far | -
| - | ) | -- |
Load 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.
-See https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf
-| m | The matrix to set. |
| left | |
| right | |
| bottom | |
| top | |
| near | |
| far |
| void rsMatrixLoadIdentity | -( | -rs_matrix4x4 * | -m | ) | -- |
Set the elements of a matrix to the identity matrix.
-| m | The matrix to set. |
| void rsMatrixLoadIdentity | -( | -rs_matrix3x3 * | -m | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoadIdentity | -( | -rs_matrix2x2 * | -m | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoadMultiply | -( | -rs_matrix4x4 * | -m, | -
| - | - | const rs_matrix4x4 * | -lhs, | -
| - | - | const rs_matrix4x4 * | -rhs | -
| - | ) | -- |
Multiply two 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).
-| m | The matrix to set. |
| lhs | The left matrix of the product. |
| rhs | The right matrix of the product. |
| void rsMatrixLoadMultiply | -( | -rs_matrix3x3 * | -m, | -
| - | - | const rs_matrix3x3 * | -lhs, | -
| - | - | const rs_matrix3x3 * | -rhs | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoadMultiply | -( | -rs_matrix2x2 * | -m, | -
| - | - | const rs_matrix2x2 * | -lhs, | -
| - | - | const rs_matrix2x2 * | -rhs | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixLoadOrtho | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -left, | -
| - | - | float | -right, | -
| - | - | float | -bottom, | -
| - | - | float | -top, | -
| - | - | float | -near, | -
| - | - | float | -far | -
| - | ) | -- |
Load an 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 and https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf
-| m | The matrix to set. |
| left | |
| right | |
| bottom | |
| top | |
| near | |
| far |
| void rsMatrixLoadPerspective | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -fovy, | -
| - | - | float | -aspect, | -
| - | - | float | -near, | -
| - | - | float | -far | -
| - | ) | -- |
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.
-See https://www.opengl.org/documentation/specs/version2.0/glspec20.pdf
-| m | The matrix to set. |
| fovy | Field of view, in degrees along the Y axis. |
| aspect | Ratio of x / y. |
| near | The near clipping plane. |
| far | The far clipping plane. |
| void rsMatrixLoadRotate | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -rot, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | -- |
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 .
-| m | The matrix to set. |
| rot | How much rotation to do, in degrees. |
| x | The x component of the vector that is the axis of rotation. |
| y | The y component of the vector that is the axis of rotation. |
| z | The z component of the vector that is the axis of rotation. |
| void rsMatrixLoadScale | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | -- |
Load a scale 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.
-| m | The matrix to set. |
| x | The multiple to scale the x components by. |
| y | The multiple to scale the y components by. |
| z | The multiple to scale the z components by. |
| void rsMatrixLoadTranslate | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | -- |
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.
-| m | The matrix to set. |
| x | The number to add to each x component. |
| y | The number to add to each y component. |
| z | The number to add to each z component. |
| void rsMatrixMultiply | -( | -rs_matrix4x4 * | -m, | -
| - | - | const rs_matrix4x4 * | -rhs | -
| - | ) | -- |
Multiply a matrix into another one.
-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.
-| m | The left matrix of the product and the matrix to be set. |
| rhs | The right matrix of the product. |
| void rsMatrixMultiply | -( | -rs_matrix3x3 * | -m, | -
| - | - | const rs_matrix3x3 * | -rhs | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixMultiply | -( | -rs_matrix2x2 * | -m, | -
| - | - | const rs_matrix2x2 * | -rhs | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| _RS_RUNTIME float4 rsMatrixMultiply | -( | -rs_matrix4x4 * | -m, | -
| - | - | float4 | -in | -
| - | ) | -- |
Multiply a vector by a matrix.
-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).
-This function is available in API version 10-13. Starting with API 14, the function takes a const matrix as the first argument.
-This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| _RS_RUNTIME float3 rsMatrixMultiply | -( | -rs_matrix3x3 * | -m, | -
| - | - | float3 | -in | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| _RS_RUNTIME float2 rsMatrixMultiply | -( | -rs_matrix2x2 * | -m, | -
| - | - | float2 | -in | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixRotate | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -rot, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | -- |
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.
-| m | The matrix to modify. |
| rot | How much rotation to do, in degrees. |
| x | The x component of the vector that is the axis of rotation. |
| y | The y component of the vector that is the axis of rotation. |
| z | The z component of the vector that is the axis of rotation. |
| void rsMatrixScale | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | -- |
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.
-| m | The matrix to modify. |
| x | The multiple to scale the x components by. |
| y | The multiple to scale the y components by. |
| z | The multiple to scale the z components by. |
| _RS_RUNTIME void rsMatrixSet | -( | -rs_matrix4x4 * | -m, | -
| - | - | uint32_t | -col, | -
| - | - | uint32_t | -row, | -
| - | - | float | -v | -
| - | ) | -- |
Set an element of a matrix.
-| m | The matrix that will be modified. |
| col | The zero-based column of the element to be set. |
| row | The zero-based row of the element to be set. |
| v | The value to set. |
| _RS_RUNTIME void rsMatrixSet | -( | -rs_matrix3x3 * | -m, | -
| - | - | uint32_t | -col, | -
| - | - | uint32_t | -row, | -
| - | - | float | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| _RS_RUNTIME void rsMatrixSet | -( | -rs_matrix2x2 * | -m, | -
| - | - | uint32_t | -col, | -
| - | - | uint32_t | -row, | -
| - | - | float | -v | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixTranslate | -( | -rs_matrix4x4 * | -m, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | -- |
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.
-| m | The matrix to modify. |
| x | The number to add to each x component. |
| y | The number to add to each y component. |
| z | The number to add to each z component. |
| void rsMatrixTranspose | -( | -rs_matrix4x4 * | -m | ) | -- |
Transpose the matrix m in place.
-| m | The matrix to transpose. |
| void rsMatrixTranspose | -( | -rs_matrix3x3 * | -m | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsMatrixTranspose | -( | -rs_matrix2x2 * | -m | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00050 #ifndef __RS_MATRIX_RSH__ -00051 #define __RS_MATRIX_RSH__ -00052 -00066 _RS_RUNTIME void __attribute__((overloadable)) -00067 rsMatrixSet(rs_matrix4x4 *m, uint32_t col, uint32_t row, float v); -00071 _RS_RUNTIME void __attribute__((overloadable)) -00072 rsMatrixSet(rs_matrix3x3 *m, uint32_t col, uint32_t row, float v); -00076 _RS_RUNTIME void __attribute__((overloadable)) -00077 rsMatrixSet(rs_matrix2x2 *m, uint32_t col, uint32_t row, float v); -00078 -00091 _RS_RUNTIME float __attribute__((overloadable)) -00092 rsMatrixGet(const rs_matrix4x4 *m, uint32_t col, uint32_t row); -00096 _RS_RUNTIME float __attribute__((overloadable)) -00097 rsMatrixGet(const rs_matrix3x3 *m, uint32_t col, uint32_t row); -00101 _RS_RUNTIME float __attribute__((overloadable)) -00102 rsMatrixGet(const rs_matrix2x2 *m, uint32_t col, uint32_t row); -00103 -00109 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix4x4 *m); -00113 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix3x3 *m); -00117 extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix2x2 *m); -00118 -00130 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const float *v); -00134 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const float *v); -00138 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const float *v); -00156 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v); -00160 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v); -00164 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v); -00168 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const rs_matrix3x3 *v); -00172 extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const rs_matrix2x2 *v); -00173 -00191 extern void __attribute__((overloadable)) -00192 rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); -00193 -00208 extern void __attribute__((overloadable)) -00209 rsMatrixLoadScale(rs_matrix4x4 *m, float x, float y, float z); -00210 -00225 extern void __attribute__((overloadable)) -00226 rsMatrixLoadTranslate(rs_matrix4x4 *m, float x, float y, float z); -00227 -00247 extern void __attribute__((overloadable)) -00248 rsMatrixLoadMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *lhs, const rs_matrix4x4 *rhs); -00252 extern void __attribute__((overloadable)) -00253 rsMatrixLoadMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *lhs, const rs_matrix3x3 *rhs); -00257 extern void __attribute__((overloadable)) -00258 rsMatrixLoadMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *lhs, const rs_matrix2x2 *rhs); -00259 -00272 extern void __attribute__((overloadable)) -00273 rsMatrixMultiply(rs_matrix4x4 *m, const rs_matrix4x4 *rhs); -00277 extern void __attribute__((overloadable)) -00278 rsMatrixMultiply(rs_matrix3x3 *m, const rs_matrix3x3 *rhs); -00282 extern void __attribute__((overloadable)) -00283 rsMatrixMultiply(rs_matrix2x2 *m, const rs_matrix2x2 *rhs); -00284 -00300 extern void __attribute__((overloadable)) -00301 rsMatrixRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); -00302 -00318 extern void __attribute__((overloadable)) -00319 rsMatrixScale(rs_matrix4x4 *m, float x, float y, float z); -00320 -00336 extern void __attribute__((overloadable)) -00337 rsMatrixTranslate(rs_matrix4x4 *m, float x, float y, float z); -00338 -00361 extern void __attribute__((overloadable)) -00362 rsMatrixLoadOrtho(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far); -00363 -00384 extern void __attribute__((overloadable)) -00385 rsMatrixLoadFrustum(rs_matrix4x4 *m, float left, float right, float bottom, float top, float near, float far); -00386 -00403 extern void __attribute__((overloadable)) -00404 rsMatrixLoadPerspective(rs_matrix4x4* m, float fovy, float aspect, float near, float far); -00405 -00406 #if !defined(RS_VERSION) || (RS_VERSION < 14) -00407 -00421 _RS_RUNTIME float4 __attribute__((overloadable)) -00422 rsMatrixMultiply(rs_matrix4x4 *m, float4 in); -00423 -00427 _RS_RUNTIME float4 __attribute__((overloadable)) -00428 rsMatrixMultiply(rs_matrix4x4 *m, float3 in); -00429 -00433 _RS_RUNTIME float4 __attribute__((overloadable)) -00434 rsMatrixMultiply(rs_matrix4x4 *m, float2 in); -00435 -00439 _RS_RUNTIME float3 __attribute__((overloadable)) -00440 rsMatrixMultiply(rs_matrix3x3 *m, float3 in); -00441 -00445 _RS_RUNTIME float3 __attribute__((overloadable)) -00446 rsMatrixMultiply(rs_matrix3x3 *m, float2 in); -00447 -00451 _RS_RUNTIME float2 __attribute__((overloadable)) -00452 rsMatrixMultiply(rs_matrix2x2 *m, float2 in); -00453 #else -00454 -00467 _RS_RUNTIME float4 __attribute__((overloadable)) -00468 rsMatrixMultiply(const rs_matrix4x4 *m, float4 in); -00469 -00473 _RS_RUNTIME float4 __attribute__((overloadable)) -00474 rsMatrixMultiply(const rs_matrix4x4 *m, float3 in); -00475 -00479 _RS_RUNTIME float4 __attribute__((overloadable)) -00480 rsMatrixMultiply(const rs_matrix4x4 *m, float2 in); -00481 -00485 _RS_RUNTIME float3 __attribute__((overloadable)) -00486 rsMatrixMultiply(const rs_matrix3x3 *m, float3 in); -00487 -00491 _RS_RUNTIME float3 __attribute__((overloadable)) -00492 rsMatrixMultiply(const rs_matrix3x3 *m, float2 in); -00493 -00497 _RS_RUNTIME float2 __attribute__((overloadable)) -00498 rsMatrixMultiply(const rs_matrix2x2 *m, float2 in); -00499 #endif -00500 -00501 -00509 extern bool __attribute__((overloadable)) rsMatrixInverse(rs_matrix4x4 *m); -00510 -00519 extern bool __attribute__((overloadable)) rsMatrixInverseTranspose(rs_matrix4x4 *m); -00520 -00526 extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix4x4 *m); -00530 extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix3x3 *m); -00534 extern void __attribute__((overloadable)) rsMatrixTranspose(rs_matrix2x2 *m); -00535 -00536 -00537 #endif -
-Functions | |
| uint32_t | rsgMeshGetVertexAllocationCount (rs_mesh m) |
| uint32_t | rsgMeshGetPrimitiveCount (rs_mesh m) |
| rs_allocation | rsgMeshGetVertexAllocation (rs_mesh m, uint32_t index) |
| rs_allocation | rsgMeshGetIndexAllocation (rs_mesh m, uint32_t index) |
| rs_primitive | rsgMeshGetPrimitive (rs_mesh m, uint32_t index) |
Mesh routines.
- -Definition in file rs_mesh.rsh.
-| rs_allocation rsgMeshGetIndexAllocation | -( | -rs_mesh | -m, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
Returns an allocation containing index data or a null allocation if only the primitive is specified
-| m | mesh to get data from |
| index | index of the index allocation |
| rs_primitive rsgMeshGetPrimitive | -( | -rs_mesh | -m, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
Returns the primitive describing how a part of the mesh is rendered
-| m | mesh to get data from |
| index | index of the primitive |
Meshes could have multiple index sets, this function returns the number.
-| m | mesh to get data from |
| rs_allocation rsgMeshGetVertexAllocation | -( | -rs_mesh | -m, | -
| - | - | uint32_t | -index | -
| - | ) | -- |
Returns an allocation that is part of the mesh and contains vertex data, e.g. positions, normals, texcoords
-| m | mesh to get data from |
| index | index of the vertex allocation |
00001 /* -00002 * Copyright (C) 2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_MESH_RSH__ -00024 #define __RS_MESH_RSH__ -00025 -00026 // New API's -00027 #if (defined(RS_VERSION) && (RS_VERSION >= 16)) -00028 -00037 extern uint32_t __attribute__((overloadable)) -00038 rsgMeshGetVertexAllocationCount(rs_mesh m); -00039 -00049 extern uint32_t __attribute__((overloadable)) -00050 rsgMeshGetPrimitiveCount(rs_mesh m); -00051 -00060 extern rs_allocation __attribute__((overloadable)) -00061 rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index); -00062 -00071 extern rs_allocation __attribute__((overloadable)) -00072 rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index); -00073 -00082 extern rs_primitive __attribute__((overloadable)) -00083 rsgMeshGetPrimitive(rs_mesh m, uint32_t index); -00084 -00085 #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) -00086 -00087 #endif // __RS_MESH_RSH__ -00088 -
Object routines.
- -Definition in file rs_object.rsh.
-| void rsClearObject | -( | -rs_element * | -dst | ) | -- |
Sets the object to NULL.
-| void rsClearObject | -( | -rs_type * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_allocation * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_sampler * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_script * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_path * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_mesh * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_program_fragment * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_program_vertex * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_program_raster * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_program_store * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsClearObject | -( | -rs_font * | -dst | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_element | -) | -- |
Tests if the object is valid. Returns true if the object is valid, false if it is NULL.
-| bool rsIsObject | -( | -rs_type | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_allocation | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_sampler | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_script | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_path | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_mesh | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_program_fragment | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_program_vertex | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_program_raster | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_program_store | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| bool rsIsObject | -( | -rs_font | -) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_element * | -dst, | -
| - | - | rs_element | -src | -
| - | ) | -- |
Copy reference to the specified object.
-| dst | |
| src |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_allocation * | -dst, | -
| - | - | rs_allocation | -src | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_sampler * | -dst, | -
| - | - | rs_sampler | -src | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_program_fragment * | -dst, | -
| - | - | rs_program_fragment | -src | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_program_vertex * | -dst, | -
| - | - | rs_program_vertex | -src | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_program_raster * | -dst, | -
| - | - | rs_program_raster | -src | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -| void rsSetObject | -( | -rs_program_store * | -dst, | -
| - | - | rs_program_store | -src | -
| - | ) | -- |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- -00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_OBJECT_RSH__ -00024 #define __RS_OBJECT_RSH__ -00025 -00026 -00033 extern void __attribute__((overloadable)) -00034 rsSetObject(rs_element *dst, rs_element src); -00038 extern void __attribute__((overloadable)) -00039 rsSetObject(rs_type *dst, rs_type src); -00043 extern void __attribute__((overloadable)) -00044 rsSetObject(rs_allocation *dst, rs_allocation src); -00048 extern void __attribute__((overloadable)) -00049 rsSetObject(rs_sampler *dst, rs_sampler src); -00053 extern void __attribute__((overloadable)) -00054 rsSetObject(rs_script *dst, rs_script src); -00058 extern void __attribute__((overloadable)) -00059 rsSetObject(rs_path *dst, rs_path src); -00063 extern void __attribute__((overloadable)) -00064 rsSetObject(rs_mesh *dst, rs_mesh src); -00068 extern void __attribute__((overloadable)) -00069 rsSetObject(rs_program_fragment *dst, rs_program_fragment src); -00073 extern void __attribute__((overloadable)) -00074 rsSetObject(rs_program_vertex *dst, rs_program_vertex src); -00078 extern void __attribute__((overloadable)) -00079 rsSetObject(rs_program_raster *dst, rs_program_raster src); -00083 extern void __attribute__((overloadable)) -00084 rsSetObject(rs_program_store *dst, rs_program_store src); -00088 extern void __attribute__((overloadable)) -00089 rsSetObject(rs_font *dst, rs_font src); -00090 -00096 extern void __attribute__((overloadable)) -00097 rsClearObject(rs_element *dst); -00101 extern void __attribute__((overloadable)) -00102 rsClearObject(rs_type *dst); -00106 extern void __attribute__((overloadable)) -00107 rsClearObject(rs_allocation *dst); -00111 extern void __attribute__((overloadable)) -00112 rsClearObject(rs_sampler *dst); -00116 extern void __attribute__((overloadable)) -00117 rsClearObject(rs_script *dst); -00121 extern void __attribute__((overloadable)) -00122 rsClearObject(rs_path *dst); -00126 extern void __attribute__((overloadable)) -00127 rsClearObject(rs_mesh *dst); -00131 extern void __attribute__((overloadable)) -00132 rsClearObject(rs_program_fragment *dst); -00136 extern void __attribute__((overloadable)) -00137 rsClearObject(rs_program_vertex *dst); -00141 extern void __attribute__((overloadable)) -00142 rsClearObject(rs_program_raster *dst); -00146 extern void __attribute__((overloadable)) -00147 rsClearObject(rs_program_store *dst); -00151 extern void __attribute__((overloadable)) -00152 rsClearObject(rs_font *dst); -00153 -00154 -00155 -00162 extern bool __attribute__((overloadable)) -00163 rsIsObject(rs_element); -00167 extern bool __attribute__((overloadable)) -00168 rsIsObject(rs_type); -00172 extern bool __attribute__((overloadable)) -00173 rsIsObject(rs_allocation); -00177 extern bool __attribute__((overloadable)) -00178 rsIsObject(rs_sampler); -00182 extern bool __attribute__((overloadable)) -00183 rsIsObject(rs_script); -00187 extern bool __attribute__((overloadable)) -00188 rsIsObject(rs_path); -00192 extern bool __attribute__((overloadable)) -00193 rsIsObject(rs_mesh); -00197 extern bool __attribute__((overloadable)) -00198 rsIsObject(rs_program_fragment); -00202 extern bool __attribute__((overloadable)) -00203 rsIsObject(rs_program_vertex); -00207 extern bool __attribute__((overloadable)) -00208 rsIsObject(rs_program_raster); -00212 extern bool __attribute__((overloadable)) -00213 rsIsObject(rs_program_store); -00217 extern bool __attribute__((overloadable)) -00218 rsIsObject(rs_font); -00219 -00220 #endif -
-Functions | |
| rs_depth_func | rsgProgramStoreGetDepthFunc (rs_program_store ps) |
| bool | rsgProgramStoreIsDepthMaskEnabled (rs_program_store ps) |
| bool | rsgProgramStoreIsColorMaskRedEnabled (rs_program_store ps) |
| bool | rsgProgramStoreIsColorMaskGreenEnabled (rs_program_store ps) |
| bool | rsgProgramStoreIsColorMaskBlueEnabled (rs_program_store ps) |
| bool | rsgProgramStoreIsColorMaskAlphaEnabled (rs_program_store ps) |
| rs_blend_src_func | rsgProgramStoreGetBlendSrcFunc (rs_program_store ps) |
| rs_blend_dst_func | rsgProgramStoreGetBlendDstFunc (rs_program_store ps) |
| bool | rsgProgramStoreIsDitherEnabled (rs_program_store ps) |
| bool | rsgProgramRasterIsPointSpriteEnabled (rs_program_raster pr) |
| rs_cull_mode | rsgProgramRasterGetCullMode (rs_program_raster pr) |
Program object routines.
- -Definition in file rs_program.rsh.
-| rs_cull_mode rsgProgramRasterGetCullMode | -( | -rs_program_raster | -pr | ) | -- |
Get program raster cull mode
-| pr | program raster to query |
| bool rsgProgramRasterIsPointSpriteEnabled | -( | -rs_program_raster | -pr | ) | -- |
Get program raster point sprite state
-| pr | program raster to query |
| rs_blend_dst_func rsgProgramStoreGetBlendDstFunc | -( | -rs_program_store | -ps | ) | -- |
Get program store blend destination function
-| ps | program store to query |
| rs_blend_src_func rsgProgramStoreGetBlendSrcFunc | -( | -rs_program_store | -ps | ) | -- |
Get program store blend source function
-| ps | program store to query |
| rs_depth_func rsgProgramStoreGetDepthFunc | -( | -rs_program_store | -ps | ) | -- |
Get program store depth function
-| ps | program store to query |
| bool rsgProgramStoreIsColorMaskAlphaEnabled | -( | -rs_program_store | -ps | ) | -- |
Get program store alpha component color mask
-| ps | program store to query |
| bool rsgProgramStoreIsColorMaskBlueEnabled | -( | -rs_program_store | -ps | ) | -- |
Get program store blur component color mask
-| ps | program store to query |
| bool rsgProgramStoreIsColorMaskGreenEnabled | -( | -rs_program_store | -ps | ) | -- |
Get program store green component color mask
-| ps | program store to query |
| bool rsgProgramStoreIsColorMaskRedEnabled | -( | -rs_program_store | -ps | ) | -- |
Get program store red component color mask
-| ps | program store to query |
| bool rsgProgramStoreIsDepthMaskEnabled | -( | -rs_program_store | -ps | ) | -- |
Get program store depth mask
-| ps | program store to query |
| bool rsgProgramStoreIsDitherEnabled | -( | -rs_program_store | -ps | ) | -- |
Get program store dither state
-| ps | program store to query |
00001 /* -00002 * Copyright (C) 2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_PROGRAM_RSH__ -00024 #define __RS_PROGRAM_RSH__ -00025 -00026 #if (defined(RS_VERSION) && (RS_VERSION >= 16)) -00027 -00033 extern rs_depth_func __attribute__((overloadable)) -00034 rsgProgramStoreGetDepthFunc(rs_program_store ps); -00035 -00041 extern bool __attribute__((overloadable)) -00042 rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps); -00048 extern bool __attribute__((overloadable)) -00049 rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps); -00050 -00056 extern bool __attribute__((overloadable)) -00057 rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps); -00058 -00064 extern bool __attribute__((overloadable)) -00065 rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps); -00066 -00072 extern bool __attribute__((overloadable)) -00073 rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps); -00074 -00080 extern rs_blend_src_func __attribute__((overloadable)) -00081 rsgProgramStoreGetBlendSrcFunc(rs_program_store ps); -00082 -00088 extern rs_blend_dst_func __attribute__((overloadable)) -00089 rsgProgramStoreGetBlendDstFunc(rs_program_store ps); -00090 -00096 extern bool __attribute__((overloadable)) -00097 rsgProgramStoreIsDitherEnabled(rs_program_store ps); -00098 -00104 extern bool __attribute__((overloadable)) -00105 rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr); -00106 -00112 extern rs_cull_mode __attribute__((overloadable)) -00113 rsgProgramRasterGetCullMode(rs_program_raster pr); -00114 -00115 #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) -00116 -00117 #endif // __RS_PROGRAM_RSH__ -00118 -
-Functions | |
| static void | rsQuaternionSet (rs_quaternion *q, float w, float x, float y, float z) |
| static void | rsQuaternionSet (rs_quaternion *q, const rs_quaternion *rhs) |
| static void | rsQuaternionMultiply (rs_quaternion *q, float s) |
| static void | rsQuaternionAdd (rs_quaternion *q, const rs_quaternion *rhs) |
| static void | rsQuaternionLoadRotateUnit (rs_quaternion *q, float rot, float x, float y, float z) |
| static void | rsQuaternionLoadRotate (rs_quaternion *q, float rot, float x, float y, float z) |
| static void | rsQuaternionConjugate (rs_quaternion *q) |
| static float | rsQuaternionDot (const rs_quaternion *q0, const rs_quaternion *q1) |
| static void | rsQuaternionNormalize (rs_quaternion *q) |
| static void | rsQuaternionMultiply (rs_quaternion *q, const rs_quaternion *rhs) |
| static void | rsQuaternionSlerp (rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t) |
| static void | rsQuaternionGetMatrixUnit (rs_matrix4x4 *m, const rs_quaternion *q) |
Quaternion routines.
- -Definition in file rs_quaternion.rsh.
-| static void rsQuaternionAdd | -( | -rs_quaternion * | -q, | -
| - | - | const rs_quaternion * | -rhs | -
| - | ) | - [static] |
-
Add two quaternions
-| q | destination quaternion to add to |
| rsh | right hand side quaternion to add |
Definition at line 74 of file rs_quaternion.rsh.
- -| static void rsQuaternionConjugate | -( | -rs_quaternion * | -q | ) | - [static] |
-
Conjugates the quaternion
-| q | quaternion to conjugate |
Definition at line 127 of file rs_quaternion.rsh.
- -| static float rsQuaternionDot | -( | -const rs_quaternion * | -q0, | -
| - | - | const rs_quaternion * | -q1 | -
| - | ) | - [static] |
-
Dot product of two quaternions
-| q0 | first quaternion |
| q1 | second quaternion |
Definition at line 140 of file rs_quaternion.rsh.
- -| static void rsQuaternionGetMatrixUnit | -( | -rs_matrix4x4 * | -m, | -
| - | - | const rs_quaternion * | -q | -
| - | ) | - [static] |
-
Computes rotation matrix from the normalized quaternion
-| m | resulting matrix |
| p | normalized quaternion |
Definition at line 228 of file rs_quaternion.rsh.
- -| static void rsQuaternionLoadRotate | -( | -rs_quaternion * | -q, | -
| - | - | float | -rot, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | - [static] |
-
Loads a quaternion that represents a rotation about an arbitrary vector (doesn't have to be unit)
-| q | quaternion to set |
| rot | angle to rotate by |
| x | component of a vector |
| y | component of a vector |
| x | component of a vector |
Definition at line 111 of file rs_quaternion.rsh.
- -| static void rsQuaternionLoadRotateUnit | -( | -rs_quaternion * | -q, | -
| - | - | float | -rot, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | - [static] |
-
Loads a quaternion that represents a rotation about an arbitrary unit vector
-| q | quaternion to set |
| rot | angle to rotate by |
| x | component of a vector |
| y | component of a vector |
| x | component of a vector |
Definition at line 90 of file rs_quaternion.rsh.
- -| static void rsQuaternionMultiply | -( | -rs_quaternion * | -q, | -
| - | - | float | -s | -
| - | ) | - [static] |
-
Multiply quaternion by a scalar
-| q | quaternion to multiply |
| s | scalar |
Definition at line 61 of file rs_quaternion.rsh.
- -| static void rsQuaternionMultiply | -( | -rs_quaternion * | -q, | -
| - | - | const rs_quaternion * | -rhs | -
| - | ) | - [static] |
-
Multiply quaternion by another quaternion
-| q | destination quaternion |
| rhs | right hand side quaternion to multiply by |
Definition at line 163 of file rs_quaternion.rsh.
- -| static void rsQuaternionNormalize | -( | -rs_quaternion * | -q | ) | - [static] |
-
Normalizes the quaternion
-| q | quaternion to normalize |
Definition at line 149 of file rs_quaternion.rsh.
- -| static void rsQuaternionSet | -( | -rs_quaternion * | -q, | -
| - | - | float | -w, | -
| - | - | float | -x, | -
| - | - | float | -y, | -
| - | - | float | -z | -
| - | ) | - [static] |
-
Set the quaternion components
-| w | component |
| x | component |
| y | component |
| z | component |
Definition at line 35 of file rs_quaternion.rsh.
- -| static void rsQuaternionSet | -( | -rs_quaternion * | -q, | -
| - | - | const rs_quaternion * | -rhs | -
| - | ) | - [static] |
-
Set the quaternion from another quaternion
-| q | destination quaternion |
| rhs | source quaternion |
Definition at line 48 of file rs_quaternion.rsh.
- -| static void rsQuaternionSlerp | -( | -rs_quaternion * | -q, | -
| - | - | const rs_quaternion * | -q0, | -
| - | - | const rs_quaternion * | -q1, | -
| - | - | float | -t | -
| - | ) | - [static] |
-
Performs spherical linear interpolation between two quaternions
-| q | result quaternion from interpolation |
| q0 | first param |
| q1 | second param |
| t | how much to interpolate by |
Definition at line 182 of file rs_quaternion.rsh.
- -00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_QUATERNION_RSH__ -00024 #define __RS_QUATERNION_RSH__ -00025 -00026 -00034 static void __attribute__((overloadable)) -00035 rsQuaternionSet(rs_quaternion *q, float w, float x, float y, float z) { -00036 q->w = w; -00037 q->x = x; -00038 q->y = y; -00039 q->z = z; -00040 } -00041 -00047 static void __attribute__((overloadable)) -00048 rsQuaternionSet(rs_quaternion *q, const rs_quaternion *rhs) { -00049 q->w = rhs->w; -00050 q->x = rhs->x; -00051 q->y = rhs->y; -00052 q->z = rhs->z; -00053 } -00054 -00060 static void __attribute__((overloadable)) -00061 rsQuaternionMultiply(rs_quaternion *q, float s) { -00062 q->w *= s; -00063 q->x *= s; -00064 q->y *= s; -00065 q->z *= s; -00066 } -00067 -00073 static void -00074 rsQuaternionAdd(rs_quaternion *q, const rs_quaternion *rhs) { -00075 q->w *= rhs->w; -00076 q->x *= rhs->x; -00077 q->y *= rhs->y; -00078 q->z *= rhs->z; -00079 } -00080 -00089 static void -00090 rsQuaternionLoadRotateUnit(rs_quaternion *q, float rot, float x, float y, float z) { -00091 rot *= (float)(M_PI / 180.0f) * 0.5f; -00092 float c = cos(rot); -00093 float s = sin(rot); -00094 -00095 q->w = c; -00096 q->x = x * s; -00097 q->y = y * s; -00098 q->z = z * s; -00099 } -00100 -00110 static void -00111 rsQuaternionLoadRotate(rs_quaternion *q, float rot, float x, float y, float z) { -00112 const float len = x*x + y*y + z*z; -00113 if (len != 1) { -00114 const float recipLen = 1.f / sqrt(len); -00115 x *= recipLen; -00116 y *= recipLen; -00117 z *= recipLen; -00118 } -00119 rsQuaternionLoadRotateUnit(q, rot, x, y, z); -00120 } -00121 -00126 static void -00127 rsQuaternionConjugate(rs_quaternion *q) { -00128 q->x = -q->x; -00129 q->y = -q->y; -00130 q->z = -q->z; -00131 } -00132 -00139 static float -00140 rsQuaternionDot(const rs_quaternion *q0, const rs_quaternion *q1) { -00141 return q0->w*q1->w + q0->x*q1->x + q0->y*q1->y + q0->z*q1->z; -00142 } -00143 -00148 static void -00149 rsQuaternionNormalize(rs_quaternion *q) { -00150 const float len = rsQuaternionDot(q, q); -00151 if (len != 1) { -00152 const float recipLen = 1.f / sqrt(len); -00153 rsQuaternionMultiply(q, recipLen); -00154 } -00155 } -00156 -00162 static void __attribute__((overloadable)) -00163 rsQuaternionMultiply(rs_quaternion *q, const rs_quaternion *rhs) { -00164 rs_quaternion qtmp; -00165 rsQuaternionSet(&qtmp, q); -00166 -00167 q->w = qtmp.w*rhs->w - qtmp.x*rhs->x - qtmp.y*rhs->y - qtmp.z*rhs->z; -00168 q->x = qtmp.w*rhs->x + qtmp.x*rhs->w + qtmp.y*rhs->z - qtmp.z*rhs->y; -00169 q->y = qtmp.w*rhs->y + qtmp.y*rhs->w + qtmp.z*rhs->x - qtmp.x*rhs->z; -00170 q->z = qtmp.w*rhs->z + qtmp.z*rhs->w + qtmp.x*rhs->y - qtmp.y*rhs->x; -00171 rsQuaternionNormalize(q); -00172 } -00173 -00181 static void -00182 rsQuaternionSlerp(rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t) { -00183 if (t <= 0.0f) { -00184 rsQuaternionSet(q, q0); -00185 return; -00186 } -00187 if (t >= 1.0f) { -00188 rsQuaternionSet(q, q1); -00189 return; -00190 } -00191 -00192 rs_quaternion tempq0, tempq1; -00193 rsQuaternionSet(&tempq0, q0); -00194 rsQuaternionSet(&tempq1, q1); -00195 -00196 float angle = rsQuaternionDot(q0, q1); -00197 if (angle < 0) { -00198 rsQuaternionMultiply(&tempq0, -1.0f); -00199 angle *= -1.0f; -00200 } -00201 -00202 float scale, invScale; -00203 if (angle + 1.0f > 0.05f) { -00204 if (1.0f - angle >= 0.05f) { -00205 float theta = acos(angle); -00206 float invSinTheta = 1.0f / sin(theta); -00207 scale = sin(theta * (1.0f - t)) * invSinTheta; -00208 invScale = sin(theta * t) * invSinTheta; -00209 } else { -00210 scale = 1.0f - t; -00211 invScale = t; -00212 } -00213 } else { -00214 rsQuaternionSet(&tempq1, tempq0.z, -tempq0.y, tempq0.x, -tempq0.w); -00215 scale = sin(M_PI * (0.5f - t)); -00216 invScale = sin(M_PI * t); -00217 } -00218 -00219 rsQuaternionSet(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale, -00220 tempq0.y*scale + tempq1.y*invScale, tempq0.z*scale + tempq1.z*invScale); -00221 } -00222 -00228 static void rsQuaternionGetMatrixUnit(rs_matrix4x4 *m, const rs_quaternion *q) { -00229 float xx = q->x * q->x; -00230 float xy = q->x * q->y; -00231 float xz = q->x * q->z; -00232 float xw = q->x * q->w; -00233 float yy = q->y * q->y; -00234 float yz = q->y * q->z; -00235 float yw = q->y * q->w; -00236 float zz = q->z * q->z; -00237 float zw = q->z * q->w; -00238 -00239 m->m[0] = 1.0f - 2.0f * ( yy + zz ); -00240 m->m[4] = 2.0f * ( xy - zw ); -00241 m->m[8] = 2.0f * ( xz + yw ); -00242 m->m[1] = 2.0f * ( xy + zw ); -00243 m->m[5] = 1.0f - 2.0f * ( xx + zz ); -00244 m->m[9] = 2.0f * ( yz - xw ); -00245 m->m[2] = 2.0f * ( xz - yw ); -00246 m->m[6] = 2.0f * ( yz + xw ); -00247 m->m[10] = 1.0f - 2.0f * ( xx + yy ); -00248 m->m[3] = m->m[7] = m->m[11] = m->m[12] = m->m[13] = m->m[14] = 0.0f; -00249 m->m[15] = 1.0f; -00250 } -00251 -00252 #endif -00253 -
-Functions | |
| rs_sampler_value | rsSamplerGetMinification (rs_sampler s) |
| rs_sampler_value | rsSamplerGetMagnification (rs_sampler s) |
| rs_sampler_value | rsSamplerGetWrapS (rs_sampler s) |
| rs_sampler_value | rsSamplerGetWrapT (rs_sampler s) |
| float | rsSamplerGetAnisotropy (rs_sampler s) |
Sampler routines.
- -Definition in file rs_sampler.rsh.
-| float rsSamplerGetAnisotropy | -( | -rs_sampler | -s | ) | -- |
Get sampler anisotropy
-| s | sampler to query |
| rs_sampler_value rsSamplerGetMagnification | -( | -rs_sampler | -s | ) | -- |
Get sampler magnification value
-| s | sampler to query |
| rs_sampler_value rsSamplerGetMinification | -( | -rs_sampler | -s | ) | -- |
Get sampler minification value
-| s | sampler to query |
| rs_sampler_value rsSamplerGetWrapS | -( | -rs_sampler | -s | ) | -- |
Get sampler wrap S value
-| s | sampler to query |
| rs_sampler_value rsSamplerGetWrapT | -( | -rs_sampler | -s | ) | -- |
Get sampler wrap T value
-| s | sampler to query |
00001 /* -00002 * Copyright (C) 2012 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00023 #ifndef __RS_SAMPLER_RSH__ -00024 #define __RS_SAMPLER_RSH__ -00025 -00026 // New API's -00027 #if (defined(RS_VERSION) && (RS_VERSION >= 16)) -00028 -00035 extern rs_sampler_value __attribute__((overloadable)) -00036 rsSamplerGetMinification(rs_sampler s); -00037 -00044 extern rs_sampler_value __attribute__((overloadable)) -00045 rsSamplerGetMagnification(rs_sampler s); -00046 -00053 extern rs_sampler_value __attribute__((overloadable)) -00054 rsSamplerGetWrapS(rs_sampler s); -00055 -00062 extern rs_sampler_value __attribute__((overloadable)) -00063 rsSamplerGetWrapT(rs_sampler s); -00064 -00071 extern float __attribute__((overloadable)) -00072 rsSamplerGetAnisotropy(rs_sampler s); -00073 -00074 #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) -00075 -00076 #endif // __RS_SAMPLER_RSH__ -00077 -
-Data Structures | |
| struct | rs_tm |
-Typedefs | |
| typedef int | rs_time_t |
-Functions | |
| rs_time_t | rsTime (rs_time_t *timer) |
| rs_tm * | rsLocaltime (rs_tm *local, const rs_time_t *timer) |
| int64_t | rsUptimeMillis (void) |
| int64_t | rsUptimeNanos (void) |
| float | rsGetDt (void) |
RenderScript time routines.
-This file contains RenderScript functions relating to time and date manipulation.
- -Definition in file rs_time.rsh.
-| typedef int rs_time_t | -
Calendar time interpreted as seconds elapsed since the Epoch (00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)).
- -Definition at line 31 of file rs_time.rsh.
- -| float rsGetDt | -( | -void | -) | -- |
Returns the time in seconds since this function was last called in this script.
-| rs_tm* rsLocaltime | -( | -rs_tm * | -local, | -
| - | - | const rs_time_t * | -timer | -
| - | ) | -- |
Converts the time specified by timer into broken-down time and stores it in local. This function also returns a pointer to local. If local is NULL, this function does nothing and returns NULL.
| local | Broken-down time. |
| timer | Input time as calendar time. |
local). Returns the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970). If timer is non-NULL, the result is also stored in the memory pointed to by this variable. If an error occurs, a value of -1 is returned.
| timer | Location to also store the returned calendar time. |
| int64_t rsUptimeMillis | -( | -void | -) | -- |
Returns the current system clock (uptime) in milliseconds.
-| int64_t rsUptimeNanos | -( | -void | -) | -- |
Returns the current system clock (uptime) in nanoseconds.
-00001 /* -00002 * Copyright (C) 2011 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00024 #ifndef __RS_TIME_RSH__ -00025 #define __RS_TIME_RSH__ -00026 -00031 typedef int rs_time_t; -00032 -00049 typedef struct { -00050 int tm_sec; -00051 int tm_min; -00052 int tm_hour; -00053 int tm_mday; -00054 int tm_mon; -00055 int tm_year; -00056 int tm_wday; -00057 int tm_yday; -00058 int tm_isdst; -00059 } rs_tm; -00060 -00070 extern rs_time_t __attribute__((overloadable)) -00071 rsTime(rs_time_t *timer); -00072 -00083 extern rs_tm * __attribute__((overloadable)) -00084 rsLocaltime(rs_tm *local, const rs_time_t *timer); -00085 -00091 extern int64_t __attribute__((overloadable)) -00092 rsUptimeMillis(void); -00093 -00099 extern int64_t __attribute__((overloadable)) -00100 rsUptimeNanos(void); -00101 -00108 extern float __attribute__((overloadable)) -00109 rsGetDt(void); -00110 -00111 #endif -
#include "stdbool.h"-Data Structures | |
| struct | rs_element |
| Opaque handle to a RenderScript element. More... | |
| struct | rs_type |
| Opaque handle to a RenderScript type. More... | |
| struct | rs_allocation |
| Opaque handle to a RenderScript allocation. More... | |
| struct | rs_sampler |
| Opaque handle to a RenderScript sampler object. More... | |
| struct | rs_script |
| Opaque handle to a RenderScript script object. More... | |
| struct | rs_mesh |
| Opaque handle to a RenderScript mesh object. More... | |
| struct | rs_path |
| Opaque handle to a RenderScript Path object. More... | |
| struct | rs_program_fragment |
| Opaque handle to a RenderScript ProgramFragment object. More... | |
| struct | rs_program_vertex |
| Opaque handle to a RenderScript ProgramVertex object. More... | |
| struct | rs_program_raster |
| Opaque handle to a RenderScript ProgramRaster object. More... | |
| struct | rs_program_store |
| Opaque handle to a RenderScript ProgramStore object. More... | |
| struct | rs_font |
| Opaque handle to a RenderScript font object. More... | |
| struct | rs_matrix4x4 |
| 4x4 float matrix More... | |
| struct | rs_matrix3x3 |
| 3x3 float matrix More... | |
| struct | rs_matrix2x2 |
| 2x2 float matrix More... | |
-Typedefs | |
| typedef char | int8_t |
| typedef short | int16_t |
| typedef int | int32_t |
| typedef long long | int64_t |
| typedef unsigned char | uint8_t |
| typedef unsigned short | uint16_t |
| typedef unsigned int | uint32_t |
| typedef unsigned long long | uint64_t |
| typedef uint8_t | uchar |
| typedef uint16_t | ushort |
| typedef uint32_t | uint |
| typedef uint64_t | ulong |
| typedef uint32_t | size_t |
| typedef int32_t | ssize_t |
| typedef float | float2 |
| typedef float | float3 |
| typedef float | float4 |
| typedef double | double2 |
| typedef double | double3 |
| typedef double | double4 |
| typedef uchar | uchar2 |
| typedef uchar | uchar3 |
| typedef uchar | uchar4 |
| typedef ushort | ushort2 |
| typedef ushort | ushort3 |
| typedef ushort | ushort4 |
| typedef uint | uint2 |
| typedef uint | uint3 |
| typedef uint | uint4 |
| typedef ulong | ulong2 |
| typedef ulong | ulong3 |
| typedef ulong | ulong4 |
| typedef char | char2 |
| typedef char | char3 |
| typedef char | char4 |
| typedef short | short2 |
| typedef short | short3 |
| typedef short | short4 |
| typedef int | int2 |
| typedef int | int3 |
| typedef int | int4 |
| typedef long | long2 |
| typedef long | long3 |
| typedef long | long4 |
| typedef float4 | rs_quaternion |
-Enumerations | |
| enum | rs_allocation_cubemap_face |
| Enum for selecting cube map faces. | |
| enum | rs_allocation_usage_type |
| Bitfield to specify the usage types for an allocation. More... | |
| enum | rs_primitive { - RS_PRIMITIVE_POINT = 0, -RS_PRIMITIVE_LINE = 1, -RS_PRIMITIVE_LINE_STRIP = 2, -RS_PRIMITIVE_TRIANGLE = 3, - - RS_PRIMITIVE_TRIANGLE_STRIP = 4, -RS_PRIMITIVE_TRIANGLE_FAN = 5, -RS_PRIMITIVE_INVALID = 100 - - } |
| enum | rs_data_type |
| Enumeration for possible element data types. More... | |
| enum | rs_data_kind |
| Enumeration for possible element data kind. More... | |
| enum | rs_depth_func { - RS_DEPTH_FUNC_ALWAYS = 0, -RS_DEPTH_FUNC_LESS = 1, -RS_DEPTH_FUNC_LEQUAL = 2, -RS_DEPTH_FUNC_GREATER = 3, - - RS_DEPTH_FUNC_GEQUAL = 4, -RS_DEPTH_FUNC_EQUAL = 5, -RS_DEPTH_FUNC_NOTEQUAL = 6, -RS_DEPTH_FUNC_INVALID = 100 - - } |
Define the standard RenderScript types
-Integers 8 bit: char, int8_t 16 bit: short, int16_t 32 bit: int, in32_t 64 bit: long, long long, int64_t
-Unsigned Integers 8 bit: uchar, uint8_t 16 bit: ushort, uint16_t 32 bit: uint, uint32_t 64 bit: ulong, uint64_t
-Floating point 32 bit: float 64 bit: double
-Vectors of length 2, 3, and 4 are supported for all the types above.
- -Definition in file rs_types.rsh.
-| typedef char char2 | -
Vector version of the basic char type. Provides two char fields packed into a single 16 bit field with 16 bit alignment.
- -Definition at line 292 of file rs_types.rsh.
- -| typedef char char3 | -
Vector version of the basic char type. Provides three char fields packed into a single 32 bit field with 32 bit alignment.
- -Definition at line 297 of file rs_types.rsh.
- -| typedef char char4 | -
Vector version of the basic char type. Provides four char fields packed into a single 32 bit field with 32 bit alignment.
- -Definition at line 302 of file rs_types.rsh.
- -| typedef double double2 | -
Vector version of the basic double type. Provides two double fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 212 of file rs_types.rsh.
- -| typedef double double3 | -
Vector version of the basic double type. Provides three double fields packed into a single 256 bit field with 256 bit alignment.
- -Definition at line 217 of file rs_types.rsh.
- -| typedef double double4 | -
Vector version of the basic double type. Provides four double fields packed into a single 256 bit field with 256 bit alignment.
- -Definition at line 222 of file rs_types.rsh.
- -| typedef float float2 | -
Vector version of the basic float type. Provides two float fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 195 of file rs_types.rsh.
- -| typedef float float3 | -
Vector version of the basic float type. Provides three float fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 200 of file rs_types.rsh.
- -| typedef float float4 | -
Vector version of the basic float type. Provides four float fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 206 of file rs_types.rsh.
- -| typedef short int16_t | -
16 bit integer type
- -Definition at line 67 of file rs_types.rsh.
- -| typedef int int2 | -
Vector version of the basic int type. Provides two int fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 324 of file rs_types.rsh.
- -| typedef int int3 | -
Vector version of the basic int type. Provides three int fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 329 of file rs_types.rsh.
- -| typedef int int32_t | -
32 bit integer type
- -Definition at line 71 of file rs_types.rsh.
- -| typedef int int4 | -
Vector version of the basic int type. Provides two four fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 334 of file rs_types.rsh.
- -| typedef long long int64_t | -
64 bit integer type
- -Definition at line 75 of file rs_types.rsh.
- -| typedef char int8_t | -
8 bit integer type
- -Definition at line 63 of file rs_types.rsh.
- -| typedef long long2 | -
Vector version of the basic long type. Provides two long fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 340 of file rs_types.rsh.
- -| typedef long long3 | -
Vector version of the basic long type. Provides three long fields packed into a single 256 bit field with 256 bit alignment.
- -Definition at line 345 of file rs_types.rsh.
- -| typedef long long4 | -
Vector version of the basic long type. Provides four long fields packed into a single 256 bit field with 256 bit alignment.
- -Definition at line 350 of file rs_types.rsh.
- -| typedef float4 rs_quaternion | -
quaternion type for use with the quaternion functions
- -Definition at line 383 of file rs_types.rsh.
- -| typedef short short2 | -
Vector version of the basic short type. Provides two short fields packed into a single 32 bit field with 32 bit alignment.
- -Definition at line 308 of file rs_types.rsh.
- -| typedef short short3 | -
Vector version of the basic short type. Provides three short fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 313 of file rs_types.rsh.
- -| typedef short short4 | -
Vector version of the basic short type. Provides four short fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 318 of file rs_types.rsh.
- -Typedef for unsigned int
- -Definition at line 111 of file rs_types.rsh.
- -Typedef for int (use for 32-bit integers)
- -Definition at line 115 of file rs_types.rsh.
- -8 bit unsigned integer type
- -Definition at line 95 of file rs_types.rsh.
- -Vector version of the basic uchar type. Provides two uchar fields packed into a single 16 bit field with 16 bit alignment.
- -Definition at line 228 of file rs_types.rsh.
- -Vector version of the basic uchar type. Provides three uchar fields packed into a single 32 bit field with 32 bit alignment.
- -Definition at line 233 of file rs_types.rsh.
- -Vector version of the basic uchar type. Provides four uchar fields packed into a single 32 bit field with 32 bit alignment.
- -Definition at line 238 of file rs_types.rsh.
- -32 bit unsigned integer type
- -Definition at line 103 of file rs_types.rsh.
- -| typedef unsigned short uint16_t | -
16 bit unsigned integer type
- -Definition at line 83 of file rs_types.rsh.
- -Vector version of the basic uint type. Provides two uint fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 260 of file rs_types.rsh.
- -Vector version of the basic uint type. Provides three uint fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 265 of file rs_types.rsh.
- -| typedef unsigned int uint32_t | -
32 bit unsigned integer type
- -Definition at line 87 of file rs_types.rsh.
- -Vector version of the basic uint type. Provides four uint fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 270 of file rs_types.rsh.
- -| typedef unsigned long long uint64_t | -
64 bit unsigned integer type
- -Definition at line 91 of file rs_types.rsh.
- -| typedef unsigned char uint8_t | -
8 bit unsigned integer type
- -Definition at line 79 of file rs_types.rsh.
- -Typedef for unsigned long (use for 64-bit unsigned integers)
- -Definition at line 107 of file rs_types.rsh.
- -Vector version of the basic ulong type. Provides two ulong fields packed into a single 128 bit field with 128 bit alignment.
- -Definition at line 276 of file rs_types.rsh.
- -Vector version of the basic ulong type. Provides three ulong fields packed into a single 256 bit field with 256 bit alignment.
- -Definition at line 281 of file rs_types.rsh.
- -Vector version of the basic ulong type. Provides four ulong fields packed into a single 256 bit field with 256 bit alignment.
- -Definition at line 286 of file rs_types.rsh.
- -16 bit unsigned integer type
- -Definition at line 99 of file rs_types.rsh.
- -Vector version of the basic ushort type. Provides two ushort fields packed into a single 32 bit field with 32 bit alignment.
- -Definition at line 244 of file rs_types.rsh.
- -Vector version of the basic ushort type. Provides three ushort fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 249 of file rs_types.rsh.
- -Vector version of the basic ushort type. Provides four ushort fields packed into a single 64 bit field with 64 bit alignment.
- -Definition at line 254 of file rs_types.rsh.
- -| enum rs_allocation_usage_type | -
Bitfield to specify the usage types for an allocation.
-These values are ORed together to specify which usages or memory spaces are relevant to an allocation or an operation on an allocation.
- -Definition at line 408 of file rs_types.rsh.
- -| enum rs_data_kind | -
Enumeration for possible element data kind.
-The special interpretation of the data if required. This is primarly useful for graphical data. USER indicates no special interpretation is expected. PIXEL is used in conjunction with the standard data types for representing texture formats.
- -Definition at line 524 of file rs_types.rsh.
- -| enum rs_data_type | -
Enumeration for possible element data types.
-DataType represents the basic type information for a basic element. The naming convention follows. For numeric types it is FLOAT, SIGNED, or UNSIGNED followed by the _BITS where BITS is the size of the data. BOOLEAN is a true / false (1,0) represented in an 8 bit container. The UNSIGNED variants with multiple bit definitions 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.
-MATRIX the three matrix types contain FLOAT_32 elements and are treated as 32 bits for alignment purposes.
-RS_* objects. 32 bit opaque handles.
- -Definition at line 478 of file rs_types.rsh.
- -| enum rs_depth_func | -
Definition at line 538 of file rs_types.rsh.
- -| enum rs_primitive | -
Describes the way mesh vertex data is interpreted when rendering
-Definition at line 425 of file rs_types.rsh.
- -00001 /* -00002 * Copyright (C) 2013 The Android Open Source Project -00003 * -00004 * Licensed under the Apache License, Version 2.0 (the "License"); -00005 * you may not use this file except in compliance with the License. -00006 * You may obtain a copy of the License at -00007 * -00008 * http://www.apache.org/licenses/LICENSE-2.0 -00009 * -00010 * Unless required by applicable law or agreed to in writing, software -00011 * distributed under the License is distributed on an "AS IS" BASIS, -00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -00013 * See the License for the specific language governing permissions and -00014 * limitations under the License. -00015 */ -00016 -00041 #ifndef __RS_TYPES_RSH__ -00042 #define __RS_TYPES_RSH__ -00043 -00044 /* Constants */ -00045 #define M_E 2.718281828459045235360287471352662498f /* e */ -00046 #define M_LOG2E 1.442695040888963407359924681001892137f /* log_2 e */ -00047 #define M_LOG10E 0.434294481903251827651128918916605082f /* log_10 e */ -00048 #define M_LN2 0.693147180559945309417232121458176568f /* log_e 2 */ -00049 #define M_LN10 2.302585092994045684017991454684364208f /* log_e 10 */ -00050 #define M_PI 3.141592653589793238462643383279502884f /* pi */ -00051 #define M_PI_2 1.570796326794896619231321691639751442f /* pi/2 */ -00052 #define M_PI_4 0.785398163397448309615660845819875721f /* pi/4 */ -00053 #define M_1_PI 0.318309886183790671537767526745028724f /* 1/pi */ -00054 #define M_2_PIl 0.636619772367581343075535053490057448f /* 2/pi */ -00055 #define M_2_SQRTPI 1.128379167095512573896158903121545172f /* 2/sqrt(pi) */ -00056 #define M_SQRT2 1.414213562373095048801688724209698079f /* sqrt(2) */ -00057 #define M_SQRT1_2 0.707106781186547524400844362104849039f /* 1/sqrt(2) */ -00058 -00059 #include "stdbool.h" -00063 typedef char int8_t; -00067 typedef short int16_t; -00071 typedef int int32_t; -00075 typedef long long int64_t; -00079 typedef unsigned char uint8_t; -00083 typedef unsigned short uint16_t; -00087 typedef unsigned int uint32_t; -00091 typedef unsigned long long uint64_t; -00095 typedef uint8_t uchar; -00099 typedef uint16_t ushort; -00103 typedef uint32_t uint; -00107 typedef uint64_t ulong; -00111 typedef uint32_t size_t; -00115 typedef int32_t ssize_t; -00116 -00122 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_element; -00128 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_type; -00134 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_allocation; -00140 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_sampler; -00146 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_script; -00152 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_mesh; -00158 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_path; -00164 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_fragment; -00170 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_vertex; -00176 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_raster; -00182 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_store; -00188 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_font; -00189 -00195 typedef float float2 __attribute__((ext_vector_type(2))); -00200 typedef float float3 __attribute__((ext_vector_type(3))); -00206 typedef float float4 __attribute__((ext_vector_type(4))); -00207 -00212 typedef double double2 __attribute__((ext_vector_type(2))); -00217 typedef double double3 __attribute__((ext_vector_type(3))); -00222 typedef double double4 __attribute__((ext_vector_type(4))); -00223 -00228 typedef uchar uchar2 __attribute__((ext_vector_type(2))); -00233 typedef uchar uchar3 __attribute__((ext_vector_type(3))); -00238 typedef uchar uchar4 __attribute__((ext_vector_type(4))); -00239 -00244 typedef ushort ushort2 __attribute__((ext_vector_type(2))); -00249 typedef ushort ushort3 __attribute__((ext_vector_type(3))); -00254 typedef ushort ushort4 __attribute__((ext_vector_type(4))); -00255 -00260 typedef uint uint2 __attribute__((ext_vector_type(2))); -00265 typedef uint uint3 __attribute__((ext_vector_type(3))); -00270 typedef uint uint4 __attribute__((ext_vector_type(4))); -00271 -00276 typedef ulong ulong2 __attribute__((ext_vector_type(2))); -00281 typedef ulong ulong3 __attribute__((ext_vector_type(3))); -00286 typedef ulong ulong4 __attribute__((ext_vector_type(4))); -00287 -00292 typedef char char2 __attribute__((ext_vector_type(2))); -00297 typedef char char3 __attribute__((ext_vector_type(3))); -00302 typedef char char4 __attribute__((ext_vector_type(4))); -00303 -00308 typedef short short2 __attribute__((ext_vector_type(2))); -00313 typedef short short3 __attribute__((ext_vector_type(3))); -00318 typedef short short4 __attribute__((ext_vector_type(4))); -00319 -00324 typedef int int2 __attribute__((ext_vector_type(2))); -00329 typedef int int3 __attribute__((ext_vector_type(3))); -00334 typedef int int4 __attribute__((ext_vector_type(4))); -00335 -00340 typedef long long2 __attribute__((ext_vector_type(2))); -00345 typedef long long3 __attribute__((ext_vector_type(3))); -00350 typedef long long4 __attribute__((ext_vector_type(4))); -00351 -00358 typedef struct { -00359 float m[16]; -00360 } rs_matrix4x4; -00367 typedef struct { -00368 float m[9]; -00369 } rs_matrix3x3; -00376 typedef struct { -00377 float m[4]; -00378 } rs_matrix2x2; -00379 -00383 typedef float4 rs_quaternion; -00384 -00385 #define RS_PACKED __attribute__((packed, aligned(4))) -00386 #define NULL ((void *)0) -00387 -00388 #if (defined(RS_VERSION) && (RS_VERSION >= 14)) -00389 -00393 typedef enum { -00394 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0, -00395 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1, -00396 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2, -00397 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3, -00398 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4, -00399 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5 -00400 } rs_allocation_cubemap_face; -00401 -00408 typedef enum { -00409 RS_ALLOCATION_USAGE_SCRIPT = 0x0001, -00410 RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, -00411 RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, -00412 RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, -00413 RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010 -00414 } rs_allocation_usage_type; -00415 -00416 #endif //defined(RS_VERSION) && (RS_VERSION >= 14) -00417 -00418 // New API's -00419 #if (defined(RS_VERSION) && (RS_VERSION >= 16)) -00420 -00425 typedef enum { -00429 RS_PRIMITIVE_POINT = 0, -00433 RS_PRIMITIVE_LINE = 1, -00437 RS_PRIMITIVE_LINE_STRIP = 2, -00441 RS_PRIMITIVE_TRIANGLE = 3, -00447 RS_PRIMITIVE_TRIANGLE_STRIP = 4, -00452 RS_PRIMITIVE_TRIANGLE_FAN = 5, -00453 -00457 RS_PRIMITIVE_INVALID = 100, -00458 } rs_primitive; -00459 -00478 typedef enum { -00479 RS_TYPE_NONE = 0, -00480 RS_TYPE_FLOAT_32 = 2, -00481 RS_TYPE_FLOAT_64 = 3, -00482 RS_TYPE_SIGNED_8 = 4, -00483 RS_TYPE_SIGNED_16 = 5, -00484 RS_TYPE_SIGNED_32 = 6, -00485 RS_TYPE_SIGNED_64 = 7, -00486 RS_TYPE_UNSIGNED_8 = 8, -00487 RS_TYPE_UNSIGNED_16 = 9, -00488 RS_TYPE_UNSIGNED_32 = 10, -00489 RS_TYPE_UNSIGNED_64 = 11, -00490 -00491 RS_TYPE_BOOLEAN = 12, -00492 -00493 RS_TYPE_UNSIGNED_5_6_5 = 13, -00494 RS_TYPE_UNSIGNED_5_5_5_1 = 14, -00495 RS_TYPE_UNSIGNED_4_4_4_4 = 15, -00496 -00497 RS_TYPE_MATRIX_4X4 = 16, -00498 RS_TYPE_MATRIX_3X3 = 17, -00499 RS_TYPE_MATRIX_2X2 = 18, -00500 -00501 RS_TYPE_ELEMENT = 1000, -00502 RS_TYPE_TYPE = 1001, -00503 RS_TYPE_ALLOCATION = 1002, -00504 RS_TYPE_SAMPLER = 1003, -00505 RS_TYPE_SCRIPT = 1004, -00506 RS_TYPE_MESH = 1005, -00507 RS_TYPE_PROGRAM_FRAGMENT = 1006, -00508 RS_TYPE_PROGRAM_VERTEX = 1007, -00509 RS_TYPE_PROGRAM_RASTER = 1008, -00510 RS_TYPE_PROGRAM_STORE = 1009, -00511 RS_TYPE_FONT = 1010, -00512 -00513 RS_TYPE_INVALID = 10000, -00514 } rs_data_type; -00515 -00524 typedef enum { -00525 RS_KIND_USER = 0, -00526 -00527 RS_KIND_PIXEL_L = 7, -00528 RS_KIND_PIXEL_A = 8, -00529 RS_KIND_PIXEL_LA = 9, -00530 RS_KIND_PIXEL_RGB = 10, -00531 RS_KIND_PIXEL_RGBA = 11, -00532 RS_KIND_PIXEL_DEPTH = 12, -00533 RS_KIND_PIXEL_YUV = 13, -00534 -00535 RS_KIND_INVALID = 100, -00536 } rs_data_kind; -00537 -00538 typedef enum { -00542 RS_DEPTH_FUNC_ALWAYS = 0, -00547 RS_DEPTH_FUNC_LESS = 1, -00552 RS_DEPTH_FUNC_LEQUAL = 2, -00557 RS_DEPTH_FUNC_GREATER = 3, -00562 RS_DEPTH_FUNC_GEQUAL = 4, -00567 RS_DEPTH_FUNC_EQUAL = 5, -00572 RS_DEPTH_FUNC_NOTEQUAL = 6, -00576 RS_DEPTH_FUNC_INVALID = 100, -00577 } rs_depth_func; -00578 -00579 typedef enum { -00580 RS_BLEND_SRC_ZERO = 0, -00581 RS_BLEND_SRC_ONE = 1, -00582 RS_BLEND_SRC_DST_COLOR = 2, -00583 RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3, -00584 RS_BLEND_SRC_SRC_ALPHA = 4, -00585 RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5, -00586 RS_BLEND_SRC_DST_ALPHA = 6, -00587 RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7, -00588 RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8, -00589 -00590 RS_BLEND_SRC_INVALID = 100, -00591 } rs_blend_src_func; -00592 -00593 typedef enum { -00594 RS_BLEND_DST_ZERO = 0, -00595 RS_BLEND_DST_ONE = 1, -00596 RS_BLEND_DST_SRC_COLOR = 2, -00597 RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3, -00598 RS_BLEND_DST_SRC_ALPHA = 4, -00599 RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5, -00600 RS_BLEND_DST_DST_ALPHA = 6, -00601 RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7, -00602 -00603 RS_BLEND_DST_INVALID = 100, -00604 } rs_blend_dst_func; -00605 -00606 typedef enum { -00607 RS_CULL_BACK = 0, -00608 RS_CULL_FRONT = 1, -00609 RS_CULL_NONE = 2, -00610 -00611 RS_CULL_INVALID = 100, -00612 } rs_cull_mode; -00613 -00614 typedef enum { -00615 RS_SAMPLER_NEAREST = 0, -00616 RS_SAMPLER_LINEAR = 1, -00617 RS_SAMPLER_LINEAR_MIP_LINEAR = 2, -00618 RS_SAMPLER_WRAP = 3, -00619 RS_SAMPLER_CLAMP = 4, -00620 RS_SAMPLER_LINEAR_MIP_NEAREST = 5, -00621 RS_SAMPLER_MIRRORED_REPEAT = 6, -00622 -00623 RS_SAMPLER_INVALID = 100, -00624 } rs_sampler_value; -00625 -00626 #endif // (defined(RS_VERSION) && (RS_VERSION >= 16)) -00627 -00628 #endif // __RS_TYPES_RSH__ -
Opaque handle to a RenderScript allocation. - More...
-Opaque handle to a RenderScript allocation.
-See: android.renderscript.Allocation
- -Definition at line 134 of file rs_types.rsh.
-Opaque handle to a RenderScript element. - More...
-Opaque handle to a RenderScript element.
-See: android.renderscript.Element
- -Definition at line 122 of file rs_types.rsh.
-Opaque handle to a RenderScript font object. - More...
-Opaque handle to a RenderScript font object.
-See: android.renderscript.Font
- -Definition at line 188 of file rs_types.rsh.
-2x2 float matrix - More...
-2x2 float matrix
-Native holder for RS matrix. Elements are stored in the array at the location [row*2 + col]
- -Definition at line 376 of file rs_types.rsh.
-3x3 float matrix - More...
-3x3 float matrix
-Native holder for RS matrix. Elements are stored in the array at the location [row*3 + col]
- -Definition at line 367 of file rs_types.rsh.
-4x4 float matrix - More...
-4x4 float matrix
-Native holder for RS matrix. Elements are stored in the array at the location [row*4 + col]
- -Definition at line 358 of file rs_types.rsh.
-Opaque handle to a RenderScript mesh object. - More...
-Opaque handle to a RenderScript mesh object.
-See: android.renderscript.Mesh
- -Definition at line 152 of file rs_types.rsh.
-Opaque handle to a RenderScript Path object. - More...
-Opaque handle to a RenderScript Path object.
-See: android.renderscript.Path
- -Definition at line 158 of file rs_types.rsh.
-Opaque handle to a RenderScript ProgramFragment object. - More...
-Opaque handle to a RenderScript ProgramFragment object.
-See: android.renderscript.ProgramFragment
- -Definition at line 164 of file rs_types.rsh.
-Opaque handle to a RenderScript ProgramRaster object. - More...
-Opaque handle to a RenderScript ProgramRaster object.
-See: android.renderscript.ProgramRaster
- -Definition at line 176 of file rs_types.rsh.
-Opaque handle to a RenderScript ProgramStore object. - More...
-Opaque handle to a RenderScript ProgramStore object.
-See: android.renderscript.ProgramStore
- -Definition at line 182 of file rs_types.rsh.
-Opaque handle to a RenderScript ProgramVertex object. - More...
-Opaque handle to a RenderScript ProgramVertex object.
-See: android.renderscript.ProgramVertex
- -Definition at line 170 of file rs_types.rsh.
-Opaque handle to a RenderScript sampler object. - More...
-Opaque handle to a RenderScript sampler object.
-See: android.renderscript.Sampler
- -Definition at line 140 of file rs_types.rsh.
-Opaque handle to a RenderScript script object. - More...
-Opaque handle to a RenderScript script object.
-See: android.renderscript.ScriptC
- -Definition at line 146 of file rs_types.rsh.
-Structure to provide extra information to a rsForEach call. Primarly used to restrict the call to a subset of cells in the allocation.
- -Definition at line 110 of file rs_core.rsh.
--Data Fields | |
| -int | tm_sec |
| seconds | |
| -int | tm_min |
| minutes | |
| -int | tm_hour |
| hours | |
| -int | tm_mday |
| day of the month | |
| -int | tm_mon |
| month | |
| -int | tm_year |
| year | |
| -int | tm_wday |
| day of the week | |
| -int | tm_yday |
| day of the year | |
| -int | tm_isdst |
| daylight savings time | |
Data structure for broken-down time components.
-tm_sec - Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds. tm_min - Minutes after the hour. This ranges from 0 to 59. tm_hour - Hours past midnight. This ranges from 0 to 23. tm_mday - Day of the month. This ranges from 1 to 31. tm_mon - Months since January. This ranges from 0 to 11. tm_year - Years since 1900. tm_wday - Days since Sunday. This ranges from 0 to 6. tm_yday - Days since January 1. This ranges from 0 to 365. tm_isdst - Flag to indicate whether daylight saving time is in effect. The value is positive if it is in effect, zero if it is not, and negative if the information is not available.
- -Definition at line 49 of file rs_time.rsh.
-Opaque handle to a RenderScript type. - More...
-Opaque handle to a RenderScript type.
-See: android.renderscript.Type
- -Definition at line 128 of file rs_types.rsh.
-