Variable ScanbotImageProcessorConst

ScanbotImageProcessor: {
    applyFilters(params): Promise<ImageRef>;
    applyFiltersOnImageFile(params): Promise<string>;
    crop(params): Promise<ImageRef>;
    cropImageFile(params): Promise<string>;
    readImageData(imageFileUri): Promise<string>;
    resize(params): Promise<ImageRef>;
    resizeImageFile(params): Promise<string>;
    rotate(params): Promise<ImageRef>;
    rotateImageFile(params): Promise<string>;
}

Entry point for all image processing features.

Type declaration

  • applyFilters:function
    • Applies the given filters on the image.

      Parameters

      Returns Promise<ImageRef>

      • Reference of the image with applied filters.
  • applyFiltersOnImageFile:function
    • Applies the given filters on the image.

      Parameters

      • params: {
            filters: ParametricFilter[];
            imageFileUri: string;
            overwrite?: boolean;
            saveOptions?: SaveImageOptions;
        }
        • filters: ParametricFilter[]

          List of filters to be applied on the image.

        • imageFileUri: string

          File uri of the image to be processed.

        • Optional overwrite?: boolean

          Whether to overwrite the original image file or create a new file. Default is false

        • Optional saveOptions?: SaveImageOptions

          Options for saving the image.

      Returns Promise<string>

      • File uri of the image with applied filters.
  • crop:function
    • Crops the image to the given polygon area.

      Parameters

      • params: {
            image: ImageRef;
            polygon: Point[];
        }
        • image: ImageRef

          Reference of the image to be cropped.

        • polygon: Point[]

          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.

      Returns Promise<ImageRef>

      • Reference of the cropped image.
  • cropImageFile:function
    • Crops the image to the given polygon area.

      Parameters

      • params: {
            imageFileUri: string;
            overwrite?: boolean;
            polygon: Point[];
            saveOptions?: SaveImageOptions;
        }
        • imageFileUri: string

          File uri of the image to be cropped.

        • Optional overwrite?: boolean

          Whether to overwrite the original image file or create a new file. Default is false

        • polygon: Point[]

          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.

        • Optional saveOptions?: SaveImageOptions

          Options for saving the image.

      Returns Promise<string>

      • File uri of the cropped image.
  • readImageData:function
    • Reads image data from the given file uri and returns it as a Base 64 encoded string.

      Parameters

      • imageFileUri: string

        File uri of the image to be read.

      Returns Promise<string>

      • The Base 64 encoded representation of the image.
  • resize:function
    • Resizes the image to fit within the given maximum size for the longest edge.

      Parameters

      • params: {
            image: ImageRef;
            maxSize: number;
        }
        • image: ImageRef

          Reference of the image to be resized.

        • maxSize: number

          Maximum size for the longest edge of the image.

      Returns Promise<ImageRef>

      • Reference of the resized image.
  • resizeImageFile:function
    • Resizes the image to fit within the given maximum size for the longest edge.

      Parameters

      • params: {
            imageFileUri: string;
            maxSize: number;
            overwrite?: boolean;
            saveOptions?: SaveImageOptions;
        }
        • imageFileUri: string

          File uri of the image to be resized.

        • maxSize: number

          Maximum size for the longest edge of the image.

        • Optional overwrite?: boolean

          Whether to overwrite the original image file or create a new file. Default is false

        • Optional saveOptions?: SaveImageOptions

          Options for saving the image.

      Returns Promise<string>

      • File uri of the resized image.
  • rotate:function
    • Rotates the image by the given rotation degree. This methods must be wrapped inside an autorelease pool.

      Parameters

      Returns Promise<ImageRef>

      • Reference of the rotated image.
  • rotateImageFile:function
    • Rotates the image by the given rotation degree.

      Parameters

      • params: {
            imageFileUri: string;
            overwrite?: boolean;
            rotation: ImageRotation;
            saveOptions?: SaveImageOptions;
        }
        • imageFileUri: string

          File uri of the image to be rotated.

        • Optional overwrite?: boolean

          Whether to overwrite the original image file or create a new file. Default is false

        • rotation: ImageRotation

          Rotation degree.

        • Optional saveOptions?: SaveImageOptions

          Options for saving the image.

      Returns Promise<string>

      • File uri of the rotated image.