applyPerspective function
Apply perspective
filter to image
.
Implementation
FilterResult? applyPerspective(
CanvasImageSource image, List<Point<num>> perspective) {
var wh = getImageDimension(image)!;
var w = wh.width;
var h = wh.height;
var filter = ImagePerspectiveFilter(image, w, h);
filter.setCornersFromPointsList(perspective);
return filter.filter();
}