public void setCreatedFromResId(int resId, String description) { this.createdFromResId = resId; appendDescription(" for resource:" + description); }
public void appendDescription(String s) { ShadowBitmap shadowBitmap = Shadow.extract(targetBitmap); shadowBitmap.appendDescription(s); }
@Implementation protected boolean compress(Bitmap.CompressFormat format, int quality, OutputStream stream) { appendDescription(" compressed as " + format + " with quality " + quality); return ImageUtil.writeToStream(realBitmap, format, quality, stream); }
@Implementation protected static Bitmap createBitmap(Bitmap src) { ShadowBitmap shadowBitmap = Shadow.extract(src); shadowBitmap.appendDescription(" created from Bitmap object"); return src; }
@Implementation protected static Bitmap createBitmap(Bitmap src, int x, int y, int width, int height) { if (x == 0 && y == 0 && width == src.getWidth() && height == src.getHeight()) { return src; // Return the original. } Bitmap newBitmap = ReflectionHelpers.callConstructor(Bitmap.class); ShadowBitmap shadowBitmap = Shadow.extract(newBitmap); ShadowBitmap shadowSrcBitmap = Shadow.extract(src); shadowBitmap.appendDescription(shadowSrcBitmap.getDescription()); shadowBitmap.appendDescription(" at (" + x + "," + y); shadowBitmap.appendDescription(" with width " + width + " and height " + height); shadowBitmap.createdFromBitmap = src; shadowBitmap.createdFromX = x; shadowBitmap.createdFromY = y; shadowBitmap.createdFromWidth = width; shadowBitmap.createdFromHeight = height; shadowBitmap.width = width; shadowBitmap.height = height; return newBitmap; }
shadowNewBitmap.appendDescription(shadowSrcBitmap.getDescription()); shadowNewBitmap.appendDescription(" at (" + x + "," + y + ")"); shadowNewBitmap.appendDescription(" with width " + width + " and height " + height); shadowNewBitmap.appendDescription(" using matrix " + shadowMatrix.getDescription()); shadowNewBitmap.appendDescription(" with filter");
@Implementation @SuppressWarnings("unused") public Bitmap getFrameAtTime() { Bitmap bitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888); Shadows.shadowOf(bitmap).appendDescription(" from MediaMetadataRetriever"); return bitmap; } }
@Implementation protected static Bitmap createScaledBitmap( Bitmap src, int dstWidth, int dstHeight, boolean filter) { if (dstWidth == src.getWidth() && dstHeight == src.getHeight() && !filter) { return src; // Return the original. } Bitmap scaledBitmap = ReflectionHelpers.callConstructor(Bitmap.class); ShadowBitmap shadowBitmap = Shadow.extract(scaledBitmap); ShadowBitmap shadowSrcBitmap = Shadow.extract(src); shadowBitmap.appendDescription(shadowSrcBitmap.getDescription()); shadowBitmap.appendDescription(" scaled to " + dstWidth + " x " + dstHeight); if (filter) { shadowBitmap.appendDescription(" with filter " + filter); } shadowBitmap.createdFromBitmap = src; shadowBitmap.createdFromFilter = filter; shadowBitmap.width = dstWidth; shadowBitmap.height = dstHeight; shadowBitmap.setPixels(new int[shadowBitmap.getHeight() * shadowBitmap.getWidth()], 0, 0, 0, 0, shadowBitmap.getWidth(), shadowBitmap.getHeight()); return scaledBitmap; }
public static Bitmap create(final String name, final BitmapFactory.Options options, final Point widthAndHeight) { Bitmap bitmap = Shadow.newInstanceOf(Bitmap.class); ShadowBitmap shadowBitmap = Shadow.extract(bitmap); shadowBitmap.appendDescription(name == null ? "Bitmap" : "Bitmap for " + name); shadowBitmap.appendDescription(" with options "); shadowBitmap.appendDescription(optionsString);
private static Bitmap create(String name) { Bitmap bitmap = Shadow.newInstanceOf(Bitmap.class); shadowOf(bitmap).appendDescription(name); return bitmap; }
public void setCreatedFromResId(int resId, String description) { this.createdFromResId = resId; appendDescription(" for resource:" + description); }
public void setCreatedFromResId(int resId, String description) { this.createdFromResId = resId; appendDescription(" for resource:" + description); }
public void setCreatedFromResId(int resId, String description) { this.createdFromResId = resId; appendDescription(" for resource:" + description); }
public void setCreatedFromResId(int resId, String description) { this.createdFromResId = resId; appendDescription(" for resource:" + description); }
public void appendDescription(String s) { ShadowBitmap shadowBitmap = Shadow.extract(targetBitmap); shadowBitmap.appendDescription(s); }
@Implementation public static Bitmap createBitmap(Bitmap src) { ShadowBitmap shadowBitmap = shadowOf(src); shadowBitmap.appendDescription(" created from Bitmap object"); return src; }
@Implementation public static Bitmap createBitmap(Bitmap src) { ShadowBitmap shadowBitmap = shadowOf(src); shadowBitmap.appendDescription(" created from Bitmap object"); return src; }
@Implementation protected static Bitmap createBitmap(Bitmap src) { ShadowBitmap shadowBitmap = Shadow.extract(src); shadowBitmap.appendDescription(" created from Bitmap object"); return src; }
@Implementation public static Bitmap createBitmap(Bitmap src) { ShadowBitmap shadowBitmap = shadowOf(src); shadowBitmap.appendDescription(" created from Bitmap object"); return src; }
@Implementation protected boolean compress(Bitmap.CompressFormat format, int quality, OutputStream stream) { appendDescription(" compressed as " + format + " with quality " + quality); return ImageUtil.writeToStream(realBitmap, format, quality, stream); }