@ Override public CloseableReference < Bitmap > process ( Bitmap sourceBitmap , PlatformBitmapFactory bitmapFactory ) { final Bitmap . Config sourceBitmapConfig = sourceBitmap . getConfig ( ) ; CloseableReference < Bitmap > destBitmapRef = bitmapFactory . createBitmapInternal ( sourceBitmap . getWidth ( ) , sourceBitmap . getHeight ( ) , sourceBitmapConfig != null ? sourceBitmapConfig : FALLBACK_BITMAP_CONFIGURATION ) ; try { process ( destBitmapRef . get ( ) , sourceBitmap ) ; return CloseableReference . cloneOrNull ( destBitmapRef ) ; } finally { CloseableReference . closeSafely ( destBitmapRef ) ; } }
Clients should override this method only if the post - processed bitmap has to be of a different size than the source bitmap . If the post - processed bitmap is of the same size clients should override one of the other two methods .