com.adobe.fre.FREInvalidObjectException Java Examples

The following examples show how to use com.adobe.fre.FREInvalidObjectException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BitmapDataUtils.java    From face-detection-ane with Apache License 2.0 5 votes vote down vote up
/**
 * Switch color channels
 * http://stackoverflow.com/questions/17314467/bitmap-channels-order-different-in-android
 */
public static Bitmap getBitmap( FREBitmapData bitmapData ) throws FREWrongThreadException, FREInvalidObjectException {
	bitmapData.acquire();
	Bitmap bitmap = Bitmap.createBitmap( bitmapData.getWidth(), bitmapData.getHeight(), Bitmap.Config.ARGB_8888 );
	Canvas canvas = new Canvas( bitmap );
	Paint paint = new Paint();
	paint.setColorFilter( mColorFilter );
	bitmap.copyPixelsFromBuffer( bitmapData.getBits() );
	bitmapData.release();
	canvas.drawBitmap( bitmap, 0, 0, paint );
	return bitmap;
}