diff options
Diffstat (limited to 'renderscript/include/rs_value_types.rsh')
-rw-r--r-- | renderscript/include/rs_value_types.rsh | 164 |
1 files changed, 134 insertions, 30 deletions
diff --git a/renderscript/include/rs_value_types.rsh b/renderscript/include/rs_value_types.rsh index c19bd4e..13c0500 100644 --- a/renderscript/include/rs_value_types.rsh +++ b/renderscript/include/rs_value_types.rsh @@ -14,57 +14,116 @@ * limitations under the License. */ -// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime. +// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh. /* - * rs_value_types.rsh: Standard RenderScript types + * rs_value_types.rsh: Numerical Types * - * Integers: - * 8 bit: char, int8_t - * 16 bit: short, int16_t - * 32 bit: int, in32_t - * 64 bit: long, long long, int64_t + * Scalars: * - * Unsigned integers: - * 8 bit: uchar, uint8_t - * 16 bit: ushort, uint16_t - * 32 bit: uint, uint32_t - * 64 bit: ulong, uint64_t + * RenderScript supports the following scalar numerical types: * - * Floating point: - * 32 bit: float - * 64 bit: double + * Integers: + * - 8 bit: char, int8_t + * - 16 bit: short, int16_t + * - 32 bit: int, int32_t + * - 64 bit: long, long long, int64_t * - * Vectors of length 2, 3, and 4 are supported for all the types above. + * 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: + * + * RenderScript supports fixed size vectors of length 2, 3, and 4. + * Vectors are declared using the common type name followed by a 2, 3, or 4. + * E.g. float4, int3, double2, ulong4. + * + * To create vector literals, use the vector type followed by the values enclosed + * between parentheses, e.g. (float3)(1.0f, 2.0f, 3.0f). + * + * Entries of a vector can be accessed using different naming styles. + * + * Single entries can be accessed by following the variable name with a dot and: + * - The letters x, y, z, and w, + * - The letters r, g, b, and a, + * - The letter s or S, followed by a zero based index. + * + * For example, with int4 myVar; the following are equivalent: + * myVar.x == myVar.r == myVar.s0 == myVar.S0 + * myVar.y == myVar.g == myVar.s1 == myVar.S1 + * myVar.z == myVar.b == myVar.s2 == myVar.S2 + * myVar.w == myVar.a == myVar.s3 == myVar.S3 + * + * Multiple entries of a vector can be accessed at once by using an identifier + * that is the concatenation of multiple letters or indices. The resulting vector + * has a size equal to the number of entries named. + * + * With the example above, the middle two entries can be accessed using + * myVar.yz, myVar.gb, myVar.s12, and myVar.S12. + * + * The entries don't have to be contiguous or in increasing order. + * Entries can even be repeated, as long as we're not trying to assign + * to it. You also can't mix the naming styles. + * + * Here are examples of what can or can't be done: + * float4 v4; + * float3 v3; + * float2 v2; + * v2 = v4.xx; // Valid + * v3 = v4.zxw; // Valid + * v3 = v4.bba; // Valid + * v3 = v4.s034; // 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... + * + * + * Matrices and Quaternions: + * + * RenderScript supports fixed size square matrices of floats of size 2x2, 3x3, and 4x4. + * The types are named rs_matrix2x2, rs_matrix3x3, and rs_matrix4x4. See + * Matrix Functions for the list of operations. + * + * Quaternions are also supported via rs_quaternion. See Quaterion Functions. for the list of operations. */ + #ifndef RENDERSCRIPT_RS_VALUE_TYPES_RSH #define RENDERSCRIPT_RS_VALUE_TYPES_RSH /* * int8_t: 8 bit signed integer * - * 8 bit integer type + * 8 bit signed integer type. */ typedef char int8_t; /* * int16_t: 16 bit signed integer * - * 16 bit integer type + * A 16 bit signed integer type. */ typedef short int16_t; /* * int32_t: 32 bit signed integer * - * 32 bit integer type + * A 32 bit signed integer type. */ typedef int int32_t; /* * int64_t: 64 bit signed integer * - * 64 bit integer type + * A 64 bit signed integer type. */ #if !defined(RS_VERSION) || (RS_VERSION <= 20) typedef long long int64_t; @@ -77,28 +136,28 @@ typedef long int64_t; /* * uint8_t: 8 bit unsigned integer * - * 8 bit unsigned integer type + * 8 bit unsigned integer type. */ typedef unsigned char uint8_t; /* * uint16_t: 16 bit unsigned integer * - * 16 bit unsigned integer type + * A 16 bit unsigned integer type. */ typedef unsigned short uint16_t; /* * uint32_t: 32 bit unsigned integer * - * 32 bit unsigned integer type + * A 32 bit unsigned integer type. */ typedef unsigned int uint32_t; /* * uint64_t: 64 bit unsigned integer * - * 64 bit unsigned integer type + * A 64 bit unsigned integer type. */ #if !defined(RS_VERSION) || (RS_VERSION <= 20) typedef unsigned long long uint64_t; @@ -111,35 +170,35 @@ typedef unsigned long uint64_t; /* * uchar: 8 bit unsigned integer * - * 8 bit unsigned integer type + * 8 bit unsigned integer type. */ typedef uint8_t uchar; /* * ushort: 16 bit unsigned integer * - * 16 bit unsigned integer type + * A 16 bit unsigned integer type. */ typedef uint16_t ushort; /* * uint: 32 bit unsigned integer * - * 32 bit unsigned integer type + * A 32 bit unsigned integer type. */ typedef uint32_t uint; /* * ulong: 64 bit unsigned integer * - * Typedef for unsigned long (use for 64-bit unsigned integers) + * A 64 bit unsigned integer type. */ typedef uint64_t ulong; /* * size_t: Unsigned size type * - * Typedef for size_t + * Unsigned size type. The number of bits depend on the compilation flags. */ #ifdef __LP64__ typedef uint64_t size_t; @@ -152,7 +211,7 @@ typedef uint32_t size_t; /* * ssize_t: Signed size type * - * Typedef for ssize_t + * Signed size type. The number of bits depend on the compilation flags. */ #ifdef __LP64__ typedef int64_t ssize_t; @@ -402,4 +461,49 @@ typedef long __attribute__((ext_vector_type(3))) long3; */ typedef long __attribute__((ext_vector_type(4))) long4; +/* + * rs_matrix2x2: 2x2 matrix of 32 bit floats + * + * A square 2x2 matrix of floats. The entries are stored in the array at the + * location [row*2 + col]. + * + * See Matrix Functions. + */ +typedef struct { + float m[4]; +} rs_matrix2x2; + +/* + * rs_matrix3x3: 3x3 matrix of 32 bit floats + * + * A square 3x3 matrix of floats. The entries are stored in the array at the + * location [row*3 + col]. + * + * See Matrix Functions. + */ +typedef struct { + float m[9]; +} rs_matrix3x3; + +/* + * rs_matrix4x4: 4x4 matrix of 32 bit floats + * + * A square 4x4 matrix of floats. The entries are stored in the array at the + * location [row*4 + col]. + * + * See Matrix Functions. + */ +typedef struct { + float m[16]; +} rs_matrix4x4; + +/* + * rs_quaternion: Quaternion + * + * A square 4x4 matrix of floats that represents a quaternion. + * + * See Quaternion Functions. + */ +typedef float4 rs_quaternion; + #endif // RENDERSCRIPT_RS_VALUE_TYPES_RSH |