UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

46 lines 2 kB
import { ImageRef, handleImageInput, withSBErrorHandling } from '../types'; import { ScanbotSDKPlugin } from './Definitions'; /** * @internal * @hidden */ export const ScanbotImageProcessorImpl = { async applyFiltersOnImageFile(params) { return withSBErrorHandling(async () => { return (await ScanbotSDKPlugin.applyFiltersOnImageFile(params)).result; }); }, async applyFilters(params) { return withSBErrorHandling(async () => ImageRef.from(await ScanbotSDKPlugin.applyFiltersOnImage({ filters: params.filters, image: handleImageInput(params.image) }))); }, async rotateImageFile(params) { return withSBErrorHandling(async () => { return (await ScanbotSDKPlugin.rotateImageFile(params)).result; }); }, async rotate(params) { return withSBErrorHandling(async () => ImageRef.from(await ScanbotSDKPlugin.rotateImage({ rotation: params.rotation, image: handleImageInput(params.image) }))); }, async readImageData(imageFileUri) { return withSBErrorHandling(async () => { return (await ScanbotSDKPlugin.readImageData({ imageFileUri: imageFileUri })).result; }); }, async resizeImageFile(params) { return withSBErrorHandling(async () => { return (await ScanbotSDKPlugin.resizeImageFile(params)).result; }); }, async resize(params) { return withSBErrorHandling(async () => ImageRef.from(await ScanbotSDKPlugin.resizeImage({ maxSize: params.maxSize, image: handleImageInput(params.image) }))); }, async cropImageFile(params) { return withSBErrorHandling(async () => { return (await ScanbotSDKPlugin.cropImageFile(params)).result; }); }, async crop(params) { return withSBErrorHandling(async () => ImageRef.from(await ScanbotSDKPlugin.cropImage({ polygon: params.polygon, image: handleImageInput(params.image) }))); }, }; //# sourceMappingURL=ImageProcessorImpl.js.map