CameraSourceConfig.Builder

public static class CameraSourceConfig.Builder extends Object

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
CameraSourceConfig.Builder
CameraSourceConfig.Builder
setRequestedPreviewSize(int width, int height)
Sets the desired width and height of the camera frames in pixels.

Inherited Method Summary

Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

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 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.