FileDocCategorySizeDatePackage
Script.javaAPI DocAndroid 5.1 API14905Thu Mar 12 22:22:56 GMT 2015android.support.v8.renderscript

Script

public class Script extends BaseObj
The parent class for all executable scripts. This should not be used by applications.

Fields Summary
ScriptCThunker
mT
private final android.util.SparseArray
mKIDs
private final android.util.SparseArray
mFIDs
Constructors Summary
Script(int id, RenderScript rs)

        super(id, rs);
    
Methods Summary
public voidbindAllocation(Allocation va, int slot)
Only intended for use by generated reflected code.

param
va
param
slot

        if (mT != null) {
            mT.thunkBindAllocation(va, slot);
            return;
        }

        mRS.validate();
        if (va != null) {
            mRS.nScriptBindAllocation(getID(mRS), va.getID(mRS), slot);
        } else {
            mRS.nScriptBindAllocation(getID(mRS), 0, slot);
        }
    
protected android.support.v8.renderscript.Script$FieldIDcreateFieldID(int slot, Element e)
Only to be used by generated reflected classes.

param
slot
param
e
return
FieldID

                       
          

        // Any thunking caller to createFieldID must create its own native IDs
        // except ScriptC
        if (mRS.isNative == true) {
            FieldID f = new FieldID(0, mRS, this, slot);
            if (mT != null) {
                f.mN = mT.thunkCreateFieldID(slot, e);
            }
            mFIDs.put(slot, f);
            return f;
        }
        FieldID f = mFIDs.get(slot);
        if (f != null) {
            return f;
        }

        int id = mRS.nScriptFieldIDCreate(getID(mRS), slot);
        if (id == 0) {
            throw new RSDriverException("Failed to create FieldID");
        }

        f = new FieldID(id, mRS, this, slot);
        mFIDs.put(slot, f);
        return f;
    
protected android.support.v8.renderscript.Script$KernelIDcreateKernelID(int slot, int sig, Element ein, Element eout)
Only to be used by generated reflected classes.

param
slot
param
sig
param
ein
param
eout
return
KernelID

                           
              
        KernelID k = mKIDs.get(slot);
        if (k != null) {
            return k;
        }

        // Any native callers to createKernelID must initialize their own native IDs
        // excpet ScriptCThunker
        if (mRS.isNative == true) {
            k = new KernelID(0, mRS, this, slot, sig);
            if (mT != null) {
                k.mN = mT.thunkCreateKernelID(slot, sig, ein, eout);
            }
            mKIDs.put(slot, k);
            return k;
        }


        int id = mRS.nScriptKernelIDCreate(getID(mRS), slot, sig);
        if (id == 0) {
            throw new RSDriverException("Failed to create KernelID");
        }

        k = new KernelID(id, mRS, this, slot, sig);

        mKIDs.put(slot, k);
        return k;
    
protected voidforEach(int slot, Allocation ain, Allocation aout, FieldPacker v)
Only intended for use by generated reflected code.

param
slot
param
ain
param
aout
param
v

        if (mT != null) {
            mT.thunkForEach(slot, ain, aout, v);
            return;
        }

        if (ain == null && aout == null) {
            throw new RSIllegalArgumentException(
                "At least one of ain or aout is required to be non-null.");
        }
        int in_id = 0;
        if (ain != null) {
            in_id = ain.getID(mRS);
        }
        int out_id = 0;
        if (aout != null) {
            out_id = aout.getID(mRS);
        }
        byte[] params = null;
        if (v != null) {
            params = v.getData();
        }
        mRS.nScriptForEach(getID(mRS), slot, in_id, out_id, params);
    
protected voidforEach(int slot, Allocation ain, Allocation aout, FieldPacker v, android.support.v8.renderscript.Script$LaunchOptions sc)
Only intended for use by generated reflected code.

