Package com.banuba.sdk.input
Class CameraDeviceConfigurator
java.lang.Object
com.banuba.sdk.input.CameraDeviceConfigurator
The class helps to reconfigure the camera.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Flash mode for camera with the flash unitstatic interface
Allows to adjust the camera's input orientationstatic enum
Front or back camera selector -
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final CameraDeviceConfigurator.FlashMode
static final android.util.Size
static final CameraDeviceConfigurator.LensSelector
static final float
static final android.util.Size
Default settings.static final float
static final android.util.Size
static final android.util.Size
protected CameraDeviceConfigurator.FlashMode
protected android.util.Size
protected boolean
protected CameraDeviceConfigurator.LensSelector
protected float
protected boolean
protected android.util.Size
Current settingsprotected float
static final android.util.Size
static final android.util.Size
Available video and photo capture resolutions. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
commit()
The method commits all changes and reconfigures the camera.setFlashMode
(CameraDeviceConfigurator.FlashMode flashMode) Set flash mode when taking photosSet frame rotation provider callbacksetImageCaptureSize
(android.util.Size imageCaptureSize) Set the image capture resolutionSelect current camera (front/back)setLens
(CameraDeviceConfigurator.LensSelector lens, boolean isMirroringEnabled) Select current camera (front/back) and mirroringsetLinearZoom
(float zoom) Set the camera linear zoomsetTorchEnabled
(boolean enabled) Set the torch enabledsetVideoCaptureSize
(android.util.Size videoCaptureSize) Set the video capture resolutionsetZoomRatio
(float zoom) Set the camera zoom ratio
-
Field Details
-
SD_CAPTURE_SIZE
public static final android.util.Size SD_CAPTURE_SIZEAvailable video and photo capture resolutions. In addition to these video resolutions, you can use your own. -
HD_CAPTURE_SIZE
public static final android.util.Size HD_CAPTURE_SIZE -
FHD_CAPTURE_SIZE
public static final android.util.Size FHD_CAPTURE_SIZE -
QHD_CAPTURE_SIZE
public static final android.util.Size QHD_CAPTURE_SIZE -
DEFAULT_VIDEO_CAPTURE_SIZE
public static final android.util.Size DEFAULT_VIDEO_CAPTURE_SIZEDefault settings. -
DEFAULT_IMAGE_CAPTURE_SIZE
public static final android.util.Size DEFAULT_IMAGE_CAPTURE_SIZE -
DEFAULT_LENS
-
DEFAULT_FLASH_MODE
-
DEFAULT_LINEAR_ZOOM
public static final float DEFAULT_LINEAR_ZOOM- See Also:
-
DEFAULT_ZOOM_RATIO
public static final float DEFAULT_ZOOM_RATIO- See Also:
-
DEAULT_TORCH_ENABLED
public static final boolean DEAULT_TORCH_ENABLED- See Also:
-
mVideoCaptureSize
protected android.util.Size mVideoCaptureSizeCurrent settings -
mImageCaptureSize
protected android.util.Size mImageCaptureSize -
mLens
-
mFrameRotationProviderCallback
-
mIsMirroringEnabled
protected boolean mIsMirroringEnabled -
mTorchEnabled
protected boolean mTorchEnabled -
mLinearZoom
protected float mLinearZoom -
mZoomRatio
protected float mZoomRatio -
mFlashMode
-
-
Constructor Details
-
CameraDeviceConfigurator
public CameraDeviceConfigurator()
-
-
Method Details
-
setVideoCaptureSize
Set the video capture resolution- Parameters:
videoCaptureSize
- resolution
-
setImageCaptureSize
Set the image capture resolution- Parameters:
imageCaptureSize
- resolution
-
setLens
Select current camera (front/back)- Parameters:
lens
- front or back camera
-
setLens
public CameraDeviceConfigurator setLens(CameraDeviceConfigurator.LensSelector lens, boolean isMirroringEnabled) Select current camera (front/back) and mirroring- Parameters:
lens
- front or back cameraisMirroringEnabled
- enable mirroring. By default, front camera has mirroring enabled and the back camera has mirroring disabled
-
setTorchEnabled
Set the torch enabled- Parameters:
enabled
- switches torch
-
setFlashMode
Set flash mode when taking photos- Parameters:
flashMode
- one of three: OFF, AUTO or ON
-
setLinearZoom
Set the camera linear zoom- Parameters:
zoom
- value in range [0.0f; 1.0f]
-
setZoomRatio
Set the camera zoom ratio- Parameters:
zoom
- ratio value. Min and max The min and max zoom value can be obtained from CameraDevice.getMinZoomRatio() and CameraDevice.getMaxZoomRatio()
-
setFrameRotationProviderCallback
public CameraDeviceConfigurator setFrameRotationProviderCallback(CameraDeviceConfigurator.IFrameRotationProviderCallback callback) Set frame rotation provider callback- Parameters:
callback
- rotation provider
-
commit
public abstract void commit()The method commits all changes and reconfigures the camera.
-