Frame Data

Defined in namespace Scandit.DataCapture.Core.Data

Channel

Added in version 6.8.0

Enumeration of possible channel types.

Y

Added in version 6.8.0

Luminance (Y) or gray-scale channel

U

Added in version 6.8.0

V

Added in version 6.8.0

R

Added in version 6.8.0

Red channel

G

Added in version 6.8.0

Green channel

B

Added in version 6.8.0

Blue channel

A

Added in version 6.8.0

Alpha channel

IFrameData
interface IFrameData : IDisposable

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

ImageBuffers
IList<ImageBuffer> ImageBuffers { get; }

Added in version 6.8.0

The image buffers contained in this frame data.

ImagePlane
class ImagePlane

Added in version 6.8.0

An individual image plane as part of an image buffer. The image plane data may or may not be interleaved with other image planes.

Channel
Channel Channel { get; }

Added in version 6.8.0

Data
IntPtr Data { get; }

Added in version 6.8.0

The bytes used by this image plane. For interleaved image planes, parts of the bytes exposed this property may not be part of this plane and belong to other planes. For example, for an ImageBuffer with red, green and blue planes using an interleaved layout, only every third byte belongs to the red image plane.

The life-time of the data is tied to the life-time of the ImageBuffer, which for image buffers belonging to frame data is bound to the life-time of the IFrameData instance.

SubsamplingX
uint SubsamplingX { get; }

Added in version 6.8.0

The amount of subsampling (in pixels in X-direction). For image plane with the exception of U and V planes, the subsampling in both x and y will be 1 (meaning no subsampling). A subsampling of 2 indicates that two horizontally adjacent pixels share the same pixel data.

SubsamplingY
uint SubsamplingY { get; }

Added in version 6.8.0

The amount of subsampling (in pixels in Y-direction). For image plane with the exception of U and V planes, the subsampling in both x and y will be 1 (meaning no subsampling). A subsampling of 2 indicates that two vertically adjacent pixels share the same pixel data.

RowStride
uint RowStride { get; }

Added in version 6.8.0

The number of bytes of a row of pixels. For example, an RGB image will typically have a row stride of 3 * width, with potential padding at the end to match mulitples of 4.

PixelStride
uint PixelStride { get; }

Added in version 6.8.0

Number of bytes between two adjacent pixels part of the same image plane. In case of subsampling, this value is the number of bytes per pixel as if there were no subsampling. For example, for a non-interleaved U plane subsampled at 2, the element stride is 1.

ImageBuffer
class ImageBuffer

Added in version 6.8.0

An image buffer consists of one or more images planes that describe how the memory is laid out. Instances of this class don’t own the data, rather the data is owned by another class (typically a IFrameData instance).

Width
uint Width { get; }

Added in version 6.8.0

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

Height
uint Height { get; }

Added in version 6.8.0

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

Planes
IList<ImagePlane> Planes { get; }

Added in version 6.8.0

List of planes that this image buffer holds. The data used by these image planes may or may not be part of the same block of memory.

ToImage()
Image ToImage()

Added in version 6.8.0

Converts the video frame to a Xamarin.Forms.Image that can be visualized in the UI, or stored on disk.

On Android depending on the underlying representation, this call may require an image conversion to a different format. As such, it’s a relatively expensive operation. Make sure to only call this method when the image is required.

The returned image has the same dimensions as the video frame.