Search code examples
androidintrinsicsrenderscript

Renderscript Intrinsics documentation


I use the Renderscript ScriptIntrinsicBlur, which which works great and saves my app a lot of calculation time. However, I was looking for a kind of a user guide and documentation of these very useful Renderscript Intrinsic functions but found almost nothing, except some high level technical info on the developer site. For example:

how is the blur radius of ScriptIntrinsicBlur defined? I assume it must some cut-off of the gaussian Sigma in relation to the kernel size (e.g. 99%), but I didn't find anything on that. also I would be interested in the histogram function, e.g. in order to apply them for histogram-matching of two Pictures. But I found little on that. how exactly are the types U8_4, U8_3, U8_2, U8 defined? And what type would be most efficient for Gray-Value Pictures?

Thanks for any Feedback.


Solution

  • I don't know much about the Gaussian Sigma here, but the source code is available online (https://android.googlesource.com/platform/frameworks/rs/+/master/cpu_ref/rsCpuIntrinsicBlur.cpp). Note that GPGPU drivers are free to reimplement this slightly differently too.

    As far as the U8 stuff goes, those are just the underlying Element types. U8 means a single unsigned char. U8_2 is a 2-wide vector of unsigned chars. U8_3 and U8_4 are similarly 3 and 4 wide vectors of unsigned chars. For many image processing tasks, U8_4 is the underlying type (as in RGBA_8888, which is 4 8-bit values for red, green, blue, alpha).