renderscript

Where is the filterscript documentation (and how can I use it)? [closed]

﹥>﹥吖頭↗ 提交于 2019-11-30 04:57:33
When Jelly Bean 4.2 was announced a month ago, Filterscript was also announced. It appears to be a language that is a subscript of Renderscript with a different file extension. And that's about all I know about the language. I have read the two total paragraphs that exist about Filterscript on the entire Internet and created a small .fs file with pragma rs_fp_relaxed , but it does not get picked up by the ADT builders like a normal .rs file is in the same location. My ADT is the latest public version (21.0.0), which seems to be too low for Filterscript. tools.android.com appears to have 21.0.1

Passing Array to rsForEach in Renderscript Compute

天大地大妈咪最大 提交于 2019-11-30 00:44:07
I found there's lacking good documentation in RenderScript, for what I know, forEach in RS is to execute the root() for each individual item in the allocation. I am trying to make a library for Renderscript that does Image processing, as a starting point, I reached this great answer . But the problem, is that the blur operation is on Each pixel and each pixel requires another loop (n with blur width) of calculation. Although running on multi-core, it is still a bit too slow. I am trying to modify it to allow (two-pass) box filter, but that requires working on a single row or column instead of

Executing ScriptIntrinsicYuvToRgb

家住魔仙堡 提交于 2019-11-30 00:23:53
问题 I want to convert a byte[] in Yuv into a byte[] in Rgb. The ScriptIntrinsic (ScriptIntrinsicYuvToRgb) is supposed to do this (based on this example). Here's some code I have right now: byte[] imageData = ...gatheryuvbuffer... Type.Builder tb = new Type.Builder(mRS, Element.createPixel(mRS, Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV)); tb.setX(outputWidth); tb.setY(outputHeight); tb.setMipmaps(false); tb.setYuvFormat(ImageFormat.NV21); Allocation ain = Allocation.createTyped(mRS,

Returning a Renderscript struct from a Renderscript kernel

青春壹個敷衍的年華 提交于 2019-11-29 15:58:57
I'm looking to return an array of struct from my renderscript kernel. My problem is that although I can create an array of the struct in java using the generated code and pass this to my root method by getting the allocation of the array generated from this, I cant get the array back into java. The Renderscript documentation says to use the copyTo method to copy out of the allocation which ensures that the renderscript has finished operating on it. However this method only supports float, int, byte, bitmap. Even after waiting several seconds before accessing the array to ensure that the

Getting Multiple dex error when using render script support lib

旧街凉风 提交于 2019-11-29 15:34:00
I am using render script in support library in my gradle file. renderscriptTargetApi 22 renderscriptSupportModeEnabled true After I added these 2 lines, I am getting this error at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) UNEXPECTED TOP-LEVEL EXCEPTION:com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes; at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge

android can't load SupportV8 RenderScript in api <17

天涯浪子 提交于 2019-11-29 08:01:48
i just want to use RenderScript's ScriptIntrinsicBlur in my application , i've added renderscript.v8.jar (in android support lib v8) for supporting under 17 apis but it crashes on this line (in api <17 this happens it works fine on 4.2 or higher) : RenderScript rs = RenderScript.create(getApplicationContext()); and the Exception output is java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:299) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) at java.util.concurrent.FutureTask.setException

Android convert ImageReader Image to YCbCr_420_SP (NV21) byte array using render script?

≯℡__Kan透↙ 提交于 2019-11-29 07:18:58
问题 I am currently working with Javacv which makes use of the public void onPreviewFrame(byte[] data, Camera camera) camera function. Since camera is deprecated, I have been looking into camera2 and MediaProjection. Both of these libraries make use of the ImageReader class. Currently I instantiate such an ImageReader with the following code: ImageReader.newInstance(DISPLAY_WIDTH, DISPLAY_HEIGHT, PixelFormat.RGBA_8888, 2); And attach an OnImageAvailableListener like this: private final ImageReader

Where is the filterscript documentation (and how can I use it)? [closed]

喜欢而已 提交于 2019-11-29 02:35:24
问题 When Jelly Bean 4.2 was announced a month ago, Filterscript was also announced. It appears to be a language that is a subscript of Renderscript with a different file extension. And that's about all I know about the language. I have read the two total paragraphs that exist about Filterscript on the entire Internet and created a small .fs file with pragma rs_fp_relaxed , but it does not get picked up by the ADT builders like a normal .rs file is in the same location. My ADT is the latest public

Passing Array to rsForEach in Renderscript Compute

不想你离开。 提交于 2019-11-28 21:36:58
问题 I found there's lacking good documentation in RenderScript, for what I know, forEach in RS is to execute the root() for each individual item in the allocation. I am trying to make a library for Renderscript that does Image processing, as a starting point, I reached this great answer. But the problem, is that the blur operation is on Each pixel and each pixel requires another loop (n with blur width) of calculation. Although running on multi-core, it is still a bit too slow. I am trying to

Has anyone managed to obtain a YUV_420_888 frame using RenderScript and the new Camera API?

南笙酒味 提交于 2019-11-28 12:45:19
I'm using RenderScript and Allocation to obtain YUV_420_888 frames from the Android Camera2 API, but once I copy the byte[] from the Allocation I receive only the Y plane from the 3 planes which compose the frame, while the U and V planes values are set to 0 in the byte[]. I'm trying to mimic the onPreviewframe from the previos camera API in order to perform in app processing of the camera frames. My Allocation is created like: Type.Builder yuvTypeBuilderIn = new Type.Builder(rs, Element.YUV(rs)); yuvTypeBuilderIn.setX(dimensions.getWidth()); yuvTypeBuilderIn.setY(dimensions.getHeight());