Quad class

Four normalized corner points describing a document outline.

Corners are stored in a fixed order — topLeft, topRight, bottomRight, bottomLeft — which both native sides rely on when serializing over the channel and when applying the perspective transform.

Constructors

Quad({required ScanPoint topLeft, required ScanPoint topRight, required ScanPoint bottomRight, required ScanPoint bottomLeft})
Creates a quad from four explicit corners.
const
Quad.fromList(List<Object?> raw)
Reconstructs a quad from a flat list of 8 doubles in corner order: [tlX, tlY, trX, trY, brX, brY, blX, blY].
factory
Quad.full()
A quad covering the entire frame (the sensible default when detection fails and the user must adjust corners manually).
factory

Properties

bottomLeft → ScanPoint
final
bottomRight → ScanPoint
final
clamped → Quad
Returns a copy with every corner clamped to the unit square.
no setter
corners → List<ScanPoint>
The four corners in serialization order.
no setter
hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
topLeft → ScanPoint
final
topRight → ScanPoint
final

Methods

copyWithCorner(int index, ScanPoint point) → Quad
Replaces a single corner, identified by its index in corners (0 = TL, 1 = TR, 2 = BR, 3 = BL).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toList() → List<double>
Flattens the quad to [tlX, tlY, trX, trY, brX, brY, blX, blY] for the platform channel.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override