@Test public void testReturnsNewBitmap() { Bitmap bitmap = Bitmap.createBitmap(400, 400, Bitmap.Config.ARGB_8888); Matrix matrix = new Matrix(); matrix.postScale(.5f, 1f); MatrixProcessor processor = new MatrixProcessor(matrix); Bitmap result = processor.process(bitmap); Assert.assertNotNull(result); Assert.assertNotSame(bitmap, result); }
@Override public Bitmap process(Bitmap in) { Bitmap result = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(), matrix, false); if (result != in) in.recycle(); return result; }
MatrixProcessor implements BitmapProcessor { @Override public Bitmap process(Bitmap in) { Bitmap result = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(), matrix, false); if (result != in) in.recycle(); return result; } }
MatrixProcessor implements BitmapProcessor { @Override public Bitmap process(Bitmap in) { Bitmap result = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(), matrix, false); if (result != in) in.recycle(); return result; } MatrixProcessor(Matrix matrix); }
MatrixProcessor implements BitmapProcessor { @Override public Bitmap process(Bitmap in) { Bitmap result = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(), matrix, false); if (result != in) in.recycle(); return result; } MatrixProcessor(Matrix matrix); @Override String getId(); @Override Bitmap process(Bitmap in); }
MatrixProcessor implements BitmapProcessor { @Override public Bitmap process(Bitmap in) { Bitmap result = Bitmap.createBitmap(in, 0, 0, in.getWidth(), in.getHeight(), matrix, false); if (result != in) in.recycle(); return result; } MatrixProcessor(Matrix matrix); @Override String getId(); @Override Bitmap process(Bitmap in);  }