rsInternalDefines.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*
  2. * Copyright (C) 2014 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. #ifndef RENDER_SCRIPT_INTERNAL_DEFINES_H
  17. #define RENDER_SCRIPT_INTERNAL_DEFINES_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include "rsDefines.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. //////////////////////////////////////////////////////
  25. //
  26. typedef void (* RsBitmapCallback_t)(void *);
  27. typedef struct {
  28. uint32_t colorMin;
  29. uint32_t colorPref;
  30. uint32_t alphaMin;
  31. uint32_t alphaPref;
  32. uint32_t depthMin;
  33. uint32_t depthPref;
  34. uint32_t stencilMin;
  35. uint32_t stencilPref;
  36. uint32_t samplesMin;
  37. uint32_t samplesPref;
  38. float samplesQ;
  39. } RsSurfaceConfig;
  40. enum RsMessageToClientType {
  41. RS_MESSAGE_TO_CLIENT_NONE = 0,
  42. RS_MESSAGE_TO_CLIENT_EXCEPTION = 1,
  43. RS_MESSAGE_TO_CLIENT_RESIZE = 2,
  44. RS_MESSAGE_TO_CLIENT_ERROR = 3,
  45. RS_MESSAGE_TO_CLIENT_USER = 4,
  46. RS_MESSAGE_TO_CLIENT_NEW_BUFFER = 5
  47. };
  48. enum RsTextureTarget {
  49. RS_TEXTURE_2D,
  50. RS_TEXTURE_CUBE
  51. };
  52. enum RsDepthFunc {
  53. RS_DEPTH_FUNC_ALWAYS,
  54. RS_DEPTH_FUNC_LESS,
  55. RS_DEPTH_FUNC_LEQUAL,
  56. RS_DEPTH_FUNC_GREATER,
  57. RS_DEPTH_FUNC_GEQUAL,
  58. RS_DEPTH_FUNC_EQUAL,
  59. RS_DEPTH_FUNC_NOTEQUAL
  60. };
  61. enum RsBlendSrcFunc {
  62. RS_BLEND_SRC_ZERO, // 0
  63. RS_BLEND_SRC_ONE, // 1
  64. RS_BLEND_SRC_DST_COLOR, // 2
  65. RS_BLEND_SRC_ONE_MINUS_DST_COLOR, // 3
  66. RS_BLEND_SRC_SRC_ALPHA, // 4
  67. RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA, // 5
  68. RS_BLEND_SRC_DST_ALPHA, // 6
  69. RS_BLEND_SRC_ONE_MINUS_DST_ALPHA, // 7
  70. RS_BLEND_SRC_SRC_ALPHA_SATURATE, // 8
  71. RS_BLEND_SRC_INVALID = 100,
  72. };
  73. enum RsBlendDstFunc {
  74. RS_BLEND_DST_ZERO, // 0
  75. RS_BLEND_DST_ONE, // 1
  76. RS_BLEND_DST_SRC_COLOR, // 2
  77. RS_BLEND_DST_ONE_MINUS_SRC_COLOR, // 3
  78. RS_BLEND_DST_SRC_ALPHA, // 4
  79. RS_BLEND_DST_ONE_MINUS_SRC_ALPHA, // 5
  80. RS_BLEND_DST_DST_ALPHA, // 6
  81. RS_BLEND_DST_ONE_MINUS_DST_ALPHA, // 7
  82. RS_BLEND_DST_INVALID = 100,
  83. };
  84. enum RsTexEnvMode {
  85. RS_TEX_ENV_MODE_NONE,
  86. RS_TEX_ENV_MODE_REPLACE,
  87. RS_TEX_ENV_MODE_MODULATE,
  88. RS_TEX_ENV_MODE_DECAL
  89. };
  90. enum RsProgramParam {
  91. RS_PROGRAM_PARAM_INPUT,
  92. RS_PROGRAM_PARAM_OUTPUT,
  93. RS_PROGRAM_PARAM_CONSTANT,
  94. RS_PROGRAM_PARAM_TEXTURE_TYPE,
  95. };
  96. enum RsPrimitive {
  97. RS_PRIMITIVE_POINT,
  98. RS_PRIMITIVE_LINE,
  99. RS_PRIMITIVE_LINE_STRIP,
  100. RS_PRIMITIVE_TRIANGLE,
  101. RS_PRIMITIVE_TRIANGLE_STRIP,
  102. RS_PRIMITIVE_TRIANGLE_FAN,
  103. RS_PRIMITIVE_INVALID = 100,
  104. };
  105. enum RsPathPrimitive {
  106. RS_PATH_PRIMITIVE_QUADRATIC_BEZIER,
  107. RS_PATH_PRIMITIVE_CUBIC_BEZIER
  108. };
  109. enum RsAnimationInterpolation {
  110. RS_ANIMATION_INTERPOLATION_STEP,
  111. RS_ANIMATION_INTERPOLATION_LINEAR,
  112. RS_ANIMATION_INTERPOLATION_BEZIER,
  113. RS_ANIMATION_INTERPOLATION_CARDINAL,
  114. RS_ANIMATION_INTERPOLATION_HERMITE,
  115. RS_ANIMATION_INTERPOLATION_BSPLINE
  116. };
  117. enum RsAnimationEdge {
  118. RS_ANIMATION_EDGE_UNDEFINED,
  119. RS_ANIMATION_EDGE_CONSTANT,
  120. RS_ANIMATION_EDGE_GRADIENT,
  121. RS_ANIMATION_EDGE_CYCLE,
  122. RS_ANIMATION_EDGE_OSCILLATE,
  123. RS_ANIMATION_EDGE_CYLE_RELATIVE
  124. };
  125. enum RsA3DClassID {
  126. RS_A3D_CLASS_ID_UNKNOWN,
  127. RS_A3D_CLASS_ID_MESH,
  128. RS_A3D_CLASS_ID_TYPE,
  129. RS_A3D_CLASS_ID_ELEMENT,
  130. RS_A3D_CLASS_ID_ALLOCATION,
  131. RS_A3D_CLASS_ID_PROGRAM_VERTEX,
  132. RS_A3D_CLASS_ID_PROGRAM_RASTER,
  133. RS_A3D_CLASS_ID_PROGRAM_FRAGMENT,
  134. RS_A3D_CLASS_ID_PROGRAM_STORE,
  135. RS_A3D_CLASS_ID_SAMPLER,
  136. RS_A3D_CLASS_ID_ANIMATION,
  137. RS_A3D_CLASS_ID_ADAPTER_1D,
  138. RS_A3D_CLASS_ID_ADAPTER_2D,
  139. RS_A3D_CLASS_ID_SCRIPT_C,
  140. RS_A3D_CLASS_ID_SCRIPT_KERNEL_ID,
  141. RS_A3D_CLASS_ID_SCRIPT_FIELD_ID,
  142. RS_A3D_CLASS_ID_SCRIPT_METHOD_ID,
  143. RS_A3D_CLASS_ID_SCRIPT_GROUP,
  144. RS_A3D_CLASS_ID_CLOSURE,
  145. RS_A3D_CLASS_ID_SCRIPT_GROUP2,
  146. RS_A3D_CLASS_ID_SCRIPT_INVOKE_ID
  147. };
  148. enum RsCullMode {
  149. RS_CULL_BACK,
  150. RS_CULL_FRONT,
  151. RS_CULL_NONE,
  152. RS_CULL_INVALID = 100,
  153. };
  154. enum RsScriptIntrinsicID {
  155. RS_SCRIPT_INTRINSIC_ID_UNDEFINED = 0,
  156. RS_SCRIPT_INTRINSIC_ID_CONVOLVE_3x3 = 1,
  157. RS_SCRIPT_INTRINSIC_ID_COLOR_MATRIX = 2,
  158. RS_SCRIPT_INTRINSIC_ID_LUT = 3,
  159. RS_SCRIPT_INTRINSIC_ID_CONVOLVE_5x5 = 4,
  160. RS_SCRIPT_INTRINSIC_ID_BLUR = 5,
  161. RS_SCRIPT_INTRINSIC_ID_YUV_TO_RGB = 6,
  162. RS_SCRIPT_INTRINSIC_ID_BLEND = 7,
  163. RS_SCRIPT_INTRINSIC_ID_3DLUT = 8,
  164. RS_SCRIPT_INTRINSIC_ID_HISTOGRAM = 9,
  165. // unused 10, 11
  166. RS_SCRIPT_INTRINSIC_ID_RESIZE = 12,
  167. RS_SCRIPT_INTRINSIC_ID_BLAS = 13,
  168. RS_SCRIPT_INTRINSIC_ID_EXTBLAS = 14,
  169. RS_SCRIPT_INTRINSIC_ID_OEM_START = 0x10000000
  170. };
  171. typedef struct {
  172. RsA3DClassID classID;
  173. const char* objectName;
  174. } RsFileIndexEntry;
  175. enum RsThreadPriorities {
  176. RS_THREAD_PRIORITY_LOW = 15,
  177. RS_THREAD_PRIORITY_NORMAL_GRAPHICS = -8,
  178. RS_THREAD_PRIORITY_NORMAL = -1,
  179. RS_THREAD_PRIORITY_LOW_LATENCY = -4
  180. };
  181. // Structure for rs.spec functions
  182. typedef struct {
  183. RsElement e;
  184. uint32_t dimX;
  185. uint32_t dimY;
  186. uint32_t dimZ;
  187. bool mipmaps;
  188. bool faces;
  189. uint32_t yuv;
  190. uint32_t array0;
  191. uint32_t array1;
  192. uint32_t array2;
  193. uint32_t array3;
  194. } RsTypeCreateParams;
  195. #ifdef __cplusplus
  196. };
  197. #endif
  198. #endif // RENDER_SCRIPT_DEFINES_H