MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / overlay

Method overlay

src/com/cloudream/ishow/algorithm/FaceDetector.java:859–877  ·  view source on GitHub ↗
(Bitmap src, Bitmap dst, float left, float top, int alpha)

Source from the content-addressed store, hash-verified

857 }
858
859 public static Bitmap overlay(Bitmap src, Bitmap dst, float left, float top, int alpha)
860 {
861 alpha = Math.min(Math.max(0, alpha), 255);
862 if(!dst.isMutable())
863 throw new NullPointerException("cannot write to dst Bitmap");
864
865 // operations on Canvas, a preferable way!
866 Paint paint = new Paint();
867 paint.setAntiAlias(true);
868 paint.setAlpha(255 - alpha);
869
870 Canvas canvas = new Canvas(dst);
871 canvas.drawBitmap(dst, 0, 0, paint);
872
873 paint.setAlpha(alpha);
874 canvas.drawBitmap(src, left, top, paint);
875
876 return dst;
877 }
878
879 public static Bitmap overlay(Bitmap src, Bitmap dst, Matrix matrix, int alpha)
880 {

Callers

nothing calls this directly

Calls 3

minMethod · 0.80
maxMethod · 0.80
drawBitmapMethod · 0.80

Tested by

no test coverage detected