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