Class CameraSettings.Builder

  • Enclosing class:
    CameraSettings

    public static class CameraSettings.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setType

        @NonNull
        public CameraSettings.Builder setType​(@NonNull
                                              CameraType cameraType)
        Sets type of camera that will be used.
        Parameters:
        cameraType - type of camera that will be used.
      • setIsOptimizedForNearScan

        @NonNull
        public CameraSettings.Builder setIsOptimizedForNearScan​(boolean isOptimizedForNearScan)
        Defines whether camera parameters should be optimized for near object scanning. When camera parameters are optimized for near object scanning, macro focus mode will be preferred over autofocus mode. Thus, camera will have easier time focusing on to near objects, but might have harder time focusing on far objects. If you expect that most of your scans will be performed by holding the device very near the object, turn on that parameter. By default, this parameter is set to false, except in cases when from other settings it can be safely concluded that it is better to turn it on.
        Parameters:
        isOptimizedForNearScan - whether camera parameters should be optimized for near object scanning.
      • setPreviewZoomScale

        public CameraSettings.Builder setPreviewZoomScale​(@FloatRange(from=1.0,to=2.0)
                                                          float previewZoomScale)
        Sets the preview zoom scale that will be used to draw the camera preview. If the preview is upscaled, the visible part will be centered, and marginal parts of the camera preview will be invisible.
        Parameters:
        previewZoomScale - zoom scale in range [1, 2]
      • setForceLegacyApi

        @NonNull
        public CameraSettings.Builder setForceLegacyApi​(boolean forceLegacyCameraApi)
        Sets whether legacy camera API should be used even on Lollipop devices that support newer Camera2 API. Default is false;
        Parameters:
        forceLegacyCameraApi - true to use legacy camera API, false otherwise.
      • setIsPinchToZoomAllowed

        @NonNull
        public CameraSettings.Builder setIsPinchToZoomAllowed​(boolean isPinchToZoomAllowed)
      • setVideoResolutionPreset

        @NonNull
        public CameraSettings.Builder setVideoResolutionPreset​(@NonNull
                                                               VideoResolutionPreset videoResolutionPreset)
        Sets the video resolution preset that will be used when choosing camera resolution for scanning.
        Parameters:
        videoResolutionPreset - video resolution preset that will be used when choosing camera resolution for scanning.