Methods Summary |
---|
public native boolean | contains(int x, int y)Return true if the region contains the specified point
|
public int | describeContents()
return 0;
|
protected void | finalize()
nativeDestructor(mNativeRegion);
|
public Path | getBoundaryPath()Return the boundary of the region as a new Path. If the region is empty,
the path will also be empty.
Path path = new Path();
nativeGetBoundaryPath(mNativeRegion, path.ni());
return path;
|
public boolean | getBoundaryPath(Path path)Set the path to the boundary of the region. If the region is empty, the
path will also be empty.
return nativeGetBoundaryPath(mNativeRegion, path.ni());
|
public Rect | getBounds()Return a new Rect set to the bounds of the region. If the region is
empty, the Rect will be set to [0, 0, 0, 0]
Rect r = new Rect();
nativeGetBounds(mNativeRegion, r);
return r;
|
public boolean | getBounds(Rect r)Set the Rect to the bounds of the region. If the region is empty, the
Rect will be set to [0, 0, 0, 0]
if (r == null) {
throw new NullPointerException();
}
return nativeGetBounds(mNativeRegion, r);
|
public native boolean | isComplex()Return true if the region contains more than one rectangle
|
public native boolean | isEmpty()Return true if this region is empty
|
public native boolean | isRect()Return true if the region contains a single rectangle
|
private static native int | nativeConstructor()
|
private static native int | nativeCreateFromParcel(android.os.Parcel p)
|
private static native void | nativeDestructor(int native_region)
|
private static native boolean | nativeGetBoundaryPath(int native_region, int native_path)
|
private static native boolean | nativeGetBounds(int native_region, Rect rect)
|
private static native boolean | nativeOp(int native_dst, int left, int top, int right, int bottom, int op)
|
private static native boolean | nativeOp(int native_dst, Rect rect, int native_region, int op)
|
private static native boolean | nativeOp(int native_dst, int native_region1, int native_region2, int op)
|
private static native boolean | nativeSetPath(int native_dst, int native_path, int native_clip)
|
private static native boolean | nativeSetRect(int native_dst, int left, int top, int right, int bottom)
|
private static native boolean | nativeSetRegion(int native_dst, int native_src)
|
private static native boolean | nativeWriteToParcel(int native_region, android.os.Parcel p)
|
final int | ni()
return mNativeRegion;
|
public boolean | op(Rect r, android.graphics.Region$Op op)Perform the specified Op on this region and the specified rect. Return
true if the result of the op is not empty.
return nativeOp(mNativeRegion, r.left, r.top, r.right, r.bottom,
op.nativeInt);
|
public boolean | op(int left, int top, int right, int bottom, android.graphics.Region$Op op)Perform the specified Op on this region and the specified rect. Return
true if the result of the op is not empty.
return nativeOp(mNativeRegion, left, top, right, bottom,
op.nativeInt);
|
public boolean | op(android.graphics.Region region, android.graphics.Region$Op op)Perform the specified Op on this region and the specified region. Return
true if the result of the op is not empty.
return op(this, region, op);
|
public boolean | op(Rect rect, android.graphics.Region region, android.graphics.Region$Op op)Set this region to the result of performing the Op on the specified rect
and region. Return true if the result is not empty.
return nativeOp(mNativeRegion, rect, region.mNativeRegion,
op.nativeInt);
|
public boolean | op(android.graphics.Region region1, android.graphics.Region region2, android.graphics.Region$Op op)Set this region to the result of performing the Op on the specified
regions. Return true if the result is not empty.
return nativeOp(mNativeRegion, region1.mNativeRegion,
region2.mNativeRegion, op.nativeInt);
|
public boolean | quickContains(Rect r)Return true if the region is a single rectangle (not complex) and it
contains the specified rectangle. Returning false is not a guarantee
that the rectangle is not contained by this region, but return true is a
guarantee that the rectangle is contained by this region.
return quickContains(r.left, r.top, r.right, r.bottom);
|
public native boolean | quickContains(int left, int top, int right, int bottom)Return true if the region is a single rectangle (not complex) and it
contains the specified rectangle. Returning false is not a guarantee
that the rectangle is not contained by this region, but return true is a
guarantee that the rectangle is contained by this region.
|
public boolean | quickReject(Rect r)Return true if the region is empty, or if the specified rectangle does
not intersect the region. Returning false is not a guarantee that they
intersect, but returning true is a guarantee that they do not.
return quickReject(r.left, r.top, r.right, r.bottom);
|
public native boolean | quickReject(int left, int top, int right, int bottom)Return true if the region is empty, or if the specified rectangle does
not intersect the region. Returning false is not a guarantee that they
intersect, but returning true is a guarantee that they do not.
|
public native boolean | quickReject(android.graphics.Region rgn)Return true if the region is empty, or if the specified region does not
intersect the region. Returning false is not a guarantee that they
intersect, but returning true is a guarantee that they do not.
|
public boolean | set(android.graphics.Region region)Set the region to the specified region.
return nativeSetRegion(mNativeRegion, region.mNativeRegion);
|
public boolean | set(Rect r)Set the region to the specified rectangle
return nativeSetRect(mNativeRegion, r.left, r.top, r.right, r.bottom);
|
public boolean | set(int left, int top, int right, int bottom)Set the region to the specified rectangle
return nativeSetRect(mNativeRegion, left, top, right, bottom);
|
public void | setEmpty()Set the region to the empty region
nativeSetRect(mNativeRegion, 0, 0, 0, 0);
|
public boolean | setPath(Path path, android.graphics.Region clip)Set the region to the area described by the path and clip.
Return true if the resulting region is non-empty. This produces a region
that is identical to the pixels that would be drawn by the path
(with no antialiasing).
return nativeSetPath(mNativeRegion, path.ni(), clip.mNativeRegion);
|
public void | translate(int dx, int dy)Translate the region by [dx, dy]. If the region is empty, do nothing.
translate(dx, dy, null);
|
public native void | translate(int dx, int dy, android.graphics.Region dst)Set the dst region to the result of translating this region by [dx, dy].
If this region is empty, then dst will be set to empty.
|
public final boolean | union(Rect r)
return op(r, Op.UNION);
|
public void | writeToParcel(android.os.Parcel p, int flags)Write the region and its pixels to the parcel. The region can be
rebuilt from the parcel by calling CREATOR.createFromParcel().
if (!nativeWriteToParcel(mNativeRegion, p)) {
throw new RuntimeException();
}
|