• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    <!-- change minSdk if needed-->
24    <minSdk>8</minSdk>
25
26    <dependency_external>'renderscript-v8.jar'</dependency_external>
27
28    <defaultConfig>
29        renderscriptTargetApi 18
30        renderscriptSupportModeEnabled true
31    </defaultConfig>
32
33    <strings>
34        <intro>
35            <![CDATA[
36            RenderScriptIntrinsic sample that demonstrates how to use RenderScript intrinsics.
37            Creates several RenderScript intrinsics and shows a filtering result with various parameters.
38            Also shows how to extends RedioButton with StateListDrawable.
39            ]]>
40        </intro>
41    </strings>
42
43    <template src="base"/>
44    <common src="logger"/>
45
46    <metadata>
47        <status>PUBLISHED</status>
48        <categories>RenderScript</categories>
49        <technologies>Android</technologies>
50        <languages>Java</languages>
51        <solutions>Mobile</solutions>
52        <level>EXPERT</level>
53        <icon>screenshots/icon-web.png</icon>
54        <screenshots>
55            <img>screenshots/main.png</img>
56        </screenshots>
57        <api_refs>
58            <android>android.renderscript.RenderScript</android>
59            <android>android.renderscript.ScriptIntrinsicBlur</android>
60            <android>android.renderscript.ScriptIntrinsicConvolve5x5</android>
61            <android>android.renderscript.ScriptIntrinsicColorMatrix</android>
62            <android></android>
63        </api_refs>
64
65        <description>
66<![CDATA[
67RenderScriptIntrinsic sample that demonstrates how to use RenderScript intrinsics.
68Creates several RenderScript intrinsics and shows a filtering result with various parameters.
69Also shows how to extends RedioButton with StateListDrawable.
70]]>
71        </description>
72
73        <intro>
74<![CDATA[
75[RenderScript][1] is a framework for running computationally intensive tasks at high performance on Android. RenderScript is
76primarily oriented for use with data-parallel computation, although serial computationally intensive workloads can
77benefit as well.
78
79RenderScript **intrinsics** are built-in functions that perform well-defined operations often seen
80in image processing. Intrinsics provide extremely high-performance implementations of standard
81functions with a minimal amount of code.
82
83This sample shows how to access and use the blur, convolve, and matrix intrinsics:
84
85```java
86mScriptBlur = ScriptIntrinsicBlur.create(mRS, Element.U8_4(mRS));
87mScriptConvolve = ScriptIntrinsicConvolve5x5.create(mRS,
88        Element.U8_4(mRS));
89mScriptMatrix = ScriptIntrinsicColorMatrix.create(mRS,
90        Element.U8_4(mRS));
91```
92
93RenderScript intrinsics will usually be the fastest possible way for a developer to perform these operations. The
94Android team works closely with our partners to ensure that the intrinsics perform as fast as possible on their
95architectures — often far beyond anything that can be achieved in a general-purpose language.
96
97[1]: http://developer.android.com/guide/topics/renderscript/compute.html
98]]>
99        </intro>
100    </metadata>
101</sample>
102