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