android - rs 文件中的 RenderScript 复制 3D 分配
问题描述
RenderScript 分配可以是 1D、2D 或 3D。几乎所有方法都支持这 3 个,但是复制方法缺少 3D。根据 Android 开发人员的说法,以下是所有数据访问功能:
rsAllocationCopy1DRange Copy consecutive cells between allocations
rsAllocationCopy2DRange Copy a rectangular region of cells between allocations
rsAllocationVLoadX Get a vector from an allocation of scalars
rsAllocationVStoreX Store a vector into an allocation of scalars
rsGetElementAt Return a cell from an allocation
rsGetElementAtYuv_uchar_U Get the U component of an allocation of YUVs
rsGetElementAtYuv_uchar_V Get the V component of an allocation of YUVs
rsGetElementAtYuv_uchar_Y Get the Y component of an allocation of YUVs
rsSample Sample a value from a texture allocation
rsSetElementAt Set a cell of an allocation
如您所见,没有rsAllocationCopy3DRange
. 我还是用这段代码试过了:
rsAllocationCopy3DRange(output, 0, 0, 0, 0, 0, w, h, d, data, 0, 0, 0, 0, 0);
并且编译失败。
如何复制 3D 分配?我可以编写一个内核函数,只返回输入然后返回rsForEach
那个函数,但对于简单的副本来说似乎效率很低。
为什么没有3D副本?这没有意义。为什么 Java/Kotlin 端有 3D 副本,而 rs 端没有?
解决方案
推荐阅读
- version-control - 如何删除 Mercurial 中已推送的更改集?
- python - def 函数的问题
- ajax - 当在ajax中设置缓存为false时,它会在请求中添加一些值它是什么
- vba - 如何对vba中的数字列表求和?
- spring-mvc - 在spring MVC中使用带有方法Options和Head的请求时如何抛出错误
- php - php解密密码不起作用
- html - 从
- php - 我如何使用 foreach 在 php、pdo 中构建 2 个不同的列
- git - 我应该使用 git 的分支来保存我的代码的不同版本吗?
- php - 如果它们还没有标签,如何将 html i 标签添加到与数组元素匹配的子字符串中