Quadrangle

open class Quadrangle : Parcelable

The quadrangle used to represent document borders. It consists of four points in a specific order: Top Left, Top Right, Bottom Left, Bottom Right. If no document is present, the quadrangle matches the full image.

Constructors

Link copied to clipboard
constructor()
Create an empty quadrangle, meaning document detection has not been run, or it has detected no document in the image.
constructor(points: Array<Float>)
Create a quadrangle from an array of coordinates.
constructor(x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float, x4: Float, y4: Float)
Create a quadrangle from the coordinates of the corners.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Create a quadrangle that matches the full image, meaning a document has been detected but it fills the entire image and thus no crop should be performed.
Link copied to clipboard
open fun describeContents(): Int
Link copied to clipboard
open fun getClosestCorner(x: Float, y: Float): Int
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun isFullImage(): Boolean
Link copied to clipboard
open fun move(cornerIndex: Int, dx: Float, dy: Float)
Move a specific corner by a fixed distance.
Link copied to clipboard
open fun order()
Reorder the corners of the Quadrangle in the standard order.
Link copied to clipboard
open fun rotate(angle: RotationAngle): Quadrangle
Rotate a quadrangle by a specific angle
Link copied to clipboard
open fun setToFullImage()
Set the corners of the quadrangle to match the corners of the image.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun writeToParcel(dest: Parcel, flags: Int)