FileDocCategorySizeDatePackage
UsageIO.javaAPI DocAndroid 5.1 API2244Thu Mar 12 22:22:54 GMT 2015com.android.rs.image

UsageIO

public class UsageIO extends TestBase

Fields Summary
private android.renderscript.ScriptIntrinsicColorMatrix
mMatrix
private android.renderscript.Allocation
mScratchPixelsAllocation1
private android.renderscript.Allocation
mScratchPixelsAllocation2
Constructors Summary
public UsageIO()

    
Methods Summary
public voidcreateTest(android.content.res.Resources res)

        mMatrix = ScriptIntrinsicColorMatrix.create(mRS, Element.U8_4(mRS));

        Matrix4f m = new Matrix4f();
        m.set(1, 0, 0.2f);
        m.set(1, 1, 0.9f);
        m.set(1, 2, 0.2f);
        mMatrix.setColorMatrix(m);

        Type connect = mInPixelsAllocation.getType();

        mScratchPixelsAllocation1 = Allocation.createTyped(mRS, connect, Allocation.USAGE_IO_OUTPUT | Allocation.USAGE_SCRIPT);
        mScratchPixelsAllocation2 = Allocation.createTyped(mRS, connect, Allocation.USAGE_IO_INPUT | Allocation.USAGE_SCRIPT);

        Surface s = mScratchPixelsAllocation2.getSurface();
        mScratchPixelsAllocation1.setSurface(s);
    
public voidrunTest()

        mScratchPixelsAllocation1.copyFrom(mInPixelsAllocation);
        mScratchPixelsAllocation1.ioSend();
        mScratchPixelsAllocation2.ioReceive();
        mMatrix.forEach(mScratchPixelsAllocation2, mOutPixelsAllocation);