cropImageFile method

Future<Result<String>> cropImageFile(
  1. String imageFileUri,
  2. List<Point<double>> polygon, {
  3. bool? overwrite,
  4. SaveImageOptions? saveOptions,
  5. DocumentCropOptimization? documentCropOptimization,
})

Crops the image to the given polygon area.

imageFileUri - File uri of the image to be cropped. polygon - Polygon defining the area to be cropped. Points needs to be represented in percentage values (0.0 - 1.0) and the order should be top-left, top-right, bottom-right, bottom-left. overwrite - Whether to overwrite the original image file or create a new file. Default is false. saveOptions - Options for saving the image. documentCropOptimization - The optimization to apply when cropping a document. The method doesn't actually check if the input is a document photo, so it relies entirely on the caller's intent. Default is OPTIMIZE_QUAD.

Returns a Future that completes with file uri of the cropped image.

Implementation

Future<Result<String>> cropImageFile(
    String imageFileUri, List<Point<double>> polygon,
    {bool? overwrite,
    SaveImageOptions? saveOptions,
    DocumentCropOptimization? documentCropOptimization}) {
  return ScanbotImageProcessorImpl.cropImageFile(imageFileUri, polygon,
      overwrite, saveOptions, documentCropOptimization);
}