概览
以下函数可用于获取和设置构成分配的单元。
- 您可以使用 rsGetElementAt* 和 rsSetElementAt 函数访问各个单元格。
- 您可以使用 rsAllocationCopy* 和 rsAllocationV* 函数复制多个单元格。
- 要通过采样器获取值,请使用 rsSample。
总结
| 函数 | |
|---|---|
| rsAllocationCopy1DRange | 在分配之间复制连续单元格 |
| rsAllocationCopy2DRange | 在分配之间复制单元格的矩形区域 |
| rsAllocationVLoadX | 从标量分配中获取矢量 |
| rsAllocationVStoreX | 将向量存储到标量分配中 |
| rsGetElementAt | 从分配返回单元格 |
| rsGetElementAtYuv_uchar_U | 获取 YUV 分配的 U 分量 |
| rsGetElementAtYuv_uchar_V | 获取 YUV 分配的 V 分量 |
| rsGetElementAtYuv_uchar_Y | 获取 YUV 分配的 Y 分量 |
| rsSample | 对纹理分配中的值进行采样 |
| rsSetElementAt | 设置分配中的单元格 |
函数
rsAllocationCopy1DRange :在分配之间复制连续单元格
| void rsAllocationCopy1DRange(rs_allocation dstAlloc, uint32_t dstOff, uint32_t dstMip, uint32_t count, rs_allocation srcAlloc, uint32_t srcOff, uint32_tMip); | 在 API 级别 14 中引入 |
参数
| dstAlloc | 分配以将单元格复制到其中。 |
|---|---|
| dstOff | 第一个要复制到的单元格的目标的偏移量。 |
| dstMip | 目标分配中的 mip 级别。如果未使用 mip 映射,则为 0。 |
| count | 要复制的单元格数。 |
| srcAlloc | 来源分配。 |
| srcOff | 要复制的第一个单元格的来源中的偏移量。 |
| srcMip | 来源分配中的 mip 级别。如果未使用 mip 映射,则为 0。 |
将指定数量的单元格从一个分配复制到另一个分配。
这两个分配必须不同。使用此函数在同一分配中复制会产生未定义的结果。
该函数不会验证偏移量加计数是否超过任一分配的大小。请注意!
此函数只能在一维分配之间调用。在其他分配上调用它是未定义的。
此函数不应从内核内部调用,也不应从可能直接或间接从内核调用的函数调用。这样做会导致运行时错误。
rsAllocationCopy2DRange :在分配之间复制单元格的矩形区域
| void rsAllocationCopy2DRange(rs_allocation dstAlloc, uint32_t dstXoff, uint32_t dstYoff, uint32_t dstMip, rs_allocation_cubemap_face dstFace, uint32_location}height, uint32_location 。。23, dstAlloc, uint32_t dstXoff, 。 | 在 API 级别 14 中引入 |
参数
| dstAlloc | 分配以将单元格复制到其中。 |
|---|---|
| dstXoff | 要设置的区域目的地中的 X 偏移量。 |
| dstYoff | 要设置的区域目的地中的 Y 偏移量。 |
| dstMip | 目标分配中的 mip 级别。如果未使用 mip 映射,则为 0。 |
| dstFace | 目标分配的立方体映射面。对于不是立方体映射的分配,系统会忽略此参数。 |
| width | 要更新的传入区域的宽度。 |
| height | 要更新的传入区域的高度。 |
| srcAlloc | 来源分配。 |
| srcXoff | 来源中的 X 偏移量。 |
| srcYoff | 来源中的 Y 偏移量。 |
| srcMip | 来源分配中的 mip 级别。如果未使用 mip 映射,则为 0。 |
| srcFace | 来源分配的 Cubemap 面。对于不是立方体映射的分配,系统会忽略此参数。 |
将单元的矩形区域从一个分配复制到另一个分配。 (宽度 * 高度)复制单元格。
这两个分配必须不同。使用此函数在同一分配中复制会产生未定义的结果。
该函数不会验证来源区域或目标区域是否超过其各自分配的大小。请注意!
此函数只能在 2D 分配之间调用。在其他分配上调用它是未定义的。
此函数不应从内核内部调用,也不应从可能直接或间接从内核调用的函数调用。这样做会导致运行时错误。
rsAllocationVLoadX :从标量分配中获取矢量
| char2 rsAllocationVLoadX_char2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| char2 rsAllocationVLoadX_char2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| char2 rsAllocationVLoadX_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| char3 rsAllocationVLoadX_char3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| char3 rsAllocationVLoadX_char3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| char3 rsAllocationVLoadX_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| char4 rsAllocationVLoadX_char4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| char4 rsAllocationVLoadX_char4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| char4 rsAllocationVLoadX_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| double2 rsAllocationVLoadX_double2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| double2 rsAllocationVLoadX_double2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| double2 rsAllocationVLoadX_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| double3 rsAllocationVLoadX_double3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| double3 rsAllocationVLoadX_double3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| double3 rsAllocationVLoadX_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| double4 rsAllocationVLoadX_double4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| double4 rsAllocationVLoadX_double4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| double4 rsAllocationVLoadX_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| float2 rsAllocationVLoadX_float2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| float2 rsAllocationVLoadX_float2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| float2 rsAllocationVLoadX_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| float3 rsAllocationVLoadX_float3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| float3 rsAllocationVLoadX_float3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| float3 rsAllocationVLoadX_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| float4 rsAllocationVLoadX_float4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| float4 rsAllocationVLoadX_float4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| float4 rsAllocationVLoadX_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| int2 rsAllocationVLoadX_int2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| int2 rsAllocationVLoadX_int2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| int2 rsAllocationVLoadX_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| int3 rsAllocationVLoadX_int3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| int3 rsAllocationVLoadX_int3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| int3 rsAllocationVLoadX_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| int4 rsAllocationVLoadX_int4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| int4 rsAllocationVLoadX_int4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| int4 rsAllocationVLoadX_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| long2 rsAllocationVLoadX_long2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| long2 rsAllocationVLoadX_long2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| long2 rsAllocationVLoadX_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| long3 rsAllocationVLoadX_long3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| long3 rsAllocationVLoadX_long3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| long3 rsAllocationVLoadX_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| long4 rsAllocationVLoadX_long4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| long4 rsAllocationVLoadX_long4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| long4 rsAllocationVLoadX_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| short2 rsAllocationVLoadX_short2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| short2 rsAllocationVLoadX_short2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| short2 rsAllocationVLoadX_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| short3 rsAllocationVLoadX_short3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| short3 rsAllocationVLoadX_short3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| short3 rsAllocationVLoadX_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| short4 rsAllocationVLoadX_short4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| short4 rsAllocationVLoadX_short4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| short4 rsAllocationVLoadX_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| uchar2 rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| uchar2 rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| uchar2 rsAllocationVLoadX_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| uchar3 rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| uchar3 rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| uchar3 rsAllocationVLoadX_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| uchar4 rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| uchar4 rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| uchar4 rsAllocationVLoadX_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| uint2 rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| uint2 rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| uint2 rsAllocationVLoadX_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| uint3 rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| uint3 rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| uint3 rsAllocationVLoadX_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| uint4 rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| uint4 rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| uint4 rsAllocationVLoadX_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| ulong2 rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| ulong2 rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| ulong2 rsAllocationVLoadX_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| ulong3 rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| ulong3 rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| ulong3 rsAllocationVLoadX_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| ulong4 rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| ulong4 rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| ulong4 rsAllocationVLoadX_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| ushort2 rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| ushort2 rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| ushort2 rsAllocationVLoadX_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| ushort3 rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| ushort3 rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| ushort3 rsAllocationVLoadX_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| ushort4 rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x); | 在 API 级别 22 中引入 |
| ushort4 rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| ushort4 rsAllocationVLoadX_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
参数
| 一个 | 要从中获取数据的分配。 |
|---|---|
| x | 要复制的第一个单元格的分配中的 X 偏移量。 |
| y | 要复制的第一个单元格的分配中的 Y 偏移量。 |
| z | 要复制的第一个单元格的分配中的 Z 偏移量。 |
此函数会返回由分配的连续单元格组成的向量。它假定分配包含标量。
名称中的“X”表示通过增加 X 索引提取连续值。目前没有函数可以获取递增其他维度的连续值。请改为多次调用 rsGetElementAt()。
例如,调用 rsAllocationVLoadX_int4(a, 20, 30) 时,系统会返回由 a[20, 30]、a[21, 30]、a[22, 30] 和 a[23, 30] 组成的 int4。
从三维分配中检索时,请使用 x, y, z 变体。同样,对于二维分配,请使用 x, y 变体,对于单维分配,请使用 x。
为了提高效率,此函数不会验证输入。如果尝试封装 X 索引、超出分配的大小,或者使用与分配维度不兼容的索引,将会产生未定义的结果。
另请参阅 rsAllocationVStoreX()。
rsAllocationVStoreX :将向量存储到标量分配中
| void rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y); | 在 API 级别 22 中引入 |
| void rsAllocationVStoreX_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 22 中引入 |
参数
| 一个 | 用于存储数据的分配。 |
|---|---|
| 瓦尔 | 要存储的值。 |
| x | 要复制到的第一个单元格的分配中的 X 偏移量。 |
| y | 要复制到的第一个单元格的分配中的 Y 偏移量。 |
| z | 要复制到的第一个单元格的分配中的 Z 偏移量。 |
此函数会将向量的条目存储到分配的连续单元中。它假定分配包含标量。
名称中的“X”表示通过递增 X 索引来存储连续值。目前没有函数可以存储递增其他维度的连续值。请改为多次调用 rsSetElementAt()。
例如,调用 rsAllocationVStoreX_int3(a, v, 20, 30) 时,v.x 存储在 a[20, 30]、v.y 的 a[21, 30] 和 v.z 的 a[22, 30] 中。
存储到三维分配中时,请使用 x, y, z 变体。同样,对于二维分配,请使用 x, y 变体,对于单维分配,请使用 x。
为了提高效率,此函数不会验证输入。尝试封装 X 索引、超过分配的大小,或使用与分配维度不兼容的索引会导致未定义的结果。
另请参阅 rsAllocationVLoadX()。
rsGetElementAt :返回分配中的单元格
| char rsGetElementAt_char(rs_allocation a, uint32_t x); | |
| char rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y); | |
| char rsGetElementAt_char(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| char2 rsGetElementAt_char2(rs_allocation a, uint32_t x); | |
| char2 rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y); | |
| char2 rsGetElementAt_char2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| char3 rsGetElementAt_char3(rs_allocation a, uint32_t x); | |
| char3 rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y); | |
| char3 rsGetElementAt_char3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| char4 rsGetElementAt_char4(rs_allocation a, uint32_t x); | |
| char4 rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y); | |
| char4 rsGetElementAt_char4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| const void* rsGetElementAt(rs_allocation a, uint32_t x); | |
| const void* rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y); | |
| const void* rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| double rsGetElementAt_double(rs_allocation a, uint32_t x); | |
| double rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y); | |
| double rsGetElementAt_double(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| double2 rsGetElementAt_double2(rs_allocation a, uint32_t x); | |
| double2 rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y); | |
| double2 rsGetElementAt_double2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| double3 rsGetElementAt_double3(rs_allocation a, uint32_t x); | |
| double3 rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y); | |
| double3 rsGetElementAt_double3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| double4 rsGetElementAt_double4(rs_allocation a, uint32_t x); | |
| double4 rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y); | |
| double4 rsGetElementAt_double4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| float rsGetElementAt_float(rs_allocation a, uint32_t x); | |
| float rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y); | |
| float rsGetElementAt_float(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| float2 rsGetElementAt_float2(rs_allocation a, uint32_t x); | |
| float2 rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y); | |
| float2 rsGetElementAt_float2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| float3 rsGetElementAt_float3(rs_allocation a, uint32_t x); | |
| float3 rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y); | |
| float3 rsGetElementAt_float3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| float4 rsGetElementAt_float4(rs_allocation a, uint32_t x); | |
| float4 rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y); | |
| float4 rsGetElementAt_float4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| half rsGetElementAt_half(rs_allocation a, uint32_t x); | 在 API 级别 23 中引入 |
| half rsGetElementAt_half(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| half rsGetElementAt_half(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| half2 rsGetElementAt_half2(rs_allocation a, uint32_t x); | 在 API 级别 23 中引入 |
| half2 rsGetElementAt_half2(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| half2 rsGetElementAt_half2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| half3 rsGetElementAt_half3(rs_allocation a, uint32_t x); | 在 API 级别 23 中引入 |
| half3 rsGetElementAt_half3(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| half3 rsGetElementAt_half3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| half4 rsGetElementAt_half4(rs_allocation a, uint32_t x); | 在 API 级别 23 中引入 |
| half4 rsGetElementAt_half4(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| half4 rsGetElementAt_half4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| int rsGetElementAt_int(rs_allocation a, uint32_t x); | |
| int rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y); | |
| int rsGetElementAt_int(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| int2 rsGetElementAt_int2(rs_allocation a, uint32_t x); | |
| int2 rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y); | |
| int2 rsGetElementAt_int2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| int3 rsGetElementAt_int3(rs_allocation a, uint32_t x); | |
| int3 rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y); | |
| int3 rsGetElementAt_int3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| int4 rsGetElementAt_int4(rs_allocation a, uint32_t x); | |
| int4 rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y); | |
| int4 rsGetElementAt_int4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| long rsGetElementAt_long(rs_allocation a, uint32_t x); | |
| long rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y); | |
| long rsGetElementAt_long(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| long2 rsGetElementAt_long2(rs_allocation a, uint32_t x); | |
| long2 rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y); | |
| long2 rsGetElementAt_long2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| long3 rsGetElementAt_long3(rs_allocation a, uint32_t x); | |
| long3 rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y); | |
| long3 rsGetElementAt_long3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| long4 rsGetElementAt_long4(rs_allocation a, uint32_t x); | |
| long4 rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y); | |
| long4 rsGetElementAt_long4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| short rsGetElementAt_short(rs_allocation a, uint32_t x); | |
| short rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y); | |
| short rsGetElementAt_short(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| short2 rsGetElementAt_short2(rs_allocation a, uint32_t x); | |
| short2 rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y); | |
| short2 rsGetElementAt_short2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| short3 rsGetElementAt_short3(rs_allocation a, uint32_t x); | |
| short3 rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y); | |
| short3 rsGetElementAt_short3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| short4 rsGetElementAt_short4(rs_allocation a, uint32_t x); | |
| short4 rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y); | |
| short4 rsGetElementAt_short4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uchar rsGetElementAt_uchar(rs_allocation a, uint32_t x); | |
| uchar rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y); | |
| uchar rsGetElementAt_uchar(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uchar2 rsGetElementAt_uchar2(rs_allocation a, uint32_t x); | |
| uchar2 rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y); | |
| uchar2 rsGetElementAt_uchar2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uchar3 rsGetElementAt_uchar3(rs_allocation a, uint32_t x); | |
| uchar3 rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y); | |
| uchar3 rsGetElementAt_uchar3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uchar4 rsGetElementAt_uchar4(rs_allocation a, uint32_t x); | |
| uchar4 rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y); | |
| uchar4 rsGetElementAt_uchar4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uint rsGetElementAt_uint(rs_allocation a, uint32_t x); | |
| uint rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y); | |
| uint rsGetElementAt_uint(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uint2 rsGetElementAt_uint2(rs_allocation a, uint32_t x); | |
| uint2 rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y); | |
| uint2 rsGetElementAt_uint2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uint3 rsGetElementAt_uint3(rs_allocation a, uint32_t x); | |
| uint3 rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y); | |
| uint3 rsGetElementAt_uint3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| uint4 rsGetElementAt_uint4(rs_allocation a, uint32_t x); | |
| uint4 rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y); | |
| uint4 rsGetElementAt_uint4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ulong rsGetElementAt_ulong(rs_allocation a, uint32_t x); | |
| ulong rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y); | |
| ulong rsGetElementAt_ulong(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ulong2 rsGetElementAt_ulong2(rs_allocation a, uint32_t x); | |
| ulong2 rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y); | |
| ulong2 rsGetElementAt_ulong2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ulong3 rsGetElementAt_ulong3(rs_allocation a, uint32_t x); | |
| ulong3 rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y); | |
| ulong3 rsGetElementAt_ulong3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ulong4 rsGetElementAt_ulong4(rs_allocation a, uint32_t x); | |
| ulong4 rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y); | |
| ulong4 rsGetElementAt_ulong4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ushort rsGetElementAt_ushort(rs_allocation a, uint32_t x); | |
| ushort rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y); | |
| ushort rsGetElementAt_ushort(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ushort2 rsGetElementAt_ushort2(rs_allocation a, uint32_t x); | |
| ushort2 rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y); | |
| ushort2 rsGetElementAt_ushort2(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ushort3 rsGetElementAt_ushort3(rs_allocation a, uint32_t x); | |
| ushort3 rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y); | |
| ushort3 rsGetElementAt_ushort3(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); | |
| ushort4 rsGetElementAt_ushort4(rs_allocation a, uint32_t x); | |
| ushort4 rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y); | |
| ushort4 rsGetElementAt_ushort4(rs_allocation a, uint32_t x, uint32_t y, uint32_t z); |
此函数从分配中提取单个单元格。
从三维分配中检索时,请使用 x, y, z 变体。同样,对于二维分配,请使用 x, y 变体,对于单维分配,请使用 x。
此函数有两种样式。一个使用 void* 返回值的地址,另一个返回实际值,例如 rsGetElementAt() 与 rsGetElementAt_int4()。对于基元类型,请始终使用后者,因为它效率更高。
rsGetElementAtYuv_uchar_U :获取 YUV 分配的 U 分量
| uchar rsGetElementAtYuv_uchar_U(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
从 YUV 的 2D 分配中提取单个 YUV 值的 U 分量。
在分配中,如果不同的平面和分辨率不同,则可以存储 Y、U 和 V 分量。此处提供的 x、y 坐标采用 Y 平面的尺寸。
请参阅 rsGetElementAtYuv_uchar_Y()。
rsGetElementAtYuv_uchar_V :获取 YUV 分配的 V 分量
| uchar rsGetElementAtYuv_uchar_V(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
从 YUV 的 2D 分配中提取单个 YUV 值的 V 分量。
在分配中,如果不同的平面和分辨率不同,则可以存储 Y、U 和 V 分量。此处提供的 x、y 坐标采用 Y 平面的尺寸。
请参阅 rsGetElementAtYuv_uchar_Y()。
rsGetElementAtYuv_uchar_Y :获取 YUV 分配的 Y 分量
| uchar rsGetElementAtYuv_uchar_Y(rs_allocation a, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
从 YUV 的 2D 分配中提取单个 YUV 值的 Y 分量。
在分配中,如果不同的平面和分辨率不同,则可以存储 Y、U 和 V 分量。此处提供的 x、y 坐标采用 Y 平面的尺寸。
请参阅 rsGetElementAtYuv_uchar_U() 和 rsGetElementAtYuv_uchar_V()。
rsSample :对纹理分配中的值进行采样
| float4 rsSample(rs_allocation a, rs_sampler s, float location); | 在 API 级别 16 中引入 |
| float4 rsSample(rs_allocation a, rs_sampler s, float location, float lod); | 在 API 级别 16 中引入 |
| float4 rsSample(rs_allocation a, rs_sampler s, float2 location); | 在 API 级别 16 中引入 |
| float4 rsSample(rs_allocation a, rs_sampler s, float2 location, float lod); | 在 API 级别 16 中引入 |
参数
| 一个 | 供采样使用的分配。 |
|---|---|
| 秒 | 采样器状态。 |
| 地理位置 | 采样位置。 |
| Lod | 要采样的 mip 级别,对于小数值,如果使用 RS_SAMPLER_LINEAR_MIP_LINEAR,将插入 mip 级别。 |
按照采样器描述的方式从纹理分配中提取值。
如果您的分配是 1D,请使用包含浮点数的变体来指定位置。对于 2D 模型,请使用 float2 变体。
如需了解详情,请参阅 android.renderscript.Sampler。
rsSetElementAt :设置分配的单元格
| void rsSetElementAt(rs_allocation a, void* ptr, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt(rs_allocation a, void* ptr, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char(rs_allocation a, char val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char(rs_allocation a, char val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char(rs_allocation a, char val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char2(rs_allocation a, char2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char3(rs_allocation a, char3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_char4(rs_allocation a, char4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double(rs_allocation a, double val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double(rs_allocation a, double val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double(rs_allocation a, double val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double2(rs_allocation a, double2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double3(rs_allocation a, double3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_double4(rs_allocation a, double4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float(rs_allocation a, float val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float(rs_allocation a, float val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float(rs_allocation a, float val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float2(rs_allocation a, float2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float3(rs_allocation a, float3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_float4(rs_allocation a, float4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_half(rs_allocation a, half val, uint32_t x); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half(rs_allocation a, half val, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half(rs_allocation a, half val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half2(rs_allocation a, half2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half3(rs_allocation a, half3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x, uint32_t y); | 在 API 级别 23 中引入 |
| void rsSetElementAt_half4(rs_allocation a, half4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 23 中引入 |
| void rsSetElementAt_int(rs_allocation a, int val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int(rs_allocation a, int val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int(rs_allocation a, int val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int2(rs_allocation a, int2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int3(rs_allocation a, int3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_int4(rs_allocation a, int4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long(rs_allocation a, long val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long(rs_allocation a, long val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long(rs_allocation a, long val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long2(rs_allocation a, long2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long3(rs_allocation a, long3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_long4(rs_allocation a, long4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short(rs_allocation a, short val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short(rs_allocation a, short val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short(rs_allocation a, short val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short2(rs_allocation a, short2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short3(rs_allocation a, short3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_short4(rs_allocation a, short4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar(rs_allocation a, uchar val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar2(rs_allocation a, uchar2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar3(rs_allocation a, uchar3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uchar4(rs_allocation a, uchar4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint(rs_allocation a, uint val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint2(rs_allocation a, uint2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint3(rs_allocation a, uint3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_uint4(rs_allocation a, uint4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong(rs_allocation a, ulong val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong2(rs_allocation a, ulong2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong3(rs_allocation a, ulong3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ulong4(rs_allocation a, ulong4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort(rs_allocation a, ushort val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort2(rs_allocation a, ushort2 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort3(rs_allocation a, ushort3 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y); | 在 API 级别 18 中引入 |
| void rsSetElementAt_ushort4(rs_allocation a, ushort4 val, uint32_t x, uint32_t y, uint32_t z); | 在 API 级别 18 中引入 |
此函数会将值存储到分配的单个单元格中。
存储到三维分配中时,请使用 x, y, z 变体。同样,对于二维分配,请使用 x, y 变体,对于单维分配,请使用 x。
此函数有两种样式。一个使用 void* 传递要存储的值,另一个使用实际值作为参数,例如 rsSetElementAt() 与 rsSetElementAt_int4()。对于基元类型,请始终使用后者,因为它效率更高。
另请参阅 rsGetElementAt()。