FileDocCategorySizeDatePackage
ScriptIntrinsicBlend.javaAPI DocAndroid 5.1 API16886Thu Mar 12 22:22:42 GMT 2015android.renderscript

ScriptIntrinsicBlend

public class ScriptIntrinsicBlend extends ScriptIntrinsic
Intrinsic kernels for blending two {@link android.renderscript.Allocation} objects.

Fields Summary
Constructors Summary
ScriptIntrinsicBlend(long id, RenderScript rs)

        super(id, rs);
    
Methods Summary
private voidblend(int id, Allocation ain, Allocation aout, Script.LaunchOptions opt)

        if (!ain.getElement().isCompatible(Element.U8_4(mRS))) {
            throw new RSIllegalArgumentException("Input is not of expected format.");
        }
        if (!aout.getElement().isCompatible(Element.U8_4(mRS))) {
            throw new RSIllegalArgumentException("Output is not of expected format.");
        }
        forEach(id, ain, aout, null, opt);
    
public static android.renderscript.ScriptIntrinsicBlendcreate(RenderScript rs, Element e)
Supported elements types are {@link Element#U8_4}

param
rs The RenderScript context
param
e Element type for inputs and outputs
return
ScriptIntrinsicBlend

        // 7 comes from RS_SCRIPT_INTRINSIC_ID_BLEND in rsDefines.h
        long id = rs.nScriptIntrinsicCreate(7, e.getID(rs));
        return new ScriptIntrinsicBlend(id, rs);

    
public voidforEachAdd(Allocation ain, Allocation aout)
Sets dst = min(src + dst, 1.0)

param
ain The source buffer
param
aout The destination buffer

        forEachAdd(ain, aout, null);
    
public voidforEachAdd(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = min(src + dst, 1.0)

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(34, ain, aout, opt);
    
public voidforEachClear(Allocation ain, Allocation aout)
Sets dst = {0, 0, 0, 0}

param
ain The source buffer
param
aout The destination buffer

        forEachClear(ain, aout, null);
    
public voidforEachClear(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = {0, 0, 0, 0}

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(0, ain, aout, opt);
    
public voidforEachDst(Allocation ain, Allocation aout)
Sets dst = dst This is a NOP.

param
ain The source buffer
param
aout The destination buffer

        // NOP
    
public voidforEachDst(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = dst This is a NOP.

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        // N, optOP
    
public voidforEachDstAtop(Allocation ain, Allocation aout)
dst = dst.rgb * src.a + (1.0 - dst.a) * src.rgb dst.a = src.a

param
ain The source buffer
param
aout The destination buffer

        forEachDstAtop(ain, aout, null);
    
public voidforEachDstAtop(Allocation ain, Allocation aout, Script.LaunchOptions opt)
dst = dst.rgb * src.a + (1.0 - dst.a) * src.rgb dst.a = src.a

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(10, ain, aout, opt);
    
public voidforEachDstIn(Allocation ain, Allocation aout)
Sets dst = dst * src.a

param
ain The source buffer
param
aout The destination buffer

        forEachDstIn(ain, aout, null);
    
public voidforEachDstIn(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = dst * src.a

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(6, ain, aout, opt);
    
public voidforEachDstOut(Allocation ain, Allocation aout)
Sets dst = dst * (1.0 - src.a)

param
ain The source buffer
param
aout The destination buffer

        forEachDstOut(ain, aout, null);
    
public voidforEachDstOut(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = dst * (1.0 - src.a)

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(8, ain, aout, opt);
    
public voidforEachDstOver(Allocation ain, Allocation aout)
Sets dst = dst + src * (1.0 - dst.a)

param
ain The source buffer
param
aout The destination buffer

        forEachDstOver(ain, aout, null);
    
public voidforEachDstOver(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = dst + src * (1.0 - dst.a)

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(4, ain, aout, opt);
    
public voidforEachMultiply(Allocation ain, Allocation aout)
Sets dst = src * dst

param
ain The source buffer
param
aout The destination buffer

        forEachMultiply(ain, aout, null);
    
public voidforEachMultiply(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = src * dst

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(14, ain, aout, opt);
    
public voidforEachSrc(Allocation ain, Allocation aout)
Sets dst = src

param
ain The source buffer
param
aout The destination buffer

        forEachSrc(ain, aout, null);
    
public voidforEachSrc(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = src

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(1, ain, aout, null);
    
public voidforEachSrcAtop(Allocation ain, Allocation aout)
dst.rgb = src.rgb * dst.a + (1.0 - src.a) * dst.rgb dst.a = dst.a

param
ain The source buffer
param
aout The destination buffer

        forEachSrcAtop(ain, aout, null);
    
public voidforEachSrcAtop(Allocation ain, Allocation aout, Script.LaunchOptions opt)
dst.rgb = src.rgb * dst.a + (1.0 - src.a) * dst.rgb dst.a = dst.a

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(9, ain, aout, opt);
    
public voidforEachSrcIn(Allocation ain, Allocation aout)
Sets dst = src * dst.a

param
ain The source buffer
param
aout The destination buffer

        forEachSrcIn(ain, aout, null);
    
public voidforEachSrcIn(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = src * dst.a

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(5, ain, aout, opt);
    
public voidforEachSrcOut(Allocation ain, Allocation aout)
Sets dst = src * (1.0 - dst.a)

param
ain The source buffer
param
aout The destination buffer

        forEachSrcOut(ain, aout, null);
    
public voidforEachSrcOut(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = src * (1.0 - dst.a)

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(7, ain, aout, opt);
    
public voidforEachSrcOver(Allocation ain, Allocation aout)
Sets dst = src + dst * (1.0 - src.a)

param
ain The source buffer
param
aout The destination buffer

        forEachSrcOver(ain, aout, null);
    
public voidforEachSrcOver(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = src + dst * (1.0 - src.a)

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(3, ain, aout, opt);
    
public voidforEachSubtract(Allocation ain, Allocation aout)
Sets dst = max(dst - src, 0.0)

param
ain The source buffer
param
aout The destination buffer

        forEachSubtract(ain, aout, null);
    
public voidforEachSubtract(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = max(dst - src, 0.0)

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(35, ain, aout, opt);
    
public voidforEachXor(Allocation ain, Allocation aout)
Sets dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}

param
ain The source buffer
param
aout The destination buffer

        forEachXor(ain, aout, null);
    
public voidforEachXor(Allocation ain, Allocation aout, Script.LaunchOptions opt)
Sets dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}

param
ain The source buffer
param
aout The destination buffer
param
opt LaunchOptions for clipping

        blend(11, ain, aout, opt);
    
public Script.KernelIDgetKernelIDAdd()
Get a KernelID for the Add kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(34, 3, null, null);
    
public Script.KernelIDgetKernelIDClear()
Get a KernelID for the Clear kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(0, 3, null, null);
    
public Script.KernelIDgetKernelIDDst()
Get a KernelID for the Dst kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(2, 3, null, null);
    
public Script.KernelIDgetKernelIDDstAtop()
Get a KernelID for the DstAtop kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(10, 3, null, null);
    
public Script.KernelIDgetKernelIDDstIn()
Get a KernelID for the DstIn kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(6, 3, null, null);
    
public Script.KernelIDgetKernelIDDstOut()
Get a KernelID for the DstOut kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(8, 3, null, null);
    
public Script.KernelIDgetKernelIDDstOver()
Get a KernelID for the DstOver kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(4, 3, null, null);
    
public Script.KernelIDgetKernelIDMultiply()
Get a KernelID for the Multiply kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(14, 3, null, null);
    
public Script.KernelIDgetKernelIDSrc()
Get a KernelID for the Src kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(1, 3, null, null);
    
public Script.KernelIDgetKernelIDSrcAtop()
Get a KernelID for the SrcAtop kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(9, 3, null, null);
    
public Script.KernelIDgetKernelIDSrcIn()
Get a KernelID for the SrcIn kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(5, 3, null, null);
    
public Script.KernelIDgetKernelIDSrcOut()
Get a KernelID for the SrcOut kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(7, 3, null, null);
    
public Script.KernelIDgetKernelIDSrcOver()
Get a KernelID for the SrcOver kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(3, 3, null, null);
    
public Script.KernelIDgetKernelIDSubtract()
Get a KernelID for the Subtract kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(35, 3, null, null);
    
public Script.KernelIDgetKernelIDXor()
Get a KernelID for the Xor kernel.

return
Script.KernelID The KernelID object.

        return createKernelID(11, 3, null, null);