Skip to main content

DepthFrameSession

Class

Used for receiving DepthFrameData on Spectacles device.

  • Available on all platforms
1 platform note
  • 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).

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

  • All platforms. Restricted when the Lens uses internet-connected APIs (see Privacy Restrictions)

Exposes user data

Used for receiving DepthFrameData on Spectacles device.

Index

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

readonly onNewFrame: 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()

static getTypeName(): 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

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


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

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame


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