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

AllocationThunker

public class AllocationThunker extends Allocation

Fields Summary
android.renderscript.Allocation
mN
static BitmapFactory.Options
mBitmapOptions
Constructors Summary
AllocationThunker(RenderScript rs, Type t, int usage, android.renderscript.Allocation na)

        super(0, rs, t, usage);

        mType = t;
        mUsage = usage;
        mN = na;
    
Methods Summary
static android.renderscript.Allocation.MipmapControlconvertMipmapControl(MipmapControl mc)


        switch(mc) {
        case MIPMAP_NONE:
            return android.renderscript.Allocation.MipmapControl.MIPMAP_NONE;
        case MIPMAP_FULL:
            return android.renderscript.Allocation.MipmapControl.MIPMAP_FULL;
        case MIPMAP_ON_SYNC_TO_TEXTURE:
            return android.renderscript.Allocation.MipmapControl.MIPMAP_ON_SYNC_TO_TEXTURE;
        }
        return null;
    
public voidcopy1DRangeFrom(int off, int count, int[] d)

        try {
            mN.copy1DRangeFrom(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFrom(int off, int count, short[] d)

        try {
            mN.copy1DRangeFrom(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFrom(int off, int count, byte[] d)

        try {
            mN.copy1DRangeFrom(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFrom(int off, int count, float[] d)

        try {
            mN.copy1DRangeFrom(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFrom(int off, int count, Allocation data, int dataOff)

        try {
            AllocationThunker at = (AllocationThunker)data;
            mN.copy1DRangeFrom(off, count, at.mN, dataOff);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFromUnchecked(int off, int count, int[] d)

        try {
            mN.copy1DRangeFromUnchecked(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFromUnchecked(int off, int count, short[] d)

        try {
            mN.copy1DRangeFromUnchecked(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFromUnchecked(int off, int count, byte[] d)

        try {
            mN.copy1DRangeFromUnchecked(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy1DRangeFromUnchecked(int off, int count, float[] d)

        try {
            mN.copy1DRangeFromUnchecked(off, count, d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy2DRangeFrom(int xoff, int yoff, int w, int h, byte[] data)

        try {
            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy2DRangeFrom(int xoff, int yoff, int w, int h, short[] data)

        try {
            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy2DRangeFrom(int xoff, int yoff, int w, int h, int[] data)

        try {
            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy2DRangeFrom(int xoff, int yoff, int w, int h, float[] data)

        try {
            mN.copy2DRangeFrom(xoff, yoff, w, h, data);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy2DRangeFrom(int xoff, int yoff, int w, int h, Allocation data, int dataXoff, int dataYoff)

        try {
            AllocationThunker at = (AllocationThunker)data;
            mN.copy2DRangeFrom(xoff, yoff, w, h, at.mN, dataXoff, dataYoff);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopy2DRangeFrom(int xoff, int yoff, android.graphics.Bitmap data)

        try {
            mN.copy2DRangeFrom(xoff, yoff, data);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(BaseObj[] d)

        if (d == null) {
            return;
        }
        android.renderscript.BaseObj[] dN = new android.renderscript.BaseObj[d.length];
        for (int i = 0; i < d.length; i++) {
            dN[i] = d[i].getNObj();
        }
        try {
            mN.copyFrom(dN);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(int[] d)

        try {
            mN.copyFrom(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(short[] d)

        try {
            mN.copyFrom(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(byte[] d)

        try {
            mN.copyFrom(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(float[] d)

        try {
            mN.copyFrom(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(android.graphics.Bitmap b)

        try {
            mN.copyFrom(b);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFrom(Allocation a)

        AllocationThunker at = (AllocationThunker)a;
        try {
            mN.copyFrom(at.mN);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFromUnchecked(int[] d)

        try {
            mN.copyFromUnchecked(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFromUnchecked(short[] d)

        try {
            mN.copyFromUnchecked(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFromUnchecked(byte[] d)

        try {
            mN.copyFromUnchecked(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyFromUnchecked(float[] d)

        try {
            mN.copyFromUnchecked(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyTo(android.graphics.Bitmap b)

        try {
            mN.copyTo(b);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyTo(byte[] d)

        try {
            mN.copyTo(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyTo(short[] d)

        try {
            mN.copyTo(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyTo(int[] d)

        try {
            mN.copyTo(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidcopyTo(float[] d)

        try {
            mN.copyTo(d);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static AllocationcreateCubemapFromBitmap(RenderScript rs, android.graphics.Bitmap b, MipmapControl mips, int usage)

        RenderScriptThunker rst = (RenderScriptThunker)rs;
        try {
            android.renderscript.Allocation a =
                    android.renderscript.Allocation.createCubemapFromBitmap(
                    rst.mN, b, convertMipmapControl(mips), usage);
            TypeThunker tt = new TypeThunker(rs, a.getType());
            return new AllocationThunker(rs, tt, usage, a);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static AllocationcreateCubemapFromCubeFaces(RenderScript rs, android.graphics.Bitmap xpos, android.graphics.Bitmap xneg, android.graphics.Bitmap ypos, android.graphics.Bitmap yneg, android.graphics.Bitmap zpos, android.graphics.Bitmap zneg, MipmapControl mips, int usage)

        RenderScriptThunker rst = (RenderScriptThunker)rs;
        try {
            android.renderscript.Allocation a =
                    android.renderscript.Allocation.createCubemapFromCubeFaces(
                    rst.mN, xpos, xneg, ypos, yneg, zpos, zneg,
                    convertMipmapControl(mips), usage);
            TypeThunker tt = new TypeThunker(rs, a.getType());
            return new AllocationThunker(rs, tt, usage, a);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static AllocationcreateFromBitmap(RenderScript rs, android.graphics.Bitmap b, MipmapControl mips, int usage)


        RenderScriptThunker rst = (RenderScriptThunker)rs;
        try {
            android.renderscript.Allocation a =
                android.renderscript.Allocation.createFromBitmap(rst.mN, b,
                                                                 convertMipmapControl(mips),
                                                                 usage);
            TypeThunker tt = new TypeThunker(rs, a.getType());
            return new AllocationThunker(rs, tt, usage, a);

        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static AllocationcreateFromBitmapResource(RenderScript rs, android.content.res.Resources res, int id, MipmapControl mips, int usage)


        RenderScriptThunker rst = (RenderScriptThunker)rs;
        try {
            android.renderscript.Allocation a =
                    android.renderscript.Allocation.createFromBitmapResource(
                    rst.mN, res, id, convertMipmapControl(mips), usage);
            TypeThunker tt = new TypeThunker(rs, a.getType());
            return new AllocationThunker(rs, tt, usage, a);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static AllocationcreateFromString(RenderScript rs, java.lang.String str, int usage)

        RenderScriptThunker rst = (RenderScriptThunker)rs;
        try {
            android.renderscript.Allocation a =
                    android.renderscript.Allocation.createFromString(
                    rst.mN, str, usage);
            TypeThunker tt = new TypeThunker(rs, a.getType());
            return new AllocationThunker(rs, tt, usage, a);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public static AllocationcreateSized(RenderScript rs, Element e, int count, int usage)

        RenderScriptThunker rst = (RenderScriptThunker)rs;
        ElementThunker et = (ElementThunker) e;
        try {
            android.renderscript.Allocation a =
                android.renderscript.Allocation.createSized
                (rst.mN, (android.renderscript.Element)e.getNObj(), count, usage);
            TypeThunker tt = new TypeThunker(rs, a.getType());
            return new AllocationThunker(rs, tt, usage, a);
        } catch (android.renderscript.RSRuntimeException exc) {
            throw ExceptionThunker.convertException(exc);
        }
    
public static AllocationcreateTyped(RenderScript rs, Type type, MipmapControl mips, int usage)

     
        mBitmapOptions.inScaled = false;
    
        RenderScriptThunker rst = (RenderScriptThunker)rs;
        TypeThunker tt = (TypeThunker)type;

        try {
            android.renderscript.Allocation a =
                android.renderscript.Allocation.createTyped(rst.mN, tt.mN,
                                                            convertMipmapControl(mips),
                                                            usage);
            return new AllocationThunker(rs, type, usage, a);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidgenerateMipmaps()

        try {
            mN.generateMipmaps();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public intgetBytesSize()

        try {
            return mN.getBytesSize();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public ElementgetElement()

        return getType().getElement();
    
android.renderscript.AllocationgetNObj()

        return mN;
    
public TypegetType()

        return TypeThunker.find(mN.getType());
    
public intgetUsage()

        try {
            return mN.getUsage();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidioReceive()

        try {
            mN.ioReceive();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidioSend()

        try {
            mN.ioSend();
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidsetFromFieldPacker(int xoff, FieldPacker fp)

        try {
            // Must construct actual FieldPacker from scratch, since we don't
            // know how many bytes were actually used.
            byte[] data = fp.getData();
            int fp_length = fp.getPos();
            android.renderscript.FieldPacker nfp =
                new android.renderscript.FieldPacker(fp_length);
            for (int i = 0; i < fp_length; i++) {
                nfp.addI8(data[i]);
            }
            mN.setFromFieldPacker(xoff, nfp);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidsetFromFieldPacker(int xoff, int component_number, FieldPacker fp)

        try {
            // Must construct actual FieldPacker from scratch, since we don't
            // know how many bytes were actually used.
            byte[] data = fp.getData();
            int fp_length = fp.getPos();
            android.renderscript.FieldPacker nfp =
                new android.renderscript.FieldPacker(fp_length);
            for (int i = 0; i < fp_length; i++) {
                nfp.addI8(data[i]);
            }
            mN.setFromFieldPacker(xoff, component_number, nfp);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }
    
public voidsyncAll(int srcLocation)

        try {
            mN.syncAll(srcLocation);
        } catch (android.renderscript.RSRuntimeException e) {
            throw ExceptionThunker.convertException(e);
        }