Properties

Link copied to clipboard

Delay that camera will took before snap on auto focus complete called from camera core in ms. For some devices this callback could call even before real auto focus completed, so we need to take some delay before snapping. Usually you can set 500ms. By default it is set to 20ms.

Link copied to clipboard
abstract var lifecycleOwner: <Error class: unknown class>?

Sets lifecycle owner for camera view. N/A for ScanbotCameraView implementation. Setting null means view will attempt to resolve lifecycle on its own.

Link copied to clipboard

TODO: desperately needs documentation!!!

Link copied to clipboard

TODO: desperately needs documentation!!!

Functions

Link copied to clipboard
abstract fun addCameraStateCallback(cameraStateCallback: CameraStateCallback)

Adds callback which will be notified about camera state changes. Callbacks are invoked on a main thread.

Link copied to clipboard
abstract fun addFrameHandler(frameHandler: FrameHandler)

Used to add FrameHandler that will be called on each next frame.

Link copied to clipboard
abstract fun addPictureCallback(pictureCallback: BasePictureCallback)

Adds callback which will be notified when picture will be taken. Callbacks are invoked on a worker thread, so you can safely perform "heavy" operations here.

Link copied to clipboard
abstract fun addTakePictureCallback(cameraTakePictureCallback: CameraTakePictureCallback)

Adds callback which will be notified about take picture operation process. Callbacks are invoked on a main thread.

Link copied to clipboard
abstract fun autoFocus()

Performs auto-focus.

Link copied to clipboard
abstract fun continuousFocus()

Cancels auto-focus and performs continuous-focus. Should be executed from the main thread and when camera is opened

Link copied to clipboard
abstract fun <T : FrameHandler> getAttachedFrameHandler(clazz: Class<T>): T?

Obtain FrameHandler instance of type clazz, that is attached to the view (if any).

Link copied to clipboard
abstract fun isFlashEnabled(): Boolean

Returns the current state of the flashlight Should be executed from the main thread and when camera is opened

Link copied to clipboard
abstract fun isSnapAnimationEnabled(enabled: Boolean)

Set whether camera should use snapping animation. By default set to true This parameter works only with ScanbotCameraXView enabled

Link copied to clipboard
abstract fun lockMinFocusDistance(lock: Boolean)

Locks the min supported focus distance and disables continuous focus

Link copied to clipboard
abstract fun lockToLandscape(lockPicture: Boolean)

Locks camera in landscape mode

Link copied to clipboard
abstract fun lockToPortrait(lockPicture: Boolean)

Locks camera in portrait mode

Link copied to clipboard
abstract fun removeCameraStateCallback(cameraStateCallback: CameraStateCallback)

Removes callback, so it won't receive any further notifications.

Link copied to clipboard
abstract fun removeFrameHandler(frameHandler: FrameHandler)

Unregisters given FrameHandler instance.

Link copied to clipboard
abstract fun removePictureCallback(pictureCallback: BasePictureCallback)

Removes callback, so it won't receive any further notifications.

Link copied to clipboard
abstract fun removeTakePictureCallback(cameraTakePictureCallback: CameraTakePictureCallback)

Removes callback, so it won't receive any further notifications.

Link copied to clipboard
abstract fun restartPreview()

Restarts preview stream.

Link copied to clipboard
abstract fun setAnalyzerFpsLimit(fps: Float)

Limit the frame rate of the camera analyzer. By default, the frame rate is set to the maximum possible value.

Link copied to clipboard
abstract fun setAutoFocusOnTouch(autoFocusOnTouch: Boolean)
Link copied to clipboard
abstract fun setCameraModule(cameraModule: CameraModule)

Defines a camera module. By default is CameraModule.BACK.

Link copied to clipboard
abstract fun setCameraOpenCallback(cameraOpenCallback: CameraOpenCallback)

Callback which will be invoked when camera will be opened

Link copied to clipboard
abstract fun setCaptureCallback(captureCallback: CaptureCallback?)

Sets the callback which will be notified about the moment of actual image capture.

Link copied to clipboard
abstract fun setForceMaxSnappingQuality(enabled: Boolean)

Set whether camera should force maximum possible quality of snapped picture. As a result snapping speed could be significantly slower and result image could be bigger. By default set to false This parameter works only with ScanbotCameraXView enabled

Link copied to clipboard
abstract fun setForceMaxSnappingSize(enabled: Boolean)

Set whether camera should force maximum possible size of snapped picture or use maximum size that available with the same aspect ratio as preview by default set to false This parameter works only with ScanbotCameraXView enabled

Link copied to clipboard
abstract fun setPhysicalZoom(zoomLevel: Float)

Allows to set camera physical zoom value, if the value out of range of real camera min and max values it chooses min or max value. Example: camera physical zoom range 1f..5f if we set 6f it will set 5f. Default value is 1f.

Link copied to clipboard
abstract fun setPhysicalZoomRange(zoomRange: ZoomRange)

Set custom zoom range. Default value is ZoomRange(0.5f, 100f).

Link copied to clipboard
abstract fun setPreviewMode(mode: CameraPreviewMode)

Set the camera preview mode. By default - CameraPreviewMode.FILL_IN.

Link copied to clipboard
abstract fun setShutterSound(value: Boolean)

Set camera shutter sound state. true if system sound should be played on the take picture event, false - otherwise. By default, the camera plays the system-defined camera shutter sound when takePicture() is called.

Link copied to clipboard
abstract fun setSnappingAutoAdjustment(enabled: Boolean)

Set whether camera should automatically adjusts the final image with the surrounding scenery. For example, the vendor library implementation might do low-light detection and switch to low-light mode or HDR to take the picture. Alternatively, the face retouch mode could be automatically applied when taking a portrait image. This delegates modes to the vendor library implementation to decide.

Link copied to clipboard
abstract fun startPreview()

Starts/resumes camera preview stream. Usually used after picture was taken.

Link copied to clipboard
abstract fun stopPreview()

Stops camera preview stream.

Link copied to clipboard
abstract fun takePicture(acquireFocus: Boolean)
abstract fun takePicture(acquireFocus: Boolean, isCapturedAutomatically: Boolean)

Takes picture.

Link copied to clipboard
abstract fun unlockOrientation()

Unlocks camera orientation

Link copied to clipboard
abstract fun useFlash(useFlash: Boolean)

Enables or disables camera flash.

Link copied to clipboard
abstract fun usePinchToZoom(usePinchToZoom: Boolean)

Enables/disables Pinch-to-Zoom camera functionality