Package com.geniusscansdk.core
Class GeniusScanSDK
- java.lang.Object
-
- com.geniusscansdk.core.GeniusScanSDK
-
public class GeniusScanSDK extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GeniusScanSDK()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LoggergetLogger()Return the logger used by the SDK.static voidinit(android.content.Context context, java.lang.String licenseKey)Initialize the SDK librarystatic android.graphics.BitmaprotateImage(android.graphics.Bitmap in, RotationAngle angle)Rotate an image.static voidrotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle)static voidrotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle, boolean isBinary)Rotate an image.static voidscaleImage(java.lang.String inPath, java.lang.String outPath, float scalingRatio)Create a new scaled image.static voidscaleImage(java.lang.String inPath, java.lang.String outPath, int maxImageSize)Scale image so that both dimensions fit inside given size.static voidsetJPGQuality(int JPGQuality)Sets the JPG quality used to write imagesstatic voidsetLogger(Logger logger)Set the logger used by the SDK.
-
-
-
Method Detail
-
init
public static void init(android.content.Context context, java.lang.String licenseKey) throws LicenseExceptionInitialize the SDK library- Parameters:
context- Application or activity context- Throws:
LicenseException
-
setLogger
public static void setLogger(Logger logger)
Set the logger used by the SDK.- Parameters:
logger- Logger
-
getLogger
public static Logger getLogger()
Return the logger used by the SDK. Default implementation logs to the Android console- Returns:
- Object implementing the Logger interface
-
setJPGQuality
public static void setJPGQuality(int JPGQuality)
Sets the JPG quality used to write images- Parameters:
JPGQuality- Desired JPG quality (between 0 and 100)
-
rotateImage
public static void rotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle, boolean isBinary) throws java.io.IOException, ProcessingException, LicenseExceptionRotate an image.- Parameters:
imageToRotatePath- Path to the input imagerotatedImagePath- Desired path to the output imageangle- Rotation angle- Throws:
java.io.IOException- if input file cannot be read or output folder does not existProcessingExceptionLicenseException
-
rotateImage
public static void rotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle) throws java.io.IOException, ProcessingException, LicenseException- Throws:
java.io.IOExceptionProcessingExceptionLicenseException
-
rotateImage
public static android.graphics.Bitmap rotateImage(android.graphics.Bitmap in, RotationAngle angle) throws ProcessingException, LicenseExceptionRotate an image.- Parameters:
in- Image bitmap to rotateangle- Rotation angle.- Returns:
- The rotated image bitmap
- Throws:
ProcessingException- if rotation fails (eg if bitmap is not valid)LicenseException
-
scaleImage
public static void scaleImage(java.lang.String inPath, java.lang.String outPath, float scalingRatio) throws java.io.IOException, LicenseException, ProcessingExceptionCreate a new scaled image.- Parameters:
inPath- Path of the input imageoutPath- Path of the output imagescalingRatio- Ratio between the output image and the input image- Throws:
java.io.IOException- if input file cannot be readLicenseExceptionProcessingException
-
scaleImage
public static void scaleImage(java.lang.String inPath, java.lang.String outPath, int maxImageSize) throws java.io.IOException, LicenseException, ProcessingExceptionScale image so that both dimensions fit inside given size.- Parameters:
inPath- Path of the input imageoutPath- Path of the output imagemaxImageSize- Max image size after resize operation- Throws:
java.io.IOException- if input file cannot be readLicenseExceptionProcessingException
-
-