diff options
author | Tim Murray <timmurray@google.com> | 2013-09-03 11:42:26 -0700 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2013-09-04 16:15:45 -0700 |
commit | 932e78e9903342e3494983fd3463084caab4ba42 (patch) | |
tree | 2892ce127d617120c1e6acb6722103cc4d179a47 /graphics/java | |
parent | 5c2dfa8a21e7bd4e07e00f268d30058b654aa099 (diff) | |
download | frameworks_base-932e78e9903342e3494983fd3463084caab4ba42.zip frameworks_base-932e78e9903342e3494983fd3463084caab4ba42.tar.gz frameworks_base-932e78e9903342e3494983fd3463084caab4ba42.tar.bz2 |
Add YUV element convenience function.
Change-Id: Ie67dfba6a4c4f1913875ad9817c53e45d56809ae
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/renderscript/Element.java | 7 | ||||
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 2 | ||||
-rw-r--r-- | graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java index 3838c61..68badfa 100644 --- a/graphics/java/android/renderscript/Element.java +++ b/graphics/java/android/renderscript/Element.java @@ -725,6 +725,13 @@ public class Element extends BaseObj { return rs.mElement_LONG_4; } + public static Element YUV(RenderScript rs) { + if (rs.mElement_YUV == null) { + rs.mElement_YUV = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_YUV); + } + return rs.mElement_YUV; + } + public static Element MATRIX_4X4(RenderScript rs) { if(rs.mElement_MATRIX_4X4 == null) { rs.mElement_MATRIX_4X4 = createUser(rs, DataType.MATRIX_4X4); diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 854f079..7d4a5c4 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -898,6 +898,8 @@ public class RenderScript { Element mElement_LONG_3; Element mElement_LONG_4; + Element mElement_YUV; + Element mElement_MATRIX_4X4; Element mElement_MATRIX_3X3; Element mElement_MATRIX_2X2; diff --git a/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java b/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java index 9b5de9b..845625d 100644 --- a/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java +++ b/graphics/java/android/renderscript/ScriptIntrinsicYuvToRGB.java @@ -20,9 +20,9 @@ package android.renderscript; /** * Intrinsic for converting an Android YUV buffer to RGB. * - * The input allocation is supplied in NV21 format as a U8 - * element type. The output is RGBA, the alpha channel will be - * set to 255. + * The input allocation should be supplied in a supported YUV format + * as a YUV element Allocation. The output is RGBA; the alpha channel + * will be set to 255. */ public final class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic { private Allocation mInput; |