DepthFrameSession
ClassUsed for receiving DepthFrameData on Spectacles device.
- Available on all platforms
- SnapchatFully supported
- SPECSFully supported
- Camera Kit WebFully supported
- Camera Kit MobileFully supported
Applies to all platforms
- Restricted when the Lens uses internet-connected APIs (see Privacy Restrictions).
Exposes user data
Used for receiving DepthFrameData on Spectacles device.
Index
Properties
Methods
Example
const depthModule = require("LensStudio:DepthModule");
const session = depthModule.createDepthFrameSession();
session.onNewFrame.add((depthFrameData) => {
// Make use of depth frame data
});
session.start();
session.stop();
Extends
Properties
onNewFrame
readonlyonNewFrame:event1<DepthFrameData,void>
Exposes user data
Register a callback to be called whenever new DepthFrameData is available. On Spectacles, the depth update rate is different from the color frame update rate and the render update rate.
Methods
getTypeName()
staticgetTypeName():TypeName<DepthFrameSession>
Exposes user data
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<DepthFrameSession>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
start()
start():
void
Exposes user data
Starts depth estimation for the DepthFrameSession on Spectacles.
Returns
void
Remarks
The DepthFrameSession.onNewFrame events will only be triggered after start has been called.
stop()
stop():
void
Exposes user data
Stops depth estimation for the DepthFrameSession on Spectacles.
Returns
void