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

Method gray

src/com/cloudream/ishow/util/BitmapUtils.java:776–787  ·  view source on GitHub ↗

turn true color image into gray image. @param image @return gray image, format ARGB_8888 as before.

(Bitmap image)

Source from the content-addressed store, hash-verified

774 * @return gray image, format ARGB_8888 as before.
775 */
776 public Bitmap gray(Bitmap image)
777 {
778 Bitmap result = Bitmap.createBitmap(image.getWidth(), image.getHeight(), Bitmap.Config.ARGB_8888);
779 Canvas canvas = new Canvas(result);
780 Paint paint = new Paint();
781 ColorMatrix transform = new ColorMatrix();
782 transform.setSaturation(0);
783 ColorMatrixColorFilter filter = new ColorMatrixColorFilter(transform);
784 paint.setColorFilter(filter);
785 canvas.drawBitmap(image, 0, 0, paint);
786 return result;
787 }
788
789 // convert View to Bitmap, it can be archived to SD card later.
790 public static Bitmap getBitmapFromView(View view)

Callers

nothing calls this directly

Calls 2

createBitmapMethod · 0.80
drawBitmapMethod · 0.80

Tested by

no test coverage detected