Reader small image

You're reading from  Android NDK: Beginner's Guide

Product typeBook
Published inApr 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783989645
Edition1st Edition
Languages
Right arrow
Author (1)
Sylvain Ratabouil
Sylvain Ratabouil
author image
Sylvain Ratabouil

Sylvain Ratabouil is an IT consultant, experienced in Android, Java, and C/C++. He has contributed to the development of digital and mobile applications for large companies as well as industrial projects for the space and aeronautics industries. As a technology lover, he is passionate about mobile technologies and cannot live without his Android smartphone.
Read more about Sylvain Ratabouil

Right arrow

Time for action – writing a luminance threshold filter


Let's append a new component to our UI and implement the new image filter.

  1. Add a new Threshold SeekBar and Button in res/activity_renderscript.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
      xmlns:a="http://schemas.android.com/apk/res/android"
      a:layout_width="fill_parent" a:layout_height="fill_parent"
      a:layout_weight="1" a:orientation="vertical" >
      <LinearLayout 
        a:orientation="horizontal"
        a:layout_width="fill_parent" a:layout_height="wrap_content" >
        ...
        <SeekBar a:id="@+id/thresholdBar" a:max="100"
          a:layout_gravity="center_vertical"
          a:layout_width="128dp" a:layout_height="wrap_content" />
        <Button a:id="@+id/thresholdButton" a:text="Threshold"
          a:layout_width="wrap_content" a:layout_height="wrap_content"/>
      </LinearLayout>
      <LinearLayout 
        a:baselineAligned="true" a:orientation="horizontal"
        a:layout_width="fill_parent" a:layout_height...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Android NDK: Beginner's Guide
Published in: Apr 2015Publisher: PacktISBN-13: 9781783989645

Author (1)

author image
Sylvain Ratabouil

Sylvain Ratabouil is an IT consultant, experienced in Android, Java, and C/C++. He has contributed to the development of digital and mobile applications for large companies as well as industrial projects for the space and aeronautics industries. As a technology lover, he is passionate about mobile technologies and cannot live without his Android smartphone.
Read more about Sylvain Ratabouil