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 Logger
getLogger()
Return the logger used by the SDK.static void
init(android.content.Context context, java.lang.String licenseKey)
Initialize the SDK librarystatic android.graphics.Bitmap
rotateImage(android.graphics.Bitmap in, RotationAngle angle)
Rotate an image.static void
rotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle)
static void
rotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle, boolean isBinary)
Rotate an image.static void
scaleImage(java.lang.String inPath, java.lang.String outPath, float scalingRatio)
Create a new scaled image.static void
scaleImage(java.lang.String inPath, java.lang.String outPath, int maxImageSize)
Scale image so that both dimensions fit inside given size.static void
setJPGQuality(int JPGQuality)
Sets the JPG quality used to write imagesstatic void
setLogger(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 LicenseException
Initialize 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, LicenseException
Rotate 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 existProcessingException
LicenseException
-
rotateImage
public static void rotateImage(java.lang.String imageToRotatePath, java.lang.String rotatedImagePath, RotationAngle angle) throws java.io.IOException, ProcessingException, LicenseException
- Throws:
java.io.IOException
ProcessingException
LicenseException
-
rotateImage
public static android.graphics.Bitmap rotateImage(android.graphics.Bitmap in, RotationAngle angle) throws ProcessingException, LicenseException
Rotate 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, ProcessingException
Create 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 readLicenseException
ProcessingException
-
scaleImage
public static void scaleImage(java.lang.String inPath, java.lang.String outPath, int maxImageSize) throws java.io.IOException, LicenseException, ProcessingException
Scale 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 readLicenseException
ProcessingException
-
-