Added in API level 17
Deprecated in API level 23

ScriptGroup.Builder


public static final class ScriptGroup.Builder
extends Object

java.lang.Object
   ↳ android.renderscript.ScriptGroup.Builder


This class was deprecated in API level 23.
Use Builder2 instead.

Helper class to build a ScriptGroup. A ScriptGroup is created in two steps.

First, all kernels to be used by the ScriptGroup should be added.

Second, add connections between kernels. There are two types of connections: kernel to kernel and kernel to field. Kernel to kernel allows a kernel's output to be passed to another kernel as input. Kernel to field allows the output of one kernel to be bound as a script global. Kernel to kernel is higher performance and should be used where possible.

A ScriptGroup must contain a single directed acyclic graph (DAG); it cannot contain cycles. Currently, all kernels used in a ScriptGroup must come from different Script objects. Additionally, all kernels in a ScriptGroup must have at least one input, output, or internal connection.

Once all connections are made, a call to create() will return the ScriptGroup object.

Summary

Public constructors

Builder(RenderScript rs)

Create a Builder for generating a ScriptGroup.

Public methods

ScriptGroup.Builder addConnection(Type t, Script.KernelID from, Script.FieldID to)

Adds a connection to the group.

ScriptGroup.Builder addConnection(Type t, Script.KernelID from, Script.KernelID to)

Adds a connection to the group.

ScriptGroup.Builder addKernel(Script.KernelID k)

Adds a Kernel to the group.

ScriptGroup create()

Creates the Script group.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 17
public Builder (RenderScript rs)

Create a Builder for generating a ScriptGroup.

Parameters
rs RenderScript: The RenderScript context.

Public methods

addConnection

Added in API level 17
public ScriptGroup.Builder addConnection (Type t, 
                Script.KernelID from, 
                Script.FieldID to)

Adds a connection to the group.

Parameters
t Type: The type of the connection. This is used to determine the kernel launch sizes on the source side of this connection.

from Script.KernelID: The source for the connection.

to Script.FieldID: The destination of the connection.

Returns
ScriptGroup.Builder Builder Returns this

addConnection

Added in API level 17
public ScriptGroup.Builder addConnection (Type t, 
                Script.KernelID from, 
                Script.KernelID to)

Adds a connection to the group.

Parameters
t Type: The type of the connection. This is used to determine the kernel launch sizes for both sides of this connection.

from Script.KernelID: The source for the connection.

to Script.KernelID: The destination of the connection.

Returns
ScriptGroup.Builder Builder Returns this

addKernel

Added in API level 17
public ScriptGroup.Builder addKernel (Script.KernelID k)

Adds a Kernel to the group.

Parameters
k Script.KernelID: The kernel to add.

Returns
ScriptGroup.Builder Builder Returns this.

create

Added in API level 17
public ScriptGroup create ()

Creates the Script group.

Returns
ScriptGroup ScriptGroup The new ScriptGroup

Learn how to create and configure a CMake build script.

Updated Jan 3, 2024

A toolset that lets you implement parts of your app in native code, using languages such as C and C++.

Updated Aug 13, 2020

A toolset that lets you implement parts of your app in native code, using languages such as C and C++.

Updated Jan 3, 2024