public class RectUtils
extends java.lang.Object
| Constructor and Description |
|---|
RectUtils() |
| Modifier and Type | Method and Description |
|---|---|
static float[] |
getCenterFromRect(android.graphics.RectF r) |
static float[] |
getCornersFromRect(android.graphics.RectF r)
Gets a float array of the 2D coordinates representing a rectangles
corners.
|
static float[] |
getRectSidesFromCorners(float[] corners)
Gets a float array of two lengths representing a rectangles width and height
The order of the corners in the input float array is:
0------->1
^ |
| |
| v
3<-------2
|
static android.graphics.RectF |
trapToRect(float[] array)
Takes an array of 2D coordinates representing corners and returns the
smallest rectangle containing those coordinates.
|
public static float[] getCornersFromRect(android.graphics.RectF r)
r - the rectangle to get the corners ofpublic static float[] getRectSidesFromCorners(float[] corners)
corners - the float array of corners (8 floats)public static float[] getCenterFromRect(android.graphics.RectF r)
public static android.graphics.RectF trapToRect(float[] array)
array - array of 2D coordinates