Code example for Allocation

Methods: copyTo

0
    } 
 
    public void surfaceCreated(SurfaceHolder holder) {
        createScript(); 
        mScript.invoke_filter();
        mOutPixelsAllocation.copyTo(mBitmapOut);
    } 
 
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
    } 
 
    public void surfaceDestroyed(SurfaceHolder holder) {
    } 
 
    private void createScript() { 
        mRS = RenderScript.create(this);
        mRS.setMessageHandler(new FilterCallback());
 
        mInPixelsAllocation = Allocation.createFromBitmap(mRS, mBitmapIn,
                                                          Allocation.MipmapControl.MIPMAP_NONE,
                                                          Allocation.USAGE_SCRIPT);