| Hak Matsuda | 19b8151 | 2014-01-27 17:50:20 -0800 | [diff] [blame] | 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--> |
| Yuichi Araki | f302c13 | 2019-01-11 17:19:47 +0900 | [diff] [blame] | 26 | <minSdk>14</minSdk> |
| Hak Matsuda | 19b8151 | 2014-01-27 17:50:20 -0800 | [diff] [blame] | 27 | |
| 28 | <defaultConfig> |
| Yuichi Araki | 1acd441 | 2016-07-07 16:54:01 +0900 | [diff] [blame] | 29 | renderscriptTargetApi 24 |
| Trevor Johns | 492618f | 2014-12-04 18:53:13 -0800 | [diff] [blame] | 30 | renderscriptSupportModeEnabled true |
| Hak Matsuda | 19b8151 | 2014-01-27 17:50:20 -0800 | [diff] [blame] | 31 | </defaultConfig> |
| 32 | |
| 33 | <strings> |
| 34 | <intro> |
| 35 | <![CDATA[ |
| Trevor Johns | ec8b185 | 2014-12-12 00:59:51 -0800 | [diff] [blame] | 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 |
| Takeshi Hagikura | cd87842 | 2015-02-19 11:03:50 +0900 | [diff] [blame] | 38 | adjustment, running the computation on the device\'s GPU or other compute hardware as deemed appropriate by the system. |
| Hak Matsuda | 19b8151 | 2014-01-27 17:50:20 -0800 | [diff] [blame] | 39 | ]]> |
| 40 | </intro> |
| 41 | </strings> |
| 42 | |
| 43 | <template src="base"/> |
| Hak Matsuda | 19b8151 | 2014-01-27 17:50:20 -0800 | [diff] [blame] | 44 | |
| Trevor Johns | ec8b185 | 2014-12-12 00:59:51 -0800 | [diff] [blame] | 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[ |
| 63 | This sample demonstrates using RenderScript to perform basic image manipulation. Specifically, it allows users |
| 64 | to dynamically adjust the saturation for an image using a slider. A custom RenderScript kernel performs the saturation |
| Takeshi Hagikura | cd87842 | 2015-02-19 11:03:50 +0900 | [diff] [blame] | 65 | adjustment, running the computation on the device\'s GPU or other compute hardware as deemed appropriate by the system. |
| Trevor Johns | ec8b185 | 2014-12-12 00:59:51 -0800 | [diff] [blame] | 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 |
| 72 | primarily oriented for use with data-parallel computation, although serial computationally intensive workloads can |
| 73 | benefit as well. |
| 74 | |
| 75 | The RenderScript runtime will parallelize work across all processors available on a device, such as multi-core CPUs, |
| 76 | GPUs, or DSPs, allowing you to focus on expressing algorithms rather than scheduling work or load balancing. |
| 77 | RenderScript is especially useful for applications performing image processing, computational photography, or computer |
| 78 | vision. |
| 79 | |
| 80 | This sample demonstrates the fundamentals of writing a RenderScript compute kernel, and using it to perform basic image |
| 81 | manipulation. In this case, each pixel is transformed based on a liner interpolation between its original |
| 82 | RGB 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> |
| Hak Matsuda | 19b8151 | 2014-01-27 17:50:20 -0800 | [diff] [blame] | 89 | </sample> |