android - How do you get neighboring pixels of a bitmap Allocation in Renderscript? -
I want to do an image processing operation that requires a neighboring pixel, but I'm not sure how to use them allocated should do . I have noticed that most of the kernels work on single pixels, update it, and then return it. What is one way I can use the neighbors of x (y) in the method given below.
uchar4 __attribute __ ((kernel)) Invert (uchar4 in, uint32_t x, uint32_t y) {uchar4 neighbor = allocation [x + 1] [y]; // How can I do this in renderwriting? uchar4 other bottom = allocation [x-1] [or]; ...}
Criteria input / output allocation that is fully connected to the neighboring Access to pixels, but you can get them by making global variables of RS_Olocation type only.
rs_allocation input; Uchar4 __attribute __ ((kernel)) Inversion (uchar4, uint32_t x, uint32_t y) {uchar4 neighbor = rsGetElementAt_uchar4 (input, x + 1, y); Uchar4 Other Squeeze = RSgateAlexEnt_Char 4 (Input, X-1, Y); ...} In Java, to call you first on your kernel, you just need to:
myScript.set_input (myInputAllocation ); MyScript.forEach_invert (myInputAllocation, myOutputAllocation);
Comments
Post a Comment