Sequence Frame Source
Defined in package com.scandit.datacapture.core.source
- SequenceFrameSourceProcessListener
interface SequenceFrameSourceProcessListenerAdded in version 6.14.0
- processingFinished(buffer)
fun processingFinished(buffer: ByteArray)Added in version 6.14.0
- SequenceFrameSource
class SequenceFrameSource : FrameSource
Added in version 6.14.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
The only pixel format type supported is NV21.
- create(cameraPosition)
fun SequenceFrameSource.create(cameraPosition: CameraPosition): SequenceFrameSource
Added in version 6.14.0
Constructs a new SequenceFrameSource. It requires the position of the capture device in the form of a CameraPosition, which is a direct translation from the native Android camera position (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#facing, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_FACING). Defaults to a 90º orientation for the mounted camera (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#orientation, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_ORIENTATION).
- create(cameraPosition, captureDeviceOrientation, sequenceFrameSourceProcess)
fun SequenceFrameSource.create(cameraPosition: CameraPosition, captureDeviceOrientation:
Int, sequenceFrameSourceProcess: SequenceFrameSourceProcessListener): SequenceFrameSourceAdded in version 6.14.0
Constructs a new SequenceFrameSource. It requires the position of the capture device in the form of a CameraPosition, which is a direct translation from the native Android camera position (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#facing, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_FACING), the mounted camera orientation (Camera API 1 - https://developer.android.com/reference/android/hardware/Camera.CameraInfo#orientation, Camera API 2 - https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#SENSOR_ORIENTATION) and a SequenceFrameSourceProcessListener which will be called when the frame buffer has been processed and is ready to be freed.
- desiredState
val desiredState: FrameSourceState
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.desiredState.
- currentState
val currentState: FrameSourceState
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.currentState.
- addListener(listener)
fun addListener(listener: FrameSourceListener)
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.addListener().
- removeListener(listener)
fun removeListener(listener: FrameSourceListener)
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.removeListener().
- switchToDesiredState(desiredState, whenDone)
fun switchToDesiredState(desiredState: FrameSourceState, whenDone: Callback<Boolean>?)
Added in version 6.14.0
Implemented from FrameSource. See FrameSource.switchToDesiredState().
- addFrame(width, height, buffer)
fun addFrame(width: Int, height: Int, buffer: ByteArray)
Added in version 6.14.0
Add an image byte buffer with a given width and height. If this frame source is ON and connected to a DataCaptureContext this is the next frame that will be processed. Note that the only pixel format type supported is NV21, otherwise an AssertionError is thrown.
- addFrame(frame)
fun addFrame(frame:
Image)Added in version 6.14.0
Add an
Imageto the frame source. This type is usually provided by the Camera API 2. If this frame source is ON and connected to a DataCaptureContext this is the next frame that will be processed.