• 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
19
20<sample>
21    <name>BasicRenderScript</name>
22    <group>RenderScript</group>
23    <package>com.example.android.basicrenderscript</package>
24
25    <!-- change minSdk if needed-->
26    <minSdk>14</minSdk>
27
28    <defaultConfig>
29            renderscriptTargetApi 24
30            renderscriptSupportModeEnabled true
31    </defaultConfig>
32
33    <strings>
34        <intro>
35            <![CDATA[
36            This sample demonstrates using RenderScript to perform basic image manipulation. Specifically, it allows users
37            to dynamically adjust the saturation for an image using a slider. A custom RenderScript kernel performs the saturation
38            adjustment, running the computation on the device\'s GPU or other compute hardware as deemed appropriate by the system.
39            ]]>
40        </intro>
41    </strings>
42
43    <template src="base"/>
44
45    <metadata>
46        <status>PUBLISHED</status>
47        <categories>RenderScript</categories>
48        <technologies>Android</technologies>
49        <languages>Java</languages>
50        <solutions>Mobile</solutions>
51        <level>EXPERT</level>
52        <icon>screenshots/icon-web.png</icon>
53        <screenshots>
54            <img>screenshots/main.png</img>
55        </screenshots>
56        <api_refs>
57            <android>android.renderscript.RenderScript</android>
58            <android>android.renderscript.Allocation</android>
59        </api_refs>
60
61        <description>
62<![CDATA[
63This sample demonstrates using RenderScript to perform basic image manipulation. Specifically, it allows users
64to dynamically adjust the saturation for an image using a slider. A custom RenderScript kernel performs the saturation
65adjustment, running the computation on the device\'s GPU or other compute hardware as deemed appropriate by the system.
66]]>
67        </description>
68
69        <intro>
70<![CDATA[
71[RenderScript][1] is a framework for running computationally intensive tasks at high performance on Android. RenderScript is
72primarily oriented for use with data-parallel computation, although serial computationally intensive workloads can
73benefit as well.
74
75The RenderScript runtime will parallelize work across all processors available on a device, such as multi-core CPUs,
76GPUs, or DSPs, allowing you to focus on expressing algorithms rather than scheduling work or load balancing.
77RenderScript is especially useful for applications performing image processing, computational photography, or computer
78vision.
79
80This sample demonstrates the fundamentals of writing a RenderScript compute kernel, and using it to perform basic image
81manipulation. In this case, each pixel is transformed based on a liner interpolation between its original
82RGB value and it's luminance (black-and-white) value, weighted based on the user's specified saturation target.
83
84[1]: http://developer.android.com/guide/topics/renderscript/compute.html
85[2]: http://developer.android.com/reference/renderscript/rs__cl_8rsh.html#a254612a612ff7539b01a1478e03d8697
86]]>
87        </intro>
88    </metadata>
89</sample>
90