Android RenderScript copy allocation in rs file

丶灬走出姿态 提交于 2019-12-11 21:27:00

问题


I'm passing an allocation created from Bitmap into rs file, and inside the script I'm trying to copy the allocation to a new one using the rsAllocationCopy2DRange function, but I get force close when I'm trying to run the app. Can someone please explain how to use the function correctly, and what exactly are the arguments it gets. I looked in the reference site: http://developer.android.com/reference/renderscript/rs__allocation_8rsh.html#a7f7e2369b3ed7d7db31729b6db7ba07e

but I still don't know what are the dstMip and dstFace and how to get them.

Edit: I want to implement sobel operator, and in the implementation I need to use negative values after convolution with kernel, which is not possible using the build in allocation created from Bitmap and build in convove3x3, because the allocation is using uchar4. So I thought to implement convolution inside separate script so I can use the negative before it stored back to allocation. And I want to be able to pass only one allocation and kernel matrix, and inside the script I want to create new output allocation from the input allocation, and make the convolution on it and than copy the result back to the input allocation. I don't want to create the output allocation outside the script, in the java code, I want the entire process to be as transparent as possible, without the need to add objects that are unknown to the user.

来源:https://stackoverflow.com/questions/20705061/android-renderscript-copy-allocation-in-rs-file

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