OpenNI 1.3.2
|
Modules | |
Mirror Capability | |
Alternative View Point Capability | |
Frame-Sync Capability |
Controlling Generation | |
The following functions allows controlling if a node is currently generating data or not. | |
XN_C_API XnStatus XN_C_DECL | xnStartGenerating (XnNodeHandle hInstance) |
XN_C_API XnBool XN_C_DECL | xnIsGenerating (XnNodeHandle hInstance) |
XN_C_API XnStatus XN_C_DECL | xnStopGenerating (XnNodeHandle hInstance) |
XN_C_API XnStatus XN_C_DECL | xnRegisterToGenerationRunningChange (XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback) |
XN_C_API void XN_C_DECL | xnUnregisterFromGenerationRunningChange (XnNodeHandle hInstance, XnCallbackHandle hCallback) |
Checking if new data is available | |
The following functions allows an application to know if and when a node has new data available. When new data is available, the node data is still not replaced, until explicitly done so using one of the update data functions. | |
XN_C_API XnStatus XN_C_DECL | xnRegisterToNewDataAvailable (XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback) |
XN_C_API void XN_C_DECL | xnUnregisterFromNewDataAvailable (XnNodeHandle hInstance, XnCallbackHandle hCallback) |
XN_C_API XnBool XN_C_DECL | xnIsNewDataAvailable (XnNodeHandle hInstance, XnUInt64 *pnTimestamp) |
Getting new data | |
XN_C_API XnStatus XN_C_DECL | xnWaitAndUpdateData (XnNodeHandle hInstance) |
Data properties | |
XN_C_API XnBool XN_C_DECL | xnIsDataNew (XnNodeHandle hInstance) |
XN_C_API const void *XN_C_DECL | xnGetData (XnNodeHandle hInstance) |
XN_C_API XnUInt32 XN_C_DECL | xnGetDataSize (XnNodeHandle hInstance) |
XN_C_API XnUInt64 XN_C_DECL | xnGetTimestamp (XnNodeHandle hInstance) |
XN_C_API XnUInt32 XN_C_DECL | xnGetFrameID (XnNodeHandle hInstance) |
A Generator node is a production node that also generates continuous data. It supports all Production Node functions, and adds additional functions.
XN_C_API const void* XN_C_DECL xnGetData | ( | XnNodeHandle | hInstance | ) |
Gets the current data.
hInstance | [in] A handle to the instance. |
XN_C_API XnUInt32 XN_C_DECL xnGetDataSize | ( | XnNodeHandle | hInstance | ) |
Gets the size of current data, in bytes.
hInstance | [in] A handle to the instance. |
XN_C_API XnUInt32 XN_C_DECL xnGetFrameID | ( | XnNodeHandle | hInstance | ) |
Gets the frame ID of current data.
hInstance | [in] A handle to the instance. |
XN_C_API XnUInt64 XN_C_DECL xnGetTimestamp | ( | XnNodeHandle | hInstance | ) |
Gets the timestamp of current data, in microseconds.
hInstance | [in] A handle to the instance. |
XN_C_API XnBool XN_C_DECL xnIsDataNew | ( | XnNodeHandle | hInstance | ) |
Checks whether current data is new. Meaning, did the data change on the last call to xnWaitAndUpdateAll(), xnWaitOneUpdateAll() or xnWaitAndUpdateData().
hInstance | [in] A handle to the instance. |
XN_C_API XnBool XN_C_DECL xnIsGenerating | ( | XnNodeHandle | hInstance | ) |
Checks if this node is currently generating.
hInstance | [in] A handle to the instance. |
XN_C_API XnBool XN_C_DECL xnIsNewDataAvailable | ( | XnNodeHandle | hInstance, |
XnUInt64 * | pnTimestamp | ||
) |
Checks whether this node has new data (and so a call to xnWaitAndUpdateData() will not block).
hInstance | [in] A handle to the instance. |
pnTimestamp | [out] [Optional] If not NULL, will be filled with that data timestamp. |
XN_C_API XnStatus XN_C_DECL xnRegisterToGenerationRunningChange | ( | XnNodeHandle | hInstance, |
XnStateChangedHandler | handler, | ||
void * | pCookie, | ||
XnCallbackHandle * | phCallback | ||
) |
Registers a callback function to be called when generation starts or stops.
hInstance | [in] A handle to the instance. |
handler | [in] A pointer to a function that will be called when generation starts/stops. |
pCookie | [in] A user cookie that will be passed to the callback function. |
phCallback | [out] Optional. Will be filled with a handle to be passed to xnUnregisterFromGenerationRunningChange(). |
XN_C_API XnStatus XN_C_DECL xnRegisterToNewDataAvailable | ( | XnNodeHandle | hInstance, |
XnStateChangedHandler | handler, | ||
void * | pCookie, | ||
XnCallbackHandle * | phCallback | ||
) |
Registers a callback function to be called when new data is available.
hInstance | [in] A handle to the instance. |
handler | [in] A pointer to a function that will be called when new data is available. |
pCookie | [in] A user cookie that will be passed to the callback function. |
phCallback | [out] Optional. Will be filled with a handle to be passed to xnUnregisterFromNewDataAvailable(). |
XN_C_API XnStatus XN_C_DECL xnStartGenerating | ( | XnNodeHandle | hInstance | ) |
Starts generation of the output. This will also cause all dependencies to start generating.
hInstance | [in] A handle to the instance to start generating. |
XN_C_API XnStatus XN_C_DECL xnStopGenerating | ( | XnNodeHandle | hInstance | ) |
Stops generation of the output.
hInstance | [in] A handle to the instance to stop generating. |
XN_C_API void XN_C_DECL xnUnregisterFromGenerationRunningChange | ( | XnNodeHandle | hInstance, |
XnCallbackHandle | hCallback | ||
) |
Unregisters a callback function which was registered using xnRegisterToGenerationRunningChange().
hInstance | [in] A handle to the instance. |
hCallback | [in] The handle to the callback returned from xnRegisterToGenerationRunningChange(). |
XN_C_API void XN_C_DECL xnUnregisterFromNewDataAvailable | ( | XnNodeHandle | hInstance, |
XnCallbackHandle | hCallback | ||
) |
Unregisters a callback function which was registered using xnRegisterToNewDataAvailable().
hInstance | [in] A handle to the instance. |
hCallback | [in] The handle to the callback returned from xnRegisterToNewDataAvailable(). |
XN_C_API XnStatus XN_C_DECL xnWaitAndUpdateData | ( | XnNodeHandle | hInstance | ) |
Updates the data to the latest available one. If needed, the call will block until new data is available.
hInstance | [in] A handle to the instance to be updated. |