Package io.scanbot.sdk.imagemanipulation
Class ImageManipulator
java.lang.Object
io.scanbot.sdk.imagemanipulation.ImageManipulator
- All Implemented Interfaces:
AutoCloseable
API for image processing. If applicable on the platform, all the methods return images with the same liveness flag as the input image.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes native resources held by the object.cropRect(ImageRef image, RectangleF rect) Crops out the given rectangle from the image.protected voidfinalize()flip(ImageRef image, ImageOrigin origin) Flips the given image horizontally or vertically.Resizes the given image to the given size.rotate(ImageRef image, ImageRotation rotation) Rotates the given image by the given angle.
-
Constructor Details
-
ImageManipulator
public ImageManipulator()Constructs ImageManipulator with the given params.
-
-
Method Details
-
cropRect
public ImageRef cropRect(ImageRef image, RectangleF rect) throws InvalidImageRefException, LicenseException Crops out the given rectangle from the image.- Parameters:
image- The image to crop.rect- The rectangle in normalized coordinates to crop.- Returns:
- Cropped image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
rotate
public ImageRef rotate(ImageRef image, ImageRotation rotation) throws InvalidImageRefException, LicenseException Rotates the given image by the given angle.- Parameters:
image- The image to rotate.rotation- Rotation to be applied.- Returns:
- Rotated image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
flip
public ImageRef flip(ImageRef image, ImageOrigin origin) throws InvalidImageRefException, LicenseException Flips the given image horizontally or vertically.- Parameters:
image- The image to flip.origin- Location of the image origin in the image coordinate system.- Returns:
- The result of the filter application.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
resize
Resizes the given image to the given size.- Parameters:
image- The image to resize.size- Size of the longer side of the image.- Returns:
- Resized image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
close
public void close()Closes native resources held by the object.- Specified by:
closein interfaceAutoCloseable
-
finalize
-