Class CameraSettings.Builder
java.lang.Object
com.microblink.blinkid.uisettings.CameraSettings.Builder
- Enclosing class:
- CameraSettings
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
setAspectMode
(CameraAspectMode cameraAspectMode) Defines which camera aspect mode will be used.setForceLegacyApi
(boolean forceLegacyCameraApi) Sets whether legacy camera API should be used even on Lollipop devices that support newer Camera2 API.setIsOptimizedForNearScan
(boolean isOptimizedForNearScan) Defines whether camera parameters should be optimized for near object scanning.setIsPinchToZoomAllowed
(boolean isPinchToZoomAllowed) setPreviewZoomScale
(float previewZoomScale) Sets the preview zoom scale that will be used to draw the camera preview.setSurface
(com.microblink.blinkid.view.surface.CameraSurface cameraSurface) Defines which view will be used for displaying camera preview.setType
(CameraType cameraType) Sets type of camera that will be used.setVideoResolutionPreset
(VideoResolutionPreset videoResolutionPreset) Sets the video resolution preset that will be used when choosing camera resolution for scanning.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setType
Sets type of camera that will be used.- Parameters:
cameraType
- type of camera that will be used.
-
setIsOptimizedForNearScan
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 tofalse
, 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.
-
setAspectMode
Defines which camera aspect mode will be used. If set toCameraAspectMode.ASPECT_FIT
(default), then camera preview will be letterboxed inside available view space. If set toCameraAspectMode.ASPECT_FILL
, camera preview will be zoomed and cropped to use the entire view space.- Parameters:
cameraAspectMode
- camera aspect mode that will be used.
-
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]
-
setSurface
@NonNull public CameraSettings.Builder setSurface(@NonNull com.microblink.blinkid.view.surface.CameraSurface cameraSurface) Defines which view will be used for displaying camera preview.- Parameters:
cameraSurface
- camera surface which view will be used for displaying camera preview.- See Also:
-
setForceLegacyApi
Sets whether legacy camera API should be used even on Lollipop devices that support newer Camera2 API. Default isfalse
;- Parameters:
forceLegacyCameraApi
-true
to use legacy camera API,false
otherwise.
-
setIsPinchToZoomAllowed
-
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.
-
build
-