Frame Data

Defined in library scandit_datacapture_core

abstract class FrameData

Added in version 6.14.0

Interface for holding frame data from one or more sources (cameras). The concrete type is tied to the frame source that produces the frames.

The frame data contains one or more image buffers, each of which may have different sizes. Each frame data is guaranteed to have at least one image buffer. Only frame sources that combine the input of multiple frame sources will have more than one image buffer.

A frame contains the pixel data as well as layout of one particular frame. Frames are immutable and reference counted, so they can be shared by multiple consumers. The frame is returned to the pool (recycled) when all consumers release the frame.

The frame must be requested during the execution of the listener callback, otherwise the frame will not be available outside of that scope.

int get orientation

Added in version 6.14.0

The orientation of the image buffer contained in this frame data. The value is the angle that the camera image needs to be rotated clockwise so it shows correctly on the display in its natural orientation. It is 0, 90, 180, or 270. A typical value for this is 90 as most camera modules record the frames in landscape right orientation. Rotating a landscape right frame by 90 degrees will show it correctly on the display in portrait orientation (which is the natural device orientation of most phones).

List<ImageBuffer> get imageBuffers

Added in version 6.14.0

The image buffers contained in this frame data.

class ImageBuffer

Added in version 6.14.0

int get width

Added in version 6.14.0

Width of the image buffer in pixels (non-subsampled).

int get height

Added in version 6.14.0

Height of the image buffer in pixels (non-subsampled).

Image get image

Added in version 6.14.0

Converts the video frame to a UIImage that can be visualized in the UI, or stored on disk. The returned image has the same dimensions as the video frame.

Uint8List get data

Added in version 6.22.1

The jpeg compressed image data for the image buffer.