FileDocCategorySizeDatePackage
HelloComputeNDK.javaAPI DocAndroid 5.1 API2134Thu Mar 12 22:22:54 GMT 2015com.example.android.rs.hellocomputendk

HelloComputeNDK

public class HelloComputeNDK extends android.app.Activity

Fields Summary
private android.graphics.Bitmap
mBitmapIn
private android.graphics.Bitmap
mBitmapOut
Constructors Summary
Methods Summary
private android.graphics.BitmaploadBitmap(int resource)

        final BitmapFactory.Options options = new BitmapFactory.Options();
        options.inPreferredConfig = Bitmap.Config.ARGB_8888;
        return BitmapFactory.decodeResource(getResources(), resource, options);
    
native voidnativeMono(java.lang.String cacheDir, int X, int Y, android.graphics.Bitmap in, android.graphics.Bitmap out)

protected voidonCreate(android.os.Bundle savedInstanceState)

        System.loadLibrary("RSSupport");
        System.loadLibrary("hellocomputendk");
    
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mBitmapIn = loadBitmap(R.drawable.data);
        mBitmapOut = Bitmap.createBitmap(mBitmapIn.getWidth(), mBitmapIn.getHeight(),
                                         mBitmapIn.getConfig());

        ImageView in = (ImageView) findViewById(R.id.displayin);
        in.setImageBitmap(mBitmapIn);

        ImageView out = (ImageView) findViewById(R.id.displayout);
        out.setImageBitmap(mBitmapOut);

        nativeMono(this.getCacheDir().toString(),
                   mBitmapIn.getWidth(), mBitmapIn.getHeight(),
                   mBitmapIn, mBitmapOut);