Questions tagged [android-renderscript]

101 questions
0
votes
0 answers

Renderscript samples my image incorrectly

I have an image with multiple colours present (lets call it the mask). I also have a list of 'selected' colours. My renderscript makes a new image that I use as an overlay. If a colour is present in both the mask and the selected list, the overlay…
Zee
  • 1,592
  • 12
  • 26
0
votes
0 answers

Renderscript: How to allocate a uchar4 array

In my Android code, I keep an array of colours I would like to use in my renderscript code as follows: for(int col = 0; col < imgWidth; col++){ const uchar4 colour = *(const uchar4*)rsGetElementAt(colours, col, 0); if (in.r == colour.r &&…
Zee
  • 1,592
  • 12
  • 26
0
votes
1 answer

Renderscript for Bitmap crop

It looks like Android SDK's BitmapRegionDecoder uses Skia for decoding a part of the specified bitmap. Under the hood, it uses an appropriate code (jpeg, png etc) for the same. I'm looking at ways to optimize this using Renderscript. Is it possible…
Vairavan
  • 1,246
  • 1
  • 15
  • 19
0
votes
1 answer

How to remove the blur from root view in android

I am using this class to blur the background of the root view in my activity: object BlurBuilder { private val BITMAP_SCALE = 0.4f private val BLUR_RADIUS = 20f fun blur(v: View): Bitmap { return calculateBlur(v.context,…
CyberUser
  • 348
  • 1
  • 4
  • 13
0
votes
0 answers

android renderscript ScriptIntrinsicColorMatrix setRGBtoYUV example usage

as the title says, how to convert bitmap RGB back to YUV byte[] using ScriptIntrinsicColorMatrix? below is the sample code (cannot be decoded by zxing): public byte[] getYUVBytes(Bitmap src, boolean initOutAllocOnce){ …
vims liu
  • 643
  • 1
  • 9
  • 20
0
votes
1 answer

Android, RenderScript from SupportLibrary and java.lang.NoClassDefFoundError

I wanted to use RenderScript from the SupportLibrary to create a blur effekt. For this I've found the solution from here https://stackoverflow.com/a/14988991/408780 final RenderScript rs; rs = RenderScript.create( myAndroidContext ); final…
Tima
  • 12,765
  • 23
  • 82
  • 125
0
votes
1 answer

Optimizing renderscript summation of row and column cells

Any advise in optimizing the following code? The code first grayscales, inverts and then thresholds the image (code not included, because it is trivial). It then sums the elements of each row and column (all elements are either 1 or 0). It then…
0
votes
1 answer

Is Renderscript supported in Android NDK r14?

I am trying to build and android application that makes use of RenderScript from native code. I wonder what versions of NDK supports the RenderScript API ? I can not find the RenderScript header files in NDK r14, but they were there until the…
Moustafa Alzantot
  • 397
  • 1
  • 4
  • 16
0
votes
1 answer

Inconsistent behavior of Renderscript

I've written following renderscript: ushort* curve_hth; ushort* curve_hts; ushort* curve_htv; ushort* curve_sth; ushort* curve_sts; ushort* curve_stv; ushort* curve_vth; ushort* curve_vts; ushort* curve_vtv; uchar4 RS_KERNEL transform(uchar4 in,…
Karol Jurski
  • 180
  • 1
  • 10
0
votes
1 answer

Working on a 3D RenderScript Allocation, z attribute unavailable

Background I am trying to use RenderScript to perform some actions on a 3D Allocation. Here I create the Allocation: Type.Builder analyzer3DType = new Type.Builder(rsAnalyzer, Element.U8(rsAnalyzer)) .setX(allocationSize.getWidth() -…
0
votes
1 answer

How to set values of a renderscript globalusing rsSetElementAt_type() function

In Android RenderScript: A kernel may not have more than one input or one output Allocation. If more than one input or output is required, those objects should be bound to rs_allocation script globals and accessed from a kernel or invokable function…
Gaurav Maan
  • 339
  • 1
  • 2
  • 14
0
votes
1 answer

How to declare a local/private array in RenderScript?

From my research, I have found that it is not possible to allocate memory from inside RenderScript. For example, int* values = new int[10]; isn't allowed in C99. I would like this array to be local only to the current pixel being processed, which…
Mickael Caruso
  • 8,721
  • 11
  • 40
  • 72
0
votes
1 answer

How to compute on array passed to renderscript file

I want to create a renderscript in android where an array is passed to the .rs file. On these values some calculation is done and sent back to the user. I have very little understanding of renderscript, so what I have written might be completely…
Viraj Talaty
  • 15
  • 2
  • 6
0
votes
1 answer

Android Renderscript set neighbor pixel transparent

I have a script, that clear pixels certain color. uchar red = 100; uchar green = 100; uchar blue = 100; float treshold = 100; uchar4 __attribute__((kernel)) saturation(uchar4 in,uint32_t x, uint32_t y) { float ddd = ((in.r - red)*(in.r - red) +…
Ivan
  • 191
  • 1
  • 2
  • 11
0
votes
0 answers

RenderScript: Assertion failed in rsObjectBase.cpp

I saw a lot of the following error messages in the logcat output of my app: E/RenderScript: rsAssert failed: mSysRefCount > 0, in frameworks/rs/rsObjectBase.cpp at 147 Despite of this the app did mostly work but sometimes it would crash with…
devconsole
  • 7,875
  • 1
  • 34
  • 42