to top
Android APIs
public final class

ScriptGroup

extends BaseObj
java.lang.Object
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.ScriptGroup

Class Overview

ScriptGroup creates a group of kernels that are executed together with one execution call as if they were a single kernel. The kernels may be connected internally or to an external allocation. The intermediate results for internal connections are not observable after the execution of the script.

External connections are grouped into inputs and outputs. All outputs are produced by a script kernel and placed into a user-supplied allocation. Inputs provide the input of a kernel. Inputs bound to script globals are set directly upon the script.

A ScriptGroup must contain at least one kernel. A ScriptGroup must contain only a single directed acyclic graph (DAG) of script kernels and connections. Attempting to create a ScriptGroup with multiple DAGs or attempting to create a cycle within a ScriptGroup will throw an exception.

Currently, all kernels in a ScriptGroup must be from separate Script objects. Attempting to use multiple kernels from the same Script object will result in an RSInvalidStateException.

Summary

Nested Classes
class ScriptGroup.Builder Helper class to build a ScriptGroup. 
Public Methods
void execute()
Execute the ScriptGroup.
void setInput(Script.KernelID s, Allocation a)
Sets an input of the ScriptGroup.
void setOutput(Script.KernelID s, Allocation a)
Sets an output of the ScriptGroup.
[Expand]
Inherited Methods
From class android.renderscript.BaseObj
From class java.lang.Object

Public Methods

public void execute ()

Added in API level 17

Execute the ScriptGroup. This will run all the kernels in the ScriptGroup. No internal connection results will be visible after execution of the ScriptGroup.

public void setInput (Script.KernelID s, Allocation a)

Added in API level 17

Sets an input of the ScriptGroup. This specifies an Allocation to be used for kernels that require an input Allocation provided from outside of the ScriptGroup.

Parameters
s The ID of the kernel where the allocation should be connected.
a The allocation to connect.

public void setOutput (Script.KernelID s, Allocation a)

Added in API level 17

Sets an output of the ScriptGroup. This specifies an Allocation to be used for the kernels that require an output Allocation visible after the ScriptGroup is executed.

Parameters
s The ID of the kernel where the allocation should be connected.
a The allocation to connect.