/src/ics-mr1/frameworks/base/libs/rs/scriptc/rs_types.rsh
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 The Android Open Source Project
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00041 #ifndef __RS_TYPES_RSH__
00042 #define __RS_TYPES_RSH__
00043 
00044 #define M_PI        3.14159265358979323846264338327950288f   /* pi */
00045 
00046 #include "stdbool.h"
00050 typedef char int8_t;
00054 typedef short int16_t;
00058 typedef int int32_t;
00062 typedef long long int64_t;
00066 typedef unsigned char uint8_t;
00070 typedef unsigned short uint16_t;
00074 typedef unsigned int uint32_t;
00078 typedef unsigned long long uint64_t;
00082 typedef uint8_t uchar;
00086 typedef uint16_t ushort;
00090 typedef uint32_t uint;
00094 typedef uint64_t ulong;
00098 typedef uint32_t size_t;
00102 typedef int32_t ssize_t;
00103 
00109 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_element;
00115 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_type;
00121 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_allocation;
00127 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_sampler;
00133 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_script;
00139 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_mesh;
00145 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_fragment;
00151 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_vertex;
00157 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_raster;
00163 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_program_store;
00169 typedef struct { const int* const p; } __attribute__((packed, aligned(4))) rs_font;
00170 
00176 typedef float float2 __attribute__((ext_vector_type(2)));
00181 typedef float float3 __attribute__((ext_vector_type(3)));
00187 typedef float float4 __attribute__((ext_vector_type(4)));
00188 
00193 typedef double double2 __attribute__((ext_vector_type(2)));
00198 typedef double double3 __attribute__((ext_vector_type(3)));
00203 typedef double double4 __attribute__((ext_vector_type(4)));
00204 
00209 typedef uchar uchar2 __attribute__((ext_vector_type(2)));
00214 typedef uchar uchar3 __attribute__((ext_vector_type(3)));
00219 typedef uchar uchar4 __attribute__((ext_vector_type(4)));
00220 
00225 typedef ushort ushort2 __attribute__((ext_vector_type(2)));
00230 typedef ushort ushort3 __attribute__((ext_vector_type(3)));
00235 typedef ushort ushort4 __attribute__((ext_vector_type(4)));
00236 
00241 typedef uint uint2 __attribute__((ext_vector_type(2)));
00246 typedef uint uint3 __attribute__((ext_vector_type(3)));
00251 typedef uint uint4 __attribute__((ext_vector_type(4)));
00252 
00257 typedef ulong ulong2 __attribute__((ext_vector_type(2)));
00262 typedef ulong ulong3 __attribute__((ext_vector_type(3)));
00267 typedef ulong ulong4 __attribute__((ext_vector_type(4)));
00268 
00273 typedef char char2 __attribute__((ext_vector_type(2)));
00278 typedef char char3 __attribute__((ext_vector_type(3)));
00283 typedef char char4 __attribute__((ext_vector_type(4)));
00284 
00289 typedef short short2 __attribute__((ext_vector_type(2)));
00294 typedef short short3 __attribute__((ext_vector_type(3)));
00299 typedef short short4 __attribute__((ext_vector_type(4)));
00300 
00305 typedef int int2 __attribute__((ext_vector_type(2)));
00310 typedef int int3 __attribute__((ext_vector_type(3)));
00315 typedef int int4 __attribute__((ext_vector_type(4)));
00316 
00321 typedef long long2 __attribute__((ext_vector_type(2)));
00326 typedef long long3 __attribute__((ext_vector_type(3)));
00331 typedef long long4 __attribute__((ext_vector_type(4)));
00332 
00339 typedef struct {
00340     float m[16];
00341 } rs_matrix4x4;
00348 typedef struct {
00349     float m[9];
00350 } rs_matrix3x3;
00357 typedef struct {
00358     float m[4];
00359 } rs_matrix2x2;
00360 
00364 typedef float4 rs_quaternion;
00365 
00366 #define RS_PACKED __attribute__((packed, aligned(4)))
00367 #define NULL ((const void *)0)
00368 
00369 #if (defined(RS_VERSION) && (RS_VERSION >= 14))
00370 
00374 typedef enum {
00375     RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
00376     RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
00377     RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
00378     RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
00379     RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
00380     RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
00381 } rs_allocation_cubemap_face;
00382 
00389 typedef enum {
00390     RS_ALLOCATION_USAGE_SCRIPT = 0x0001,
00391     RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002,
00392     RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004,
00393     RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008,
00394     RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010
00395 } rs_allocation_usage_type;
00396 
00397 #endif //defined(RS_VERSION) && (RS_VERSION >= 14)
00398 
00399 #endif