OpenNI2 SDK  v2.3.0.81
| 静态 Public 成员函数 | 静态 Public 属性 | 所有成员列表
org.openni.OpenNI类 参考

interface  DeviceConnectedListener
 
interface  DeviceDisconnectedListener
 
interface  DeviceStateChangedListener
 

静态 Public 成员函数

static void initialize ()
 
static void shutdown ()
 
static Version getVersion ()
 
static String getExtendedError ()
 
static List< DeviceInfoenumerateDevices ()
 
static int waitForAnyStream (List< VideoStream > streams, int timeout) throws TimeoutException
 
static void addDeviceConnectedListener (DeviceConnectedListener deviceListener)
 
static void removeDeviceConnectedListener (DeviceConnectedListener deviceListener)
 
static void addDeviceDisconnectedListener (DeviceDisconnectedListener deviceListener)
 
static void removeDeviceDisconnectedListener (DeviceDisconnectedListener deviceListener)
 
static void addDeviceStateChangedListener (DeviceStateChangedListener deviceListener)
 
static void removeDeviceStateChangedListener (DeviceStateChangedListener deviceListener)
 
static void setLogMinSeverity (int minSeverity)
 
static void setLogConsoleOutput (boolean enabled)
 
static void setLogFileOutput (boolean enabled)
 
static void setLogOutputFolder (String path)
 
static void setLogAndroidOutput (boolean enabled)
 
static void setLogAndroidOutputRedirect (boolean enabled)
 

静态 Public 属性

static final int TIMEOUT_FOREVER = -1
 

详细描述

The OpenNI class is a static entry point to the library. It is used by every OpenNI 2.0 application to initialize the SDK and drivers to enable creation of valid device objects.

It also defines a listener class and events that enable for event driven notification of device connection, device disconnection, and device configuration changes.

In addition, it gives access to SDK version information and provides a function that allows you to wait for data to become available on any one of a list of streams (as opposed to waiting for data on one specific stream with functions provided by the VideoStream class)

成员函数说明

◆ addDeviceConnectedListener()

static void org.openni.OpenNI.addDeviceConnectedListener ( DeviceConnectedListener  deviceListener)
inlinestatic

Add new device connected observer to OpenNI observers list

参数
deviceListenerobject which implements DeviceConnectedListener.

◆ addDeviceDisconnectedListener()

static void org.openni.OpenNI.addDeviceDisconnectedListener ( DeviceDisconnectedListener  deviceListener)
inlinestatic

Add new device connected observer to OpenNI observers list

参数
deviceListenerobject which implements DeviceDisconnectedListener.

◆ addDeviceStateChangedListener()

static void org.openni.OpenNI.addDeviceStateChangedListener ( DeviceStateChangedListener  deviceListener)
inlinestatic

Add new device connected observer to OpenNI observers list

参数
deviceListenerobject which implements DeviceConnectedListener.

◆ enumerateDevices()

static List<DeviceInfo> org.openni.OpenNI.enumerateDevices ( )
inlinestatic

Fills up an array of DeviceInfo DeviceInfo objects with devices that are available.

返回
deviceInfoList An array to be filled with devices.

◆ getExtendedError()

static String org.openni.OpenNI.getExtendedError ( )
inlinestatic

Retrieves the calling thread's last extended error information. The last extended error information is maintained on a per-thread basis. Multiple threads do not overwrite each others last extended error information.

The extended error information is cleared on every call to an OpenNI method, so you should call this method immediately after a call to an OpenNI method which have failed.

返回
OpenNI error String

◆ getVersion()

static Version org.openni.OpenNI.getVersion ( )
inlinestatic

This function return current OpenNI version

返回
the version of OpenNI

◆ initialize()

static void org.openni.OpenNI.initialize ( )
inlinestatic

Initialize the library. This will load all available drivers, and see which devices are available It is forbidden to call any other method in OpenNI before calling initialize().

◆ removeDeviceConnectedListener()

static void org.openni.OpenNI.removeDeviceConnectedListener ( DeviceConnectedListener  deviceListener)
inlinestatic

Remove device connected observer to OpenNI observers list

参数
deviceListenerobject which implements DeviceConnectedListener.

◆ removeDeviceDisconnectedListener()

static void org.openni.OpenNI.removeDeviceDisconnectedListener ( DeviceDisconnectedListener  deviceListener)
inlinestatic

Remove device connected observer to OpenNI observers list

参数
deviceListenerobject which implements DeviceDisconnectedListener.

◆ removeDeviceStateChangedListener()

static void org.openni.OpenNI.removeDeviceStateChangedListener ( DeviceStateChangedListener  deviceListener)
inlinestatic

Remove device state changed observer from OpenNI observers list

参数
deviceListenerobject which implements DeviceConnectedListener.

◆ setLogAndroidOutput()

static void org.openni.OpenNI.setLogAndroidOutput ( boolean  enabled)
inlinestatic

Configures if log entries will be printed to file

参数
enabledWhether log entries should be printed to android log or not.

◆ setLogAndroidOutputRedirect()

static void org.openni.OpenNI.setLogAndroidOutputRedirect ( boolean  enabled)
inlinestatic

Configures if log entries will be printed to and redirect.

参数
enabledWhether log entries should be redirected after printing to Android logs.

◆ setLogConsoleOutput()

static void org.openni.OpenNI.setLogConsoleOutput ( boolean  enabled)
inlinestatic

Configures if log entries will be printed to console

参数
enabledWhether log entries should be printed to console or not.

◆ setLogFileOutput()

static void org.openni.OpenNI.setLogFileOutput ( boolean  enabled)
inlinestatic

Configures if log entries will be printed to file

参数
enabledWhether log entries should be printed to file or not.

◆ setLogMinSeverity()

static void org.openni.OpenNI.setLogMinSeverity ( int  minSeverity)
inlinestatic

Set minimum severity for log entries

参数
minSeverityMinimum severity to output

◆ setLogOutputFolder()

static void org.openni.OpenNI.setLogOutputFolder ( String  path)
inlinestatic

Set the output folder for log files (if enabled)

参数
pathPath to write log files to.

◆ shutdown()

static void org.openni.OpenNI.shutdown ( )
inlinestatic

Stop using the library. Unload all drivers, close all streams and devices. Once shutdown() was called, no other calls to OpenNI is allowed.

◆ waitForAnyStream()

static int org.openni.OpenNI.waitForAnyStream ( List< VideoStream streams,
int  timeout 
) throws TimeoutException
inlinestatic

Wait for a new frame from any of the streams provided. The function blocks until any of the streams has a new frame available, or the timeout has passed.

参数
streamsAn list of streams to wait for.
timeoutA timeout before returning if no stream has new data. Default value is TIMEOUT_FOREVER.
返回
index of stream which received frame. In case it stop on timeout, function return -1.

该类的文档由以下文件生成: