to top
Android APIs
public class

ScriptIntrinsicBlend

extends ScriptIntrinsic
java.lang.Object
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.Script
       ↳ android.renderscript.ScriptIntrinsic
         ↳ android.renderscript.ScriptIntrinsicBlend

Class Overview

Intrinsic kernels for blending two buffers. Each blend function is a separate kernel to make it easy to change between blend modes.

Summary

Public Methods

? Examples
static ScriptIntrinsicBlend create( RenderScript rs, Element e)
Supported elements types are uchar4

? Examples
void forEachAdd( Allocation ain, Allocation aout)
dst = min(src + dst, 1.0)

? Examples
void forEachClear( Allocation ain, Allocation aout)
dst = {0, 0, 0, 0}

? Examples
void forEachDst( Allocation ain, Allocation aout)
dst = dst This is a NOP

? Examples
void forEachDstAtop( Allocation ain, Allocation aout)
dst = dst.rgb * src.a + (1.0 - dst.a) * src.rgb dst.a = src.a

? Examples
void forEachDstIn( Allocation ain, Allocation aout)
dst = dst * src.a

? Examples
void forEachDstOut( Allocation ain, Allocation aout)
dst = dst * (1.0 - src.a)

? Examples
void forEachDstOver( Allocation ain, Allocation aout)
dst = dst + src * (1.0 - dst.a)

? Examples
void forEachMultiply( Allocation ain, Allocation aout)
dst = src * dst

? Examples
void forEachSrc( Allocation ain, Allocation aout)
dst = src

? Examples
void forEachSrcAtop( Allocation ain, Allocation aout)
dst.rgb = src.rgb * dst.a + (1.0 - src.a) * dst.rgb dst.a = dst.a

? Examples
void forEachSrcIn( Allocation ain, Allocation aout)
dst = src * dst.a

? Examples
void forEachSrcOut( Allocation ain, Allocation aout)
dst = src * (1.0 - dst.a)

? Examples
void forEachSrcOver( Allocation ain, Allocation aout)
dst = src + dst * (1.0 - src.a)

? Examples
void forEachSubtract( Allocation ain, Allocation aout)
dst = max(dst - src, 0.0)

? Examples
void forEachXor( Allocation ain, Allocation aout)
dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}

? Examples
Script.KernelID getKernelIDAdd()
Get a KernelID for the Add kernel.

? Examples
Script.KernelID getKernelIDClear()
Get a KernelID for the Clear kernel.

? Examples
Script.KernelID getKernelIDDst()
Get a KernelID for the Dst kernel.

? Examples
Script.KernelID getKernelIDDstAtop()
Get a KernelID for the DstAtop kernel.

? Examples
Script.KernelID getKernelIDDstIn()
Get a KernelID for the DstIn kernel.

? Examples
Script.KernelID getKernelIDDstOut()
Get a KernelID for the DstOut kernel.

? Examples
Script.KernelID getKernelIDDstOver()
Get a KernelID for the DstOver kernel.

? Examples
Script.KernelID getKernelIDMultiply()
Get a KernelID for the Multiply kernel.

? Examples
Script.KernelID getKernelIDSrc()
Get a KernelID for the Src kernel.

? Examples
Script.KernelID getKernelIDSrcAtop()
Get a KernelID for the SrcAtop kernel.

? Examples
Script.KernelID getKernelIDSrcIn()
Get a KernelID for the SrcIn kernel.

? Examples
Script.KernelID getKernelIDSrcOut()
Get a KernelID for the SrcOut kernel.

? Examples
Script.KernelID getKernelIDSrcOver()
Get a KernelID for the SrcOver kernel.

? Examples
Script.KernelID getKernelIDSubtract()
Get a KernelID for the Subtract kernel.

? Examples
Script.KernelID getKernelIDXor()
Get a KernelID for the Xor kernel.
[Expand]
Inherited Methods
From class android.renderscript.Script
From class android.renderscript.BaseObj
From class java.lang.Object

Public Methods

public static ScriptIntrinsicBlend create (RenderScript rs, Element e)

Added in API level 17

Supported elements types are uchar4

Returns
  • ScriptIntrinsicBlend

