applyPerspective function

FilterResult? applyPerspective(
  1. CanvasImageSource image,
  2. List<Point<num>> perspective
)

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();
}