1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2013 The Android Open Source Project
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17
18<sample>
19    <name>RenderScriptIntrinsic</name>
20    <group>RenderScript</group>
21    <package>com.example.android.renderscriptintrinsic</package>
22
23    <minSdk>14</minSdk>
24
25    <defaultConfig>
26        renderscriptTargetApi 24
27        renderscriptSupportModeEnabled true
28    </defaultConfig>
29
30    <strings>
31        <intro>
32            <![CDATA[
33RenderScriptIntrinsic sample that demonstrates how to use RenderScript intrinsics.
34Creates several RenderScript intrinsics and shows a filtering result with various parameters.
35Also shows how to extends RadioButton with StateListDrawable.
36            ]]>
37        </intro>
38    </strings>
39
40    <template src="base"/>
41
42    <metadata>
43        <status>PUBLISHED</status>
44        <categories>RenderScript</categories>
45        <technologies>Android</technologies>
46        <languages>Java</languages>
47        <solutions>Mobile</solutions>
48        <level>EXPERT</level>
49        <icon>screenshots/icon-web.png</icon>
50        <screenshots>
51            <img>screenshots/main.png</img>
52        </screenshots>
53        <api_refs>
54            <android>android.renderscript.RenderScript</android>
55            <android>android.renderscript.ScriptIntrinsicBlur</android>
56            <android>android.renderscript.ScriptIntrinsicConvolve5x5</android>
57            <android>android.renderscript.ScriptIntrinsicColorMatrix</android>
58        </api_refs>
59
60        <description>
61<![CDATA[
62RenderScriptIntrinsic sample that demonstrates how to use RenderScript intrinsics.
63Creates several RenderScript intrinsics and shows a filtering result with various parameters.
64Also shows how to extends RedioButton with StateListDrawable.
65]]>
66        </description>
67
68        <intro>
69            <![CDATA[
70[RenderScript][1] is a framework for running computationally intensive tasks at high performance on
71Android. RenderScript is primarily oriented for use with data-parallel computation, although serial
72computationally intensive workloads can benefit as well.
73
74RenderScript **intrinsics** are built-in functions that perform well-defined operations often seen
75in image processing. Intrinsics provide extremely high-performance implementations of standard
76functions with a minimal amount of code.
77
78This sample shows how to access and use the blur, convolve, and matrix intrinsics:
79
80```java
81mScriptBlur = ScriptIntrinsicBlur.create(mRS, Element.U8_4(mRS));
82mScriptConvolve = ScriptIntrinsicConvolve5x5.create(mRS,
83        Element.U8_4(mRS));
84mScriptMatrix = ScriptIntrinsicColorMatrix.create(mRS,
85        Element.U8_4(mRS));
86```
87
88RenderScript intrinsics will usually be the fastest possible way for a developer to perform these
89operations. The Android team works closely with our partners to ensure that the intrinsics perform
90as fast as possible on their architectures — often far beyond anything that can be achieved in a
91general-purpose language.
92
93[1]: http://developer.android.com/guide/topics/renderscript/compute.html
94]]>
95        </intro>
96    </metadata>
97</sample>
98