Image Frame Source

Defined in framework ScanditCaptureCore

ImageFrameSource
open class ImageFrameSource : NSObject, FrameSource

Added in version 6.3.0

To emit the frame set this object as the frame source for the DataCaptureContext and turn it on by changing the desired state to FrameSourceState.on. This frame source will turn off automatically after the frame is emitted.

Note

This frame source emits a single image and turns off again. To feed a continuous stream of frames from a camera your application owns, use SequenceFrameSource instead — see Sequence Frame Source.

init(image:)
convenience init(image: UIImage)

Added in version 6.3.0

Constructs a new ImageFrameSource from the provided UIImage.

The provided UIImage should have one of the following configuration:

Gray color space:

8 bits per pixel

8 bits per component

kCGImageAlphaNone

RGB color space:

32 bits per pixel

8 bits per component

kCGImageAlphaNoneSkipFirst

32 bits per pixel

8 bits per component

kCGImageAlphaNoneSkipLast

32 bits per pixel

8 bits per component

kCGImageAlphaPremultipliedFirst

32 bits per pixel

8 bits per component

kCGImageAlphaPremultipliedLast

repeats
open var repeats: Bool { get, set }

Added in version 8.6.0

Whether the frame source keeps re-emitting its frames after all of them have been processed. By default the frame source turns itself off once all frames have been emitted. Setting this to true makes a still image behave like a continuous camera feed, giving the recognizer the multiple passes over the image it generally needs.

`switch`(toDesiredState:)
open func `switch`(toDesiredState state: FrameSourceState) async -> Bool

Added in version 6.3.0

Implemented from FrameSource. See FrameSource.`switch`(toDesiredState:completionHandler:).

`switch`(toDesiredState:)
open func `switch`(toDesiredState state: FrameSourceState) -> Void

Added in version 6.3.0

Convenience method for FrameSource.`switch`(toDesiredState:completionHandler:): it is same as calling FrameSource.`switch`(toDesiredState:completionHandler:) with the second argument set to nil.