Merge "Add YUV element convenience function." into klp-dev
This commit is contained in:
@@ -21800,6 +21800,7 @@ package android.renderscript {
|
||||
method public static android.renderscript.Element U8_2(android.renderscript.RenderScript);
|
||||
method public static android.renderscript.Element U8_3(android.renderscript.RenderScript);
|
||||
method public static android.renderscript.Element U8_4(android.renderscript.RenderScript);
|
||||
method public static android.renderscript.Element YUV(android.renderscript.RenderScript);
|
||||
method public static android.renderscript.Element createPixel(android.renderscript.RenderScript, android.renderscript.Element.DataType, android.renderscript.Element.DataKind);
|
||||
method public static android.renderscript.Element createVector(android.renderscript.RenderScript, android.renderscript.Element.DataType, int);
|
||||
method public int getBytesSize();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user