Package io.scanbot.sdk.imageprocessing
Class ImageProcessor
- java.lang.Object
-
- io.scanbot.sdk.imageprocessing.ImageProcessor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ImageProcessor extends java.lang.Object implements java.lang.AutoCloseableAPI for image processing. Required licence feature(s): ImageProcessing.
-
-
Constructor Summary
Constructors Constructor Description ImageProcessor()Constructs ImageProcessor with the given params.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImageRefapplyFilter(ImageRef image, ParametricFilter filter)Applies given filter to the given image.voidclose()Closes native resources held by the object.ImageRefcrop(ImageRef image, java.util.List<PointF> quad)Crops the given image to the given quadrilateral.protected voidfinalize()ImageRefresize(ImageRef image, int size)Resizes the given image to the given size.ImageRefrotate(ImageRef image, ImageRotation rotation)Rotates the given image by the given angle.
-
-
-
Method Detail
-
crop
public ImageRef crop(ImageRef image, java.util.List<PointF> quad) throws InvalidImageRefException, LicenseException
Crops the given image to the given quadrilateral.- Parameters:
image- The image to crop.quad- The quadrilateral of normalized points to crop.- Returns:
- Cropped image.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
resize
public ImageRef resize(ImageRef image, int size) throws InvalidImageRefException, LicenseException
Resizes the given image to the given size.- Parameters:
image- The image to resizesize- 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
-
rotate
public ImageRef rotate(ImageRef image, ImageRotation rotation) throws InvalidImageRefException, LicenseException
Rotates the given image by the given angle.- Parameters:
image- The image to rotaterotation- 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
-
applyFilter
public ImageRef applyFilter(ImageRef image, ParametricFilter filter) throws InvalidImageRefException, LicenseException
Applies given filter to the given image.- Parameters:
image- The image to apply filter onfilter- Filter to be applied- 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
-
close
public void close()
Closes native resources held by the object.- Specified by:
closein interfacejava.lang.AutoCloseable
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-