param
slot
param
ain
param
aout
param
v
param
sc

        if (mT != null) {
            mT.thunkForEach(slot, ain, aout, v, sc);
            return;
        }

        if (ain == null && aout == null) {
            throw new RSIllegalArgumentException(
                "At least one of ain or aout is required to be non-null.");
        }

        if (sc == null) {
            forEach(slot, ain, aout, v);
            return;
        }
        int in_id = 0;
        if (ain != null) {
            in_id = ain.getID(mRS);
        }
        int out_id = 0;
        if (aout != null) {
            out_id = aout.getID(mRS);
        }
        byte[] params = null;
        if (v != null) {
            params = v.getData();
        }
        mRS.nScriptForEachClipped(getID(mRS), slot, in_id, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend);
    
android.renderscript.ScriptgetNObj()

        return mT;
    
protected voidinvoke(int slot)
Only intended for use by generated reflected code.

param
slot

        if (mT != null) {
            mT.thunkInvoke(slot);
            return;
        }

        mRS.nScriptInvoke(getID(mRS), slot);
    
protected voidinvoke(int slot, FieldPacker v)
Only intended for use by generated reflected code.

param
slot
param
v

        if (mT != null) {
            mT.thunkInvoke(slot, v);
            return;
        }

        if (v != null) {
            mRS.nScriptInvokeV(getID(mRS), slot, v.getData());
        } else {
            mRS.nScriptInvoke(getID(mRS), slot);
        }
    
public voidsetTimeZone(java.lang.String timeZone)

        if (mT != null) {
            mT.thunkSetTimeZone(timeZone);
            return;
        }

        mRS.validate();
        try {
            mRS.nScriptSetTimeZone(getID(mRS), timeZone.getBytes("UTF-8"));
        } catch (java.io.UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
    
public voidsetVar(int index, float v)
Only intended for use by generated reflected code.

param
index
param
v

        if (mT != null) {
            mT.thunkSetVar(index, v);
            return;
        }

        mRS.nScriptSetVarF(getID(mRS), index, v);
    
public voidsetVar(int index, double v)
Only intended for use by generated reflected code.

param
index
param
v

        if (mT != null) {
            mT.thunkSetVar(index, v);
            return;
        }

        mRS.nScriptSetVarD(getID(mRS), index, v);
    
public voidsetVar(int index, int v)
Only intended for use by generated reflected code.

param
index
param
v

        if (mT != null) {
            mT.thunkSetVar(index, v);
            return;
        }

        mRS.nScriptSetVarI(getID(mRS), index, v);
    
public voidsetVar(int index, long v)
Only intended for use by generated reflected code.

param
index
param
v

        if (mT != null) {
            mT.thunkSetVar(index, v);
            return;
        }

        mRS.nScriptSetVarJ(getID(mRS), index, v);
    
public voidsetVar(int index, boolean v)
Only intended for use by generated reflected code.

param
index
param
v

        if (mT != null) {
            mT.thunkSetVar(index, v);
            return;
        }

        mRS.nScriptSetVarI(getID(mRS), index, v ? 1 : 0);
    
public voidsetVar(int index, BaseObj o)
Only intended for use by generated reflected code.

param
index
param
o

        if (mT != null) {
            mT.thunkSetVar(index, o);
            return;
        }

        mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS));
    
public voidsetVar(int index, FieldPacker v)
Only intended for use by generated reflected code.

param
index
param
v

        if (mT != null) {
            mT.thunkSetVar(index, v);
            return;
        }

        mRS.nScriptSetVarV(getID(mRS), index, v.getData());
    
public voidsetVar(int index, FieldPacker v, Element e, int[] dims)
Only intended for use by generated reflected code.

param
index
param
v
param
e
param
dims

        if (mT != null) {
            mT.thunkSetVar(index, v, e, dims);
            return;
        }

        mRS.nScriptSetVarVE(getID(mRS), index, v.getData(), e.getID(mRS), dims);