blob: 9b11b326756f8bcdf434158e8ffedbcf2c138f22 [file] [log] [blame]
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Stephen Hines3f868232015-04-10 09:22:19 -070017// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070018
19/*
Stephen Hines3f868232015-04-10 09:22:19 -070020 * rs_object_types.rsh: Object Types
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070021 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070022 * The types below are used to manipulate RenderScript objects like allocations, samplers,
23 * elements, and scripts. Most of these object are created using the Java RenderScript APIs.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070024 */
Stephen Hines3f868232015-04-10 09:22:19 -070025
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070026#ifndef RENDERSCRIPT_RS_OBJECT_TYPES_RSH
27#define RENDERSCRIPT_RS_OBJECT_TYPES_RSH
28
29#define NULL ((void *)0)
30
31// Opaque handle to a RenderScript object. Do not use this directly.
32#ifndef __LP64__
33#define _RS_HANDLE \
34struct {\
35 const int* const p;\
36} __attribute__((packed, aligned(4)))
37#else
38#define _RS_HANDLE \
39struct {\
40 const long* const p;\
41 const long* const r;\
42 const long* const v1;\
43 const long* const v2;\
44}
45#endif
46
47/*
48 * rs_element: Handle to an element
49 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070050 * An opaque handle to a RenderScript element.
51 *
52 * See android.renderscript.Element.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070053 */
54typedef _RS_HANDLE rs_element;
55
56/*
57 * rs_type: Handle to a Type
58 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070059 * An opaque handle to a RenderScript type.
60 *
61 * See android.renderscript.Type.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070062 */
63typedef _RS_HANDLE rs_type;
64
65/*
66 * rs_allocation: Handle to an allocation
67 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070068 * An opaque handle to a RenderScript allocation.
69 *
70 * See android.renderscript.Allocation.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070071 */
72typedef _RS_HANDLE rs_allocation;
73
74/*
75 * rs_sampler: Handle to a Sampler
76 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070077 * An opaque handle to a RenderScript sampler object.
78 *
79 * See android.renderscript.Sampler.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070080 */
81typedef _RS_HANDLE rs_sampler;
82
83/*
84 * rs_script: Handle to a Script
85 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070086 * An opaque handle to a RenderScript script object.
87 *
88 * See android.renderscript.ScriptC.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070089 */
90typedef _RS_HANDLE rs_script;
91
92/*
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070093 * rs_allocation_cubemap_face: Enum for selecting cube map faces
94 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -070095 * An enum used to specify one the six faces of a cubemap.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -070096 */
97#if (defined(RS_VERSION) && (RS_VERSION >= 14))
98typedef enum {
99 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X = 0,
100 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_X = 1,
101 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Y = 2,
102 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Y = 3,
103 RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_Z = 4,
104 RS_ALLOCATION_CUBEMAP_FACE_NEGATIVE_Z = 5
105} rs_allocation_cubemap_face;
106#endif
107
108/*
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700109 * rs_allocation_usage_type: Bitfield to specify how an allocation is used
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700110 *
111 * These values are ORed together to specify which usages or memory spaces are
112 * relevant to an allocation or an operation on an allocation.
113 */
114#if (defined(RS_VERSION) && (RS_VERSION >= 14))
115typedef enum {
Stephen Hines3f868232015-04-10 09:22:19 -0700116 RS_ALLOCATION_USAGE_SCRIPT = 0x0001, // Allocation is bound to and accessed by scripts.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700117 RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE = 0x0002, // Deprecated.
118 RS_ALLOCATION_USAGE_GRAPHICS_VERTEX = 0x0004, // Deprecated.
119 RS_ALLOCATION_USAGE_GRAPHICS_CONSTANTS = 0x0008, // Deprecated.
Stephen Hines3f868232015-04-10 09:22:19 -0700120 RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET = 0x0010, // Deprecated.
121 RS_ALLOCATION_USAGE_IO_INPUT = 0x0020, // Allocation is used as a Surface consumer.
122 RS_ALLOCATION_USAGE_IO_OUTPUT = 0x0040, // Allocation is used as a Surface producer.
123 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.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700124} rs_allocation_usage_type;
125#endif
126
127/*
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700128 * rs_data_type: Element basic data type
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700129 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700130 * rs_data_type is used to encode the type information of a basic element.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700131 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700132 * RS_TYPE_UNSIGNED_5_6_5, RS_TYPE_UNSIGNED_5_5_5_1, RS_TYPE_UNSIGNED_4_4_4_4 are for packed
133 * graphical data formats and represent vectors with per vector member sizes which are treated
134 * as a single unit for packing and alignment purposes.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700135 */
136#if (defined(RS_VERSION) && (RS_VERSION >= 16))
137typedef enum {
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700138 RS_TYPE_NONE = 0, // Element is a complex type, i.e. a struct.
139 RS_TYPE_FLOAT_32 = 2, // A 32 bit float point value.
140 RS_TYPE_FLOAT_64 = 3, // A 64 bit floating point value.
141 RS_TYPE_SIGNED_8 = 4, // An 8 bit signed integer.
142 RS_TYPE_SIGNED_16 = 5, // A 16 bit signed integer.
143 RS_TYPE_SIGNED_32 = 6, // A 32 bit signed integer.
144 RS_TYPE_SIGNED_64 = 7, // A 64 bit signed integer.
145 RS_TYPE_UNSIGNED_8 = 8, // An 8 bit unsigned integer.
146 RS_TYPE_UNSIGNED_16 = 9, // A 16 bit unsigned integer.
147 RS_TYPE_UNSIGNED_32 = 10, // A 32 bit unsigned integer.
148 RS_TYPE_UNSIGNED_64 = 11, // A 64 bit unsigned integer.
149 RS_TYPE_BOOLEAN = 12, // 0 or 1 (false or true) stored in an 8 bit container.
150 RS_TYPE_UNSIGNED_5_6_5 = 13, // A 16 bit unsigned integer packing graphical data in 5, 6, and 5 bit sections.
151 RS_TYPE_UNSIGNED_5_5_5_1 = 14, // A 16 bit unsigned integer packing graphical data in 5, 5, 5, and 1 bit sections.
152 RS_TYPE_UNSIGNED_4_4_4_4 = 15, // A 16 bit unsigned integer packing graphical data in 4, 4, 4, and 4 bit sections.
153 RS_TYPE_MATRIX_4X4 = 16, // A 4x4 matrix of 32 bit floats, aligned on a 32 bit boundary.
154 RS_TYPE_MATRIX_3X3 = 17, // A 3x3 matrix of 32 bit floats, aligned on a 32 bit boundary.
155 RS_TYPE_MATRIX_2X2 = 18, // A 2x2 matrix of 32 bit floats, aligned on a 32 bit boundary.
156 RS_TYPE_ELEMENT = 1000, // A handle to an Element.
157 RS_TYPE_TYPE = 1001, // A handle to a Type.
158 RS_TYPE_ALLOCATION = 1002, // A handle to an Allocation.
159 RS_TYPE_SAMPLER = 1003, // A handle to a Sampler.
160 RS_TYPE_SCRIPT = 1004, // A handle to a Script.
161 RS_TYPE_MESH = 1005, // Deprecated.
162 RS_TYPE_PROGRAM_FRAGMENT = 1006, // Deprecated.
163 RS_TYPE_PROGRAM_VERTEX = 1007, // Deprecated.
164 RS_TYPE_PROGRAM_RASTER = 1008, // Deprecated.
165 RS_TYPE_PROGRAM_STORE = 1009, // Deprecated.
166 RS_TYPE_FONT = 1010, // Deprecated.
Stephen Hines3f868232015-04-10 09:22:19 -0700167 RS_TYPE_INVALID = 10000
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700168} rs_data_type;
169#endif
170
171/*
172 * rs_data_kind: Element data kind
173 *
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700174 * This enumeration is primarly useful for graphical data. It provides additional information to
175 * help interpret the rs_data_type.
176 *
177 * RS_KIND_USER indicates no special interpretation is expected.
178 *
179 * The RS_KIND_PIXEL_* values are used in conjunction with the standard data types for representing
180 * texture formats.
181 *
182 * See the Element.createPixel() method.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700183 */
184#if (defined(RS_VERSION) && (RS_VERSION >= 16))
185typedef enum {
Pirama Arumuga Nainardb745862015-05-11 14:34:37 -0700186 RS_KIND_USER = 0, // No special interpretation.
187 RS_KIND_PIXEL_L = 7, // Luminance.
188 RS_KIND_PIXEL_A = 8, // Alpha.
189 RS_KIND_PIXEL_LA = 9, // Luminance and Alpha.
190 RS_KIND_PIXEL_RGB = 10, // Red, Green, Blue.
191 RS_KIND_PIXEL_RGBA = 11, // Red, Green, Blue, and Alpha.
192 RS_KIND_PIXEL_DEPTH = 12, // Depth for a depth texture.
193 RS_KIND_PIXEL_YUV = 13, // Luminance and chrominance.
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700194 RS_KIND_INVALID = 100
195} rs_data_kind;
196#endif
197
198/*
199 * rs_sampler_value: Sampler wrap T value
200 *
201 */
202#if (defined(RS_VERSION) && (RS_VERSION >= 16))
203typedef enum {
Stephen Hines3f868232015-04-10 09:22:19 -0700204 RS_SAMPLER_NEAREST = 0,
205 RS_SAMPLER_LINEAR = 1,
206 RS_SAMPLER_LINEAR_MIP_LINEAR = 2,
207 RS_SAMPLER_WRAP = 3,
208 RS_SAMPLER_CLAMP = 4,
209 RS_SAMPLER_LINEAR_MIP_NEAREST = 5,
210 RS_SAMPLER_MIRRORED_REPEAT = 6,
211 RS_SAMPLER_INVALID = 100
Jean-Luc Brouillet4fbd9032015-04-02 14:46:27 -0700212} rs_sampler_value;
213#endif
214
215#endif // RENDERSCRIPT_RS_OBJECT_TYPES_RSH