2

Is there a ScriptIntrinsic (built-in RenderScript kernels for common ) operations to roate a bitmap memory efficiently?

pats
  • 1,273
  • 2
  • 20
  • 43

1 Answers1

1

No, there is nothing to rotate Bitmaps in the current support library for RS.

Stephen Hines
  • 2,612
  • 1
  • 13
  • 12
  • You would have to present pretty compelling evidence that rotations are something common enough to warrant the additional library space for optimizing them. I think that you should be able to write your own custom rotation kernel that would still run quite fast (especially compared to a Java equivalent block of code). – Stephen Hines Dec 16 '15 at 18:20
  • I thik this is basic case to uae renderscript given that out of memory exception that could occur when we use createbitmap java option. Only other way to avoid outof mem is use ndk. – pats Dec 17 '15 at 04:20
  • The NDK can get out of memory errors just as easily. You should focus on making your case handle that condition more robustly (or operate on smaller images only). – Stephen Hines Dec 17 '15 at 18:52
  • Ohh I didnt know that NDK can endup with the same issues. Ndk is the widely proposed solution for bitmap rotation and avoid out of mem. I was able to get NDK solution using http://stackoverflow.com/questions/14398670/rotating-a-bitmap-using-jni-ndk. Are you saying this would not help me? – pats Dec 19 '15 at 03:45
  • Further, after a long trial and error with bulid tool versions I was able to get solution based on re nder script to work. http://stackoverflow.com/questions/12044674/android-rotate-image-without-loading-it-to-memory. but it thorws a runtime excpetion "Loading of ScriptC script failed ". It is bit confusing when we have no way to go after so much effors. – pats Dec 19 '15 at 03:48