Frame Data

Defined under the namespace Scandit.Datacapture.Core

FrameData
interface FrameData

Added in version 6.17.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 that the getter promise is passed from, otherwise the frame will not be available outside of that scope.

orientation
readonly orientation: number

Added in version 6.17.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).

imageBuffers
readonly imageBuffers: ImageBuffer[]

Added in version 6.17.0

The image buffers contained in this frame data.

ImageBuffer
class ImageBuffer

Added in version 6.17.0

width
get width(): number

Added in version 6.17.0

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

height
get height(): number

Added in version 6.17.0

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

data
get data(): string

Added in version 6.17.0

The base64 encoded image data for the image buffer.