capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
97 lines • 5.2 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from xplatforms/schemas/document_scanner/ImageProcessor.yaml
import { ScanbotImageProcessorImpl } from './impl';
/**
* Entry point for all image processing features.
*/
export const ScanbotImageProcessor = {
/**
* Applies the given filters on the image.
* @param {string} params.imageFileUri - File uri of the image to be processed.
* @param {ParametricFilter[]} params.filters - List of filters to be applied on the image.
* @param {boolean} params.overwrite - Whether to overwrite the original image file or create a new file. Default is false
* @param {SaveImageOptions} params.saveOptions - Options for saving the image.
* @returns {Promise<string>} - File uri of the image with applied filters.
*/
async applyFiltersOnImageFile(params) {
return ScanbotImageProcessorImpl.applyFiltersOnImageFile(params);
},
/**
* Applies the given filters on the image.
* @param {ImageRef} params.image - Reference of the image to be processed.
* @param {ParametricFilter[]} params.filters - List of filters to be applied on the image.
* @returns {Promise<ImageRef>} - Reference of the image with applied filters.
*/
async applyFilters(params) {
return ScanbotImageProcessorImpl.applyFilters(params);
},
/**
* Rotates the image by the given rotation degree.
* @param {string} params.imageFileUri - File uri of the image to be rotated.
* @param {ImageRotation} params.rotation - Rotation degree.
* @param {boolean} params.overwrite - Whether to overwrite the original image file or create a new file. Default is false
* @param {SaveImageOptions} params.saveOptions - Options for saving the image.
* @returns {Promise<string>} - File uri of the rotated image.
*/
async rotateImageFile(params) {
return ScanbotImageProcessorImpl.rotateImageFile(params);
},
/**
* Rotates the image by the given rotation degree. This methods must be wrapped inside an autorelease pool.
* @param {ImageRef} params.image - Reference of the image to be rotated.
* @param {ImageRotation} params.rotation - Rotation degree.
* @returns {Promise<ImageRef>} - Reference of the rotated image.
*/
async rotate(params) {
return ScanbotImageProcessorImpl.rotate(params);
},
/**
* Resizes the image to fit within the given maximum size for the longest edge.
* @param {string} params.imageFileUri - File uri of the image to be resized.
* @param {number} params.maxSize - Maximum size for the longest edge of the image.
* @param {boolean} params.overwrite - Whether to overwrite the original image file or create a new file. Default is false
* @param {SaveImageOptions} params.saveOptions - Options for saving the image.
* @returns {Promise<string>} - File uri of the resized image.
*/
async resizeImageFile(params) {
return ScanbotImageProcessorImpl.resizeImageFile(params);
},
/**
* Resizes the image to fit within the given maximum size for the longest edge.
* @param {ImageRef} params.image - Reference of the image to be resized.
* @param {number} params.maxSize - Maximum size for the longest edge of the image.
* @returns {Promise<ImageRef>} - Reference of the resized image.
*/
async resize(params) {
return ScanbotImageProcessorImpl.resize(params);
},
/**
* Crops the image to the given polygon area.
* @param {string} params.imageFileUri - File uri of the image to be cropped.
* @param {Point[]} params.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.
* @param {boolean} params.overwrite - Whether to overwrite the original image file or create a new file. Default is false
* @param {SaveImageOptions} params.saveOptions - Options for saving the image.
* @returns {Promise<string>} - File uri of the cropped image.
*/
async cropImageFile(params) {
return ScanbotImageProcessorImpl.cropImageFile(params);
},
/**
* Crops the image to the given polygon area.
* @param {ImageRef} params.image - Reference of the image to be cropped.
* @param {Point[]} params.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.
* @returns {Promise<ImageRef>} - Reference of the cropped image.
*/
async crop(params) {
return ScanbotImageProcessorImpl.crop(params);
},
/**
* Reads image data from the given file uri and returns it as a Base 64 encoded string.
* @param {string} imageFileUri - File uri of the image to be read.
* @returns {Promise<string>} - The Base 64 encoded representation of the image.
*/
async readImageData(imageFileUri) {
return ScanbotImageProcessorImpl.readImageData(imageFileUri);
},
};
//# sourceMappingURL=ImageProcessor.js.map