Frame Data

Defined in package com.scandit.datacapture.core

Channel

Added in version 8.6.0

Enumeration of possible channel types.

Y

Added in version 8.6.0

Luminance (Y) or gray-scale channel

U

Added in version 8.6.0

V

Added in version 8.6.0

R

Added in version 8.6.0

Red channel

G

Added in version 8.6.0

Green channel

B

Added in version 8.6.0

Blue channel

A

Added in version 8.6.0

Alpha channel

D

Added in version 8.6.0

Depth channel

FrameData
interface FrameData

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

retain()
fun retain()

Added in version 8.6.0

Increments the reference count of the video frame by one. Must be balanced by a matching call to release().

release()
fun release()

Added in version 8.6.0

Decrements the reference count of the video frame by one. When the reference count drops to zero, the frame is recycled. Must be balanced by a call to retain().

orientation
val orientation: Int

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

imageBuffer
val imageBuffer: ImageBuffer?

Added in version 8.6.0

The image buffer contained in this frame data.

imageBuffers
val imageBuffers: List<ImageBuffer>

Added in version 8.6.0

The image buffers contained in this frame data.

timestamp
val timestamp: Long?

Added in version 8.6.0

The timestamp of the frame data in ns from the epoch.

ImageBuffer
class ImageBuffer

Added in version 8.6.0

toRgbaBytes()
fun toRgbaBytes(): ByteArray

Added in version 8.6.0

Returns the image buffer’s pixels as RGBA-encoded bytes.

width
val width: Int

Added in version 8.6.0

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

height
val height: Int

Added in version 8.6.0

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