HelloComputeNDKpublic class HelloComputeNDK extends android.app.Activity
Fields Summary |
---|
private android.graphics.Bitmap | mBitmapIn | private android.graphics.Bitmap | mBitmapOut |
Methods Summary |
---|
private android.graphics.Bitmap | loadBitmap(int resource)
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
return BitmapFactory.decodeResource(getResources(), resource, options);
| native void | nativeMono(java.lang.String cacheDir, int X, int Y, android.graphics.Bitmap in, android.graphics.Bitmap out)
| protected void | onCreate(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);
|
|