Writing a custom Kernel
RenderScript gives you the ability to develop small custom "scripts" instead of the built-in Intrinsics. These programs are called Kernels and are written in a C-like language. They are compiled to an intermediate language by the RenderScript LLVM-based compiler at build time. Finally, they are translated to machine code at runtime. RenderScript takes care of platform-dependent optimizations.
Let's now see how to create such a Kernel by implementing a custom image effect that filters pixels according to their luminosity.
Note
The resulting project is provided with this book under the name RenderScript_Part2
.