FileDocCategorySizeDatePackage
ScriptIntrinsicYuvToRGB.javaAPI DocAndroid 5.1 API2573Thu Mar 12 22:22:42 GMT 2015android.renderscript

ScriptIntrinsicYuvToRGB

public final class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic
Intrinsic for converting an Android YUV buffer to RGB. 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.

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

        super(id, rs);
    
Methods Summary
public static android.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

        // 6 comes from RS_SCRIPT_INTRINSIC_YUV_TO_RGB in rsDefines.h
        long 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, (Allocation) 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);