Book Image

Android NDK: Beginner's Guide

By : Sylvain Ratabouil
Book Image

Android NDK: Beginner's Guide

By: Sylvain Ratabouil

Overview of this book

Table of Contents (18 chapters)
Android NDK Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.