RenderScript(google API)
2018-01-31 11:20
169 查看
RenderScript
RenderScript是一个基类。这个类的一个对象创建本地工作线程,用于处理来自这些对象的命令。该基类不提供任何,提供简单数据处理能力类的扩展。对于扩展功能使用派生类如RenderScriptGL
Element
RenderScript最基本的数据类型。一个元素代表一个内存分配的一个单元格。元素是Renderscript的基本数据类型。
一个元素可以有两种形式:基本元素或复杂的形式。
作为基本元素是:
?单精度浮点数值
?4元浮点矢量
?单RGB-565色
?单unsigned int类型16
复杂的元素中包含的子元素和名称的列表,表示的结构的数据。可以访问的字段名称从脚本或着色。定义的内存布局和有序。数据对齐是由最基本的原始类型。即一个float4载体将对准与sizeof(浮动)而不是sizeof(float4的)。在内存中的元素的顺序将它们被添加的顺序,根据需要与每个组件对齐。无需重新排序将得到伸张。
元素的主要来源是从脚本。出口绑定点数据结构的脚本生成一个的Renderscript元素代表由脚本导出的数据。其他常见元素的来源是从位图格式。
Type
Type 是一个配置模版,用来获取一些内存分配的信息,但不分配任何数据内存。他包含一个Element、一个或者很多的维度信息。
一个Type对象包含很多的维度信息,这些维度信息为X、Y、Z,LOD(Lever of detail);面(faces of a cube map).如果X=10,y=0,z=0则数据会被看作是一维数据。
LOD和面尺寸为布尔值,表示存在或不存在。
Allocation
Allocation是为renderscript分配内存的类。一个Allocation绑定了一个Type来提供用户数据存储和对象存储。这意味着,在renderscript中,所有的内存分配都由Allocation分配。
数据分配的主要方式是:对于Script脚本,数据的移如和移出。内存是用户的同步,可能存在很多的内存空间。目前这些空间是:
Script: 可被RS Scripts使用的
Graphics Texture: 对于图形纹理是可用的
Graphics Vertex:对于图形定点数据是可用的
Graphics Constants: 对于用户着色器中的常量是可用的
例如,当创建一个分配的纹理时,用户可以指定它的内存空间作为脚本和手感。这意味着它可以被用作脚本具有约束力,且作为GPU的纹理进行渲染。脚本修改保持同步,如果使用其他的目标,它必须调用同步功能将更新推到内存的分配,否则的结果是不确定的。
默认情况下,Android系统端更新总是??应用于脚本accessable内存的。如果不存在,然后,它们被应用到各种硬件类型的存储器。 àsyncAll()调用是必要的脚本数据后同步更新,以保持其他内存空间。
配置数据上传两种主要方式之一。对于简单的阵列的copyfrom()函数,数组从控制代码,将它复制到从内存存储。这两种类型的检查,未选中的文件的副本提供。未经检验的变种存在,允许应用程序从控制语言不支持结构的结构数组复制。
Allocation.MipmapControl
Controls mipmap behavior when using the bitmap creation and update functions.
当用bitmap图片创建和更新时,控制图片的Mipmap图形属性
MIPMAP_FULL: A Full mipmap chain will be created in script memory.
MIPMAP_NONE: No mipmaps will be generated and the type generated from the incoming bitmap will not contain additional LODs.
MIPMAP_ON_SYNC_TO_TEXTURE: The type of the allocation will be the same as MIPMAP_NONE.
RenderScriptGL
RenderScript的图形派生类。扩展基类去增加Root脚本,RenderScriptGL用于显示图形输出。当系统需要更新显示当前绑定的根脚本将被调用。预计发行此脚本渲染命令重绘屏幕。
RenderScriptGL.SurfaceConfig
这个类是用来描述一个图形缓冲区的像素格式。这是用来描述的预定格式的显示表面。描述了配置内每个组件的最小和首选位深度对配置和额外的结构信息。
ProgramFragmentFixedFunction
ProgramFragmentFixedFunction is a helper class that provides a way to make a simple fragment shader without writing any GLSL code. This class allows for display of constant color, interpolated color from the vertex shader, or combinations of the both blended
with results of up to two texture lookups.
Mesh
This class is a container for geometric data displayed with Renderscript. Internally, a mesh is a collection of allocations that represent vertex data (positions, normals, texture coordinates) and index data such as triangles and lines.
Vertex data could either be interleaved within one allocation that is provided separately, as multiple allocation objects, or done as a combination of both. When a vertex channel name matc
9044
hes an input in the vertex program, Renderscript automatically connects
the two together.
Parts of the mesh can be rendered with either explicit index sets or primitive types.
Mesh.AllocationBuilder
Mesh builder object. It starts empty and requires the user to add all the vertex and index allocations that comprise the mesh
Mesh.Primitive
确定绘制方式
以下是几种绘制方式:
POINT
LINE
LINE_STRIP
TRIANGLE
TRIANGLE_FAN
TRIANGLE_STRIP
尊重劳动成果,转载请保留出处:
http://xiaxveliang.blog.163.com/blog/static/2970803420139844152392/
RenderScript是一个基类。这个类的一个对象创建本地工作线程,用于处理来自这些对象的命令。该基类不提供任何,提供简单数据处理能力类的扩展。对于扩展功能使用派生类如RenderScriptGL
Element
RenderScript最基本的数据类型。一个元素代表一个内存分配的一个单元格。元素是Renderscript的基本数据类型。
一个元素可以有两种形式:基本元素或复杂的形式。
作为基本元素是:
?单精度浮点数值
?4元浮点矢量
?单RGB-565色
?单unsigned int类型16
复杂的元素中包含的子元素和名称的列表,表示的结构的数据。可以访问的字段名称从脚本或着色。定义的内存布局和有序。数据对齐是由最基本的原始类型。即一个float4载体将对准与sizeof(浮动)而不是sizeof(float4的)。在内存中的元素的顺序将它们被添加的顺序,根据需要与每个组件对齐。无需重新排序将得到伸张。
元素的主要来源是从脚本。出口绑定点数据结构的脚本生成一个的Renderscript元素代表由脚本导出的数据。其他常见元素的来源是从位图格式。
Type
Type 是一个配置模版,用来获取一些内存分配的信息,但不分配任何数据内存。他包含一个Element、一个或者很多的维度信息。
一个Type对象包含很多的维度信息,这些维度信息为X、Y、Z,LOD(Lever of detail);面(faces of a cube map).如果X=10,y=0,z=0则数据会被看作是一维数据。
LOD和面尺寸为布尔值,表示存在或不存在。
Allocation
Allocation是为renderscript分配内存的类。一个Allocation绑定了一个Type来提供用户数据存储和对象存储。这意味着,在renderscript中,所有的内存分配都由Allocation分配。
数据分配的主要方式是:对于Script脚本,数据的移如和移出。内存是用户的同步,可能存在很多的内存空间。目前这些空间是:
Script: 可被RS Scripts使用的
Graphics Texture: 对于图形纹理是可用的
Graphics Vertex:对于图形定点数据是可用的
Graphics Constants: 对于用户着色器中的常量是可用的
例如,当创建一个分配的纹理时,用户可以指定它的内存空间作为脚本和手感。这意味着它可以被用作脚本具有约束力,且作为GPU的纹理进行渲染。脚本修改保持同步,如果使用其他的目标,它必须调用同步功能将更新推到内存的分配,否则的结果是不确定的。
默认情况下,Android系统端更新总是??应用于脚本accessable内存的。如果不存在,然后,它们被应用到各种硬件类型的存储器。 àsyncAll()调用是必要的脚本数据后同步更新,以保持其他内存空间。
配置数据上传两种主要方式之一。对于简单的阵列的copyfrom()函数,数组从控制代码,将它复制到从内存存储。这两种类型的检查,未选中的文件的副本提供。未经检验的变种存在,允许应用程序从控制语言不支持结构的结构数组复制。
Allocation.MipmapControl
Controls mipmap behavior when using the bitmap creation and update functions.
当用bitmap图片创建和更新时,控制图片的Mipmap图形属性
MIPMAP_FULL: A Full mipmap chain will be created in script memory.
MIPMAP_NONE: No mipmaps will be generated and the type generated from the incoming bitmap will not contain additional LODs.
MIPMAP_ON_SYNC_TO_TEXTURE: The type of the allocation will be the same as MIPMAP_NONE.
RenderScriptGL
RenderScript的图形派生类。扩展基类去增加Root脚本,RenderScriptGL用于显示图形输出。当系统需要更新显示当前绑定的根脚本将被调用。预计发行此脚本渲染命令重绘屏幕。
RenderScriptGL.SurfaceConfig
这个类是用来描述一个图形缓冲区的像素格式。这是用来描述的预定格式的显示表面。描述了配置内每个组件的最小和首选位深度对配置和额外的结构信息。
ProgramFragmentFixedFunction
ProgramFragmentFixedFunction is a helper class that provides a way to make a simple fragment shader without writing any GLSL code. This class allows for display of constant color, interpolated color from the vertex shader, or combinations of the both blended
with results of up to two texture lookups.
Mesh
This class is a container for geometric data displayed with Renderscript. Internally, a mesh is a collection of allocations that represent vertex data (positions, normals, texture coordinates) and index data such as triangles and lines.
Vertex data could either be interleaved within one allocation that is provided separately, as multiple allocation objects, or done as a combination of both. When a vertex channel name matc
9044
hes an input in the vertex program, Renderscript automatically connects
the two together.
Parts of the mesh can be rendered with either explicit index sets or primitive types.
Mesh.AllocationBuilder
Mesh builder object. It starts empty and requires the user to add all the vertex and index allocations that comprise the mesh
Mesh.Primitive
确定绘制方式
以下是几种绘制方式:
POINT
LINE
LINE_STRIP
TRIANGLE
TRIANGLE_FAN
TRIANGLE_STRIP
尊重劳动成果,转载请保留出处:
http://xiaxveliang.blog.163.com/blog/static/2970803420139844152392/
相关文章推荐
- 论文-基于MFC单文档的Google Earth COM API程序设计
- Google Geocoding API 免费版和商业版(地理编码逆地址)
- Google 地图 API
- Google发布图表API
- Google Map API使用详解(如何在自己的网页中嵌入地图)
- arcgis flex api 访问 google 地图
- Android Google Map API使用的八个步骤
- 在Google Maps API中实现container层坐标和地理坐标之间的转化
- Google 地图 API V3 之事件
- GOOGLE地图基站定位-Google Mobile Maps API
- 使用Google Map API可能会遇到的问题汇总
- google asr api
- GOOGLE API 备忘录
- 10分钟学会Google Map API (一)
- 借助Google Translate API实现网站多国语言翻译功能
- ArcGIS API for Flex 调用天地图和Google地图服务
- Google Chart API
- 国内使用Google Maps JavaScript API
- Venn Diagram in Qlikview using google chart api
- google map api 离线地图服务器架设方案