Builder for CameraSourceConfig.
Public Constructor Summary
<ResultT> |
Builder(Context
context, Detector<ResultT> detector, DetectionTaskCallback<ResultT>
detectionTaskCallback)
Creates a
CameraSourceConfig
builder with the supplied context, a vision Detector
and a post detection DetectionTaskCallback .
|
Public Method Summary
CameraSourceConfig |
build()
|
CameraSourceConfig.Builder |
setFacing(int facing)
Sets the camera to use (either
CameraSourceConfig.CAMERA_FACING_BACK or
CameraSourceConfig.CAMERA_FACING_FRONT ).
|
CameraSourceConfig.Builder |
setRequestedPreviewSize(int width, int height)
Sets the desired width and height of the camera frames in pixels.
|
Inherited Method Summary
Public Constructors
public Builder (Context context, Detector<ResultT> detector, DetectionTaskCallback<ResultT> detectionTaskCallback)
Creates a CameraSourceConfig
builder with the supplied context, a vision Detector
and a post detection DetectionTaskCallback
.
Camera preview images will be streamed to the associated detector upon starting the
camera source.
Public Methods
public CameraSourceConfig build ()
public CameraSourceConfig.Builder setFacing (int facing)
Sets the camera to use (either
CameraSourceConfig.CAMERA_FACING_BACK
or
CameraSourceConfig.CAMERA_FACING_FRONT
). Default:
CameraSourceConfig.CAMERA_FACING_BACK
.
public CameraSourceConfig.Builder setRequestedPreviewSize (int width, int height)
Sets the desired width and height of the camera frames in pixels. If the exact desired values are not available options, the best matching available options are selected.
We pass the desired size to CameraX and let CameraX choose the best available size.
Default: 480x360.