Class 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 library
      static 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)
      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)
      static void scaleImage​(java.lang.String inPath, java.lang.String outPath, int maxImageSize, ImageType imageType)
      Scale image so that both dimensions fit inside given size.
      static void setJPGQuality​(int JPGQuality)
      Sets the JPG quality used to write images
      static void setLogger​(Logger logger)
      Set the logger used by the SDK.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeniusScanSDK

        public GeniusScanSDK()
    • 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)
                                throws java.io.IOException,
                                       ProcessingException,
                                       LicenseException
        Rotate an image.
        Parameters:
        imageToRotatePath - Path to the input image
        rotatedImagePath - Desired path to the output image
        angle - Rotation angle
        Throws:
        java.io.IOException - if input file cannot be read or output folder does not exist
        ProcessingException
        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 image
        outPath - Path of the output image
        scalingRatio - Ratio between the output image and the input image
        Throws:
        java.io.IOException - if input file cannot be read
        LicenseException
        ProcessingException
      • scaleImage

        public static void scaleImage​(java.lang.String inPath,
                                      java.lang.String outPath,
                                      int maxImageSize,
                                      ImageType imageType)
                               throws java.io.IOException,
                                      LicenseException,
                                      ProcessingException
        Scale image so that both dimensions fit inside given size.
        Parameters:
        inPath - Path of the input image
        outPath - Path of the output image
        maxImageSize - Max image size after resize operation
        imageType - Type of filter that was applied to the image. That defines if image is read in 1 or 3 channels and which interpolation filter is used.
        Throws:
        java.io.IOException - if input file cannot be read
        LicenseException
        ProcessingException