Sequence Frame Source

Defined in package com.scandit.datacapture.core

SequenceFrameSource
class SequenceFrameSource : FrameSource

Added in version 8.6.0

Emits frames added via addFrame().

This class can be used if the camera is not handled by Scandit Data Capture SDK (i.e., when using another framework handling the camera, like ARKit). Register an instance of this class as the data source via DataCaptureContext.frameSource and then add frames coming from the camera via addFrame().

Note

Register the frame source and switch it on once, outside of your frame loop, and then call addFrame() for each frame. Do not create a frame source per frame, and do not set one on the DataCaptureContext from inside the frame loop. In particular, do not feed a continuous camera stream through ImageFrameSource — it is meant for single images and turns off after each one.

create(cameraPosition, lensPosition)
fun SequenceFrameSource.create(cameraPosition: CameraPosition,
        lensPosition: Float): SequenceFrameSource

Added in version 8.6.0

desiredState
val desiredState: FrameSourceState

Added in version 8.6.0

Implemented from FrameSource. See FrameSource.desiredState.

currentState
val currentState: FrameSourceState

Added in version 8.6.0

Implemented from FrameSource. See FrameSource.currentState.

addListener(listener)
fun addListener(listener: FrameSourceListener)

Added in version 8.6.0

Implemented from FrameSource. See FrameSource.addListener().

removeListener(listener)
fun removeListener(listener: FrameSourceListener)

Added in version 8.6.0

Implemented from FrameSource. See FrameSource.removeListener().

switchToDesiredState(state, callback)
fun switchToDesiredState(state: FrameSourceState,
        callback: ((Boolean) -> Unit)?)

Added in version 8.6.0

Convenience method for FrameSource.switchToDesiredState(): it is same as calling FrameSource.switchToDesiredState() with the second argument set to null.

addFrame(width, height, buffer)
fun addFrame(width: Int,
        height: Int,
        buffer: ByteArray)

Added in version 8.6.0