FileDocCategorySizeDatePackage
ScriptIntrinsicYuvToRGB.javaAPI DocAndroid 5.1 API2705Thu Mar 12 22:22:56 GMT 2015android.support.v8.renderscript

ScriptIntrinsicYuvToRGB

public class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic
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.

Fields Summary
private Allocation
mInput
Constructors Summary
ScriptIntrinsicYuvToRGB(int id, RenderScript rs)

        super(id, rs);
    
Methods Summary
public static android.support.v8.renderscript.ScriptIntrinsicYuvToRGBcreate(RenderScript rs, Element e)
Create an intrinsic for converting YUV to RGB. Supported elements types are {@link Element#U8_4}

param
rs The RenderScript context
param
e Element type for output
return
ScriptIntrinsicYuvToRGB

        if (rs.isNative) {
            RenderScriptThunker rst = (RenderScriptThunker) rs;
            return ScriptIntrinsicYuvToRGBThunker.create(rs, e);
        }

        // 6 comes from RS_SCRIPT_INTRINSIC_YUV_TO_RGB in rsDefines.h
        int id = rs.nScriptIntrinsicCreate(6, e.getID(rs));
        ScriptIntrinsicYuvToRGB si = new ScriptIntrinsicYuvToRGB(id, rs);
        return si;
    
public voidforEach(Allocation aout)
Convert the image to RGB.

param
aout Output allocation. Must match creation element type.

        forEach(0, null, aout, null);
    
public Script.FieldIDgetFieldID_Input()
Get a FieldID for the input field of this intrinsic.

return
Script.FieldID The FieldID object.

        return createFieldID(0, null);
    
public Script.KernelIDgetKernelID()
Get a KernelID for this intrinsic kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(0, 2, null, null);
    
public voidsetInput(Allocation ain)
Set the input yuv allocation, must be {@link Element#U8}.

param
ain The input allocation.

        mInput = ain;
        setVar(0, ain);