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. |
Members
data
Retrieve the frame data
format
Retrieve pixel format of the frame
frameNumber
Retrieve frame number
isValid
Check if the frame is valid
streamType
Retrieve the origin stream type that produced the frame
timestamp
Retrieve timestamp from the frame in milliseconds
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)
Methods
destroy()
Destroy the frame and its resource
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 |
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:
-
- VideoFrame.dataByteLength to determine the buffer size in bytes.
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
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 |
Returns:
true if supported, and false if not
- Type
- Boolean