public void forEachAdd (Allocation ain, Allocation aout)

Added in API level 17

dst = min(src + dst, 1.0)

Parameters
ain The source buffer
aout The destination buffer

public void forEachClear (Allocation ain, Allocation aout)

Added in API level 17

dst = {0, 0, 0, 0}

Parameters
ain The source buffer
aout The destination buffer

public void forEachDst (Allocation ain, Allocation aout)

Added in API level 17

dst = dst This is a NOP

Parameters
ain The source buffer
aout The destination buffer

public void forEachDstAtop (Allocation ain, Allocation aout)

Added in API level 17

dst = dst.rgb * src.a + (1.0 - dst.a) * src.rgb dst.a = src.a

Parameters
ain The source buffer
aout The destination buffer

public void forEachDstIn (Allocation ain, Allocation aout)

Added in API level 17

dst = dst * src.a

Parameters
ain The source buffer
aout The destination buffer

public void forEachDstOut (Allocation ain, Allocation aout)

Added in API level 17

dst = dst * (1.0 - src.a)

Parameters
ain The source buffer
aout The destination buffer

public void forEachDstOver (Allocation ain, Allocation aout)

Added in API level 17

dst = dst + src * (1.0 - dst.a)

Parameters
ain The source buffer
aout The destination buffer

public void forEachMultiply (Allocation ain, Allocation aout)

Added in API level 17

dst = src * dst

Parameters
ain The source buffer
aout The destination buffer

public void forEachSrc (Allocation ain, Allocation aout)

Added in API level 17

dst = src

Parameters
ain The source buffer
aout The destination buffer

public void forEachSrcAtop (Allocation ain, Allocation aout)

Added in API level 17

dst.rgb = src.rgb * dst.a + (1.0 - src.a) * dst.rgb dst.a = dst.a

Parameters
ain The source buffer
aout The destination buffer

public void forEachSrcIn (Allocation ain, Allocation aout)

Added in API level 17

dst = src * dst.a

Parameters
ain The source buffer
aout The destination buffer

public void forEachSrcOut (Allocation ain, Allocation aout)

Added in API level 17

dst = src * (1.0 - dst.a)

Parameters
ain The source buffer
aout The destination buffer

public void forEachSrcOver (Allocation ain, Allocation aout)

Added in API level 17

dst = src + dst * (1.0 - src.a)

Parameters
ain The source buffer
aout The destination buffer

public void forEachSubtract (Allocation ain, Allocation aout)

Added in API level 17

dst = max(dst - src, 0.0)

Parameters
ain The source buffer
aout The destination buffer

public void forEachXor (Allocation ain, Allocation aout)

Added in API level 17

dst = {src.r ^ dst.r, src.g ^ dst.g, src.b ^ dst.b, src.a ^ dst.a}

Parameters
ain The source buffer
aout The destination buffer

public Script.KernelID getKernelIDAdd ()

Added in API level 17

Get a KernelID for the Add kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDClear ()

Added in API level 17

Get a KernelID for the Clear kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDDst ()

Added in API level 17

Get a KernelID for the Dst kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDDstAtop ()

Added in API level 17

Get a KernelID for the DstAtop kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDDstIn ()

Added in API level 17

Get a KernelID for the DstIn kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDDstOut ()

Added in API level 17

Get a KernelID for the DstOut kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDDstOver ()

Added in API level 17

Get a KernelID for the DstOver kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDMultiply ()

Added in API level 17

Get a KernelID for the Multiply kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDSrc ()

Added in API level 17

Get a KernelID for the Src kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDSrcAtop ()

Added in API level 17

Get a KernelID for the SrcAtop kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDSrcIn ()

Added in API level 17

Get a KernelID for the SrcIn kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDSrcOut ()

Added in API level 17

Get a KernelID for the SrcOut kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDSrcOver ()

Added in API level 17

Get a KernelID for the SrcOver kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDSubtract ()

Added in API level 17

Get a KernelID for the Subtract kernel.

Returns
  • Script.KernelID The KernelID object.

public Script.KernelID getKernelIDXor ()

Added in API level 17

Get a KernelID for the Xor kernel.

Returns
  • Script.KernelID The KernelID object.
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.