public class Quadrilateral
extends java.lang.Object
implements android.os.Parcelable
| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<Quadrilateral> |
CREATOR |
| Modifier | Constructor and Description |
|---|---|
|
Quadrilateral() |
|
Quadrilateral(float[] points)
Constructor from float array.
|
|
Quadrilateral(int top,
int bottom,
int left,
int right,
int hostActivityOrientation) |
protected |
Quadrilateral(android.os.Parcel in) |
|
Quadrilateral(Point uleft,
Point uright,
Point lleft,
Point lright) |
| Modifier and Type | Method and Description |
|---|---|
Quadrilateral |
clone() |
int |
describeContents() |
int |
getColor() |
Point |
getLowerLeft()
Returns the point nearest to (0, height) coordinate
|
Point |
getLowerRight()
Returns the point nearest to (width, height) coordinate
|
Quadrilateral |
getSortedQuad()
Returns the Quadrilateral which has same corners as original, but it guarantees that upper left
point is the point nearest to (0,0) coordinate.
|
Point |
getUpperLeft()
Returns the point nearest to (0, 0) coordinate.
|
Point |
getUpperRight()
Returns the point nearest to (width, 0) coordinate
|
boolean |
isDefaultQuad() |
boolean |
isEmpty()
Returns true if quadrilateral is empty, i.e.
|
boolean |
matchesMargins(int top,
int bottom,
int left,
int right,
int hostActivityOrientation) |
void |
mirror(int canvasWidth,
int canvasHeight,
int hostActivityOrientation)
Mirrors the quadrangle so that it can be properly drawn on mirrored camera preview
|
void |
setColor(int color) |
void |
setIsDefaultQuad(boolean defaultQuad) |
void |
setMargins(int top,
int bottom,
int left,
int right,
int hostActivityOrientation) |
void |
setPoints(Point uleft,
Point uright,
Point lleft,
Point lright) |
void |
toFloatArray(float[] arr)
Converts this quadrilateral to array of float points.
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<Quadrilateral> CREATOR
public Quadrilateral(int top,
int bottom,
int left,
int right,
int hostActivityOrientation)
public Quadrilateral()
public Quadrilateral(float[] points)
points - float pairs representing quadrilateral pointsprotected Quadrilateral(android.os.Parcel in)
public void setMargins(int top,
int bottom,
int left,
int right,
int hostActivityOrientation)
public boolean matchesMargins(int top,
int bottom,
int left,
int right,
int hostActivityOrientation)
public boolean isEmpty()
public void toFloatArray(@NonNull
float[] arr)
public java.lang.String toString()
toString in class java.lang.Objectpublic void mirror(int canvasWidth,
int canvasHeight,
int hostActivityOrientation)
canvasWidth - width of canvascanvasHeight - height of canvaspublic Quadrilateral getSortedQuad()
public Point getUpperLeft()
public Point getUpperRight()
public Point getLowerLeft()
public Point getLowerRight()
public int getColor()
public void setColor(int color)
public boolean isDefaultQuad()
public void setIsDefaultQuad(boolean defaultQuad)
public Quadrilateral clone()
clone in class java.lang.Objectpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelable