# VKSession
Start from base library version 2.20.0. Please remaining backward compatible.
vision kit Session object.
# attribute
# number state
Session state
state Legal value
value | Introductions | Minimum version |
---|---|---|
0 | Not available | |
1 | In operation | |
2 | Suspended. |
# VKConfig config
Session configuration
# VKFrameSize cameraSize
Camera size
# method
# VKSession.start(VKSessionStartCallback callback)
Start the session.
# VKSession.stop()
Stop the session.
# VKSession.destroy()
Destroy the session.
# number VKSession.requestAnimationFrame(function callback)
Executes on the next redraw.
# VKSession.cancelAnimationFrame(number requestID)
Cancel by requestAnimationFrame Add an animated frame request to the schedule.
# VKFrame VKSession.getVKFrame(number width, number height)
Get the frame object, each call will trigger a frame analysis process.
# Array.<HitTestRes> VKSession.hitTest(number x, number and Object reset)
Touch detection is currently supported only in a single plane that is hitTest After generating a plane, the following hitTest Instead of generating a plane, the detection is based on the previously generated plane. If you need to reidentify another plane, you can call this method by setting the reset Parameter set to true。
# VKSession.on(string eventName, function fn)
Listen for session events.
# VKSession.off(string eventName, function fn)
Cancels listening session events.