public class

MaskImageProcessor

extends Object
implements ImageProcessor
java.lang.Object
   ↳ greendroid.image.MaskImageProcessor

Class Overview

An ImageProcessor that masks the given Bitmap according to a shape or another Bitmap.

Summary

Public Constructors
MaskImageProcessor(Bitmap maskBitmap)

Create a new MaskImageProcessor using the specified Bitmap as mask.

MaskImageProcessor(float radius)
Create a new MaskImageProcessor using a simple rectangle as mask.
MaskImageProcessor(float[] radii)

Create a new MaskImageProcessor using a simple rectangle as mask.

Public Methods
Bitmap processImage(Bitmap bitmap)
Called whenever the bitmap need to be processed.
[Expand]
Inherited Methods
From class java.lang.Object
From interface greendroid.image.ImageProcessor

Public Constructors

public MaskImageProcessor (Bitmap maskBitmap)

Create a new MaskImageProcessor using the specified Bitmap as mask.

Parameters
maskBitmap The Bitmap used for masking

public MaskImageProcessor (float radius)

Create a new MaskImageProcessor using a simple rectangle as mask. Specifying a radius > 0, enable clients to use a rounded rectangle, rather than a rectangle.

Parameters
radius The radius for the corners of the rectangle.

public MaskImageProcessor (float[] radii)

Create a new MaskImageProcessor using a simple rectangle as mask. Specifying a radius > 0, enable clients to use a rounded rectangle, rather than a rectangle.

Specify radii for each of the 4 corners. For each corner, the array contains 2 values, [X_radius, Y_radius]. The corners are ordered top-left, top-right, bottom-right, bottom-left

Parameters
radii The radii for the corners of the rectangle

Public Methods

public Bitmap processImage (Bitmap bitmap)

Called whenever the bitmap need to be processed. The returned may have been modified or completely different.

Parameters
bitmap The Bitmap to process
Returns
  • A Bitmap that has been modified