问题
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