PerspectiveTransform.fromQuadrilaterals constructor
PerspectiveTransform.fromQuadrilaterals()
Creates a PerspectiveTransform that transforms a given quadrilateral into another given quadrilateral, expressed as a list of its vertices.
Implementation
factory PerspectiveTransform.fromQuadrilaterals(
List<Position> originVertices,
List<Position> destinationVertices,
) {
final fromOriginToSquare =
PerspectiveTransform.fromTransformedSquare(originVertices).inverse();
final fromSquareToDestination =
PerspectiveTransform.fromTransformedSquare(destinationVertices);
return fromSquareToDestination.compose(fromOriginToSquare);
}