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

Function xnIsMapOutputModeSupported

Source/OpenNI/XnQueries.cpp:196–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196static XnBool xnIsMapOutputModeSupported(XnNodeHandle hNode, const XnMapOutputMode* pQuery)
197{
198 XnUInt32 nModes = xnGetSupportedMapOutputModesCount(hNode);
199 if (nModes == 0)
200 {
201 return (FALSE);
202 }
203
204 XnMapOutputMode* aModes = (XnMapOutputMode*)xnOSCalloc(nModes, sizeof(XnMapOutputMode));
205 if (aModes == NULL)
206 {
207 return (FALSE);
208 }
209
210 if (XN_STATUS_OK != xnGetSupportedMapOutputModes(hNode, aModes, &nModes))
211 {
212 xnOSFree(aModes);
213 return (FALSE);
214 }
215
216 for (XnUInt i = 0; i < nModes; ++i)
217 {
218 if (pQuery->nXRes != (XnUInt32)(-1) && pQuery->nXRes == aModes[i].nXRes &&
219 pQuery->nYRes != (XnUInt32)(-1) && pQuery->nYRes == aModes[i].nYRes &&
220 pQuery->nFPS != (XnUInt32)(-1) && pQuery->nFPS == aModes[i].nFPS)
221 {
222 xnOSFree(aModes);
223 return (TRUE);
224 }
225 }
226
227 xnOSFree(aModes);
228 return (FALSE);
229}
230
231static XnBool xnIsInfoQueryMatch(const XnNodeQuery* pQuery, XnNodeInfo* pNodeInfo)
232{

Callers 1

xnIsNodeInstanceMatchFunction · 0.85

Calls 4

xnOSCallocFunction · 0.50
xnOSFreeFunction · 0.50

Tested by

no test coverage detected