ScriptIntrinsicBlendpublic class ScriptIntrinsicBlend extends ScriptIntrinsic Intrinsic kernels for blending two {@link android.renderscript.Allocation} objects. |
Constructors Summary |
---|
ScriptIntrinsicBlend(long id, RenderScript rs)
super(id, rs);
|
Methods Summary |
---|
private void | blend(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.ScriptIntrinsicBlend | create(RenderScript rs, Element e)Supported elements types are {@link Element#U8_4}
// 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 void | forEachAdd(Allocation ain, Allocation aout)Sets dst = min(src + dst, 1.0)
forEachAdd(ain, aout, null);
| public void | forEachAdd(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = min(src + dst, 1.0)
blend(34, ain, aout, opt);
| public void | forEachClear(Allocation ain, Allocation aout)Sets dst = {0, 0, 0, 0}
forEachClear(ain, aout, null);
| public void | forEachClear(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = {0, 0, 0, 0}
blend(0, ain, aout, opt);
| public void | forEachDst(Allocation ain, Allocation aout)Sets dst = dst
This is a NOP.
// NOP
| public void | forEachDst(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = dst
This is a NOP.
// N, optOP
| public void | forEachDstAtop(Allocation ain, Allocation aout)dst = dst.rgb * src.a + (1.0 - dst.a) * src.rgb
dst.a = src.a
forEachDstAtop(ain, aout, null);
| public void | forEachDstAtop(Allocation ain, Allocation aout, Script.LaunchOptions opt)dst = dst.rgb * src.a + (1.0 - dst.a) * src.rgb
dst.a = src.a
blend(10, ain, aout, opt);
| public void | forEachDstIn(Allocation ain, Allocation aout)Sets dst = dst * src.a
forEachDstIn(ain, aout, null);
| public void | forEachDstIn(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = dst * src.a
blend(6, ain, aout, opt);
| public void | forEachDstOut(Allocation ain, Allocation aout)Sets dst = dst * (1.0 - src.a)
forEachDstOut(ain, aout, null);
| public void | forEachDstOut(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = dst * (1.0 - src.a)
blend(8, ain, aout, opt);
| public void | forEachDstOver(Allocation ain, Allocation aout)Sets dst = dst + src * (1.0 - dst.a)
forEachDstOver(ain, aout, null);
| public void | forEachDstOver(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = dst + src * (1.0 - dst.a)
blend(4, ain, aout, opt);
| public void | forEachMultiply(Allocation ain, Allocation aout)Sets dst = src * dst
forEachMultiply(ain, aout, null);
| public void | forEachMultiply(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = src * dst
blend(14, ain, aout, opt);
| public void | forEachSrc(Allocation ain, Allocation aout)Sets dst = src
forEachSrc(ain, aout, null);
| public void | forEachSrc(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = src
blend(1, ain, aout, null);
| public void | forEachSrcAtop(Allocation ain, Allocation aout)dst.rgb = src.rgb * dst.a + (1.0 - src.a) * dst.rgb
dst.a = dst.a
forEachSrcAtop(ain, aout, null);
| public void | forEachSrcAtop(Allocation ain, Allocation aout, Script.LaunchOptions opt)dst.rgb = src.rgb * dst.a + (1.0 - src.a) * dst.rgb
dst.a = dst.a
blend(9, ain, aout, opt);
| public void | forEachSrcIn(Allocation ain, Allocation aout)Sets dst = src * dst.a
forEachSrcIn(ain, aout, null);
| public void | forEachSrcIn(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = src * dst.a
blend(5, ain, aout, opt);
| public void | forEachSrcOut(Allocation ain, Allocation aout)Sets dst = src * (1.0 - dst.a)
forEachSrcOut(ain, aout, null);
| public void | forEachSrcOut(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = src * (1.0 - dst.a)
blend(7, ain, aout, opt);
| public void | forEachSrcOver(Allocation ain, Allocation aout)Sets dst = src + dst * (1.0 - src.a)
forEachSrcOver(ain, aout, null);
| public void | forEachSrcOver(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = src + dst * (1.0 - src.a)
blend(3, ain, aout, opt);
| public void | forEachSubtract(Allocation ain, Allocation aout)Sets dst = max(dst - src, 0.0)
forEachSubtract(ain, aout, null);
| public void | forEachSubtract(Allocation ain, Allocation aout, Script.LaunchOptions opt)Sets dst = max(dst - src, 0.0)
blend(35, ain, aout, opt);
| public void | forEachXor(Allocation ain, Allocation aout)Sets dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}
forEachXor(ain, aout, null);
| public void | forEachXor(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}
blend(11, ain, aout, opt);
| public Script.KernelID | getKernelIDAdd()Get a KernelID for the Add kernel.
return createKernelID(34, 3, null, null);
| public Script.KernelID | getKernelIDClear()Get a KernelID for the Clear kernel.
return createKernelID(0, 3, null, null);
| public Script.KernelID | getKernelIDDst()Get a KernelID for the Dst kernel.
return createKernelID(2, 3, null, null);
| public Script.KernelID | getKernelIDDstAtop()Get a KernelID for the DstAtop kernel.
return createKernelID(10, 3, null, null);
| public Script.KernelID | getKernelIDDstIn()Get a KernelID for the DstIn kernel.
return createKernelID(6, 3, null, null);
| public Script.KernelID | getKernelIDDstOut()Get a KernelID for the DstOut kernel.
return createKernelID(8, 3, null, null);
| public Script.KernelID | getKernelIDDstOver()Get a KernelID for the DstOver kernel.
return createKernelID(4, 3, null, null);
| public Script.KernelID | getKernelIDMultiply()Get a KernelID for the Multiply kernel.
return createKernelID(14, 3, null, null);
| public Script.KernelID | getKernelIDSrc()Get a KernelID for the Src kernel.
return createKernelID(1, 3, null, null);
| public Script.KernelID | getKernelIDSrcAtop()Get a KernelID for the SrcAtop kernel.
return createKernelID(9, 3, null, null);
| public Script.KernelID | getKernelIDSrcIn()Get a KernelID for the SrcIn kernel.
return createKernelID(5, 3, null, null);
| public Script.KernelID | getKernelIDSrcOut()Get a KernelID for the SrcOut kernel.
return createKernelID(7, 3, null, null);
| public Script.KernelID | getKernelIDSrcOver()Get a KernelID for the SrcOver kernel.
return createKernelID(3, 3, null, null);
| public Script.KernelID | getKernelIDSubtract()Get a KernelID for the Subtract kernel.
return createKernelID(35, 3, null, null);
| public Script.KernelID | getKernelIDXor()Get a KernelID for the Xor kernel.
return createKernelID(11, 3, null, null);
|
|