renderscript

Allocation.copyTo(Bitmap) corrupting pixel values

谁说我不能喝 提交于 2019-12-10 14:57:04
问题 I'm new to Renderscript, and am striking issues with my first script. As far as I can see (from debugging statements I've inserted) my code works fine, but the computed values are getting mangled when they are being copied back to the Bitmap by the Allocation.copyTo(Bitmap) method. I was getting weird colours out, so eventually stripped down my script to this sample which shows the problem: void root(const uchar4 *v_in, uchar4 *v_out, const void *usrData, uint32_t x, uint32_t y) { *v_out =

How to use the Renderscript blurring effect without artifacts?

a 夏天 提交于 2019-12-09 06:10:03
问题 Background There are plenty of places (including here) to show how to use Renderscript to blur images, as such: @TargetApi(VERSION_CODES.JELLY_BEAN_MR1) public static Bitmap renderScriptBlur(Context context, Bitmap srcBitmap, @FloatRange(from = 0.0f, to = 25.0f) float radius) { if (srcBitmap == null) return null; Bitmap outputBitmap = null; RenderScript rs = null; try { rs = RenderScript.create(context); outputBitmap = Bitmap.createBitmap(srcBitmap.getWidth(), srcBitmap.getHeight(), Bitmap

Renderscript samples build errors

a 夏天 提交于 2019-12-09 02:07:18
问题 So I wanted to try out the samples that use RenderScript, and I imported HelloWorld in Eclipse. But it gives me errors like: [2011-10-25 13:10:48 - HelloWorld] /home/mileoresko/workspace/utils/android-sdk-linux_86 /platforms/android-11/renderscript/include/rs_graphics.rsh:240:58: error: unknown type name 'float3'; did you mean 'float'? [2011-10-25 13:10:48 - HelloWorld] /home/mileoresko/workspace/utils/android-sdk-linux_86 /platforms/android-11/renderscript/include/rs_graphics.rsh:237:31:

RSRuntimeException: Loading of ScriptC script failed (build tools 19.0.2)

我的梦境 提交于 2019-12-08 13:01:35
Here's my entire output: 02-26 09:55:50.410 625-640/com.vsco.cam E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:299) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352) at java.util.concurrent.FutureTask.setException(FutureTask.java:219) at java.util.concurrent.FutureTask.run(FutureTask.java:239) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java

Android Renderscript Allocation.USAGE_SHARED crash

半城伤御伤魂 提交于 2019-12-08 08:25:04
问题 I am getting a crash while running my app which uses renderscript. Unfortunately, the logcat does not give any specific details. b = Bitmap.createBitmap(ib.getWidth(), ib.getHeight(),ib.getConfig()); Allocation mInAllocation = Allocation.createFromBitmap(mRS, inBitmap, Allocation.MipmapControl.MIPMAP_NONE,Allocation.USAGE_SHARED); Allocation mOutAllocation2 = Allocation.createFromBitmap(mRS, outBitmap, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SHARED); ...execute an algorithm

Renderscript usage

风流意气都作罢 提交于 2019-12-08 04:55:42
问题 Can I use renderscript in an application that is meant to be for android 2.2 and up? Because I know that it has been used for wallpapers, but only internal. Did that change, because renderscript is public now? I am building an application for the tablet, and i am writing it in renderscript, but i want to be able to release it for mobile phones as well. Porting the renderscript code to open gl es 2.0 or sth would be very very hard work for me. 回答1: Renderscript is a 3.0+ API only. Renderscript

Renderscript limitation size of array

淺唱寂寞╮ 提交于 2019-12-08 01:34:33
问题 I'm doing matrix multiplication in Renderscript. I have my java file which prepares all the arrays. In my Renderscript I have global variables which will be set by the java file. But I have seen there is a limitation. If I want to do a multiplication with 37x37 matrix the results still right. If I do a 38x38 matrix multplication the results are no longer correct. After the first row of the final result the calculation results are not correct. I guess there is a limitation. 37*37 = 1369 int

Battery Power Consumption between C/Renderscript/Neon Intrinsics — Video filter (Edgedetection) APK

徘徊边缘 提交于 2019-12-07 20:21:05
问题 I have developed 3 C/RS/Neon-Intrinsics versions of Video Processing Algorithm using Android NDK (using C++ APIs for Renderscript). Calls to C/RS/Neon will be made to Native level on NDK side from JAVA front end. I found that for some reason Neon version consumes lot of power in comparison with C and RS versions. I used Trepn 5.0 for my power testing. Can some one clarify me regarding the power consumption level for each of these methods C , Renderscript - GPU, Neon Intrinsics. Which one

renderscript rsMatrixMultiply function

戏子无情 提交于 2019-12-07 18:48:35
问题 I am developing an OpenGL ES 2.0 android application, by porting the code from an renderscript created application. In renderscript this function is used: float4 rsMatrixMultiply(rs_matrix4x4 *m, float3 in); Does anyone knows what exactly this function does and how it is implemented, because I need to use it in my OpenGL application using Java. 回答1: This does standard matrix multiplication between the matrix 'm' and the vector 'in'. The result is placed back in 'm'. In order to multiply the

Android - RenderScript - Performance drop in SDK 21

与世无争的帅哥 提交于 2019-12-07 16:36:23
问题 I'm developing a project which requires complex Photoshop type blend effects. I am using custom RenderScript scripts to solve this. I've been testing it on a Samsung Galaxy S4 device running Kitkat , and everything works great and very quickly. I then tried testing it on a Nexus 5 running Lollipop , and I noticed a sudden drop in performance. I started timing separate sections in the code to see which parts slow down, and came up with this: Allocation.createFromBitmap - Runtime on Kitkat - ~5