Class CameraConfig


  • public class CameraConfig
    extends java.lang.Object
    Class holds configurations for the camera
    • Constructor Detail

      • CameraConfig

        public CameraConfig​(@Nullable
                            org.json.JSONObject jsonObject)
        Create config from the given json object.
        Parameters:
        jsonObject - the json object with the settings
    • Method Detail

      • getPreferredPreviewWidth

        public int getPreferredPreviewWidth()
      • setPreferredPreviewWidth

        public void setPreferredPreviewWidth​(int preferredPreviewWidth)
        Set the preferred preview width. When trying to find the best preview size, this is used instead of the views width.
        Parameters:
        preferredPreviewWidth - the desired preview width
      • getPreferredPreviewHeight

        public int getPreferredPreviewHeight()
      • setPreferredPreviewHeight

        public void setPreferredPreviewHeight​(int preferredPreviewHeight)
        Set the preferred preview height. When trying to find the best preview size, this is used instead of the views height.
        Parameters:
        preferredPreviewHeight - the desired preview height
      • getPreferredPictureWidth

        public int getPreferredPictureWidth()
      • setPreferredPictureWidth

        public void setPreferredPictureWidth​(int preferredPictureWidth)
        Set the preferred width when taking a full picture. When trying to find the best picture width, this is used instead of the maximum width.
        Parameters:
        preferredPictureWidth - the desired picture width
      • getPreferredPictureHeight

        public int getPreferredPictureHeight()
      • setPreferredPictureHeight

        public void setPreferredPictureHeight​(int preferredPictureHeight)
        Set the preferred height when taking a full picture. When trying to find the best picture height, this is used instead of the maximum height.
        Parameters:
        preferredPictureHeight - the desired picture height
      • getDefaultLensFacing

        public CameraFeatures.LensFacing getDefaultLensFacing()
        Returns:
        the default camera to use for scanning
      • setDefaultLensFacing

        public void setDefaultLensFacing​(CameraFeatures.LensFacing defaultLensFacing)
        Set the default camera used for scanning
        Parameters:
        defaultLensFacing - the CameraFacing
      • getFallbackLensFacings

        public java.util.EnumSet<CameraFeatures.LensFacing> getFallbackLensFacings()
        Returns:
        the fallback CameraFacings
      • setFallbackLensFacings

        public void setFallbackLensFacings​(java.util.EnumSet<CameraFeatures.LensFacing> fallbackLensFacings)
        Set the fallback camera facings which are used if the default camera facing is not available on the device
        Parameters:
        fallbackLensFacings - the fallback options for CameraFacing
      • isZoomGestureEnabled

        public boolean isZoomGestureEnabled()
      • getFocalLength

        public double getFocalLength()
      • getMaxZoomRatio

        public double getMaxZoomRatio()
      • setZoomGestureEnabled

        public void setZoomGestureEnabled​(boolean zoomGestureEnabled)
      • setFocalLength

        public void setFocalLength​(double focalLength)
      • setMaxZoomRatio

        public void setMaxZoomRatio​(double maxZoomRatio)
      • getZoomRatio

        public double getZoomRatio()
      • setZoomRatio

        public void setZoomRatio​(double zoomRatio)
      • getMaxFocalLength

        public double getMaxFocalLength()
      • setMaxFocalLength

        public void setMaxFocalLength​(double maxFocalLength)