MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / initConstants

Function initConstants

Samples/NiViewer/Device.cpp:66–106  ·  view source on GitHub ↗

-------------------------------- Code --------------------------------

Source from the content-addressed store, hash-verified

64// Code
65// --------------------------------
66void initConstants()
67{
68 // Primary Streams
69 int nIndex = 0;
70
71 g_PrimaryStream.pValues[nIndex++] = "Any";
72 g_PrimaryStream.pValues[nIndex++] = xnProductionNodeTypeToString(XN_NODE_TYPE_DEPTH);
73 g_PrimaryStream.pValues[nIndex++] = xnProductionNodeTypeToString(XN_NODE_TYPE_IMAGE);
74 g_PrimaryStream.pValues[nIndex++] = xnProductionNodeTypeToString(XN_NODE_TYPE_IR);
75 g_PrimaryStream.pValues[nIndex++] = xnProductionNodeTypeToString(XN_NODE_TYPE_AUDIO);
76
77 g_PrimaryStream.nValuesCount = nIndex;
78
79 // Registration
80 nIndex = 0;
81
82 g_Registration.pValues[nIndex++] = FALSE;
83 g_Registration.pValueToName[FALSE] = "Off";
84
85 g_Registration.pValues[nIndex++] = TRUE;
86 g_Registration.pValueToName[TRUE] = "Depth -> Image";
87
88 g_Registration.nValuesCount = nIndex;
89
90 // Resolutions
91 nIndex = 0;
92
93 g_Resolution.pValues[nIndex++] = XN_RES_QVGA;
94 g_Resolution.pValueToName[XN_RES_QVGA] = Resolution(XN_RES_QVGA).GetName();
95
96 g_Resolution.pValues[nIndex++] = XN_RES_VGA;
97 g_Resolution.pValueToName[XN_RES_VGA] = Resolution(XN_RES_VGA).GetName();
98
99 g_Resolution.pValues[nIndex++] = XN_RES_SXGA;
100 g_Resolution.pValueToName[XN_RES_SXGA] = Resolution(XN_RES_SXGA).GetName();
101
102 g_Resolution.pValues[nIndex++] = XN_RES_UXGA;
103 g_Resolution.pValueToName[XN_RES_UXGA] = Resolution(XN_RES_UXGA).GetName();
104
105 g_Resolution.nValuesCount = nIndex;
106}
107
108void XN_CALLBACK_TYPE onErrorStateChanged(XnStatus errorState, void* /*pCookie*/)
109{

Callers 1

openCommonFunction · 0.85

Calls 3

GetNameMethod · 0.80
ResolutionClass · 0.50

Tested by

no test coverage detected