An application would usually want to fully configure a node before it starts streaming data. For that reason, OpenNI defines a flow in which configuration can take place, and once all configuration is set, the node xn::Generator::StartGenerating() method can be called to make it start streaming the data.
The following code creates a depth generator, configures it to VGA resolution, 30 FPS, and then starts it:
nRetVal = depth.
Create(context);
nRetVal = context.StartGeneratingAll();
while (bShouldRun)
{
nRetVal = context.WaitOneUpdateAll(depth);
{
continue;
}
}
XN_C_API const XnChar *XN_C_DECL xnGetStatusString(const XnStatus Status)
#define XN_STATUS_OK
Definition: XnStatus.h:37
XnUInt16 XnDepthPixel
Definition: XnTypes.h:276
Definition: XnCppWrapper.h:4695
const XnDepthPixel * GetDepthMap() const
Gets the current depth-map. This map is updated after a call to xnWaitAndUpdateData()....
Definition: XnCppWrapper.h:4739
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a DepthGenerator node from available production node alternatives.
Definition: XnCppWrapper.h:9801
XnStatus SetMapOutputMode(const XnMapOutputMode &OutputMode)
Sets the current map output mode of the generator node.
Definition: XnCppWrapper.h:4304
Definition: XnTypes.h:433
XnUInt32 nXRes
Definition: XnTypes.h:435
XnUInt32 nYRes
Definition: XnTypes.h:437
XnUInt32 nFPS
Definition: XnTypes.h:439