renderscript: accessing 'z' coordinate

余生颓废 提交于 2019-12-13 05:37:25

问题


I'm trying to write a simple kernel for image processing; I was planning on storing the channel of image in the 'z' coordinate of an allocation. I think this should be possible based on the documentation:

A kernel may access the coordinates of the current execution using the x, y, and z arguments. These arguments are optional, but the type of the coordinate arguments must be uint32_t.

I tried to write an empty kernel which uses the 'z' coordinate:

#pragma version(1)
#pragma rs java_package_name(org.rjpower.testcompute)

rs_allocation data_in;
rs_allocation data_out;

void root(const float* src, float* dst, uint32_t x, uint32_t y, uint32_t z) {
}

But the compile fails with:

error: Unexpected kernel root() parameter 'z' of type 'uint32_t'

Are z-coordinates actually supported?


回答1:


No, right now we don't support z coordinates when used with forEach.



来源:https://stackoverflow.com/questions/21358733/renderscript-accessing-z-coordinate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!