Class: Frame

Frame()

This class resprents a picture frame

Constructor

new Frame()

Properties:
Name Type Description
isValid Boolean True if the frame is valid, otherwise false.
data Uint16Array | Uint8Array A typed array representing the data.
The type of the typed array depends on the format specified in camera configuration.
width Integer The width of the frame.
height Integer The height of the frame.
frameNumber Integer | Int64 An integer or an object representing the frame number.
If the frame number is less than 2^53, then the return value is an integer number;
Otherwise it will be an Int64 object defined in npm module "node-int64"
timestamp Number The timestamp of the frame.
streamType Integer The stream type of the frame. see enum stream
bitsPerPixel Integer The number of bits per pixel
timestampDomain Integer Get the domain (clock name) of timestamp value.
Source:

Members

data

Retrieve the frame data
Source:

format

Retrieve pixel format of the frame
Source:

frameNumber

Retrieve frame number
Source:

isValid

Check if the frame is valid
Source:

streamType

Retrieve the origin stream type that produced the frame
Source:

timestamp

Retrieve timestamp from the frame in milliseconds
Source:

timestampDomain

Retrieve timestamp domain. timestamps can only be comparable if they are in common domain (for example, depth timestamp might come from system time while color timestamp might come from the device) this method is used to check if two timestamp values are comparable (generated from the same clock)
Source:

Methods

destroy()

Destroy the frame and its resource
Source:

frameMetadata(metadata) → {Uint8Array}

Retrieve the current value of a single frame metadata
Parameters:
Name Type Description
metadata String | Number the type of metadata, see frame_metadata for avaiable values
Source:
Returns:
The metadata value, 8 bytes, byte order is bigendian.
Type
Uint8Array

getData(bufferopt) → {Float32Array|Uint16Array|Uint8Array|undefined}

Get the frame buffer data There are 2 acceptable forms of syntax:

 Syntax 1. getData()
 Syntax 2. getData(ArrayBuffer)
Parameters:
Name Type Attributes Description
buffer ArrayBuffer <optional>
The buffer that will be written to.
Source:
See:
Returns:
Returns a TypedArray or undefined for syntax 1, see Frame#data; if syntax 2 is used, return value is not used (undefined).
Type
Float32Array | Uint16Array | Uint8Array | undefined

keep() → {undefined}

communicate to the library you intend to keep the frame alive for a while this will remove the frame from the regular count of the frame pool once this function is called, the SDK can no longer guarantee 0-allocations during frame cycling
Source:
Returns:
Type
undefined

supportsFrameMetadata(metadata) → {Boolean}

Determine if the device allows a specific metadata to be queried
Parameters:
Name Type Description
metadata String | Number The type of metadata
Source:
Returns:
true if supported, and false if not
Type
Boolean